@thready-web/dsh-bot-plugin 0.1.0-beta.6 → 0.1.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,63 +0,0 @@
1
- (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))r(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&r(f)}).observe(document,{childList:!0,subtree:!0});function a(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(u){if(u.ep)return;u.ep=!0;const o=a(u);fetch(u.href,o)}})();function OS(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ld={exports:{}},$r={};var Ay;function _S(){if(Ay)return $r;Ay=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(r,u,o){var f=null;if(o!==void 0&&(f=""+o),u.key!==void 0&&(f=""+u.key),"key"in u){o={};for(var h in u)h!=="key"&&(o[h]=u[h])}else o=u;return u=o.ref,{$$typeof:n,type:r,key:f,ref:u!==void 0?u:null,props:o}}return $r.Fragment=l,$r.jsx=a,$r.jsxs=a,$r}var Cy;function zS(){return Cy||(Cy=1,ld.exports=_S()),ld.exports}var b=zS(),ad={exports:{}},Oe={};var Ny;function qS(){if(Ny)return Oe;Ny=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),x=Symbol.iterator;function k(q){return q===null||typeof q!="object"?null:(q=x&&q[x]||q["@@iterator"],typeof q=="function"?q:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,E={};function M(q,ee,fe){this.props=q,this.context=ee,this.refs=E,this.updater=fe||T}M.prototype.isReactComponent={},M.prototype.setState=function(q,ee){if(typeof q!="object"&&typeof q!="function"&&q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,q,ee,"setState")},M.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function H(){}H.prototype=M.prototype;function $(q,ee,fe){this.props=q,this.context=ee,this.refs=E,this.updater=fe||T}var te=$.prototype=new H;te.constructor=$,A(te,M.prototype),te.isPureReactComponent=!0;var O=Array.isArray;function Q(){}var ne={H:null,A:null,T:null,S:null},he=Object.prototype.hasOwnProperty;function _(q,ee,fe){var ge=fe.ref;return{$$typeof:n,type:q,key:ee,ref:ge!==void 0?ge:null,props:fe}}function Z(q,ee){return _(q.type,ee,q.props)}function P(q){return typeof q=="object"&&q!==null&&q.$$typeof===n}function Se(q){var ee={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(fe){return ee[fe]})}var Re=/\/+/g;function ae(q,ee){return typeof q=="object"&&q!==null&&q.key!=null?Se(""+q.key):ee.toString(36)}function G(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(Q,Q):(q.status="pending",q.then(function(ee){q.status==="pending"&&(q.status="fulfilled",q.value=ee)},function(ee){q.status==="pending"&&(q.status="rejected",q.reason=ee)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function se(q,ee,fe,ge,Te){var Ne=typeof q;(Ne==="undefined"||Ne==="boolean")&&(q=null);var Ee=!1;if(q===null)Ee=!0;else switch(Ne){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(q.$$typeof){case n:case l:Ee=!0;break;case y:return Ee=q._init,se(Ee(q._payload),ee,fe,ge,Te)}}if(Ee)return Te=Te(q),Ee=ge===""?"."+ae(q,0):ge,O(Te)?(fe="",Ee!=null&&(fe=Ee.replace(Re,"$&/")+"/"),se(Te,ee,fe,"",function(it){return it})):Te!=null&&(P(Te)&&(Te=Z(Te,fe+(Te.key==null||q&&q.key===Te.key?"":(""+Te.key).replace(Re,"$&/")+"/")+Ee)),ee.push(Te)),1;Ee=0;var W=ge===""?".":ge+":";if(O(q))for(var de=0;de<q.length;de++)ge=q[de],Ne=W+ae(ge,de),Ee+=se(ge,ee,fe,Ne,Te);else if(de=k(q),typeof de=="function")for(q=de.call(q),de=0;!(ge=q.next()).done;)ge=ge.value,Ne=W+ae(ge,de++),Ee+=se(ge,ee,fe,Ne,Te);else if(Ne==="object"){if(typeof q.then=="function")return se(G(q),ee,fe,ge,Te);throw ee=String(q),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function ue(q,ee,fe){if(q==null)return q;var ge=[],Te=0;return se(q,ge,"","",function(Ne){return ee.call(fe,Ne,Te++)}),ge}function ke(q){if(q._status===-1){var ee=q._result,fe=ee();fe.then(function(ge){(q._status===0||q._status===-1)&&(q._status=1,q._result=ge,fe.status===void 0&&(fe.status="fulfilled",fe.value=ge))},function(ge){(q._status===0||q._status===-1)&&(q._status=2,q._result=ge,fe.status===void 0&&(fe.status="rejected",fe.reason=ge))}),q._status===-1&&(q._status=0,q._result=fe)}if(q._status===1)return q._result.default;throw q._result}var j=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)};function Pe(q){var ee=ne.T,fe={};fe.types=ee!==null?ee.types:null,ne.T=fe;try{var ge=q(),Te=ne.S;Te!==null&&Te(fe,ge),typeof ge=="object"&&ge!==null&&typeof ge.then=="function"&&ge.then(Q,j)}catch(Ne){j(Ne)}finally{ee!==null&&fe.types!==null&&(ee.types=fe.types),ne.T=ee}}function ht(q){var ee=ne.T;if(ee!==null){var fe=ee.types;fe===null?ee.types=[q]:fe.indexOf(q)===-1&&fe.push(q)}else Pe(ht.bind(null,q))}var z={map:ue,forEach:function(q,ee,fe){ue(q,function(){ee.apply(this,arguments)},fe)},count:function(q){var ee=0;return ue(q,function(){ee++}),ee},toArray:function(q){return ue(q,function(ee){return ee})||[]},only:function(q){if(!P(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return Oe.Activity=m,Oe.Children=z,Oe.Component=M,Oe.Fragment=a,Oe.Profiler=u,Oe.PureComponent=$,Oe.StrictMode=r,Oe.Suspense=p,Oe.ViewTransition=S,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ne,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(q){return ne.H.useMemoCache(q)}},Oe.addTransitionType=ht,Oe.cache=function(q){return function(){return q.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(q,ee,fe){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var ge=A({},q.props),Te=q.key;if(ee!=null)for(Ne in ee.key!==void 0&&(Te=""+ee.key),ee)!he.call(ee,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&ee.ref===void 0||(ge[Ne]=ee[Ne]);var Ne=arguments.length-2;if(Ne===1)ge.children=fe;else if(1<Ne){for(var Ee=Array(Ne),W=0;W<Ne;W++)Ee[W]=arguments[W+2];ge.children=Ee}return _(q.type,Te,ge)},Oe.createContext=function(q){return q={$$typeof:f,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:o,_context:q},q},Oe.createElement=function(q,ee,fe){var ge,Te={},Ne=null;if(ee!=null)for(ge in ee.key!==void 0&&(Ne=""+ee.key),ee)he.call(ee,ge)&&ge!=="key"&&ge!=="__self"&&ge!=="__source"&&(Te[ge]=ee[ge]);var Ee=arguments.length-2;if(Ee===1)Te.children=fe;else if(1<Ee){for(var W=Array(Ee),de=0;de<Ee;de++)W[de]=arguments[de+2];Te.children=W}if(q&&q.defaultProps)for(ge in Ee=q.defaultProps,Ee)Te[ge]===void 0&&(Te[ge]=Ee[ge]);return _(q,Ne,Te)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(q){return{$$typeof:h,render:q}},Oe.isValidElement=P,Oe.lazy=function(q){return{$$typeof:y,_payload:{_status:-1,_result:q},_init:ke}},Oe.memo=function(q,ee){return{$$typeof:g,type:q,compare:ee===void 0?null:ee}},Oe.startTransition=Pe,Oe.unstable_useCacheRefresh=function(){return ne.H.useCacheRefresh()},Oe.use=function(q){return ne.H.use(q)},Oe.useActionState=function(q,ee,fe){return ne.H.useActionState(q,ee,fe)},Oe.useCallback=function(q,ee){return ne.H.useCallback(q,ee)},Oe.useContext=function(q){return ne.H.useContext(q)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(q,ee){return ne.H.useDeferredValue(q,ee)},Oe.useEffect=function(q,ee){return ne.H.useEffect(q,ee)},Oe.useEffectEvent=function(q){return ne.H.useEffectEvent(q)},Oe.useId=function(){return ne.H.useId()},Oe.useImperativeHandle=function(q,ee,fe){return ne.H.useImperativeHandle(q,ee,fe)},Oe.useInsertionEffect=function(q,ee){return ne.H.useInsertionEffect(q,ee)},Oe.useLayoutEffect=function(q,ee){return ne.H.useLayoutEffect(q,ee)},Oe.useMemo=function(q,ee){return ne.H.useMemo(q,ee)},Oe.useOptimistic=function(q,ee){return ne.H.useOptimistic(q,ee)},Oe.useReducer=function(q,ee,fe){return ne.H.useReducer(q,ee,fe)},Oe.useRef=function(q){return ne.H.useRef(q)},Oe.useState=function(q){return ne.H.useState(q)},Oe.useSyncExternalStore=function(q,ee,fe){return ne.H.useSyncExternalStore(q,ee,fe)},Oe.useTransition=function(){return ne.H.useTransition()},Oe.version="19.3.1",Oe}var jy;function Wd(){return jy||(jy=1,ad.exports=qS()),ad.exports}var L=Wd(),rd={exports:{}},Pr={},sd={exports:{}},ud={};var Oy;function RS(){return Oy||(Oy=1,(function(n){function l(G,se){var ue=G.length;G.push(se);e:for(;0<ue;){var ke=ue-1>>>1,j=G[ke];if(0<u(j,se))G[ke]=se,G[ue]=j,ue=ke;else break e}}function a(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var se=G[0],ue=G.pop();if(ue!==se){G[0]=ue;e:for(var ke=0,j=G.length,Pe=j>>>1;ke<Pe;){var ht=2*(ke+1)-1,z=G[ht],q=ht+1,ee=G[q];if(0>u(z,ue))q<j&&0>u(ee,z)?(G[ke]=ee,G[q]=ue,ke=q):(G[ke]=z,G[ht]=ue,ke=ht);else if(q<j&&0>u(ee,ue))G[ke]=ee,G[q]=ue,ke=q;else break e}}return se}function u(G,se){var ue=G.sortIndex-se.sortIndex;return ue!==0?ue:G.id-se.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var p=[],g=[],y=1,m=null,S=3,x=!1,k=!1,T=!1,A=!1,E=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function $(G){for(var se=a(g);se!==null;){if(se.callback===null)r(g);else if(se.startTime<=G)r(g),se.sortIndex=se.expirationTime,l(p,se);else break;se=a(g)}}function te(G){if(T=!1,$(G),!k)if(a(p)!==null)k=!0,O||(O=!0,P());else{var se=a(g);se!==null&&ae(te,se.startTime-G)}}var O=!1,Q=-1,ne=5,he=-1;function _(){return A?!0:!(n.unstable_now()-he<ne)}function Z(){if(A=!1,O){var G=n.unstable_now();he=G;var se=!0;try{e:{k=!1,T&&(T=!1,M(Q),Q=-1),x=!0;var ue=S;try{t:{for($(G),m=a(p);m!==null&&!(m.expirationTime>G&&_());){var ke=m.callback;if(typeof ke=="function"){m.callback=null,S=m.priorityLevel;var j=ke(m.expirationTime<=G);if(G=n.unstable_now(),typeof j=="function"){m.callback=j,$(G),se=!0;break t}m===a(p)&&r(p),$(G)}else r(p);m=a(p)}if(m!==null)se=!0;else{var Pe=a(g);Pe!==null&&ae(te,Pe.startTime-G),se=!1}}break e}finally{m=null,S=ue,x=!1}se=void 0}}finally{se?P():O=!1}}}var P;if(typeof H=="function")P=function(){H(Z)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,Re=Se.port2;Se.port1.onmessage=Z,P=function(){Re.postMessage(null)}}else P=function(){E(Z,0)};function ae(G,se){Q=E(function(){G(n.unstable_now())},se)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(G){G.callback=null},n.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<G?Math.floor(1e3/G):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(G){switch(S){case 1:case 2:case 3:var se=3;break;default:se=S}var ue=S;S=se;try{return G()}finally{S=ue}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(G,se){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ue=S;S=G;try{return se()}finally{S=ue}},n.unstable_scheduleCallback=function(G,se,ue){var ke=n.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?ke+ue:ke):ue=ke,G){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=ue+j,G={id:y++,callback:se,priorityLevel:G,startTime:ue,expirationTime:j,sortIndex:-1},ue>ke?(G.sortIndex=ue,l(g,G),a(p)===null&&G===a(g)&&(T?(M(Q),Q=-1):T=!0,ae(te,ue-ke))):(G.sortIndex=j,l(p,G),k||x||(k=!0,O||(O=!0,P()))),G},n.unstable_shouldYield=_,n.unstable_wrapCallback=function(G){var se=S;return function(){var ue=S;S=se;try{return G.apply(this,arguments)}finally{S=ue}}}})(ud)),ud}var _y;function MS(){return _y||(_y=1,sd.exports=RS()),sd.exports}var od={exports:{}},Wt={};var zy;function DS(){if(zy)return Wt;zy=1;var n=Wd();function l(y){var m="https://react.dev/errors/"+y;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)m+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+y+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(l(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal"),o=Symbol.for("react.recoverable"),f=Symbol.for("react.optimistic_key");function h(y,m,S){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:x===f?f:""+x,children:y,containerInfo:m,implementation:S}}var p=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(y,m){if(y==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Wt.browser=function(y){return{$$typeof:o,_reason:y}},Wt.createPortal=function(y,m){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(l(299));return h(y,m,null,S)},Wt.flushSync=function(y){var m=p.T,S=r.p;try{if(p.T=null,r.p=2,y)return y()}finally{p.T=m,r.p=S,r.d.f()}},Wt.preconnect=function(y,m){typeof y=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(y,m))},Wt.prefetchDNS=function(y){typeof y=="string"&&r.d.D(y)},Wt.preinit=function(y,m){if(typeof y=="string"&&m&&typeof m.as=="string"){var S=m.as,x=g(S,m.crossOrigin),k=typeof m.integrity=="string"?m.integrity:void 0,T=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;S==="style"?r.d.S(y,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:k,fetchPriority:T}):S==="script"&&r.d.X(y,{crossOrigin:x,integrity:k,fetchPriority:T,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Wt.preinitModule=function(y,m){if(typeof y=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var S=g(m.as,m.crossOrigin);r.d.M(y,{crossOrigin:S,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0})}}else m==null&&r.d.M(y)},Wt.preload=function(y,m){if(typeof y=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var S=m.as,x=g(S,m.crossOrigin);r.d.L(y,S,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Wt.preloadModule=function(y,m){if(typeof y=="string")if(m){var S=g(m.as,m.crossOrigin);r.d.m(y,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:S,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0})}else r.d.m(y)},Wt.requestFormReset=function(y){r.d.r(y)},Wt.unstable_batchedUpdates=function(y,m){return y(m)},Wt.useFormState=function(y,m,S){return p.H.useFormState(y,m,S)},Wt.useFormStatus=function(){return p.H.useHostTransitionStatus()},Wt.version="19.3.1",Wt}var qy;function Kv(){if(qy)return od.exports;qy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),od.exports=DS(),od.exports}var Ry;function LS(){if(Ry)return Pr;Ry=1;var n=MS(),l=Wd(),a=Kv();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(o(e)!==e)throw Error(r(188))}function g(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(r(188));return t!==e?null:e}for(var i=e,s=t;;){var c=i.return;if(c===null)break;var d=c.alternate;if(d===null){if(s=c.return,s!==null){i=s;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===i)return p(c),e;if(d===s)return p(c),t;d=d.sibling}throw Error(r(188))}if(i.return!==s.return)i=c,s=d;else{for(var v=!1,w=c.child;w;){if(w===i){v=!0,i=c,s=d;break}if(w===s){v=!0,s=c,i=d;break}w=w.sibling}if(!v){for(w=d.child;w;){if(w===i){v=!0,i=d,s=c;break}if(w===s){v=!0,s=d,i=c;break}w=w.sibling}if(!v)throw Error(r(189))}}if(i.alternate!==s)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}function m(e,t,i,s,c,d){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,s,c,d)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,i,s,c,d))return!0;e=e.sibling}return!1}function S(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function x(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function k(e){var t=[null,null],i=S(e);return i===null||T(t,e,i.child,{foundSelf:!1}),t}function T(e,t,i,s){for(;i!==null;){if(i===t)s.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(s.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&T(e,t,i.child,s))return!0;i=i.sibling}return!1}function A(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(r(559))}}var E=null,M=null;function H(e,t,i){return e===i?!0:e===t?(E=e,!0):!1}function $(e,t,i){return e===i?(M=e,!1):e===t?(M!==null&&(E=e),!0):!1}function te(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function O(e,t,i){for(var s=0,c=e;c;c=i(c))s++;c=0;for(var d=t;d;d=i(d))c++;for(;0<s-c;)e=i(e),s--;for(;0<c-s;)t=i(t),c--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var Q=Object.assign,ne=Symbol.for("react.element"),he=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),Se=Symbol.for("react.profiler"),Re=Symbol.for("react.consumer"),ae=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),ke=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),Pe=Symbol.for("react.activity"),ht=Symbol.for("react.legacy_hidden"),z=Symbol.for("react.memo_cache_sentinel"),q=Symbol.for("react.view_transition"),ee=Symbol.for("react.recoverable"),fe=Symbol.iterator;function ge(e){return e===null||typeof e!="object"?null:(e=fe&&e[fe]||e["@@iterator"],typeof e=="function"?e:null)}var Te=Symbol.for("react.client.reference");function Ne(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case Se:return"Profiler";case P:return"StrictMode";case se:return"Suspense";case ue:return"SuspenseList";case Pe:return"Activity";case q:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case ae:return e.displayName||"Context";case Re:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ke:return t=e.displayName||null,t!==null?t:Ne(e.type)||"Memo";case j:t=e._payload,e=e._init;try{return Ne(e(t))}catch{}}return null}var Ee=Array.isArray,W=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,it={pending:!1,data:null,method:null,action:null},nn=[],we=-1;function _t(e){return{current:e}}function pt(e){0>we||(e.current=nn[we],nn[we]=null,we--)}function Ke(e,t){we++,nn[we]=e.current,e.current=t}var qe=_t(null),lt=_t(null),wt=_t(null),un=_t(null);function Ht(e,t){switch(Ke(wt,t),Ke(lt,e),Ke(qe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Mg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Mg(t),e=Dg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}pt(qe),Ke(qe,e)}function It(){pt(qe),pt(lt),pt(wt)}function on(e){var t=e.memoizedState;t!==null&&(Za._currentValue=t.memoizedState,Ke(un,e)),t=qe.current;var i=Dg(t,e.type);t!==i&&(Ke(lt,e),Ke(qe,i))}function Vt(e){lt.current===e&&(pt(qe),pt(lt)),un.current===e&&(pt(un),Za._currentValue=it)}var X,ie;function ve(e){if(X===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);X=t&&t[1]||"",ie=-1<i.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+X+e+ie}var be=!1;function kt(e,t){if(!e||be)return"";be=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(ce){var D=ce}Reflect.construct(e,[],J)}else{try{J.call()}catch(ce){D=ce}J=!1;try{var V=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),J=!0,new e}finally{J&&(V!==void 0?Object.defineProperty(e.prototype,"props",V):delete e.prototype.props)}}}else{try{throw Error()}catch(ce){D=ce}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(ce){if(ce&&D&&typeof ce.stack=="string")return[ce.stack,D.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),v=d[0],w=d[1];if(v&&w){var N=v.split(`
4
- `),U=w.split(`
5
- `);for(c=s=0;s<N.length&&!N[s].includes("DetermineComponentFrameRoot");)s++;for(;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;if(s===N.length||c===U.length)for(s=N.length-1,c=U.length-1;1<=s&&0<=c&&N[s]!==U[c];)c--;for(;1<=s&&0<=c;s--,c--)if(N[s]!==U[c]){if(s!==1||c!==1)do if(s--,c--,0>c||N[s]!==U[c]){var Y=`
6
- `+N[s].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=s&&0<=c);break}}}finally{be=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ve(i):""}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve("Lazy");case 13:return e.child!==t&&t!==null?ve("Suspense Fallback"):ve("Suspense");case 19:return ve("SuspenseList");case 0:case 15:return kt(e.type,!1);case 11:return kt(e.type.render,!1);case 1:return kt(e.type,!0);case 31:return ve("Activity");case 30:return ve("ViewTransition");default:return""}}function bt(e){try{var t="",i=null;do t+=_e(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
7
- Error generating stack: `+s.message+`
8
- `+s.stack}}var mt=Object.prototype.hasOwnProperty,Yt=n.unstable_scheduleCallback,vn=n.unstable_cancelCallback,Bn=n.unstable_shouldYield,ua=n.unstable_requestPaint,qt=n.unstable_now,at=n.unstable_getCurrentPriorityLevel,An=n.unstable_ImmediatePriority,Rt=n.unstable_UserBlockingPriority,Ii=n.unstable_NormalPriority,Do=n.unstable_LowPriority,Ss=n.unstable_IdlePriority,ws=n.log,Lo=n.unstable_setDisableYieldValue,kl=null,cn=null;function Cn(e){if(typeof ws=="function"&&Lo(e),cn&&typeof cn.setStrictMode=="function")try{cn.setStrictMode(kl,e)}catch{}}var fn=Math.clz32?Math.clz32:Es,oa=Math.log,ks=Math.LN2;function Es(e){return e>>>=0,e===0?32:31-(oa(e)/ks|0)|0}var Vi=256,Yi=262144,El=4194304;function si(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Gi(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var c=0,d=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var w=s&134217727;return w!==0?(s=w&~d,s!==0?c=si(s):(v&=w,v!==0?c=si(v):i||(i=w&~e,i!==0&&(c=si(i))))):(w=s&~d,w!==0?c=si(w):v!==0?c=si(v):i||(i=s&~e,i!==0&&(c=si(i)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,i=t&-t,d>=i||d===32&&(i&4194048)!==0)?t:c}function ui(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nr(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-fn(i),c=1<<s;t|=e[s],i&=~c}return t}function Ts(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tl(){var e=El;return El<<=1,(El&62914560)===0&&(El=4194304),e}function Al(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Nn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ir(e,t,i,s,c,d){var v=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var w=e.entanglements,N=e.expirationTimes,U=e.hiddenUpdates;for(i=v&~i;0<i;){var Y=31-fn(i),J=1<<Y;w[Y]=0,N[Y]=-1;var D=U[Y];if(D!==null)for(U[Y]=null,Y=0;Y<D.length;Y++){var V=D[Y];V!==null&&(V.lane&=-536870913)}i&=~J}s!==0&&As(e,s,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(v&~t))}function As(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-fn(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function ki(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-fn(i),c=1<<s;c&t|e[s]&t&&(e[s]|=t),i&=~c}}function Cs(e,t){var i=t&-t;return i=(i&42)!==0?1:Cl(i),(i&(e.suspendedLanes|t))!==0?0:i}function Cl(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ns(){var e=de.p;return e!==0?e:(e=window.event,e===void 0?32:by(e.type))}function js(e,t){var i=de.p;try{return de.p=e,t()}finally{de.p=i}}var Jn=Math.random().toString(36).slice(2),Et="__reactFiber$"+Jn,ln="__reactProps$"+Jn,Ei="__reactContainer$"+Jn,lr="__reactEvents$"+Jn,Nl="__reactListeners$"+Jn,an="__reactHandles$"+Jn,ca="__reactResources$"+Jn,Xi="__reactMarker$"+Jn,jl="__reactLoad$"+Jn;function Ol(e){delete e[Et],delete e[ln],delete e[Nl],delete e[an]}function Ti(e){var t;if(t=e[Et])return t;for(var i=e.parentNode;i;){if(t=i[Ei]||i[Et]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Wg(e);e!==null;){if(i=e[Et])return i;e=Wg(e)}return t}e=i,i=e.parentNode}return null}function _l(e){if(e=e[Et]||e[Ei]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Fi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function dn(e){var t=e[ca];return t||(t=e[ca]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Nt(e){e[Xi]=!0}function Os(e){e[jl]=void 0}var $n=new Set,fa={};function rn(e,t){Ai(e,t),Ai(e+"Capture",t)}function Ai(e,t){for(fa[e]=t,e=0;e<t.length;e++)$n.add(t[e])}var ar=RegExp("^[: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]*$"),rr={},_s={};function Bo(e){return mt.call(_s,e)?!0:mt.call(rr,e)?!1:ar.test(e)?_s[e]=!0:(rr[e]=!0,!1)}var Fe=!1;function zs(){var e=Fe;return Fe=!1,e}function da(e,t,i){if(Bo(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function zl(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function Un(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,s)}}function hn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qs(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,d=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(v){i=""+v,d.call(this,v)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(v){i=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ur(e){if(!e._valueTracker){var t=sr(e)?"checked":"value";e._valueTracker=qs(e,t,""+e[t])}}function Rs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=sr(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}var ql=/[\n"\\]/g;function jn(e){return e.replace(ql,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ha(e,t,i,s,c,d,v,w){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),t!=null?v==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+hn(t)):e.value!==""+hn(t)&&(e.value=""+hn(t)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),t!=null?v==="number"&&e.value==t?pa(e,hn(e.value)):pa(e,hn(t)):i!=null?pa(e,hn(i)):s!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+hn(w):e.removeAttribute("name")}function Ms(e,t,i,s,c,d,v,w){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||i!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){ur(e);return}i=i!=null?""+hn(i):"",t=t!=null?""+hn(t):i,w||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=w?e.checked:!!s,e.defaultChecked=!!s,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),ur(e)}function pa(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function C(e,t,i,s){if(e=e.options,t){t={};for(var c=0;c<i.length;c++)t["$"+i[c]]=!0;for(i=0;i<e.length;i++)c=t.hasOwnProperty("$"+e[i].value),e[i].selected!==c&&(e[i].selected=c),c&&s&&(e[i].defaultSelected=!0)}else{for(i=""+hn(i),t=null,c=0;c<e.length;c++){if(e[c].value===i){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function F(e,t,i){if(t!=null&&(t=""+hn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+hn(i):""}function le(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(r(92));if(Ee(s)){if(1<s.length)throw Error(r(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=hn(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),ur(e)}function oe(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Ae=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function me(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||Ae.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Ge(e,t,i){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",Fe=!0);for(var c in t)s=t[c],t.hasOwnProperty(c)&&i[c]!==s&&(me(e,c,s),Fe=!0)}else for(var d in t)t.hasOwnProperty(d)&&me(e,d,t[d])}function ft(e){if(e.indexOf("-")===-1)return!1;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 We=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),et=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function rt(e){return et.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Je(){}var Tt=null;function Hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var oi=null,ma=null;function jh(e){var t=_l(e);if(t&&(e=t.stateNode)){var i=e[ln]||null;e:switch(e=t.stateNode,t.type){case"input":if(ha(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+jn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var c=s[ln]||null;if(!c)throw Error(r(90));ha(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Rs(s)}break e;case"textarea":F(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&C(e,!!i.multiple,t,!1)}}}var Uo=!1;function Oh(e,t,i){if(Uo)return e(t,i);Uo=!0;try{var s=e(t);return s}finally{if(Uo=!1,(oi!==null||ma!==null)&&(Mu(),oi&&(t=oi,e=ma,ma=oi=null,jh(t),e)))for(t=0;t<e.length;t++)jh(e[t])}}function or(e,t){var i=e.stateNode;if(i===null)return null;var s=i[ln]||null;if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(r(231,t,typeof i));return i}var Ci=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ho=!1;if(Ci)try{var cr={};Object.defineProperty(cr,"passive",{get:function(){Ho=!0}}),window.addEventListener("test",cr,cr),window.removeEventListener("test",cr,cr)}catch{Ho=!1}var Zi=null,Io=null,Ds=null;function _h(){if(Ds)return Ds;var e,t=Io,i=t.length,s,c="value"in Zi?Zi.value:Zi.textContent,d=c.length;for(e=0;e<i&&t[e]===c[e];e++);var v=i-e;for(s=1;s<=v&&t[i-s]===c[d-s];s++);return Ds=c.slice(e,1<s?1-s:void 0)}function Ls(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Bs(){return!0}function zh(){return!1}function pn(e){function t(i,s,c,d,v){this._reactName=i,this._targetInst=c,this.type=s,this.nativeEvent=d,this.target=v,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(i=e[w],this[w]=i?i(d):d[w]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Bs:zh,this.isPropagationStopped=zh,this}return Q(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Bs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Bs)},persist:function(){},isPersistent:Bs}),t}var Ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Us=pn(Ki),fr=Q({},Ki,{view:0,detail:0}),t1=pn(fr),Vo,Yo,dr,Hs=Q({},fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==dr&&(dr&&e.type==="mousemove"?(Vo=e.screenX-dr.screenX,Yo=e.screenY-dr.screenY):Yo=Vo=0,dr=e),Vo)},movementY:function(e){return"movementY"in e?e.movementY:Yo}}),qh=pn(Hs),n1=Q({},Hs,{dataTransfer:0}),i1=pn(n1),l1=Q({},fr,{relatedTarget:0}),Go=pn(l1),a1=Q({},Ki,{animationName:0,elapsedTime:0,pseudoElement:0}),r1=pn(a1),s1=Q({},Ki,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),u1=pn(s1),o1=Q({},Ki,{data:0}),Rh=pn(o1),c1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},d1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function h1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=d1[e])?!!t[e]:!1}function Qo(){return h1}var p1=Q({},fr,{key:function(e){if(e.key){var t=c1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ls(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?f1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qo,charCode:function(e){return e.type==="keypress"?Ls(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ls(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),m1=pn(p1),g1=Q({},Hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mh=pn(g1),y1=Q({},Ki,{submitter:0}),v1=pn(y1),b1=Q({},fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qo}),x1=pn(b1),S1=Q({},Ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),w1=pn(S1),k1=Q({},Hs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),E1=pn(k1),T1=Q({},Ki,{newState:0,oldState:0,source:0}),A1=pn(T1),C1=[9,13,27,32],Xo=Ci&&"CompositionEvent"in window,hr=null;Ci&&"documentMode"in document&&(hr=document.documentMode);var N1=Ci&&"TextEvent"in window&&!hr,Dh=Ci&&(!Xo||hr&&8<hr&&11>=hr),Lh=" ",Bh=!1;function Uh(e,t){switch(e){case"keyup":return C1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ga=!1;function j1(e,t){switch(e){case"compositionend":return Hh(t);case"keypress":return t.which!==32?null:(Bh=!0,Lh);case"textInput":return e=t.data,e===Lh&&Bh?null:e;default:return null}}function O1(e,t){if(ga)return e==="compositionend"||!Xo&&Uh(e,t)?(e=_h(),Ds=Io=Zi=null,ga=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dh&&t.locale!=="ko"?null:t.data;default:return null}}var _1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ih(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_1[e.type]:t==="textarea"}function Vh(e,t,i,s){oi?ma?ma.push(s):ma=[s]:oi=s,t=Iu(t,"onChange"),0<t.length&&(i=new Us("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var pr=null,mr=null;function z1(e){jg(e,0)}function Is(e){var t=Fi(e);if(Rs(t))return e}function Yh(e,t){if(e==="change")return t}var Gh=!1;if(Ci){var Fo;if(Ci){var Zo="oninput"in document;if(!Zo){var Qh=document.createElement("div");Qh.setAttribute("oninput","return;"),Zo=typeof Qh.oninput=="function"}Fo=Zo}else Fo=!1;Gh=Fo&&(!document.documentMode||9<document.documentMode)}function Xh(){pr&&(pr.detachEvent("onpropertychange",Fh),mr=pr=null)}function Fh(e){if(e.propertyName==="value"&&Is(mr)){var t=[];Vh(t,mr,e,Hn(e)),Oh(z1,t)}}function q1(e,t,i){e==="focusin"?(Xh(),pr=t,mr=i,pr.attachEvent("onpropertychange",Fh)):e==="focusout"&&Xh()}function R1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Is(mr)}function M1(e,t){if(e==="click")return Is(t)}function D1(e,t){if(e==="input"||e==="change")return Is(t)}function L1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var On=typeof Object.is=="function"?Object.is:L1;function gr(e,t){if(On(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var c=i[s];if(!mt.call(t,c)||!On(e[c],t[c]))return!1}return!0}function Ko(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 Zh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kh(e,t){var i=Zh(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Zh(i)}}function Jh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $h(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ko(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Ko(e.document)}return t}function Jo(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")}var B1=Ci&&"documentMode"in document&&11>=document.documentMode,ya=null,$o=null,yr=null,Po=!1;function Ph(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Po||ya==null||ya!==Ko(s)||(s=ya,"selectionStart"in s&&Jo(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),yr&&gr(yr,s)||(yr=s,s=Iu($o,"onSelect"),0<s.length&&(t=new Us("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=ya)))}function Rl(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var va={animationend:Rl("Animation","AnimationEnd"),animationiteration:Rl("Animation","AnimationIteration"),animationstart:Rl("Animation","AnimationStart"),transitionrun:Rl("Transition","TransitionRun"),transitionstart:Rl("Transition","TransitionStart"),transitioncancel:Rl("Transition","TransitionCancel"),transitionend:Rl("Transition","TransitionEnd")},Wo={},Wh={};Ci&&(Wh=document.createElement("div").style,"AnimationEvent"in window||(delete va.animationend.animation,delete va.animationiteration.animation,delete va.animationstart.animation),"TransitionEvent"in window||delete va.transitionend.transition);function Ml(e){if(Wo[e])return Wo[e];if(!va[e])return e;var t=va[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Wh)return Wo[e]=t[i];return e}var ep=Ml("animationend"),tp=Ml("animationiteration"),np=Ml("animationstart"),U1=Ml("transitionrun"),H1=Ml("transitionstart"),I1=Ml("transitioncancel"),ip=Ml("transitionend"),lp=new Map,ec="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ec.push("scrollEnd");function Pn(e,t){lp.set(e,t),rn(t,[e])}var V1=0;function Ni(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ni.identifierPrefix;var i=V1++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function ap(e){if(e==null||typeof e=="string")return e;var t=null,i=Ba;if(i!==null)for(var s=0;s<i.length;s++){var c=e[i[s]];if(c!=null){if(c==="none")return"none";t=t==null?c:t+(" "+c)}}return t??e.default}function ji(e,t){return e=ap(e),t=ap(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Vs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},In=[],ba=0,tc=0;function Ys(){for(var e=ba,t=tc=ba=0;t<e;){var i=In[t];In[t++]=null;var s=In[t];In[t++]=null;var c=In[t];In[t++]=null;var d=In[t];if(In[t++]=null,s!==null&&c!==null){var v=s.pending;v===null?c.next=c:(c.next=v.next,v.next=c),s.pending=c}d!==0&&rp(i,c,d)}}function Gs(e,t,i,s){In[ba++]=e,In[ba++]=t,In[ba++]=i,In[ba++]=s,tc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function nc(e,t,i,s){return Gs(e,t,i,s),Qs(e)}function Dl(e,t){return Gs(e,null,null,t),Qs(e)}function rp(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var c=!1,d=e.return;d!==null;)d.childLanes|=i,s=d.alternate,s!==null&&(s.childLanes|=i),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-fn(i),e=d.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=i|536870912),d):null}function Qs(e){if(50<Ur)throw Ur=0,Ru=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var xa={};function Y1(e,t,i,s){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(e,t,i,s){return new Y1(e,t,i,s)}function ic(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,t){var i=e.alternate;return i===null?(i=bn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function sp(e,t){e.flags&=1206910978;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Xs(e,t,i,s,c,d){var v=0;if(s=e,typeof s=="function")ic(s)&&(v=1);else if(typeof s=="string")v=yS(e,i,qe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Pe:return e=bn(31,i,t,c),e.elementType=Pe,e.lanes=d,e;case Z:return Ll(i.children,c,d,t);case P:v=8,c|=24;break;case Se:return e=bn(12,i,t,c|2),e.elementType=Se,e.lanes=d,e;case se:return e=bn(13,i,t,c),e.elementType=se,e.lanes=d,e;case ue:return e=bn(19,i,t,c),e.elementType=ue,e.lanes=d,e;case ht:case q:return e=c|32,e=bn(30,i,t,e),e.elementType=q,e.lanes=d,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case ae:v=10;break e;case Re:v=9;break e;case G:v=11;break e;case ke:v=14;break e;case j:v=16,s=null;break e}v=29,i=Error(r(130,e===null?"null":typeof e,"")),s=null}return t=bn(v,i,t,c),t.elementType=e,t.type=s,t.lanes=d,t}function Ll(e,t,i,s){return e=bn(7,e,s,t),e.lanes=i,e}function lc(e,t,i){return e=bn(6,e,null,t),e.lanes=i,e}function up(e){var t=bn(18,null,null,0);return t.stateNode=e,t}function ac(e,t,i){return t=bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var op=new WeakMap;function Vn(e,t){if(typeof e=="object"&&e!==null){var i=op.get(e);return i!==void 0?i:(t={value:e,source:t,stack:bt(t)},op.set(e,t),t)}return{value:e,source:t,stack:bt(t)}}var Sa=[],wa=0,Fs=null,vr=0,Yn=[],Gn=0,Ji=null,ci=1,fi="";function _i(e,t){Sa[wa++]=vr,Sa[wa++]=Fs,Fs=e,vr=t}function cp(e,t,i){Yn[Gn++]=ci,Yn[Gn++]=fi,Yn[Gn++]=Ji,Ji=e;var s=ci;e=fi;var c=32-fn(s)-1;s&=~(1<<c),i+=1;var d=32-fn(t)+c;if(30<d){var v=c-c%5;d=(s&(1<<v)-1).toString(32),s>>=v,c-=v,ci=1<<32-fn(t)+c|i<<c|s,fi=d+e}else ci=1<<d|i<<c|s,fi=e}function Zs(e){e.return!==null&&(_i(e,1),cp(e,1,0))}function rc(e){for(;e===Fs;)Fs=Sa[--wa],Sa[wa]=null,vr=Sa[--wa],Sa[wa]=null;for(;e===Ji;)Ji=Yn[--Gn],Yn[Gn]=null,fi=Yn[--Gn],Yn[Gn]=null,ci=Yn[--Gn],Yn[Gn]=null}function fp(e,t){Yn[Gn++]=ci,Yn[Gn++]=fi,Yn[Gn++]=Ji,ci=t.id,fi=t.overflow,Ji=e}var Qt=null,xt=null,Le=!1,$i=null,Qn=!1,sc=Error(r(519));function Pi(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw br(Vn(t,e)),sc}function dp(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[Et]=e,t[ln]=s,i){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(i=0;i<Ir.length;i++)He(Ir[i],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),Ms(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),le(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||qg(t.textContent,i)?(s.popover!=null&&(He("beforetoggle",t),He("toggle",t)),s.onScroll!=null&&He("scroll",t),s.onScrollEnd!=null&&He("scrollend",t),s.onClick!=null&&(t.onclick=Je),t=!0):t=!1,t||Pi(e,!0)}function Ks(e){for(Qt=e.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:Qn=!1;return;case 27:case 3:Qn=!0;return;default:Qt=Qt.return}}function ka(e){if(e!==Qt)return!1;if(!Le)return Ks(e),Le=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Bf(e.type,e.memoizedProps)),i=!i),i&&xt&&Pi(e),Ks(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));xt=Pg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));xt=Pg(e)}else t===27?(t=xt,pl(e.type)?(e=Ff,Ff=null,xt=e):xt=t):xt=Qt?Fn(e.stateNode.nextSibling):null;return!0}function Bl(){xt=Qt=null,Le=!1}function uc(){var e=$i;return e!==null&&(wn===null?wn=e:wn.push.apply(wn,e),$i=null),e}function br(e){$i===null?$i=[e]:$i.push(e)}var oc=_t(null),Ul=null,zi=null;function Wi(e,t,i){Ke(oc,t._currentValue),t._currentValue=i}function qi(e){e._currentValue=oc.current,pt(oc)}function Js(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function cc(e,t,i,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var v=c.child;d=d.firstContext;e:for(;d!==null;){var w=d;d=c;for(var N=0;N<t.length;N++)if(w.context===t[N]){d.lanes|=i,w=d.alternate,w!==null&&(w.lanes|=i),Js(d.return,i,e),s||(v=null);break e}d=w.next}}else if(c.tag===18){if(v=c.return,v===null)throw Error(r(341));v.lanes|=i,d=v.alternate,d!==null&&(d.lanes|=i),Js(v,i,e),v=null}else c.tag===13&&c.memoizedState!==null&&c.memoizedState.dehydrated===null?(c.lanes|=i,v=c.alternate,v!==null&&(v.lanes|=i),Js(c.return,i,e),v=c.child,v=v!==null?v.sibling:null):v=c.child;if(v!==null)v.return=c;else for(v=c;v!==null;){if(v===e){v=null;break}if(c=v.sibling,c!==null){c.return=v.return,v=c;break}v=v.return}c=v}}function Hl(e,t,i,s){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var v=c.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var w=c.type;On(c.pendingProps.value,v.value)||(e!==null?e.push(w):e=[w])}}else if(c===un.current){if(v=c.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Za):e=[Za])}c=c.return}return e!==null&&cc(t,e,i,s),t.flags|=262144,e!==null}function $s(e){for(e=e.firstContext;e!==null;){if(!On(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Il(e){Ul=e,zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zt(e){return hp(Ul,e)}function Ps(e,t){return Ul===null&&Il(e),hp(e,t)}function hp(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},zi===null){if(e===null)throw Error(r(308));zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zi=zi.next=t;return i}var G1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Q1=n.unstable_scheduleCallback,X1=n.unstable_NormalPriority,Mt={$$typeof:ae,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fc(){return{controller:new G1,data:new Map,refCount:0}}function xr(e){e.refCount--,e.refCount===0&&Q1(X1,function(){e.controller.abort()})}function pp(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var s=t[e];i.indexOf(s)===-1&&i.push(s)}}}var Sr=null;function F1(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var wr=null,dc=0,Vl=0,Ea=null;function Z1(e,t){if(wr===null){var i=wr=[];dc=0,Vl=jf(),Ea={status:"pending",value:void 0,then:function(s){i.push(s)}}}return dc++,t.then(mp,mp),t}function mp(){if(--dc===0&&(Sr=null,wr!==null)){Ea!==null&&(Ea.status="fulfilled");var e=wr;wr=null,Vl=0,Ea=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function K1(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(c){i.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<i.length;c++)(0,i[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<i.length;c++)(0,i[c])(void 0)}),s}var gp=W.S;W.S=function(e,t){if(ug=qt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Z1(e,t),Sr!==null)for(var i=Va;i!==null;)pp(i,Sr),i=i.next;if(i=e.types,i!==null){for(var s=Va;s!==null;)pp(s,i),s=s.next;if(Vl!==0){s=Sr,s===null&&(s=Sr=[]);for(var c=0;c<i.length;c++){var d=i[c];s.indexOf(d)===-1&&s.push(d)}}}gp!==null&&gp(e,t)};var Yl=_t(null);function hc(){var e=Yl.current;return e!==null?e:gt.pooledCache}function Ws(e,t){t===null?Ke(Yl,Yl.current):Ke(Yl,t.pool)}function yp(){var e=hc();return e===null?null:{parent:Mt._currentValue,pool:e}}var Ta=Error(r(460)),pc=Error(r(474)),eu=Error(r(542)),tu={then:function(){}};function vp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function bp(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Je,Je),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Sp(e),e===void 0&&!("reason"in t)?Error(r(600)):e;default:if(typeof t.status=="string")t.then(Je,Je);else{if(e=gt,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Sp(e),e}throw Ql=t,Ta}}function Gl(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ql=i,Ta):i}}var Ql=null;function xp(){if(Ql===null)throw Error(r(459));var e=Ql;return Ql=null,e}function Sp(e){if(e===Ta||e===eu)throw Error(r(483))}var Aa=null,kr=0;function nu(e){var t=kr;return kr+=1,Aa===null&&(Aa=[]),bp(Aa,e,t)}function el(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function iu(e,t){throw t.$$typeof===ne?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wp(e){function t(B,R){if(e){var I=B.deletions;I===null?(B.deletions=[R],B.flags|=16):I.push(R)}}function i(B,R){if(!e)return null;for(;R!==null;)t(B,R),R=R.sibling;return null}function s(B){for(var R=new Map;B!==null;)B.key===null?R.set(B.index,B):R.set(B.key,B),B=B.sibling;return R}function c(B,R){return B=Oi(B,R),B.index=0,B.sibling=null,B}function d(B,R,I){return B.index=I,e?(I=B.alternate,I!==null?(I=I.index,I<R?(B.flags|=2,R):I):(B.flags|=134217730,R)):(B.flags|=1048576,R)}function v(B){return e&&B.alternate===null&&(B.flags|=134217730),B}function w(B,R,I,K){return R===null||R.tag!==6?(R=lc(I,B.mode,K),R.return=B,R):(R=c(R,I),R.return=B,R)}function N(B,R,I,K){var pe=I.type;return pe===Z?(B=Y(B,R,I.props.children,K,I.key),el(B,I),B):R!==null&&(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===j&&Gl(pe)===R.type)?(R=c(R,I.props),el(R,I),R.return=B,R):(R=Xs(I.type,I.key,I.props,null,B.mode,K),el(R,I),R.return=B,R)}function U(B,R,I,K){return R===null||R.tag!==4||R.stateNode.containerInfo!==I.containerInfo||R.stateNode.implementation!==I.implementation?(R=ac(I,B.mode,K),R.return=B,R):(R=c(R,I.children||[]),R.return=B,R)}function Y(B,R,I,K,pe){return R===null||R.tag!==7?(R=Ll(I,B.mode,K,pe),R.return=B,R):(R=c(R,I),R.return=B,R)}function J(B,R,I){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=lc(""+R,B.mode,I),R.return=B,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case he:return I=Xs(R.type,R.key,R.props,null,B.mode,I),el(I,R),I.return=B,I;case _:return R=ac(R,B.mode,I),R.return=B,R;case j:return R=Gl(R),J(B,R,I)}if(Ee(R)||ge(R))return R=Ll(R,B.mode,I,null),R.return=B,R;if(typeof R.then=="function")return J(B,nu(R),I);if(R.$$typeof===ae)return J(B,Ps(B,R),I);iu(B,R)}return null}function D(B,R,I,K){var pe=R!==null?R.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return pe!==null?null:w(B,R,""+I,K);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case he:return I.key===pe?N(B,R,I,K):null;case _:return I.key===pe?U(B,R,I,K):null;case j:return I=Gl(I),D(B,R,I,K)}if(Ee(I)||ge(I))return pe!==null?null:Y(B,R,I,K,null);if(typeof I.then=="function")return D(B,R,nu(I),K);if(I.$$typeof===ae)return D(B,R,Ps(B,I),K);iu(B,I)}return null}function V(B,R,I,K,pe){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return B=B.get(I)||null,w(R,B,""+K,pe);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case he:return B=B.get(K.key===null?I:K.key)||null,N(R,B,K,pe);case _:return B=B.get(K.key===null?I:K.key)||null,U(R,B,K,pe);case j:return K=Gl(K),V(B,R,I,K,pe)}if(Ee(K)||ge(K))return B=B.get(I)||null,Y(R,B,K,pe,null);if(typeof K.then=="function")return V(B,R,I,nu(K),pe);if(K.$$typeof===ae)return V(B,R,I,Ps(R,K),pe);iu(R,K)}return null}function ce(B,R,I,K){for(var pe=null,Ve=null,xe=R,je=R=0,Bt=null;xe!==null&&je<I.length;je++){xe.index>je?(Bt=xe,xe=null):Bt=xe.sibling;var Ze=D(B,xe,I[je],K);if(Ze===null){xe===null&&(xe=Bt);break}e&&xe&&Ze.alternate===null&&t(B,xe),R=d(Ze,R,je),Ve===null?pe=Ze:Ve.sibling=Ze,Ve=Ze,xe=Bt}if(je===I.length)return i(B,xe),Le&&_i(B,je),pe;if(xe===null){for(;je<I.length;je++)xe=J(B,I[je],K),xe!==null&&(R=d(xe,R,je),Ve===null?pe=xe:Ve.sibling=xe,Ve=xe);return Le&&_i(B,je),pe}for(xe=s(xe);je<I.length;je++)Bt=V(xe,B,je,I[je],K),Bt!==null&&(e&&(Ze=Bt.alternate,Ze!==null&&xe.delete(Ze.key===null?je:Ze.key)),R=d(Bt,R,je),Ve===null?pe=Bt:Ve.sibling=Bt,Ve=Bt);return e&&xe.forEach(function(bl){return t(B,bl)}),Le&&_i(B,je),pe}function ye(B,R,I,K){if(I==null)throw Error(r(151));for(var pe=null,Ve=null,xe=R,je=R=0,Bt=null,Ze=I.next();xe!==null&&!Ze.done;je++,Ze=I.next()){xe.index>je?(Bt=xe,xe=null):Bt=xe.sibling;var bl=D(B,xe,Ze.value,K);if(bl===null){xe===null&&(xe=Bt);break}e&&xe&&bl.alternate===null&&t(B,xe),R=d(bl,R,je),Ve===null?pe=bl:Ve.sibling=bl,Ve=bl,xe=Bt}if(Ze.done)return i(B,xe),Le&&_i(B,je),pe;if(xe===null){for(;!Ze.done;je++,Ze=I.next())Ze=J(B,Ze.value,K),Ze!==null&&(R=d(Ze,R,je),Ve===null?pe=Ze:Ve.sibling=Ze,Ve=Ze);return Le&&_i(B,je),pe}for(xe=s(xe);!Ze.done;je++,Ze=I.next())Ze=V(xe,B,je,Ze.value,K),Ze!==null&&(e&&(Bt=Ze.alternate,Bt!==null&&xe.delete(Bt.key===null?je:Bt.key)),R=d(Ze,R,je),Ve===null?pe=Ze:Ve.sibling=Ze,Ve=Ze);return e&&xe.forEach(function(jS){return t(B,jS)}),Le&&_i(B,je),pe}function De(B,R,I,K){if(typeof I=="object"&&I!==null&&I.type===Z&&I.key===null&&I.props.ref===void 0&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case he:e:{for(var pe=I.key;R!==null;){if(R.key===pe){if(pe=I.type,pe===Z){if(R.tag===7){i(B,R.sibling),K=c(R,I.props.children),el(K,I),K.return=B,B=K;break e}}else if(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===j&&Gl(pe)===R.type){i(B,R.sibling),K=c(R,I.props),el(K,I),K.return=B,B=K;break e}i(B,R);break}else t(B,R);R=R.sibling}I.type===Z?(K=Ll(I.props.children,B.mode,K,I.key),el(K,I),K.return=B,B=K):(K=Xs(I.type,I.key,I.props,null,B.mode,K),el(K,I),K.return=B,B=K)}return v(B);case _:e:{for(pe=I.key;R!==null;){if(R.key===pe)if(R.tag===4&&R.stateNode.containerInfo===I.containerInfo&&R.stateNode.implementation===I.implementation){i(B,R.sibling),K=c(R,I.children||[]),K.return=B,B=K;break e}else{i(B,R);break}else t(B,R);R=R.sibling}K=ac(I,B.mode,K),K.return=B,B=K}return v(B);case j:return I=Gl(I),De(B,R,I,K)}if(Ee(I))return ce(B,R,I,K);if(ge(I)){if(pe=ge(I),typeof pe!="function")throw Error(r(150));return I=pe.call(I),ye(B,R,I,K)}if(typeof I.then=="function")return De(B,R,nu(I),K);if(I.$$typeof===ae)return De(B,R,Ps(B,I),K);iu(B,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,R!==null&&R.tag===6?(i(B,R.sibling),K=c(R,I),K.return=B,B=K):(i(B,R),K=lc(I,B.mode,K),K.return=B,B=K),v(B)):i(B,R)}return function(B,R,I,K){try{kr=0;var pe=De(B,R,I,K);return Aa=null,pe}catch(xe){if(xe===Ta||xe===eu)throw xe;var Ve=bn(29,xe,null,B.mode);return Ve.lanes=K,Ve.return=B,Ve}}}var Xl=wp(!0),kp=wp(!1),tl=!1;function mc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function nl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function il(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(tt&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=Qs(e),rp(e,null,i),t}return Gs(e,s,t,i),Qs(e)}function Er(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,ki(e,i)}}function yc(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var c=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var v={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?c=d=v:d=d.next=v,i=i.next}while(i!==null);d===null?c=d=t:d=d.next=t}else c=d=t;i={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var vc=!1;function Tr(){if(vc){var e=Ea;if(e!==null)throw e}}function Ar(e,t,i,s){vc=!1;var c=e.updateQueue;tl=!1;var d=c.firstBaseUpdate,v=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var N=w,U=N.next;N.next=null,v===null?d=U:v.next=U,v=N;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,w=Y.lastBaseUpdate,w!==v&&(w===null?Y.firstBaseUpdate=U:w.next=U,Y.lastBaseUpdate=N))}if(d!==null){var J=c.baseState;v=0,Y=U=N=null,w=d;do{var D=w.lane&-536870913,V=D!==w.lane;if(V?(Ie&D)===D:(s&D)===D){D!==0&&D===Vl&&(vc=!0),Y!==null&&(Y=Y.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var ce=e,ye=w;D=t;var De=i;switch(ye.tag){case 1:if(ce=ye.payload,typeof ce=="function"){J=ce.call(De,J,D);break e}J=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ye.payload,D=typeof ce=="function"?ce.call(De,J,D):ce,D==null)break e;J=Q({},J,D);break e;case 2:tl=!0}}D=w.callback,D!==null&&(e.flags|=64,V&&(e.flags|=8192),V=c.callbacks,V===null?c.callbacks=[D]:V.push(D))}else V={lane:D,tag:w.tag,payload:w.payload,callback:w.callback,next:null},Y===null?(U=Y=V,N=J):Y=Y.next=V,v|=D;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;V=w,w=V.next,V.next=null,c.lastBaseUpdate=V,c.shared.pending=null}}while(!0);Y===null&&(N=J),c.baseState=N,c.firstBaseUpdate=U,c.lastBaseUpdate=Y,d===null&&(c.shared.lanes=0),cl|=v,e.lanes=v,e.memoizedState=J}}function Ep(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function Tp(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Ep(i[e],t)}var ll=_t(null),lu=_t(0);function Ap(e,t){e=Bi,Ke(lu,e),Ke(ll,t),Bi=e|t.baseLanes}function bc(){Ke(lu,Bi),Ke(ll,ll.current)}function xc(){Bi=lu.current,pt(ll),pt(lu)}var Kt=_t(null),sn=null;function al(e){var t=e.alternate;Ke(Jt,Jt.current&1),Ke(Kt,e),sn===null&&(t===null||ll.current!==null||t.memoizedState!==null)&&(sn=e)}function Sc(e){Ke(Jt,Jt.current),Ke(Kt,e),sn===null&&(sn=e)}function Cp(e){e.tag===22?(Ke(Jt,Jt.current),Ke(Kt,e),sn===null&&(sn=e)):rl()}function rl(){Ke(Jt,Jt.current),Ke(Kt,Kt.current)}function _n(e){pt(Kt),sn===e&&(sn=null),pt(Jt)}var Jt=_t(0);function Cr(e,t){Ke(Kt,Kt.current),Ke(Jt,t)}function wc(e){pt(Jt),pt(Kt),sn===e&&(sn=null)}function au(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Qf(i)||Xf(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ri=0,Me=null,dt=null,Dt=null,ru=!1,Ca=!1,Fl=!1,su=0,Nr=0,Na=null,J1=0;function jt(){throw Error(r(321))}function kc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!On(e[i],t[i]))return!1;return!0}function Ec(e,t,i,s,c,d){return Ri=d,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?cm:fm,Fl=!1,d=i(s,c),Fl=!1,Ca&&(d=jp(t,i,s,c)),Np(e),d}function Np(e){W.H=pu;var t=dt!==null&&dt.next!==null;if(Ri=0,Dt=dt=Me=null,ru=!1,Nr=0,Na=null,t)throw Error(r(300));e===null||Lt||(e=e.dependencies,e!==null&&$s(e)&&(Lt=!0))}function jp(e,t,i,s){Me=e;var c=0;do{if(Ca&&(Na=null),Nr=0,Ca=!1,25<=c)throw Error(r(301));if(c+=1,Dt=dt=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}W.H=lx,d=t(i,s)}while(Ca);return d}function $1(){var e=W.H,t=e.useState()[0];return t=typeof t.then=="function"?jr(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Me.flags|=1024),t}function Tc(){var e=su!==0;return su=0,e}function Ac(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Cc(e){if(ru){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ru=!1}Ri=0,Dt=dt=Me=null,Ca=!1,Nr=su=0,Na=null}function mn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?Me.memoizedState=Dt=e:Dt=Dt.next=e,Dt}function zt(){if(dt===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=Dt===null?Me.memoizedState:Dt.next;if(t!==null)Dt=t,dt=e;else{if(e===null)throw Me.alternate===null?Error(r(467)):Error(r(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Dt===null?Me.memoizedState=Dt=e:Dt=Dt.next=e}return Dt}function uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jr(e){var t=Nr;return Nr+=1,Na===null&&(Na=[]),e=bp(Na,e,t),t=Me,(Dt===null?t.memoizedState:Dt.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?cm:fm),e}function ou(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return jr(e);if(e.$$typeof===ee)return;if(e.$$typeof===ae)return Zt(e)}throw Error(r(438,String(e)))}function Nc(e){var t=null,i=Me.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Me.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=uu(),Me.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=z;return t.index++,i}function Mi(e,t){return typeof t=="function"?t(e):t}function cu(e){var t=zt();return jc(t,dt,e)}function jc(e,t,i){var s=e.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=i;var c=e.baseQueue,d=s.pending;if(d!==null){if(c!==null){var v=c.next;c.next=d.next,d.next=v}t.baseQueue=c=d,s.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var w=v=null,N=null,U=t,Y=!1;do{var J=U.lane&-536870913;if(J!==U.lane?(Ie&J)===J:(Ri&J)===J){var D=U.revertLane;if(D===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),J===Vl&&(Y=!0);else if((Ri&D)===D){U=U.next,D===Vl&&(Y=!0);continue}else J={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(w=N=J,v=d):N=N.next=J,Me.lanes|=D,cl|=D;J=U.action,Fl&&i(d,J),d=U.hasEagerState?U.eagerState:i(d,J)}else D={lane:J,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(w=N=D,v=d):N=N.next=D,Me.lanes|=J,cl|=J;U=U.next}while(U!==null&&U!==t);if(N===null?v=d:N.next=w,!On(d,e.memoizedState)&&(Lt=!0,Y&&(i=Ea,i!==null)))throw i;e.memoizedState=d,e.baseState=v,e.baseQueue=N,s.lastRenderedState=d}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Oc(e){var t=zt(),i=t.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var s=i.dispatch,c=i.pending,d=t.memoizedState;if(c!==null){i.pending=null;var v=c=c.next;do d=e(d,v.action),v=v.next;while(v!==c);On(d,t.memoizedState)||(Lt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),i.lastRenderedState=d}return[d,s]}function Op(e,t,i){var s=Me,c=zt(),d=Le;if(d){if(i===void 0)throw Error(r(407));i=i()}else i=t();var v=!On((dt||c).memoizedState,i);if(v&&(c.memoizedState=i,Lt=!0),c=c.queue,qc(qp.bind(null,s,c,e),[e]),e=c.getSnapshot!==t||v||Dt!==null&&(Dt.memoizedState.tag&1)!==0,ja(e?9:8,{destroy:void 0},zp.bind(null,s,c,i,t),null),e){if(s.flags|=2048,gt===null)throw Error(r(349));d||(Ri&127)!==0||_p(s,t,i)}return i}function _p(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Me.updateQueue,t===null?(t=uu(),Me.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function zp(e,t,i,s){t.value=i,t.getSnapshot=s,Rp(t)&&Mp(e)}function qp(e,t,i){return i(function(){Rp(t)&&Mp(e)})}function Rp(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!On(e,i)}catch{return!0}}function Mp(e){var t=Dl(e,2);t!==null&&kn(t,e,2)}function _c(e){var t=mn();if(typeof e=="function"){var i=e;if(e=i(),Fl){Cn(!0);try{i()}finally{Cn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:e},t}function Dp(e,t,i,s){return e.baseState=i,jc(e,dt,typeof s=="function"?s:Mi)}function P1(e,t,i,s,c){if(hu(e))throw Error(r(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){d.listeners.push(v)}};W.T!==null?i(!0):d.isTransition=!1,s(d),i=t.pending,i===null?(d.next=t.pending=d,Lp(t,d)):(d.next=i.next,t.pending=i.next=d)}}function Lp(e,t){var i=t.action,s=t.payload,c=e.state;if(t.isTransition){var d=W.T,v={};v.types=d!==null?d.types:null,W.T=v;try{var w=i(c,s),N=W.S;N!==null&&N(v,w),Bp(e,t,w)}catch(U){zc(e,t,U)}finally{d!==null&&v.types!==null&&(d.types=v.types),W.T=d}}else try{d=i(c,s),Bp(e,t,d)}catch(U){zc(e,t,U)}}function Bp(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Up(e,t,s)},function(s){return zc(e,t,s)}):Up(e,t,i)}function Up(e,t,i){t.status="fulfilled",t.value=i,Hp(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Lp(e,i)))}function zc(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,Hp(t),t=t.next;while(t!==s)}e.action=null}function Hp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ip(e,t){return t}function Vp(e,t){if(Le){var i=gt.formState;if(i!==null){e:{var s=Me;if(Le){if(xt){t:{for(var c=xt,d=Qn;c.nodeType!==8;){if(!d){c=null;break t}if(c=Fn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){xt=Fn(c.nextSibling),s=c.data==="F!";break e}}Pi(s)}s=!1}s&&(t=i[0])}}return i=mn(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ip,lastRenderedState:t},i.queue=s,i=sm.bind(null,Me,s),s.dispatch=i,s=_c(!1),d=Bc.bind(null,Me,!1,s.queue),s=mn(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,i=P1.bind(null,Me,c,d,i),c.dispatch=i,s.memoizedState=e,[t,i,!1]}function Yp(e){var t=zt();return Gp(t,dt,e)}function Gp(e,t,i){if(t=jc(e,t,Ip)[0],e=cu(Mi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=jr(t)}catch(v){throw v===Ta?eu:v}else s=t;t=zt();var c=t.queue,d=c.dispatch;return i!==t.memoizedState&&(Me.flags|=2048,ja(9,{destroy:void 0},W1.bind(null,c,i),null)),[s,d,e]}function W1(e,t){e.action=t}function Qp(e){var t=zt(),i=dt;if(i!==null)return Gp(t,i,e);zt(),t=t.memoizedState,i=zt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function ja(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Me.updateQueue,t===null&&(t=uu(),Me.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function Xp(){return zt().memoizedState}function fu(e,t,i,s){var c=mn();Me.flags|=e,c.memoizedState=ja(1|t,{destroy:void 0},i,s===void 0?null:s)}function du(e,t,i,s){var c=zt();s=s===void 0?null:s;var d=c.memoizedState.inst;dt!==null&&s!==null&&kc(s,dt.memoizedState.deps)?c.memoizedState=ja(t,d,i,s):(Me.flags|=e,c.memoizedState=ja(1|t,d,i,s))}function Fp(e,t){fu(8390656,8,e,t)}function qc(e,t){du(2048,8,e,t)}function ex(e){Me.flags|=4;var t=Me.updateQueue;if(t===null)t=uu(),Me.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Zp(e){var t=zt().memoizedState;return ex({ref:t,nextImpl:e}),function(){if((tt&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Kp(e,t){return du(4,2,e,t)}function Jp(e,t){return du(4,4,e,t)}function $p(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Pp(e,t,i){i=i!=null?i.concat([e]):null,du(4,4,$p.bind(null,t,e),i)}function Rc(){}function Wp(e,t){var i=zt();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&kc(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function em(e,t){var i=zt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&kc(t,s[1]))return s[0];if(s=e(),Fl){Cn(!0);try{e()}finally{Cn(!1)}}return i.memoizedState=[s,t],s}function Mc(e,t,i){return i===void 0||(Ri&1073741824)!==0&&(Ie&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=cg(),Me.lanes|=e,cl|=e,i)}function tm(e,t,i,s){return On(i,t)?i:ll.current!==null?(e=Mc(e,i,s),On(e,t)||(Lt=!0),e):(Ri&106)===0||(Ri&1073741824)!==0&&(Ie&261930)===0?(Lt=!0,e.memoizedState=i):(e=cg(),Me.lanes|=e,cl|=e,t)}function nm(e,t,i,s,c){var d=de.p;de.p=d!==0&&8>d?d:8;var v=W.T,w={};w.types=v!==null?v.types:null,W.T=w,Bc(e,!1,t,i);try{var N=c(),U=W.S;if(U!==null&&U(w,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var Y=K1(N,s);Or(e,t,Y,Mn(e))}else Or(e,t,s,Mn(e))}catch(J){Or(e,t,{then:function(){},status:"rejected",reason:J},Mn())}finally{de.p=d,v!==null&&w.types!==null&&(v.types=w.types),W.T=v}}function tx(){}function Dc(e,t,i,s){if(e.tag!==5)throw Error(r(476));var c=im(e).queue;nm(e,c,t,it,i===null?tx:function(){return lm(e),i(s)})}function im(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:it,baseState:it,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:it},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function lm(e){var t=im(e);t.next===null&&(t=e.alternate.memoizedState),Or(e,t.next.queue,{},Mn())}function Lc(){return Zt(Za)}function am(){return zt().memoizedState}function rm(){return zt().memoizedState}function nx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Mn();e=nl(i);var s=il(t,e,i);s!==null&&(kn(s,t,i),Er(s,t,i)),t={cache:fc()},e.payload=t;return}t=t.return}}function ix(e,t,i){var s=Mn();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},hu(e)?um(t,i):(i=nc(e,t,i,s),i!==null&&(kn(i,e,s),om(i,t,s)))}function sm(e,t,i){var s=Mn();Or(e,t,i,s)}function Or(e,t,i,s){var c={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(hu(e))um(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var v=t.lastRenderedState,w=d(v,i);if(c.hasEagerState=!0,c.eagerState=w,On(w,v))return Gs(e,t,c,0),gt===null&&Ys(),!1}catch{}if(i=nc(e,t,c,s),i!==null)return kn(i,e,s),om(i,t,s),!0}return!1}function Bc(e,t,i,s){if(s={lane:2,revertLane:jf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},hu(e)){if(t)throw Error(r(479))}else t=nc(e,i,s,2),t!==null&&kn(t,e,2)}function hu(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function um(e,t){Ca=ru=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function om(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,ki(e,i)}}var pu={readContext:Zt,use:ou,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt,useEffectEvent:jt},cm={readContext:Zt,use:ou,useCallback:function(e,t){return mn().memoizedState=[e,t===void 0?null:t],e},useContext:Zt,useEffect:Fp,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,fu(4194308,4,$p.bind(null,t,e),i)},useLayoutEffect:function(e,t){return fu(4194308,4,e,t)},useInsertionEffect:function(e,t){fu(4,2,e,t)},useMemo:function(e,t){var i=mn();t=t===void 0?null:t;var s=e();if(Fl){Cn(!0);try{e()}finally{Cn(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=mn();if(i!==void 0){var c=i(t);if(Fl){Cn(!0);try{i(t)}finally{Cn(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=ix.bind(null,Me,e),[s.memoizedState,e]},useRef:function(e){var t=mn();return e={current:e},t.memoizedState=e},useState:function(e){e=_c(e);var t=e.queue,i=sm.bind(null,Me,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Rc,useDeferredValue:function(e,t){var i=mn();return Mc(i,e,t)},useTransition:function(){var e=_c(!1);return e=nm.bind(null,Me,e.queue,!0,!1),mn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Me,c=mn();if(Le){if(i===void 0)throw Error(r(407));i=i()}else{if(i=t(),gt===null)throw Error(r(349));(Ie&127)!==0||_p(s,t,i)}c.memoizedState=i;var d={value:i,getSnapshot:t};return c.queue=d,Fp(qp.bind(null,s,d,e),[e]),s.flags|=2048,ja(9,{destroy:void 0},zp.bind(null,s,d,i,t),null),i},useId:function(){var e=mn(),t=gt.identifierPrefix;if(Le){var i=fi,s=ci;i=(s&~(1<<32-fn(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=su++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=J1++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Lc,useFormState:Vp,useActionState:Vp,useOptimistic:function(e){var t=mn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Bc.bind(null,Me,!0,i),i.dispatch=t,[e,t]},useMemoCache:Nc,useCacheRefresh:function(){return mn().memoizedState=nx.bind(null,Me)},useEffectEvent:function(e){var t=mn(),i={impl:e};return t.memoizedState=i,function(){if((tt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}},fm={readContext:Zt,use:ou,useCallback:Wp,useContext:Zt,useEffect:qc,useImperativeHandle:Pp,useInsertionEffect:Kp,useLayoutEffect:Jp,useMemo:em,useReducer:cu,useRef:Xp,useState:function(){return cu(Mi)},useDebugValue:Rc,useDeferredValue:function(e,t){var i=zt();return tm(i,dt.memoizedState,e,t)},useTransition:function(){var e=cu(Mi)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:jr(e),t]},useSyncExternalStore:Op,useId:am,useHostTransitionStatus:Lc,useFormState:Yp,useActionState:Yp,useOptimistic:function(e,t){var i=zt();return Dp(i,dt,e,t)},useMemoCache:Nc,useCacheRefresh:rm,useEffectEvent:Zp},lx={readContext:Zt,use:ou,useCallback:Wp,useContext:Zt,useEffect:qc,useImperativeHandle:Pp,useInsertionEffect:Kp,useLayoutEffect:Jp,useMemo:em,useReducer:Oc,useRef:Xp,useState:function(){return Oc(Mi)},useDebugValue:Rc,useDeferredValue:function(e,t){var i=zt();return dt===null?Mc(i,e,t):tm(i,dt.memoizedState,e,t)},useTransition:function(){var e=Oc(Mi)[0],t=zt().memoizedState;return[typeof e=="boolean"?e:jr(e),t]},useSyncExternalStore:Op,useId:am,useHostTransitionStatus:Lc,useFormState:Qp,useActionState:Qp,useOptimistic:function(e,t){var i=zt();return dt!==null?Dp(i,dt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Nc,useCacheRefresh:rm,useEffectEvent:Zp};function Uc(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:Q({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Hc={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Mn(),c=nl(s);c.payload=t,i!=null&&(c.callback=i),t=il(e,c,s),t!==null&&(kn(t,e,s),Er(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Mn(),c=nl(s);c.tag=1,c.payload=t,i!=null&&(c.callback=i),t=il(e,c,s),t!==null&&(kn(t,e,s),Er(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Mn(),s=nl(i);s.tag=2,t!=null&&(s.callback=t),t=il(e,s,i),t!==null&&(kn(t,e,i),Er(t,e,i))}};function dm(e,t,i,s,c,d,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,v):t.prototype&&t.prototype.isPureReactComponent?!gr(i,s)||!gr(c,d):!0}function hm(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&Hc.enqueueReplaceState(t,t.state,null)}function Zl(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=Q({},i));for(var c in e)i[c]===void 0&&(i[c]=e[c])}return i}function pm(e){Vs(e)}function mm(e){console.error(e)}function gm(e){Vs(e)}function mu(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function ym(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Ic(e,t,i){return i=nl(i),i.tag=3,i.payload={element:null},i.callback=function(){mu(e,t)},i}function vm(e){return e=nl(e),e.tag=3,e}function bm(e,t,i,s){var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;e.payload=function(){return c(d)},e.callback=function(){ym(t,i,s)}}var v=i.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){ym(t,i,s),typeof c!="function"&&(fl===null?fl=new Set([this]):fl.add(this));var w=s.stack;this.componentDidCatch(s.value,{componentStack:w!==null?w:""})})}function ax(e,t,i,s,c){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Hl(t,i,c,!0),i=Kt.current,i!==null){switch(i.tag){case 31:case 13:case 19:return sn===null?Du():i.alternate===null&&Ot===0&&(Ot=3),i.flags&=-257,i.flags|=65536,i.lanes=c,s===tu?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Af(e,s,c)),!1;case 22:return i.flags|=65536,s===tu?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),Af(e,s,c)),!1}throw Error(r(435,i.tag))}return Af(e,s,c),Du(),!1}if(Le)return t=Kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==sc&&(e=Error(r(422),{cause:s}),br(Vn(e,i)))):(s!==sc&&(t=Error(r(423),{cause:s}),br(Vn(t,i))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=Vn(s,i),c=Ic(e.stateNode,s,c),yc(e,c),Ot!==4&&(Ot=2)),!1;var d=Error(r(520),{cause:s});if(d=Vn(d,i),Br===null?Br=[d]:Br.push(d),Ot!==4&&(Ot=2),t===null)return!0;s=Vn(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=c&-c,i.lanes|=e,e=Ic(i.stateNode,s,e),yc(i,e),!1;case 1:if(t=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(fl===null||!fl.has(d))))return i.flags|=65536,c&=-c,i.lanes|=c,c=vm(c),bm(c,e,i,s),yc(i,c),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var Vc=Error(r(461)),Lt=!1;function Gt(e,t,i,s){t.child=e===null?kp(t,null,i,s):Xl(t,e.child,i,s)}function xm(e,t,i,s,c){i=i.render;var d=t.ref;if("ref"in s){var v={};for(var w in s)w!=="ref"&&(v[w]=s[w])}else v=s;return Il(t),s=Ec(e,t,i,v,d,c),w=Tc(),e!==null&&!Lt?(Ac(e,t,c),Di(e,t,c)):(Le&&w&&Zs(t),t.flags|=1,Gt(e,t,s,c),t.child)}function Sm(e,t,i,s,c){if(e===null){var d=i.type;return typeof d=="function"&&!ic(d)&&d.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=d,wm(e,t,d,s,c)):(e=Xs(i.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Jc(e,c)){var v=d.memoizedProps;if(i=i.compare,i=i!==null?i:gr,i(v,s)&&e.ref===t.ref)return Di(e,t,c)}return t.flags|=1,e=Oi(d,s),e.ref=t.ref,e.return=t,t.child=e}function wm(e,t,i,s,c){if(e!==null){var d=e.memoizedProps;if(gr(d,s)&&e.ref===t.ref)if(Lt=!1,t.pendingProps=s=d,Jc(e,c))(e.flags&131072)!==0&&(Lt=!0);else return t.lanes=e.lanes,Di(e,t,c)}return Yc(e,t,i,s,c)}function km(e,t,i,s){var c=s.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|i:i,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,t.child=null;return Em(e,t,d,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ws(t,d!==null?d.cachePool:null),d!==null?Ap(t,d):bc(),Cp(t);else return s=t.lanes=536870912,Em(e,t,d!==null?d.baseLanes|i:i,i,s)}else d!==null?(Ws(t,d.cachePool),Ap(t,d),rl(),t.memoizedState=null):(e!==null&&Ws(t,null),bc(),rl());return Gt(e,t,c,i),t.child}function _r(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Em(e,t,i,s,c){var d=hc();return d=d===null?null:{parent:Mt._currentValue,pool:d},t.memoizedState={baseLanes:i,cachePool:d},e!==null&&Ws(t,null),bc(),Cp(t),e!==null&&Hl(e,t,s,!0),t.childLanes=c,null}function gu(e,t){return t=yu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Tm(e,t,i){return Xl(t,e.child,null,i),e=gu(t,t.pendingProps),e.flags|=2,_n(t),t.memoizedState=null,e}function rx(e,t,i){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(s.mode==="hidden")return e=gu(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},_r(null,e);if(Sc(t),(e=xt)?(e=$g(e,Qn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji!==null?{id:ci,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},i=up(e),i.return=t,t.child=i,Qt=t,xt=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return gu(t,s)}var d=e.memoizedState;if(d!==null){var v=d.dehydrated;if(Sc(t),c)if(t.flags&256)t.flags&=-257,t=Tm(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(Lt||Hl(e,t,i,!1),c=(i&e.childLanes)!==0,Lt||c){if(ll.current===null){if(s=gt,s!==null&&(v=Cs(s,i),v!==0&&v!==d.retryLane))throw d.retryLane=v,Dl(e,v),kn(s,e,v),Vc;Du()}t=Tm(e,t,i)}else e=d.treeContext,xt=Fn(v.nextSibling),Qt=t,Le=!0,$i=null,Qn=!1,e!==null&&fp(t,e),t=gu(t,s),t.flags|=134221824;return t}return e=Oi(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Oa(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(r(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Yc(e,t,i,s,c){return Il(t),i=Ec(e,t,i,s,void 0,c),s=Tc(),e!==null&&!Lt?(Ac(e,t,c),Di(e,t,c)):(Le&&s&&Zs(t),t.flags|=1,Gt(e,t,i,c),t.child)}function Am(e,t,i,s,c,d){return Il(t),t.updateQueue=null,i=jp(t,s,i,c),Np(e),s=Tc(),e!==null&&!Lt?(Ac(e,t,d),Di(e,t,d)):(Le&&s&&Zs(t),t.flags|=1,Gt(e,t,i,d),t.child)}function Cm(e,t,i,s,c){if(Il(t),t.stateNode===null){var d=xa,v=i.contextType;typeof v=="object"&&v!==null&&(d=Zt(v)),d=new i(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Hc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},mc(t),v=i.contextType,d.context=typeof v=="object"&&v!==null?Zt(v):xa,d.state=t.memoizedState,v=i.getDerivedStateFromProps,typeof v=="function"&&(Uc(t,i,v,s),d.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(v=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),v!==d.state&&Hc.enqueueReplaceState(d,d.state,null),Ar(t,s,d,c),Tr(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var w=t.memoizedProps,N=Zl(i,w);d.props=N;var U=d.context,Y=i.contextType;v=xa,typeof Y=="object"&&Y!==null&&(v=Zt(Y));var J=i.getDerivedStateFromProps;Y=typeof J=="function"||typeof d.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,Y||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(w||U!==v)&&hm(t,d,s,v),tl=!1;var D=t.memoizedState;d.state=D,Ar(t,s,d,c),Tr(),U=t.memoizedState,w||D!==U||tl?(typeof J=="function"&&(Uc(t,i,J,s),U=t.memoizedState),(N=tl||dm(t,i,N,s,D,U,v))?(Y||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=U),d.props=s,d.state=U,d.context=v,s=N):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,gc(e,t),v=t.memoizedProps,Y=Zl(i,v),d.props=Y,J=t.pendingProps,D=d.context,U=i.contextType,N=xa,typeof U=="object"&&U!==null&&(N=Zt(U)),w=i.getDerivedStateFromProps,(U=typeof w=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v!==J||D!==N)&&hm(t,d,s,N),tl=!1,D=t.memoizedState,d.state=D,Ar(t,s,d,c),Tr();var V=t.memoizedState;v!==J||D!==V||tl||e!==null&&e.dependencies!==null&&$s(e.dependencies)?(typeof w=="function"&&(Uc(t,i,w,s),V=t.memoizedState),(Y=tl||dm(t,i,Y,s,D,V,N)||e!==null&&e.dependencies!==null&&$s(e.dependencies))?(U||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,V,N),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,V,N)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||v===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=V),d.props=s,d.state=V,d.context=N,s=Y):(typeof d.componentDidUpdate!="function"||v===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,Oa(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=Xl(t,e.child,null,c),t.child=Xl(t,null,i,c)):Gt(e,t,i,c),t.memoizedState=d.state,e=t.child):e=Di(e,t,c),e}function Nm(e,t,i,s){return Bl(),t.flags|=256,Gt(e,t,i,s),t.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:yp()}}function Xc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Rn),e}function jm(e,t,i){var s=t.pendingProps,c=!1,d=(t.flags&128)!==0,v;if((v=d)||(v=e!==null&&e.memoizedState===null?!1:(Jt.current&2)!==0),v&&(c=!0,t.flags&=-129),v=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?al(t):rl(),(e=xt)?(e=$g(e,Qn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji!==null?{id:ci,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},i=up(e),i.return=t,t.child=i,Qt=t,xt=null)):e=null,e===null)throw Pi(t);return Xf(e)?t.lanes=32:t.lanes=536870912,null}return d=s.children,s=s.fallback,c?(rl(),c=t.mode,d=yu({mode:"hidden",children:d},c),s=Ll(s,c,i,null),d.return=t,s.return=t,d.sibling=s,t.child=d,s=t.child,s.memoizedState=Qc(i),s.childLanes=Xc(e,v,i),t.memoizedState=Gc,_r(null,s)):(al(t),Fc(t,d))}var w=e.memoizedState;if(w!==null){var N=w.dehydrated;if(N!==null)return sx(e,t,d,v,s,N,w,i)}return c?(rl(),c=s.fallback,d=t.mode,w=e.child,N=w.sibling,s=Oi(w,{mode:"hidden",children:s.children}),s.subtreeFlags=w.subtreeFlags&1206910976,N!==null?c=Oi(N,c):(c=Ll(c,d,i,null),c.flags|=2),c.return=t,s.return=t,s.sibling=c,t.child=s,_r(null,s),s=t.child,c=e.child.memoizedState,c===null?c=Qc(i):(d=c.cachePool,d!==null?(w=Mt._currentValue,d=d.parent!==w?{parent:w,pool:w}:d):d=yp(),c={baseLanes:c.baseLanes|i,cachePool:d}),s.memoizedState=c,s.childLanes=Xc(e,v,i),t.memoizedState=Gc,_r(e.child,s)):(al(t),i=e.child,e=i.sibling,i=Oi(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(v=t.deletions,v===null?(t.deletions=[e],t.flags|=16):v.push(e)),t.child=i,t.memoizedState=null,i)}function Fc(e,t){return t=yu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yu(e,t){return e=bn(22,e,null,t),e.lanes=0,e}function vu(e,t,i){return Xl(t,e.child,null,i),e=Fc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sx(e,t,i,s,c,d,v,w){if(i)return t.flags&256?(al(t),t.flags&=-257,vu(e,t,w)):t.memoizedState!==null?(rl(),t.child=e.child,t.flags|=128,null):(rl(),d=c.fallback,v=t.mode,c=yu({mode:"visible",children:c.children},v),d=Ll(d,v,w,null),d.flags|=2,c.return=t,d.return=t,c.sibling=d,t.child=c,Xl(t,e.child,null,w),c=t.child,c.memoizedState=Qc(w),c.childLanes=Xc(e,s,w),t.memoizedState=Gc,_r(null,c));if(al(t),Xf(d)){if(s=d.nextSibling&&d.nextSibling.dataset,s)var N=s.dgst;return s=N,s!==""&&(c=Error(r(419)),c.stack="",c.digest=s,br({value:c,source:null,stack:null})),vu(e,t,w)}if(Lt||Hl(e,t,w,!1),s=(w&e.childLanes)!==0,Lt||s){if(ll.current!==null)return vu(e,t,w);if(s=gt,s!==null&&(c=Cs(s,w),c!==0&&c!==v.retryLane))throw v.retryLane=c,Dl(e,c),kn(s,e,c),Vc;return Qf(d)||Du(),vu(e,t,w)}return Qf(d)?(t.flags|=192,t.child=e.child,null):(e=v.treeContext,xt=Fn(d.nextSibling),Qt=t,Le=!0,$i=null,Qn=!1,e!==null&&fp(t,e),t=Fc(t,c.children),t.flags|=134221824,t)}function Om(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Js(e.return,t,i)}function _m(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&au(i)===null&&(t=e),e=e.sibling}return t}function bu(e,t,i,s,c,d){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:c,treeForkCount:d}:(v.isBackwards=t,v.rendering=null,v.renderingStartTime=0,v.last=s,v.tail=i,v.tailMode=c,v.treeForkCount=d)}function Zc(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function Kc(e,t,i){var s=t.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var v=Jt.current;if(t.flags&128)return Cr(t,v),null;var w=(v&2)!==0;if(w?(v=v&1|2,t.flags|=128):v&=1,Cr(t,v),c==="backwards"&&e!==null?(Zc(e),Gt(e,t,s,i),Zc(e)):Gt(e,t,s,i),s=Le?vr:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Om(e,i,t);else if(e.tag===19)Om(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"backwards":i=_m(t.child),i===null?(c=t.child,t.child=null):(c=i.sibling,i.sibling=null,Zc(t)),bu(t,!0,c,null,d,s);break;case"unstable_legacy-backwards":for(i=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&au(e)===null){t.child=c;break}e=c.sibling,c.sibling=i,i=c,c=e}bu(t,!0,i,null,d,s);break;case"together":bu(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:i=_m(t.child),i===null?(c=t.child,t.child=null):(c=i.sibling,i.sibling=null),bu(t,!1,c,i,d,s)}return t.child}function zm(e,t,i){var s=t.pendingProps;return Wi(t,t.type,s.value),Gt(e,t,s.children,i),t.child}function Di(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),cl|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Hl(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,i=Oi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Oi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Jc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&$s(e)))}function ux(e,t,i){switch(t.tag){case 3:Ht(t,t.stateNode.containerInfo),Wi(t,Mt,e.memoizedState.cache),Bl();break;case 27:case 5:on(t);break;case 4:Ht(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Sc(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return al(t),t.flags|=128,null;s=Hl(e,t,i,!1);var c=t.child.childLanes;return s||(i&c)!==0?jm(e,t,i):(al(t),e=Di(e,t,i),e!==null?e.sibling:null)}al(t);break;case 19:if(t.flags&128)return Kc(e,t,i);if(c=(e.flags&128)!==0,s=(i&t.childLanes)!==0,s||(Hl(e,t,i,!1),s=(i&t.childLanes)!==0),c){if(s)return Kc(e,t,i);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Cr(t,Jt.current),s)break;return null;case 22:return t.lanes=0,km(e,t,i,t.pendingProps);case 24:Wi(t,Mt,e.memoizedState.cache)}return Di(e,t,i)}function qm(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Lt=!0;else{if(!Jc(e,i)&&(t.flags&128)===0)return Lt=!1,ux(e,t,i);Lt=(e.flags&131072)!==0}else Lt=!1,Le&&(t.flags&1048576)!==0&&cp(t,vr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Gl(t.elementType),t.type=e,typeof e=="function")ic(e)?(s=Zl(e,s),t.tag=1,t=Cm(null,t,e,s,i)):(t.tag=0,t=Yc(null,t,e,s,i));else{if(e!=null){var c=e.$$typeof;if(c===G){t.tag=11,t=xm(null,t,e,s,i);break e}else if(c===ke){t.tag=14,t=Sm(null,t,e,s,i);break e}else if(c===ae){t.tag=10,t.type=e,t=zm(null,t,i);break e}}throw t=Ne(e)||e,Error(r(306,t,""))}}return t;case 0:return Yc(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,c=Zl(s,t.pendingProps),Cm(e,t,s,c,i);case 3:e:{if(Ht(t,t.stateNode.containerInfo),e===null)throw Error(r(387));s=t.pendingProps;var d=t.memoizedState;c=d.element,gc(e,t),Ar(t,s,null,i);var v=t.memoizedState;if(s=v.cache,Wi(t,Mt,s),s!==d.cache&&cc(t,[Mt],i,!0),Tr(),s=v.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:v.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Nm(e,t,s,i);break e}else if(s!==c){c=Vn(Error(r(424)),t),br(c),t=Nm(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,xt=Fn(e.firstChild),Qt=t,Le=!0,$i=null,Qn=!0,i=kp(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(Bl(),s===c){t=Di(e,t,i);break e}Gt(e,t,s,i)}t=t.child}return t;case 26:return Oa(e,t),e===null?(i=ly(t.type,null,t.pendingProps,null))?t.memoizedState=i:Le||(t.stateNode=Lg(t.type,t.pendingProps,wt.current,t)):t.memoizedState=ly(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return on(t),e===null&&Le&&(s=t.stateNode=ey(t.type,t.pendingProps,wt.current),Qt=t,Qn=!0,c=xt,pl(t.type)?(Ff=c,xt=Fn(s.firstChild)):xt=c),Gt(e,t,t.pendingProps.children,i),Oa(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=s=xt)&&(s=nS(s,t.type,t.pendingProps,Qn),s!==null?(t.stateNode=s,Qt=t,xt=Fn(s.firstChild),Qn=!1,c=!0):c=!1),c||Pi(t)),on(t),c=t.type,d=t.pendingProps,v=e!==null?e.memoizedProps:null,s=d.children,Bf(c,d)?s=null:v!==null&&Bf(c,v)&&(t.flags|=32),t.memoizedState!==null&&(c=Ec(e,t,$1,null,null,i),Za._currentValue=c),Oa(e,t),Gt(e,t,s,i),t.child;case 6:return e===null&&Le&&((e=i=xt)&&(i=iS(i,t.pendingProps,Qn),i!==null?(t.stateNode=i,Qt=t,xt=null,e=!0):e=!1),e||Pi(t)),null;case 13:return jm(e,t,i);case 4:return Ht(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Xl(t,null,s,i):Gt(e,t,s,i),t.child;case 11:return xm(e,t,t.type,t.pendingProps,i);case 7:return s=t.pendingProps,Oa(e,t),Gt(e,t,s,i),t.child;case 8:return Gt(e,t,t.pendingProps.children,i),t.child;case 12:return Gt(e,t,t.pendingProps.children,i),t.child;case 10:return zm(e,t,i);case 9:return c=t.type._context,s=t.pendingProps.children,Il(t),c=Zt(c),s=s(c),t.flags|=1,Gt(e,t,s,i),t.child;case 14:return Sm(e,t,t.type,t.pendingProps,i);case 15:return wm(e,t,t.type,t.pendingProps,i);case 19:return Kc(e,t,i);case 31:return rx(e,t,i);case 22:return km(e,t,i,t.pendingProps);case 24:return Il(t),s=Zt(Mt),e===null?(c=hc(),c===null&&(c=gt,d=fc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=i),c=d),t.memoizedState={parent:s,cache:c},mc(t),Wi(t,Mt,c)):((e.lanes&i)!==0&&(gc(e,t),Ar(t,null,null,i),Tr()),c=e.memoizedState,d=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Wi(t,Mt,s)):(s=d.cache,Wi(t,Mt,s),s!==c.cache&&cc(t,[Mt],i,!0))),Gt(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=t.pendingProps,s.name!=null&&s.name!=="auto"?t.flags|=e===null?18882560:18874368:Le&&Zs(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:Oa(e,t),Gt(e,t,s.children,i),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function Li(e){e.flags|=4}function $c(e,t,i,s,c){var d;if((d=(e.mode&32)!==0)&&(d=i===null?uy(t,s):uy(t,s)&&(s.src!==i.src||s.srcSet!==i.srcSet)),d){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(pg())e.flags|=8192;else throw Ql=tu,pc}else e.flags&=-16777217}function Rm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!oy(t))if(pg())e.flags|=8192;else throw Ql=tu,pc}function xu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Tl():536870912,e.lanes|=t,Ma|=t)}function zr(e,t){if(!Le)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var c=e.child;c!==null;)i|=c.lanes|c.childLanes,s|=c.subtreeFlags&1206910976,s|=c.flags&1206910976,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)i|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function ox(e,t,i){var s=t.pendingProps;switch(rc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return St(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),qi(Mt),It(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ka(t)?Li(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,uc())),St(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(Li(t),d!==null?(St(t),Rm(t,d)):(St(t),$c(t,c,null,s,i))):d?d!==e.memoizedState?(Li(t),St(t),Rm(t,d)):(St(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Li(t),St(t),$c(t,c,e,s,i)),null;case 27:if(Vt(t),i=wt.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Li(t);else{if(!s){if(t.stateNode===null)throw Error(r(166));return St(t),t.subtreeFlags&=-33554433,null}e=qe.current,ka(t)?dp(t):(e=ey(c,s,i),t.stateNode=e,Li(t))}return St(t),t.subtreeFlags&=-33554433,null;case 5:if(Vt(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Li(t);else{if(!s){if(t.stateNode===null)throw Error(r(166));return St(t),t.subtreeFlags&=-33554433,null}if(d=qe.current,ka(t))dp(t);else{var v=Yr(wt.current);switch(d){case 1:d=v.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=v.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=v.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?v.createElement("select",{is:s.is}):v.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?v.createElement(c,{is:s.is}):v.createElement(c)}}d[Et]=t,d[ln]=s;e:for(v=t.child;v!==null;){if(v.tag===5||v.tag===6)d.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===t)break e;for(;v.sibling===null;){if(v.return===null||v.return===t)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}t.stateNode=d;e:switch(Pt(d,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Li(t)}}return St(t),t.subtreeFlags&=-33554433,$c(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Li(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(r(166));if(e=wt.current,ka(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,c=Qt,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[Et]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||qg(e.nodeValue,i)),e||Pi(t,!0)}else e=Yr(e).createTextNode(s),e[Et]=t,t.stateNode=e}return St(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=ka(t),i!==null){if(e===null){if(!s)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Et]=t}else Bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),e=!1}else i=uc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(_n(t),t):(_n(t),null);if((t.flags&128)!==0)throw Error(r(558))}return St(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ka(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(r(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));c[Et]=t}else Bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),c=!1}else c=uc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(_n(t),t):(_n(t),null)}return _n(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),xu(t,t.updateQueue),St(t),null);case 4:return It(),e===null&&qf(t.stateNode.containerInfo),t.flags|=67108864,St(t),null;case 10:return qi(t.type),St(t),null;case 19:if(wc(t),s=t.memoizedState,s===null)return St(t),null;if(c=(t.flags&128)!==0,d=s.rendering,d===null)if(c)zr(s,!1);else{if(Ot!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=au(e),d!==null){for(t.flags|=128,zr(s,!1),e=d.updateQueue,t.updateQueue=e,xu(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)sp(i,e),i=i.sibling;return Cr(t,Jt.current&1|2),Le&&_i(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&qt()>zu&&(t.flags|=128,c=!0,zr(s,!1),t.lanes=4194304)}else{if(!c)if(e=au(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,xu(t,e),zr(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!d.alternate&&!Le)return St(t),null}else 2*qt()-s.renderingStartTime>zu&&i!==536870912&&(t.flags|=128,c=!0,zr(s,!1),t.lanes=4194304);s.isBackwards?(d.sibling=t.child,t.child=d):(e=s.last,e!==null?e.sibling=d:t.child=d,s.last=d)}if(s.tail!==null){e=s.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=qt(),e.sibling=null,d=Jt.current,d=c?d&1|2:d&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!i||Le?Cr(t,d):(i=d,Ke(Kt,t),Ke(Jt,i),sn===null&&(sn=t)),Le&&_i(t,s.treeForkCount),e}return St(t),null;case 22:case 23:return _n(t),xc(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),i=t.updateQueue,i!==null&&xu(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&pt(Yl),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),qi(Mt),St(t),null;case 25:return null;case 30:return t.flags|=33554432,St(t),null}throw Error(r(156,t.tag))}function cx(e,t){switch(rc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(Mt),It(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Vt(t),null;case 31:if(t.memoizedState!==null){if(_n(t),t.alternate===null)throw Error(r(340));Bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_n(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return wc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return It(),null;case 10:return qi(t.type),null;case 22:case 23:return _n(t),xc(),e!==null&&pt(Yl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(Mt),null;case 25:return null;default:return null}}function Mm(e,t){switch(rc(t),t.tag){case 3:qi(Mt),It();break;case 26:case 27:case 5:Vt(t);break;case 4:It();break;case 31:t.memoizedState!==null&&_n(t);break;case 13:_n(t);break;case 19:wc(t);break;case 10:qi(t.type);break;case 22:case 23:_n(t),xc(),e!==null&&pt(Yl);break;case 24:qi(Mt)}}function qr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var c=s.next;i=c;do{if((i.tag&e)===e){s=void 0;var d=i.create,v=i.inst;s=d(),v.destroy=s}i=i.next}while(i!==c)}}catch(w){ut(t,t.return,w)}}function sl(e,t,i){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&e)===e){var v=s.inst,w=v.destroy;if(w!==void 0){v.destroy=void 0,c=t;var N=i,U=w;try{U()}catch(Y){ut(c,N,Y)}}}s=s.next}while(s!==d)}}catch(Y){ut(t,t.return,Y)}}function Dm(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Tp(t,i)}catch(s){ut(e,e.return,s)}}}function Lm(e,t,i){i.props=Zl(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){ut(e,t,s)}}function di(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var c=e.stateNode,d=Ni(e.memoizedProps,c);(c.ref===null||c.ref.name!==d)&&(c.ref=Gg(d)),s=c.ref;break;case 7:if(e.stateNode===null){var v=new Dn(e);m(e.child,!1,eS,v,void 0,void 0),e.stateNode=v}s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(w){ut(e,t,w)}}function $t(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(c){ut(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(c){ut(e,t,c)}else i.current=null}function Su(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)Jg(e.stateNode,t[i])}function Bm(e){for(var t=e.return;t!==null&&(Wc(t)&&Jg(e.stateNode,t.stateNode),!Pc(t));)t=t.return}function Rr(e){for(var t=e.return;t!==null&&(Wc(t)&&tS(e.stateNode,t.stateNode),!Pc(t));)t=t.return}function Pc(e){return e.tag===5||e.tag===3||e.tag===27}function Wc(e){return e&&e.tag===7&&e.stateNode!==null}function ef(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(c){ut(e,e.return,c)}}function tf(e,t,i){try{var s=e.stateNode;Dx(s,e.type,i,t),s[ln]=t}catch(c){ut(e,e.return,c)}}function Um(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pl(e.type)||e.tag===4}function nf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Um(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.tag===27&&pl(e.type)||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 lf(e,t,i,s){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(c,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(c),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Je)),Su(e,s),Fe=!0;else if(c!==4&&(c===27&&(Su(e,s),s=null,pl(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(lf(e,t,i,s),e=e.sibling;e!==null;)lf(e,t,i,s),e=e.sibling}function wu(e,t,i,s){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?i.insertBefore(c,t):i.appendChild(c),Su(e,s),Fe=!0;else if(c!==4&&(c===27&&(Su(e,s),s=null,pl(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(wu(e,t,i,s),e=e.sibling;e!==null;)wu(e,t,i,s),e=e.sibling}function Hm(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Pt(t,s,i),t[Et]=e,t[ln]=i}catch(d){ut(e,e.return,d)}}var ku=!1,zn=null;function Im(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(ku=!0)}var hi=null;function Vm(){var e=hi;return hi=null,e}var xn=0;function _a(e,t,i,s,c){return xn=0,Ym(e.child,t,i,s,c)}function Ym(e,t,i,s,c){for(var d=!1;e!==null;){if(e.tag===5){var v=e.stateNode;if(s!==null){var w=If(v);s.push(w),w.view&&(d=!0)}else d||If(v).view&&(d=!0);ku=!0,Vg(v,xn===0?t:t+"_"+xn,i),xn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||Ym(e.child,t,i,s,c)&&(d=!0));e=e.sibling}return d}function pi(e,t){for(;e!==null;)e.tag===5?Yg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||pi(e.child,t)),e=e.sibling}function Eu(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Eu(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(r(544));var i=t.name;t=ji(t.default,t.share),t!=="none"&&(_a(e,i,t,null,!1)||pi(e.child,!1))}e=e.sibling}}function af(e,t){if(e.tag===30){var i=e.stateNode,s=e.memoizedProps,c=Ni(s,i),d=ji(s.default,i.paired?s.share:s.enter);d!=="none"?_a(e,c,d,null,!1)?(Eu(e),i.paired||t||Ua(e,s.onEnter)):pi(e.child,!1):Eu(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)af(e,t),e=e.sibling;else Eu(e)}function rf(e){if(zn!==null&&zn.size!==0){var t=zn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,s=i.name;if(s!=null&&s!=="auto"){var c=t.get(s);if(c!==void 0){var d=ji(i.default,i.share);if(d!=="none"&&(_a(e,s,d,null,!1)?(d=e.stateNode,c.paired=d,d.paired=c,Ua(e,i.onShare)):pi(e.child,!1)),t.delete(s),t.size===0)break}}}rf(e)}e=e.sibling}}}function sf(e){if(e.tag===30){var t=e.memoizedProps,i=Ni(t,e.stateNode),s=zn!==null?zn.get(i):void 0,c=ji(t.default,s!==void 0?t.share:t.exit);c!=="none"&&(_a(e,i,c,null,!1)?s!==void 0?(c=e.stateNode,s.paired=c,c.paired=s,zn.delete(i),Ua(e,t.onShare)):Ua(e,t.onExit):pi(e.child,!1)),zn!==null&&rf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)sf(e),e=e.sibling;else zn!==null&&rf(e)}function Gm(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=Ni(t,e.stateNode);t=ji(t.default,t.update),e.flags&=-5,t!=="none"&&_a(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Gm(e);e=e.sibling}}function uf(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,pi(e.child,!1))}uf(e)}e=e.sibling}}function Tu(e){if(e.tag===30)e.stateNode.paired=null,pi(e.child,!1),uf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Tu(e),e=e.sibling;else uf(e)}function Qm(e){for(e=e.child;e!==null;)e.tag===30?pi(e.child,!1):(e.subtreeFlags&33554432)!==0&&Qm(e),e=e.sibling}function of(e,t,i,s,c,d,v){for(var w=!1;t!==null;){if(t.tag===5){var N=t.stateNode;if(d!==null&&xn<d.length){var U=d[xn],Y=If(N);(U.view||Y.view)&&(w=!0);var J;if(J=(e.flags&4)===0)if(Y.clip)J=!0;else{J=U.rect;var D=Y.rect;J=J.y!==D.y||J.x!==D.x||J.height!==D.height||J.width!==D.width}J&&(e.flags|=4),Y.abs?Y=!U.abs:(U=U.rect,Y=Y.rect,Y=U.height!==Y.height||U.width!==Y.width),Y&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Vg(N,xn===0?i:i+"_"+xn,c),w&&(e.flags&4)!==0||(hi===null&&(hi=[]),hi.push(N,xn===0?s:s+"_"+xn,t.memoizedProps)),xn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&v?e.flags|=t.flags&32:of(e,t.child,i,s,c,d,v)&&(w=!0));t=t.sibling}return w}function Xm(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,s=e.stateNode,c=Ni(i,s),d=ji(i.default,i.update),v;v=e.memoizedState,e.memoizedState=null,s=e;var w=e.child;xn=0,c=of(s,w,c,c,d,v,!1),(e.flags&4)!==0&&c&&Ua(e,i.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Xm(e);e=e.sibling}}var Xt=!1,nt=!1,mi=!1,cf=!1,Fm=typeof WeakSet=="function"?WeakSet:Set,Ft=null,gi=!1,Mr=!1,Au=!1,ff=!1;function fx(e,t,i){if(e=e.containerInfo,Df=Ka,e=$h(e),Jo(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var d=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var w=0,N=-1,U=-1,Y=0,J=0,D=e,V=null;t:for(;;){for(var ce;D!==s||d!==0&&D.nodeType!==3||(N=w+d),D!==v||c!==0&&D.nodeType!==3||(U=w+c),D.nodeType===3&&(w+=D.nodeValue.length),(ce=D.firstChild)!==null;)V=D,D=ce;for(;;){if(D===e)break t;if(V===s&&++Y===d&&(N=w),V===v&&++J===c&&(U=w),(ce=D.nextSibling)!==null)break;D=V,V=D.parentNode}D=ce}s=N===-1||U===-1?null:{start:N,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(Lf={focusedElem:e,selectionRange:s},Ka=!1,i=(i&335544064)===i,Ft=t,t=i?9270:1024;Ft!==null;){if(e=Ft,i&&(s=e.deletions,s!==null))for(d=0;d<s.length;d++)i&&sf(s[d]);if(e.alternate===null&&(e.flags&2)!==0)i&&Im(e),Cu(i);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&i&&sf(s),Cu(i);continue}else if(s!==null&&s.memoizedState!==null){i&&Im(e),Cu(i);continue}}s=e.child,(e.subtreeFlags&t)!==0&&s!==null?(s.return=e,Ft=s):(i&&Gm(e),Cu(i))}}zn=null}function Cu(e){for(;Ft!==null;){var t=Ft,i=e,s=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((c&1024)!==0&&s!==null){i=void 0,c=s.memoizedProps,s=s.memoizedState;var d=t.stateNode;try{var v=Zl(t.type,c);i=d.getSnapshotBeforeUpdate(v,s),d.__reactInternalSnapshotBeforeUpdate=i}catch(w){ut(t,t.return,w)}}break;case 3:if((c&1024)!==0){if(s=t.stateNode.containerInfo,i=s.nodeType,i===9)Gf(s);else if(i===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Gf(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&s!==null&&(i=Ni(s.memoizedProps,s.stateNode),c=t.memoizedProps,c=ji(c.default,c.update),c!=="none"&&_a(s,i,c,s.memoizedState=[],!0));break;default:if((c&1024)!==0)throw Error(r(163))}if(s=t.sibling,s!==null){s.return=t.return,Ft=s;break}Ft=t.return}}function Zm(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:yi(e,i),s&4&&qr(5,i);break;case 1:if(yi(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(v){ut(i,i.return,v)}else{var c=Zl(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(v){ut(i,i.return,v)}}s&64&&Dm(i),s&512&&di(i,i.return);break;case 3:if(yi(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Tp(e,t)}catch(v){ut(i,i.return,v)}}break;case 27:t===null&&s&4&&Hm(i);case 26:case 5:yi(e,i),t===null&&s&4&&ef(i),s&512&&di(i,i.return);break;case 12:yi(e,i);break;case 31:yi(e,i),s&4&&Pm(e,i);break;case 13:yi(e,i),s&4&&Wm(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=kx.bind(null,i),lS(e,i))));break;case 22:if(s=i.memoizedState!==null||Xt,!s){var d=t!==null&&t.memoizedState!==null||nt;t=Xt,c=nt,Xt=s,(nt=d)&&!c?(s=2,(i.subtreeFlags&8772)!==0&&(s|=1),ti(e,i,s)):yi(e,i),Xt=t,nt=c}break;case 30:yi(e,i),s&512&&di(i,i.return);break;case 7:s&512&&di(i,i.return);default:yi(e,i)}}function df(e,t){for(e=e.child;e!==null;)Km(e,t),e=e.sibling}function Km(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var s=i.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var c=e.stateNode,d=e.memoizedProps.style,v=d!=null&&d.hasOwnProperty("display")?d.display:null;c.style.display=v==null||typeof v=="boolean"?"":(""+v).trim()}}catch(N){ut(e,e.return,N)}hf(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Fe=!0}catch(N){ut(e,e.return,N)}break;case 18:try{var w=e.stateNode;t?Ig(w,!0):Ig(e.stateNode,!1)}catch(N){ut(e,e.return,N)}break;case 22:case 23:e.memoizedState===null&&df(e,t);break;default:df(e,t)}}function hf(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,s=t;switch(i.tag){case 4:Km(i,s);break e;case 22:i.memoizedState===null&&hf(i,s);break e;default:hf(i,s)}}e=e.sibling}}function Jm(e){var t=e.alternate;t!==null&&(e.alternate=null,Jm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ol(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var At=null,Sn=!1;function Wn(e,t,i){for(i=i.child;i!==null;)$m(e,t,i),i=i.sibling}function $m(e,t,i){if(cn&&typeof cn.onCommitFiberUnmount=="function")try{cn.onCommitFiberUnmount(kl,i)}catch{}switch(i.tag){case 26:nt||$t(i,t),Wn(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!nt&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:nt||$t(i,t),Rr(i);var s=At,c=Sn;pl(i.type)&&(At=i.stateNode,Sn=!1),Wn(e,t,i),ty(i.stateNode,i.type,i.memoizedProps),At=s,Sn=c;break;case 5:nt||$t(i,t),Rr(i);case 6:if(i.tag===6&&Rr(i),s=At,c=Sn,At=null,Wn(e,t,i),At=s,Sn=c,At!==null)if(Sn)try{(At.nodeType===9?At.body:At.nodeName==="HTML"?At.ownerDocument.body:At).removeChild(i.stateNode),Fe=!0}catch(d){ut(i,t,d)}else try{At.removeChild(i.stateNode),Fe=!0}catch(d){ut(i,t,d)}break;case 18:At!==null&&(Sn?(e=At,Hg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ja(e)):Hg(At,i.stateNode));break;case 4:s=At,c=Sn,At=i.stateNode.containerInfo,Sn=!0,Wn(e,t,i),At=s,Sn=c;break;case 0:case 11:case 14:case 15:sl(2,i,t),nt||sl(4,i,t),Wn(e,t,i);break;case 1:nt||($t(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&Lm(i,t,s)),Wn(e,t,i);break;case 21:Wn(e,t,i);break;case 22:nt=(s=nt)||i.memoizedState!==null,Wn(e,t,i),nt=s;break;case 30:$t(i,t),Wn(e,t,i);break;case 7:nt||$t(i,t),Wn(e,t,i);break;default:Wn(e,t,i)}}function Pm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ja(e)}catch(i){ut(t,t.return,i)}}}function Wm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ja(e)}catch(i){ut(t,t.return,i)}}function dx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Fm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Fm),t;default:throw Error(r(435,e.tag))}}function Nu(e,t){var i=dx(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var c=Ex.bind(null,e,s);s.then(c,c)}})}function gn(e,t,i){var s=t.deletions;if(s!==null)for(var c=0;c<s.length;c++){var d=s[c],v=e,w=t,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(pl(N.type)){At=N.stateNode,Sn=!1;break e}break;case 5:At=N.stateNode,Sn=!1;break e;case 3:case 4:At=N.stateNode.containerInfo,Sn=!0;break e}N=N.return}if(At===null)throw Error(r(160));$m(v,w,d),At=null,Sn=!1,v=d.alternate,v!==null&&(v.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)eg(t,e,i),t=t.sibling}var ei=null;function eg(e,t,i){var s=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(c&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var d=0;d<s.length;d++){var v=s[d];v.ref.impl=v.nextImpl}gn(t,e,i),yn(e),c&4&&(sl(3,e,e.return),qr(3,e),sl(5,e,e.return));break;case 1:gn(t,e,i),yn(e),c&512&&(nt||s===null||$t(s,s.return)),c&64&&Xt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(d=ei,gn(t,e,i),yn(e),c&512&&(nt||s===null||$t(s,s.return)),c&4)if(c=s!==null?s.memoizedState:null,i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null)if(Xt)e.stateNode=Lg(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,c=d.ownerDocument||d;t:switch(t){case"title":s=c.getElementsByTagName("title")[0],(!s||s[Xi]||s[Et]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=c.createElement(t),c.head.insertBefore(s,c.querySelector("head > title"))),Pt(s,t,i),s[Et]=e,Nt(s),t=s;break e;case"link":if(d=sy("link","href",c).get(t+(i.href||""))){for(v=0;v<d.length;v++)if(s=d[v],s.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&s.getAttribute("rel")===(i.rel==null?null:i.rel)&&s.getAttribute("title")===(i.title==null?null:i.title)&&s.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){d.splice(v,1);break t}}s=c.createElement(t),Pt(s,t,i),c.head.appendChild(s);break;case"meta":if(d=sy("meta","content",c).get(t+(i.content||""))){for(v=0;v<d.length;v++)if(s=d[v],s.getAttribute("content")===(i.content==null?null:""+i.content)&&s.getAttribute("name")===(i.name==null?null:i.name)&&s.getAttribute("property")===(i.property==null?null:i.property)&&s.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&s.getAttribute("charset")===(i.charSet==null?null:i.charSet)){d.splice(v,1);break t}}s=c.createElement(t),Pt(s,t,i),c.head.appendChild(s);break;default:throw Error(r(468,t))}s[Et]=e,Nt(s),t=s}e.stateNode=t}else Xt||$f(d,e.type,e.stateNode);else e.stateNode=ry(d,i,e.memoizedProps);else c!==i?(c===null?(t=s.stateNode,t===null||nt||t.parentNode.removeChild(t)):c.count--,i===null?Xt||$f(d,e.type,e.stateNode):ry(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&tf(e,e.memoizedProps,s.memoizedProps);break;case 27:gn(t,e,i),yn(e),c&512&&(nt||s===null||$t(s,s.return)),s!==null&&c&4&&tf(e,e.memoizedProps,s.memoizedProps);break;case 5:if(d=mi,mi=!1,gn(t,e,i),mi=d,yn(e),c&512&&(nt||s===null||$t(s,s.return)),e.flags&32){t=e.stateNode;try{oe(t,""),Fe=!0}catch(Y){ut(e,e.return,Y)}}c&4&&e.stateNode!=null&&(t=e.memoizedProps,tf(e,t,s!==null?s.memoizedProps:t)),c&1024&&(cf=!0);break;case 6:if(gn(t,e,i),yn(e),c&4){if(e.stateNode===null)throw Error(r(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,Fe=!0}catch(Y){ut(e,e.return,Y)}}break;case 3:if(Fe=!1,Yu=null,d=ei,ei=Gr(t.containerInfo),gn(t,e,i),ei=d,yn(e),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Ja(t.containerInfo)}catch(Y){ut(e,e.return,Y)}cf&&(cf=!1,tg(e)),Fe=!1;break;case 4:c=mi,mi=Xt,s=zs(),d=ei,ei=Gr(e.stateNode.containerInfo),gn(t,e,i),yn(e),ei=d,Fe&&Mr&&(Au=!0),Fe=s,mi=c;break;case 12:gn(t,e,i),yn(e);break;case 31:gn(t,e,i),yn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 13:gn(t,e,i),yn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(_u=qt()),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 22:d=e.memoizedState!==null,v=s!==null&&s.memoizedState!==null;var w=Xt,N=nt,U=mi;Xt=w||d,mi=U||d,nt=N||v,gn(t,e,i),nt=N,mi=U,Xt=w,yn(e),c&8192&&(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,!d||s===null||v||Xt||nt||(t=v||nt,i=Xt,s=nt,Xt=d||Xt,nt=t,ul(e,2),Xt=i,nt=s),!d&&mi||df(e,d)),c&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,Nu(e,i))));break;case 19:gn(t,e,i),yn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 30:c&512&&(nt||s===null||$t(s,s.return)),c=zs(),d=Mr,v=(i&335544064)===i,w=e.memoizedProps,Mr=v&&ji(w.default,w.update)!=="none",gn(t,e,i),yn(e),v&&s!==null&&Fe&&(e.flags|=4),Mr=d,Fe=c;break;case 21:break;case 7:c&512&&(nt||s===null||$t(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:gn(t,e,i),yn(e)}}function yn(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Um(s)){i=s;break}s=s.return}s=null;for(var c=e.return;c!==null;){if(Wc(c)){var d=c.stateNode;s===null?s=[d]:s.push(d)}if(Pc(c))break;c=c.return}var v=s;if(i==null)throw Error(r(160));switch(i.tag){case 27:var w=i.stateNode,N=nf(e);wu(e,N,w,v);break;case 5:var U=i.stateNode;i.flags&32&&(oe(U,""),i.flags&=-33);var Y=nf(e);wu(e,Y,U,v);break;case 3:case 4:var J=i.stateNode.containerInfo,D=nf(e);lf(e,D,J,v);break;default:throw Error(r(161))}}catch(V){ut(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;tg(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ka=!0,t.reset(),Ka=!1),e=e.sibling}}function za(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ng(t,e),t=t.sibling;else Xm(t)}function ng(e,t){var i=e.alternate;if(i===null)af(e,!1);else switch(e.tag){case 3:if(ff=gi=!1,Vm(),za(t,e),!gi&&!Au){if(e=hi,e!==null)for(var s=0;s<e.length;s+=3){i=e[s];var c=e[s+1];Yg(i,e[s+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+c+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),ff=!0}hi=null;break;case 5:za(t,e);break;case 4:s=gi,gi=!1,za(t,e),gi&&(Au=!0),gi=s;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?af(e,!1):za(t,e));break;case 30:s=gi,c=Vm(),gi=!1,za(t,e),gi&&(e.flags|=4);var d=e.memoizedProps,v=e.stateNode;t=Ni(d,v),v=Ni(i.memoizedProps,v);var w=ji(d.default,d.update);w==="none"?t=!1:(d=i.memoizedState,i.memoizedState=null,i=e.child,xn=0,t=of(e,i,t,v,w,d,!0),xn!==(d===null?0:d.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Ua(e,e.memoizedProps.onUpdate),hi=c):c!==null&&(c.push.apply(c,hi),hi=c),gi=(e.flags&32)!==0?!0:s;break;default:za(t,e)}}function yi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zm(e,t.alternate,t),t=t.sibling}function ul(e,t){for(e=e.child;e!==null;){var i=e,s=t;switch(i.tag){case 0:case 11:case 14:case 15:sl(4,i,i.return),ul(i,s);break;case 1:$t(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&Lm(i,i.return,c),ul(i,s);break;case 27:(s&2)!==0&&ty(i.stateNode,i.type,i.memoizedProps);case 5:$t(i,i.return),i.tag!==5&&i.tag!==27||Rr(i),ul(i,s);break;case 6:Rr(i);break;case 26:$t(i,i.return),c=i.stateNode,i.memoizedState!==null||c===null||nt||c.parentNode.removeChild(c),ul(i,s);break;case 22:i.memoizedState===null&&ul(i,s);break;case 30:$t(i,i.return),ul(i,s);break;case 7:$t(i,i.return);default:ul(i,s)}e=e.sibling}}function ti(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var s=t.alternate,c=e,d=t,v=d.flags,w=(i&1)!==0;switch(d.tag){case 0:case 11:case 15:ti(c,d,i),qr(4,d);break;case 1:if(ti(c,d,i),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Y){ut(s,s.return,Y)}if(s=d,c=s.updateQueue,c!==null){var N=s.stateNode;try{var U=c.shared.hiddenCallbacks;if(U!==null)for(c.shared.hiddenCallbacks=null,c=0;c<U.length;c++)Ep(U[c],N)}catch(Y){ut(s,s.return,Y)}}w&&v&64&&Dm(d),di(d,d.return);break;case 27:(i&2)!==0&&Hm(d);case 5:d.tag!==5&&d.tag!==27||Bm(d),ti(c,d,i),w&&s===null&&v&4&&ef(d),di(d,d.return);break;case 6:Bm(d);break;case 26:N=d.stateNode,d.memoizedState!==null||N===null||Xt||$f(Gr(N.ownerDocument),d.type,N),ti(c,d,i),w&&s===null&&v&4&&ef(d),di(d,d.return);break;case 12:ti(c,d,i);break;case 31:ti(c,d,i),w&&v&4&&Pm(c,d);break;case 13:ti(c,d,i),w&&v&4&&Wm(c,d);break;case 22:d.memoizedState===null&&ti(c,d,i),di(d,d.return);break;case 30:ti(c,d,i),di(d,d.return);break;case 7:di(d,d.return);default:ti(c,d,i)}t=t.sibling}}function pf(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&xr(i))}function mf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xr(e))}function Xn(e,t,i,s){var c=(i&335544064)===i;if(t.subtreeFlags&(c?10262:10256))for(t=t.child;t!==null;)ig(e,t,i,s),t=t.sibling;else c&&Qm(t)}function ig(e,t,i,s){var c=(i&335544064)===i;c&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Tu(t);var d=t.flags;switch(t.tag){case 0:case 11:case 15:Xn(e,t,i,s),d&2048&&qr(9,t);break;case 1:Xn(e,t,i,s);break;case 3:Xn(e,t,i,s),c&&ff&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),d&2048&&(d=null,t.alternate!==null&&(d=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==d&&(t.refCount++,d!=null&&xr(d)));break;case 12:if(d&2048){Xn(e,t,i,s),d=t.stateNode;try{var v=t.memoizedProps,w=v.id,N=v.onPostCommit;typeof N=="function"&&N(w,t.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(U){ut(t,t.return,U)}}else Xn(e,t,i,s);break;case 31:Xn(e,t,i,s);break;case 13:Xn(e,t,i,s);break;case 23:break;case 22:v=t.stateNode,w=t.alternate,t.memoizedState!==null?(c&&w!==null&&w.memoizedState===null&&Tu(w),v._visibility&2?Xn(e,t,i,s):Dr(e,t)):(c&&w!==null&&w.memoizedState!==null&&Tu(t),v._visibility&2?Xn(e,t,i,s):(v._visibility|=2,qa(e,t,i,s,(t.subtreeFlags&10256)!==0||!1))),d&2048&&pf(w,t);break;case 24:Xn(e,t,i,s),d&2048&&mf(t.alternate,t);break;case 30:c&&(d=t.alternate,d!==null&&(pi(d.child,!0),pi(t.child,!0))),Xn(e,t,i,s);break;default:Xn(e,t,i,s)}}function qa(e,t,i,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,v=t,w=i,N=s,U=v.flags;switch(v.tag){case 0:case 11:case 15:qa(d,v,w,N,c),qr(8,v);break;case 23:break;case 22:var Y=v.stateNode;v.memoizedState!==null?Y._visibility&2?qa(d,v,w,N,c):Dr(d,v):(Y._visibility|=2,qa(d,v,w,N,c)),c&&U&2048&&pf(v.alternate,v);break;case 24:qa(d,v,w,N,c),c&&U&2048&&mf(v.alternate,v);break;default:qa(d,v,w,N,c)}t=t.sibling}}function Dr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,c=s.flags;switch(s.tag){case 22:Dr(i,s),c&2048&&pf(s.alternate,s);break;case 24:Dr(i,s),c&2048&&mf(s.alternate,s);break;default:Dr(i,s)}t=t.sibling}}var Kl=8192;function Jl(e,t,i){if(e.subtreeFlags&Kl)for(e=e.child;e!==null;)lg(e,t,i),e=e.sibling}function lg(e,t,i){switch(e.tag){case 26:Jl(e,t,i),e.flags&Kl&&(e.memoizedState!==null?vS(i,ei,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&fy(i,e)));break;case 5:Jl(e,t,i),e.flags&Kl&&(e=e.stateNode,(t&335544128)===t&&fy(i,e));break;case 3:case 4:var s=ei;ei=Gr(e.stateNode.containerInfo),Jl(e,t,i),ei=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Kl,Kl=16777216,Jl(e,t,i),Kl=s):Jl(e,t,i));break;case 30:if((e.flags&Kl)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var c=e.stateNode;c.paired=null,zn===null&&(zn=new Map),zn.set(s,c)}Jl(e,t,i);break;default:Jl(e,t,i)}}function ag(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Lr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Ft=s,sg(s,e)}ag(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)rg(e),e=e.sibling}function rg(e){switch(e.tag){case 0:case 11:case 15:Lr(e),e.flags&2048&&sl(9,e,e.return);break;case 3:Lr(e);break;case 12:Lr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ju(e)):Lr(e);break;default:Lr(e)}}function ju(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Ft=s,sg(s,e)}ag(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:sl(8,t,t.return),ju(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,ju(t));break;default:ju(t)}e=e.sibling}}function sg(e,t){for(;Ft!==null;){var i=Ft;switch(i.tag){case 0:case 11:case 15:sl(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:xr(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Ft=s;else e:for(i=e;Ft!==null;){s=Ft;var c=s.sibling,d=s.return;if(Jm(s),s===i){Ft=null;break e}if(c!==null){c.return=d,Ft=c;break e}Ft=d}}}var hx={getCacheForType:function(e){var t=Zt(Mt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Zt(Mt).controller.signal}},px=typeof WeakMap=="function"?WeakMap:Map,tt=0,gt=null,Ue=null,Ie=0,st=0,qn=null,ol=!1,Ra=!1,gf=!1,Bi=0,Ot=0,cl=0,$l=0,Ou=0,Rn=0,Ma=0,Br=null,wn=null,yf=!1,_u=0,ug=0,zu=1/0,qu=null,fl=null,Ct=0,ni=null,Pl=null,vi=0,vf=0,bf=null,og=null,Da=null,La=null,Ba=null,Ur=0,Ru=null;function Mn(){return(tt&2)!==0&&Ie!==0?Ie&-Ie:W.T!==null?jf():Ns()}function cg(){if(Rn===0)if((Ie&536870912)===0||Le){var e=Yi;Yi<<=1,(Yi&3932160)===0&&(Yi=262144),Rn=e}else Rn=536870912;return e=Kt.current,e!==null&&(e.flags|=32),Rn}function Ua(e,t){if(t!=null){var i=e.stateNode,s=i.ref;s===null&&(s=i.ref=Gg(Ni(e.memoizedProps,i))),La===null&&(La=[]),La.push(t.bind(null,s))}}function kn(e,t,i){(e===gt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(Ha(e,0),dl(e,Ie,Rn,!1)),Nn(e,i),((tt&2)===0||e!==gt)&&(e===gt&&((tt&2)===0&&($l|=i),Ot===4&&dl(e,Ie,Rn,!1)),bi(e))}function fg(e,t,i){if((tt&6)!==0)throw Error(r(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||ui(e,t),c=s?yx(e,t):Sf(e,t,!0),d=s;do{if(c===0){Ra&&!s&&dl(e,t,0,!1);break}else{if(i=e.current.alternate,d&&!mx(i)){c=Sf(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){t=v;e:{var w=e;c=Br;var N=w.current.memoizedState.isDehydrated;if(N&&(Ha(w,v).flags|=256),v=Sf(w,v,!1),v!==2&&v!==6){if(gf&&!N){w.errorRecoveryDisabledLanes|=d,$l|=d,c=4;break e}d=wn,wn=c,d!==null&&(wn===null?wn=d:wn.push.apply(wn,d))}c=v}if(d=!1,c!==2)continue}}if(c===1){Ha(e,0),dl(e,t,0,!0);break}e:{switch(s=e,d=c,d){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:dl(s,t,Rn,!ol);break e;case 2:wn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(c=_u+300-qt(),10<c)){if(dl(s,t,Rn,!ol),Gi(s,0,!0)!==0)break e;vi=t,s.timeoutHandle=Hf(dg.bind(null,s,i,wn,qu,yf,t,Rn,$l,Ma,ol,d,"Throttled",-0,0),c);break e}dg(s,i,wn,qu,yf,t,Rn,$l,Ma,ol,d,null,-0,0)}}break}while(!0);bi(e)}function dg(e,t,i,s,c,d,v,w,N,U,Y,J,D,V){e.timeoutHandle=-1;var ce=t.subtreeFlags,ye=(d&335544064)===d;if(J=null,(ye||ce&8192||(ce&16785408)===16785408)&&(J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Je},zn=null,lg(t,d,J),ye&&(ce=J,ye=e.containerInfo,ye=(ye.nodeType===9?ye:ye.ownerDocument).__reactViewTransition,ye!=null&&(ce.count++,ce.waitingForViewTransition=!0,ce=Fr.bind(ce),ye.finished.then(ce,ce))),ce=(d&62914560)===d?_u-qt():(d&4194048)===d?ug-qt():0,ce=bS(J,ce),ce!==null)){vi=d,e.cancelPendingCommit=ce(xg.bind(null,e,t,d,i,s,c,v,w,N,U,Y,J,null,D,V)),dl(e,d,v,!U);return}xg(e,t,d,i,s,c,v,w,N,U,Y,J)}function mx(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var c=i[s],d=c.getSnapshot;c=c.value;try{if(!On(d(),c))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function dl(e,t,i,s){t=nr(e,t),t&=~Ou,t&=~$l,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var d=31-fn(c),v=1<<d;s[d]=-1,c&=~v}i!==0&&As(e,i,t)}function Mu(){return(tt&6)===0?(Hr(0),!1):!0}function xf(){if(Ue!==null){if(st===0)var e=Ue.return;else e=Ue,zi=Ul=null,Cc(e),Aa=null,kr=0,e=Ue;for(;e!==null;)Mm(e.alternate,e),e=e.return;Ue=null}}function Ha(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,Ux(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),vi=0,xf(),gt=e,Ue=i=Oi(e.current,null),Ie=t,st=0,qn=null,ol=!1,Ra=ui(e,t),gf=!1,Ma=Rn=Ou=$l=cl=Ot=0,wn=Br=null,yf=!1,Bi=nr(e,t),Ys(),i}function hg(e,t){Me=null,W.H=pu,t===Ta||t===eu?(t=xp(),st=3):t===pc?(t=xp(),st=4):st=t===Vc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,qn=t,Ue===null&&(Ot=1,mu(e,Vn(t,e.current)))}function pg(){var e=Kt.current;return e===null?!0:(Ie&4194048)===Ie?sn===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?e===sn:!1}function mg(){var e=W.H;return W.H=pu,e===null?pu:e}function gg(){var e=W.A;return W.A=hx,e}function Du(){Ot=4,ol||(Ie&4194048)!==Ie&&Kt.current!==null||(Ra=!0),(cl&134217727)===0&&($l&134217727)===0||gt===null||dl(gt,Ie,Rn,!1)}function Sf(e,t,i){var s=tt;tt|=2;var c=mg(),d=gg();(gt!==e||Ie!==t)&&(qu=null,Ha(e,t)),t=!1;var v=Ot;e:do try{if(st!==0&&Ue!==null){var w=Ue,N=qn;switch(st){case 8:xf(),v=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(t=!0);var U=st;if(st=0,qn=null,Ia(e,w,N,U),i&&Ra){v=0;break e}break;default:U=st,st=0,qn=null,Ia(e,w,N,U)}}gx(),v=Ot;break}catch(Y){hg(e,Y)}while(!0);return t&&e.shellSuspendCounter++,zi=Ul=null,tt=s,W.H=c,W.A=d,Ue===null&&(gt=null,Ie=0,Ys()),v}function gx(){for(;Ue!==null;)yg(Ue)}function yx(e,t){var i=tt;tt|=2;var s=mg(),c=gg();gt!==e||Ie!==t?(qu=null,zu=qt()+500,Ha(e,t)):Ra=ui(e,t);e:do try{if(st!==0&&Ue!==null){t=Ue;var d=qn;t:switch(st){case 1:st=0,qn=null,Ia(e,t,d,1);break;case 2:case 9:if(vp(d)){st=0,qn=null,vg(t);break}t=function(){st!==2&&st!==9||gt!==e||(st=7),bi(e)},d.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:vp(d)?(st=0,qn=null,vg(t)):(st=0,qn=null,Ia(e,t,d,7));break;case 5:var v=null;switch(Ue.tag){case 26:v=Ue.memoizedState;case 5:case 27:var w=Ue;if(v?oy(v):w.stateNode.complete){st=0,qn=null;var N=w.sibling;if(N!==null)Ue=N;else{var U=w.return;U!==null?(Ue=U,Lu(U)):Ue=null}break t}}st=0,qn=null,Ia(e,t,d,5);break;case 6:st=0,qn=null,Ia(e,t,d,6);break;case 8:xf(),Ot=6;break e;default:throw Error(r(462))}}vx();break}catch(Y){hg(e,Y)}while(!0);return zi=Ul=null,W.H=s,W.A=c,tt=i,Ue!==null?0:(gt=null,Ie=0,Ys(),Ot)}function vx(){for(;Ue!==null&&!Bn();)yg(Ue)}function yg(e){var t=qm(e.alternate,e,Bi);e.memoizedProps=e.pendingProps,t===null?Lu(e):Ue=t}function vg(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Am(i,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=Am(i,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:Cc(t);var s=t;s===Qt&&(Le?(Ks(s),s.tag===5&&s.stateNode!=null&&(xt=s.stateNode)):(Ks(s),Le=!0));default:Mm(i,t),t=Ue=sp(t,Bi),t=qm(i,t,Bi)}e.memoizedProps=e.pendingProps,t===null?Lu(e):Ue=t}function Ia(e,t,i,s){zi=Ul=null,Cc(t),Aa=null,kr=0;var c=t.return;try{if(ax(e,c,t,i,Ie)){Ot=1,mu(e,Vn(i,e.current)),Ue=null;return}}catch(d){if(c!==null)throw Ue=c,d;Ot=1,mu(e,Vn(i,e.current)),Ue=null;return}t.flags&32768?(Le||s===1?e=!0:Ra||(Ie&536870912)!==0?e=!1:(ol=e=!0,(s===2||s===9||s===3||s===6)&&(s=Kt.current,s!==null&&s.tag===13&&(s.flags|=16384))),bg(t,e)):Lu(t)}function Lu(e){var t=e;do{if((t.flags&32768)!==0){bg(t,ol);return}e=t.return;var i=ox(t.alternate,t,Bi);if(i!==null){Ue=i;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);Ot===0&&(Ot=5)}function bg(e,t){do{var i=cx(e.alternate,e);if(i!==null){i.flags&=32767,Ue=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=i}while(e!==null);Ot=6,Ue=null}function xg(e,t,i,s,c,d,v,w,N,U,Y,J){e.cancelPendingCommit=null;do Bu();while(Ct!==0);if((tt&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));e===gt&&(Ue=gt=null,Ie=0),Pl=t,ni=e,vi=i,bf=c,og=s,bx(e,t,i,v,w,N,J)}}function bx(e,t,i,s,c,d,v){var w=t.lanes|t.childLanes;if(vf=w,w|=tc,ir(e,i,w,s,c,d),La=null,(i&335544064)===i?(Ba=F1(e),s=10262):(Ba=null,s=10256),(t.subtreeFlags&s)!==0||(t.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,Tx(Ii,function(){return Tf(),null})):(e.callbackNode=null,e.callbackPriority=0),ku=!1,s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=W.T,W.T=null,c=de.p,de.p=2,d=tt,tt|=4;try{fx(e,t,i)}finally{tt=d,de.p=c,W.T=s}}Ct=1,ku?Da=Qx(v,e.containerInfo,Ba,wf,kf,Sx,Ef,Tf,xx):(wf(),kf(),Ef())}function xx(e){if(Ct!==0){var t=ni.onRecoverableError;t(e,{componentStack:null})}}function Sx(){Ct===3&&(Ct=0,ng(Pl,ni),Ct=4)}function wf(){if(Ct===1){Ct=0;var e=ni,t=Pl,i=vi,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=W.T,W.T=null;var c=de.p;de.p=2;var d=tt;tt|=4;try{Mr=Au=!1,eg(t,e,i),i=Lf;var v=$h(e.containerInfo),w=i.focusedElem,N=i.selectionRange;if(v!==w&&w&&w.ownerDocument&&Jh(w.ownerDocument.documentElement,w)){if(N!==null&&Jo(w)){var U=N.start,Y=N.end;if(Y===void 0&&(Y=U),"selectionStart"in w)w.selectionStart=U,w.selectionEnd=Math.min(Y,w.value.length);else{var J=w.ownerDocument||document,D=J&&J.defaultView||window;if(D.getSelection){var V=D.getSelection(),ce=w.textContent.length,ye=Math.min(N.start,ce),De=N.end===void 0?ye:Math.min(N.end,ce);!V.extend&&ye>De&&(v=De,De=ye,ye=v);var B=Kh(w,ye),R=Kh(w,De);if(B&&R&&(V.rangeCount!==1||V.anchorNode!==B.node||V.anchorOffset!==B.offset||V.focusNode!==R.node||V.focusOffset!==R.offset)){var I=J.createRange();I.setStart(B.node,B.offset),V.removeAllRanges(),ye>De?(V.addRange(I),V.extend(R.node,R.offset)):(I.setEnd(R.node,R.offset),V.addRange(I))}}}}for(J=[],V=w;V=V.parentNode;)V.nodeType===1&&J.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<J.length;w++){var K=J[w];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Ka=!!Df,Lf=Df=null}finally{tt=d,de.p=c,W.T=s}}e.current=t,Ct=2}}function kf(){if(Ct===2){Ct=0;var e=ni,t=Pl,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=W.T,W.T=null;var s=de.p;de.p=2;var c=tt;tt|=4;try{Zm(e,t.alternate,t)}finally{tt=c,de.p=s,W.T=i}}Ct=3}}function Ef(){if(Ct===4||Ct===3){Ct=0;var e=Da;Da=null,ua();var t=ni,i=Pl,s=vi,c=og,d=(s&335544064)===s?10262:10256;if((i.subtreeFlags&d)!==0||(i.flags&d)!==0?Ct=5:(Ct=0,Pl=ni=null,Sg(t,t.pendingLanes)),d=t.pendingLanes,d===0&&(fl=null),Qi(s),i=i.stateNode,cn&&typeof cn.onCommitFiberRoot=="function")try{cn.onCommitFiberRoot(kl,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=W.T,d=de.p,de.p=2,W.T=null;try{for(var v=t.onRecoverableError,w=0;w<c.length;w++){var N=c[w];v(N.value,{componentStack:N.stack})}}finally{W.T=i,de.p=d}}if(c=La,v=Ba,Ba=null,c!==null&&(La=null,v===null&&(v=[]),e!==null))for(N=0;N<c.length;N++)i=(0,c[N])(v),i!==void 0&&e.finished.finally(i);(vi&3)!==0&&Bu(),bi(t),d=t.pendingLanes,(s&261930)!==0&&(d&42)!==0?t===Ru?Ur++:(Ur=0,Ru=t):(Ur=0,Ru=null),Hr(0)}}function Sg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,xr(t)))}function Bu(){return Da!==null&&(Da.skipTransition(),Da=null),wf(),kf(),Ef(),Tf()}function Tf(){if(Ct!==5)return!1;var e=ni,t=vf;vf=0;var i=Qi(vi),s=W.T,c=de.p;try{de.p=32>i?32:i,W.T=null,i=bf,bf=null;var d=ni,v=vi;if(Ct=0,Pl=ni=null,vi=0,(tt&6)!==0)throw Error(r(331));var w=tt;if(tt|=4,rg(d.current),ig(d,d.current,v,i),tt=w,Hr(0,!1),cn&&typeof cn.onPostCommitFiberRoot=="function")try{cn.onPostCommitFiberRoot(kl,d)}catch{}return!0}finally{de.p=c,W.T=s,Sg(e,t)}}function wg(e,t,i){t=Vn(i,t),t=Ic(e.stateNode,t,2),e=il(e,t,2),e!==null&&(Nn(e,2),bi(e))}function ut(e,t,i){if(e.tag===3)wg(e,e,i);else for(;t!==null;){if(t.tag===3){wg(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(fl===null||!fl.has(s))){e=Vn(i,e),i=vm(2),s=il(t,i,2),s!==null&&(bm(i,s,t,e),Nn(s,2),bi(s));break}}t=t.return}}function Af(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new px;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(i)||(gf=!0,c.add(i),e=wx.bind(null,e,t,i),t.then(e,e))}function wx(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,gt===e&&(Ie&i)===i&&((Ot===4||Ot===3&&(Ie&62914560)===Ie&&300>qt()-_u)&&(tt&2)===0?Ha(e,0):Ou|=i,Ma===Ie&&(Ma=0)),bi(e)}function kg(e,t){t===0&&(t=Tl()),e=Dl(e,t),e!==null&&(Nn(e,t),bi(e))}function kx(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),kg(e,i)}function Ex(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(i=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(r(314))}s!==null&&s.delete(t),kg(e,i)}function Tx(e,t){return Yt(e,t)}var Va=null,Ya=null,Cf=!1,Uu=!1,Nf=!1,hl=0;function bi(e){e!==Ya&&e.next===null&&(Ya===null?Va=Ya=e:Ya=Ya.next=e),Uu=!0,Cf||(Cf=!0,Cx())}function Hr(e,t){if(!Nf&&Uu){Nf=!0;do for(var i=!1,s=Va;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var v=s.suspendedLanes,w=s.pingedLanes;d=(1<<31-fn(42|e)+1)-1,d&=c&~(v&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,Cg(s,d))}else d=Ie,d=Gi(s,s===gt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||ui(s,d)||(i=!0,Cg(s,d));s=s.next}while(i);Nf=!1}}function Ax(){Eg()}function Eg(){Uu=Cf=!1;var e=0;hl!==0&&Bx()&&(e=hl);for(var t=qt(),i=null,s=Va;s!==null;){var c=s.next,d=Tg(s,t);d===0?(s.next=null,i===null?Va=c:i.next=c,c===null&&(Ya=i)):(i=s,(e!==0||(d&3)!==0)&&(Uu=!0)),s=c}Ct!==0&&Ct!==5||Hr(e),hl!==0&&(hl=0)}function Tg(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var v=31-fn(d),w=1<<v,N=c[v];N===-1?((w&i)===0||(w&s)!==0)&&(c[v]=Ts(w,t)):N<=t&&(e.expiredLanes|=w),d&=~w}if(t=gt,i=Ie,i=Gi(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&vn(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ui(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&vn(s),Qi(i)){case 2:case 8:i=Rt;break;case 32:i=Ii;break;case 268435456:i=Ss;break;default:i=Ii}return s=Ag.bind(null,e),i=Yt(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&vn(s),e.callbackPriority=2,e.callbackNode=null,2}function Ag(e,t){if(Ct!==0&&Ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Bu()&&e.callbackNode!==i)return null;var s=Ie;return s=Gi(e,e===gt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(fg(e,s,t),Tg(e,qt()),e.callbackNode!=null&&e.callbackNode===i?Ag.bind(null,e):null)}function Cg(e,t){if(Bu())return null;fg(e,t,!0)}function Cx(){Hx(function(){(tt&6)!==0?Yt(An,Ax):Eg()})}function jf(){if(hl===0){var e=Vl;e===0&&(e=Vi,Vi<<=1,(Vi&261888)===0&&(Vi=256)),hl=e}return hl}function Ng(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:rt(e)}function Nx(e,t,i,s,c){if(t==="submit"&&i&&i.stateNode===c){var d=Ng((c[ln]||null).action),v=s.submitter;v&&(t=(t=v[ln]||null)?Ng(t.formAction):v.getAttribute("formAction"),t!==null&&(d=t,v=null));var w=new Us("action","action",null,s,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(hl!==0){var N=new FormData(c,v);Dc(i,{pending:!0,data:N,method:c.method,action:d},null,N)}}else typeof d=="function"&&(w.preventDefault(),N=new FormData(c,v),Dc(i,{pending:!0,data:N,method:c.method,action:d},d,N))},currentTarget:c}]})}}for(var Of=0;Of<ec.length;Of++){var _f=ec[Of],jx=_f.toLowerCase(),Ox=_f[0].toUpperCase()+_f.slice(1);Pn(jx,"on"+Ox)}Pn(ep,"onAnimationEnd"),Pn(tp,"onAnimationIteration"),Pn(np,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(U1,"onTransitionRun"),Pn(H1,"onTransitionStart"),Pn(I1,"onTransitionCancel"),Pn(ip,"onTransitionEnd"),Ai("onMouseEnter",["mouseout","mouseover"]),Ai("onMouseLeave",["mouseout","mouseover"]),Ai("onPointerEnter",["pointerout","pointerover"]),Ai("onPointerLeave",["pointerout","pointerover"]),rn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rn("onBeforeInput",["compositionend","keypress","textInput","paste"]),rn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_x=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ir));function jg(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],c=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var v=s.length-1;0<=v;v--){var w=s[v],N=w.instance,U=w.currentTarget;if(w=w.listener,N!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=U;try{d(c)}catch(Y){Vs(Y)}c.currentTarget=null,d=N}else for(v=0;v<s.length;v++){if(w=s[v],N=w.instance,U=w.currentTarget,w=w.listener,N!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=U;try{d(c)}catch(Y){Vs(Y)}c.currentTarget=null,d=N}}}}function He(e,t){var i=t[lr];i===void 0&&(i=t[lr]=new Set);var s=e+"__bubble";i.has(s)||(Og(t,e,2,!1),i.add(s))}function zf(e,t,i){var s=0;t&&(s|=4),Og(i,e,s,t)}var Hu="_reactListening"+Math.random().toString(36).slice(2);function qf(e){if(!e[Hu]){e[Hu]=!0,$n.forEach(function(i){i!=="selectionchange"&&(_x.has(i)||zf(i,!1,e),zf(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hu]||(t[Hu]=!0,zf("selectionchange",!1,t))}}function Og(e,t,i,s){switch(by(t)){case 2:var c=kS;break;case 8:c=ES;break;default:c=Wf}i=c.bind(null,t,i,e),c=void 0,!Ho||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,i,{capture:!0,passive:c}):e.addEventListener(t,i,!0):c!==void 0?e.addEventListener(t,i,{passive:c}):e.addEventListener(t,i,!1)}function Rf(e,t,i,s,c){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var v=s.tag;if(v===3||v===4){var w=s.stateNode.containerInfo;if(w===c)break;if(v===4)for(v=s.return;v!==null;){var N=v.tag;if((N===3||N===4)&&v.stateNode.containerInfo===c)return;v=v.return}for(;w!==null;){if(v=Ti(w),v===null)return;if(N=v.tag,N===5||N===6||N===26||N===27){s=d=v;continue e}w=w.parentNode}}s=s.return}Oh(function(){var U=d,Y=Hn(i),J=[];e:{var D=lp.get(e);if(D!==void 0){var V=Us,ce=e;switch(e){case"keypress":if(Ls(i)===0)break e;case"keydown":case"keyup":V=m1;break;case"focusin":ce="focus",V=Go;break;case"focusout":ce="blur",V=Go;break;case"beforeblur":case"afterblur":V=Go;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=qh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=i1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=x1;break;case ep:case tp:case np:V=r1;break;case ip:V=w1;break;case"scroll":case"scrollend":V=t1;break;case"wheel":V=E1;break;case"copy":case"cut":case"paste":V=u1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Mh;break;case"submit":V=v1;break;case"toggle":case"beforetoggle":V=A1}var ye=(t&4)!==0,De=!ye&&(e==="scroll"||e==="scrollend"),B=ye?D!==null?D+"Capture":null:D;ye=[];for(var R=U,I;R!==null;){var K=R;if(I=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||I===null||B===null||(K=or(R,B),K!=null&&ye.push(Vr(R,K,I))),De)break;R=R.return}0<ye.length&&(D=new V(D,ce,null,i,Y),J.push({event:D,listeners:ye}))}}if((t&7)===0){e:{if(V=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",V&&i!==Tt&&(ce=i.relatedTarget||i.fromElement)&&(Ti(ce)||ce[Ei]))break e;(D||V)&&(ce=Y.window===Y?Y:(V=Y.ownerDocument)?V.defaultView||V.parentWindow:window,D?(V=i.relatedTarget||i.toElement,D=U,V=V?Ti(V):null,V!==null&&(De=o(V),ye=V.tag,V!==De||ye!==5&&ye!==27&&ye!==6)&&(V=null)):(D=null,V=U),D!==V&&(ye=qh,K="onMouseLeave",B="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(ye=Mh,K="onPointerLeave",B="onPointerEnter",R="pointer"),De=D==null?ce:Fi(D),I=V==null?ce:Fi(V),ce=new ye(K,R+"leave",D,i,Y),ce.target=De,ce.relatedTarget=I,K=null,Ti(Y)===U&&(ye=new ye(B,R+"enter",V,i,Y),ye.target=I,ye.relatedTarget=De,K=ye),De=K,ye=D&&V?O(D,V,zx):null,D!==null&&_g(J,ce,D,ye,!1),V!==null&&De!==null&&_g(J,De,V,ye,!0)))}e:{if(D=U?Fi(U):window,V=D.nodeName&&D.nodeName.toLowerCase(),V==="select"||V==="input"&&D.type==="file")var pe=Yh;else if(Ih(D))if(Gh)pe=D1;else{pe=R1;var Ve=q1}else V=D.nodeName,!V||V.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?U&&ft(U.elementType)&&(pe=Yh):pe=M1;if(pe&&(pe=pe(e,U))){Vh(J,pe,i,Y);break e}Ve&&Ve(e,D,U)}switch(Ve=U?Fi(U):window,e){case"focusin":(Ih(Ve)||Ve.contentEditable==="true")&&(ya=Ve,$o=U,yr=null);break;case"focusout":yr=$o=ya=null;break;case"mousedown":Po=!0;break;case"contextmenu":case"mouseup":case"dragend":Po=!1,Ph(J,i,Y);break;case"selectionchange":if(B1)break;case"keydown":case"keyup":Ph(J,i,Y)}var xe;if(Xo)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else ga?Uh(e,i)&&(je="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(je="onCompositionStart");je&&(Dh&&i.locale!=="ko"&&(ga||je!=="onCompositionStart"?je==="onCompositionEnd"&&ga&&(xe=_h()):(Zi=Y,Io="value"in Zi?Zi.value:Zi.textContent,ga=!0)),Ve=Iu(U,je),0<Ve.length&&(je=new Rh(je,e,null,i,Y),J.push({event:je,listeners:Ve}),xe?je.data=xe:(xe=Hh(i),xe!==null&&(je.data=xe)))),(xe=N1?j1(e,i):O1(e,i))&&(je=Iu(U,"onBeforeInput"),0<je.length&&(Ve=new Rh("onBeforeInput","beforeinput",null,i,Y),J.push({event:Ve,listeners:je}),Ve.data=xe)),Nx(J,e,U,i,Y)}jg(J,t)})}function Vr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Iu(e,t){for(var i=t+"Capture",s=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=or(e,i),c!=null&&s.unshift(Vr(e,c,d)),c=or(e,t),c!=null&&s.push(Vr(e,c,d))),e.tag===3)return s;e=e.return}return[]}function zx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function _g(e,t,i,s,c){for(var d=t._reactName,v=[];i!==null&&i!==s;){var w=i,N=w.alternate,U=w.stateNode;if(w=w.tag,N!==null&&N===s)break;w!==5&&w!==26&&w!==27||U===null||(N=U,c?(U=or(i,d),U!=null&&v.unshift(Vr(i,U,N))):c||(U=or(i,d),U!=null&&v.push(Vr(i,U,N)))),i=i.return}v.length!==0&&e.push({event:t,listeners:v})}var qx=/\r\n?/g,Rx=/\u0000|\uFFFD/g;function zg(e){return(typeof e=="string"?e:""+e).replace(qx,`
9
- `).replace(Rx,"")}function qg(e,t){return t=zg(t),zg(e)===t}function ot(e,t,i,s,c,d){switch(i){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||oe(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&oe(e,""+s);else return;break;case"className":zl(e,"class",s);break;case"tabIndex":zl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":zl(e,i,s);break;case"style":Ge(e,s,d);return;case"data":if(t!=="object"){zl(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=rt(s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(i==="formAction"?(t!=="input"&&ot(e,t,"name",c.name,c,null),ot(e,t,"formEncType",c.formEncType,c,null),ot(e,t,"formMethod",c.formMethod,c,null),ot(e,t,"formTarget",c.formTarget,c,null)):(ot(e,t,"encType",c.encType,c,null),ot(e,t,"method",c.method,c,null),ot(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=rt(s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=Je);return;case"onScroll":s!=null&&He("scroll",e);return;case"onScrollEnd":s!=null&&He("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(r(61));if(i=s.__html,i!=null){if(c.children!=null)throw Error(r(60));d?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=rt(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":He("beforetoggle",e),He("toggle",e),da(e,"popover",s);break;case"xlinkActuate":Un(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Un(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Un(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Un(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Un(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Un(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Un(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Un(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Un(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":da(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=We.get(i)||i,da(e,i,s);else return}Fe=!0}function Mf(e,t,i,s,c,d){switch(i){case"style":Ge(e,s,d);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(r(61));if(i=s.__html,i!=null){if(c.children!=null)throw Error(r(60));d?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof s=="string")oe(e,s);else if(typeof s=="number"||typeof s=="bigint")oe(e,""+s);else return;break;case"onScroll":s!=null&&He("scroll",e);return;case"onScrollEnd":s!=null&&He("scrollend",e);return;case"onClick":s!=null&&(e.onclick=Je);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!fa.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(c=i.endsWith("Capture"),d=i.slice(2,c?i.length-7:void 0),t=e[ln]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(d,t,c),typeof s=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(d,s,c);break e}Fe=!0,i in e?e[i]=s:s===!0?e.setAttribute(i,""):da(e,i,s)}return}Fe=!0}function Pt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var s=!1,c=!1,d;for(d in i)if(i.hasOwnProperty(d)){var v=i[d];if(v!=null)switch(d){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:ot(e,t,d,v,i,null)}}c&&ot(e,t,"srcSet",i.srcSet,i,null),s&&ot(e,t,"src",i.src,i,null);return;case"input":He("invalid",e);var w=d=v=c=null,N=null,U=null;for(s in i)if(i.hasOwnProperty(s)){var Y=i[s];if(Y!=null)switch(s){case"name":c=Y;break;case"type":v=Y;break;case"checked":N=Y;break;case"defaultChecked":U=Y;break;case"value":d=Y;break;case"defaultValue":w=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,t));break;default:ot(e,t,s,Y,i,null)}}Ms(e,d,w,N,U,v,c,!1);return;case"select":He("invalid",e),s=v=d=null;for(c in i)if(i.hasOwnProperty(c)&&(w=i[c],w!=null))switch(c){case"value":d=w;break;case"defaultValue":v=w;break;case"multiple":s=w;default:ot(e,t,c,w,i,null)}t=d,i=v,e.multiple=!!s,t!=null?C(e,!!s,t,!1):i!=null&&C(e,!!s,i,!0);return;case"textarea":He("invalid",e),d=c=s=null;for(v in i)if(i.hasOwnProperty(v)&&(w=i[v],w!=null))switch(v){case"value":s=w;break;case"defaultValue":c=w;break;case"children":d=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:ot(e,t,v,w,i,null)}le(e,s,c,d);return;case"option":for(N in i)i.hasOwnProperty(N)&&(s=i[N],s!=null)&&(N==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":ot(e,t,N,s,i,null));return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(s=0;s<Ir.length;s++)He(Ir[s],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in i)if(i.hasOwnProperty(U)&&(s=i[U],s!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:ot(e,t,U,s,i,null)}return;default:if(ft(t)){for(Y in i)i.hasOwnProperty(Y)&&(s=i[Y],s!==void 0&&Mf(e,t,Y,s,i,void 0));return}}for(w in i)i.hasOwnProperty(w)&&(s=i[w],s!=null&&ot(e,t,w,s,i,null))}var Mx={};function Dx(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,v=null,w=null,N=null,U=null,Y=null;for(V in i){var J=i[V];if(i.hasOwnProperty(V)&&J!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":N=J;default:s.hasOwnProperty(V)||ot(e,t,V,null,s,J)}}for(var D in s){var V=s[D];if(J=i[D],s.hasOwnProperty(D)&&(V!=null||J!=null))switch(D){case"type":V!==J&&(Fe=!0),d=V;break;case"name":V!==J&&(Fe=!0),c=V;break;case"checked":V!==J&&(Fe=!0),U=V;break;case"defaultChecked":V!==J&&(Fe=!0),Y=V;break;case"value":V!==J&&(Fe=!0),v=V;break;case"defaultValue":V!==J&&(Fe=!0),w=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(137,t));break;default:V!==J&&ot(e,t,D,V,s,J)}}ha(e,v,w,N,U,Y,d,c);return;case"select":V=v=w=D=null;for(d in i)if(N=i[d],i.hasOwnProperty(d)&&N!=null)switch(d){case"value":break;case"multiple":V=N;default:s.hasOwnProperty(d)||ot(e,t,d,null,s,N)}for(c in s)if(d=s[c],N=i[c],s.hasOwnProperty(c)&&(d!=null||N!=null))switch(c){case"value":d!==N&&(Fe=!0),D=d;break;case"defaultValue":d!==N&&(Fe=!0),w=d;break;case"multiple":d!==N&&(Fe=!0),v=d;default:d!==N&&ot(e,t,c,d,s,N)}t=w,i=v,s=V,D!=null?C(e,!!i,D,!1):!!s!=!!i&&(t!=null?C(e,!!i,t,!0):C(e,!!i,i?[]:"",!1));return;case"textarea":V=D=null;for(w in i)if(c=i[w],i.hasOwnProperty(w)&&c!=null&&!s.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:ot(e,t,w,null,s,c)}for(v in s)if(c=s[v],d=i[v],s.hasOwnProperty(v)&&(c!=null||d!=null))switch(v){case"value":c!==d&&(Fe=!0),D=c;break;case"defaultValue":c!==d&&(Fe=!0),V=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(r(91));break;default:c!==d&&ot(e,t,v,c,s,d)}F(e,D,V);return;case"option":for(var ce in i)D=i[ce],i.hasOwnProperty(ce)&&D!=null&&!s.hasOwnProperty(ce)&&(ce==="selected"?e.selected=!1:ot(e,t,ce,null,s,D));for(N in s)D=s[N],V=i[N],s.hasOwnProperty(N)&&D!==V&&(D!=null||V!=null)&&(N==="selected"?(D!==V&&(Fe=!0),e.selected=D&&typeof D!="function"&&typeof D!="symbol"):ot(e,t,N,D,s,V));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in i)D=i[ye],i.hasOwnProperty(ye)&&D!=null&&!s.hasOwnProperty(ye)&&ot(e,t,ye,null,s,D);for(U in s)if(D=s[U],V=i[U],s.hasOwnProperty(U)&&D!==V&&(D!=null||V!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(137,t));break;default:ot(e,t,U,D,s,V)}return;default:if(ft(t)){for(var De in i)D=i[De],i.hasOwnProperty(De)&&D!==void 0&&!s.hasOwnProperty(De)&&Mf(e,t,De,void 0,s,D);for(Y in s)D=s[Y],V=i[Y],!s.hasOwnProperty(Y)||D===V||D===void 0&&V===void 0||Mf(e,t,Y,D,s,V);return}}for(var B in i)D=i[B],i.hasOwnProperty(B)&&D!=null&&!s.hasOwnProperty(B)&&ot(e,t,B,null,s,D);for(J in s)D=s[J],V=i[J],!s.hasOwnProperty(J)||D===V||D==null&&V==null||ot(e,t,J,D,s,V)}function Rg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Lx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var c=i[s],d=c.transferSize,v=c.initiatorType,w=c.duration;if(d&&w&&Rg(v)){for(v=0,w=c.responseEnd,s+=1;s<i.length;s++){var N=i[s],U=N.startTime;if(U>w)break;var Y=N.transferSize,J=N.initiatorType;Y&&Rg(J)&&(N=N.responseEnd,v+=Y*(N<w?1:(w-U)/(N-U)))}if(--s,t+=8*(d+v)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Df=null,Lf=null;function Yr(e){return e.nodeType===9?e:e.ownerDocument}function Mg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Lg(e,t,i,s){return i=Yr(i).createElement(e),i[Et]=s,i[ln]=t,Pt(i,e,t),Nt(i),i}function Bf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Uf=null;function Bx(){var e=window.event;return e&&e.type==="popstate"?e===Uf?!1:(Uf=e,!0):(Uf=null,!1)}var Hf=typeof setTimeout=="function"?setTimeout:void 0,Ux=typeof clearTimeout=="function"?clearTimeout:void 0,Bg=typeof Promise=="function"?Promise:void 0,Ug=typeof requestAnimationFrame=="function"?requestAnimationFrame:Hf,Hx=typeof queueMicrotask=="function"?queueMicrotask:typeof Bg<"u"?function(e){return Bg.resolve(null).then(e).catch(Ix)}:Hf;function Ix(e){setTimeout(function(){throw e})}function pl(e){return e==="head"}function Hg(e,t){var i=t,s=0;do{var c=i.nextSibling;if(e.removeChild(i),c&&c.nodeType===8)if(i=c.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(c),Ja(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")Zf(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Zf(i);for(var d=i.firstChild;d;){var v=d.nextSibling,w=d.nodeName;d[Xi]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&d.rel.toLowerCase()==="stylesheet"||i.removeChild(d),d=v}}else i==="body"&&Zf(e.ownerDocument.body);i=c}while(i);Ja(t)}function Ig(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function Vg(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var s=1;else for(var c=s=0;c<t.length;c++){var d=t[c];0<d.width&&0<d.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function Yg(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Vx(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function If(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return Vx(t,i,e)}function Yx(e){return e.documentElement.clientHeight}function Gx(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Qx(e,t,i,s,c,d,v,w,N){var U=t.nodeType===9?t:t.ownerDocument;try{var Y=U.startViewTransition({update:function(){var D=U.defaultView,V=D.navigation&&D.navigation.transition,ce=U.fonts.status;s();var ye=[];if(ce==="loaded"&&(Yx(U),U.fonts.status==="loading"&&ye.push(U.fonts.ready)),ce=ye.length,e!==null)for(var De=e.suspenseyImages,B=0,R=0;R<De.length;R++){var I=De[R];if(!I.complete){var K=I.getBoundingClientRect();if(0<K.bottom&&0<K.right&&K.top<D.innerHeight&&K.left<D.innerWidth){if(B+=cy(I),B>Gu){ye.length=ce;break}I=new Promise(Gx.bind(I)),ye.push(I)}}}if(0<ye.length)return D=Promise.race([Promise.all(ye),new Promise(function(pe){return setTimeout(pe,500)})]).then(c,c),(V?Promise.allSettled([V.finished,D]):D).then(d,d);if(c(),V)return V.finished.then(d,d);d()},types:i});U.__reactViewTransition=Y;var J=[];return Y.ready.then(function(){for(var D=U.documentElement.getAnimations({subtree:!0}),V=0;V<D.length;V++){var ce=D[V],ye=ce.effect,De=ye.pseudoElement;if(De!=null&&De.startsWith("::view-transition")){J.push(ce),ce=ye.getKeyframes();for(var B=De=void 0,R=!0,I=0;I<ce.length;I++){var K=ce[I],pe=K.width;if(De===void 0)De=pe;else if(De!==pe){R=!1;break}if(pe=K.height,B===void 0)B=pe;else if(B!==pe){R=!1;break}delete K.width,delete K.height,K.transform==="none"&&delete K.transform}R&&De!==void 0&&B!==void 0&&(ye.setKeyframes(ce),R=getComputedStyle(ye.target,ye.pseudoElement),R.width!==De||R.height!==B)&&(R=ce[0],R.width=De,R.height=B,R=ce[ce.length-1],R.width=De,R.height=B,ye.setKeyframes(ce))}}v()},function(D){U.__reactViewTransition===Y&&(U.__reactViewTransition=null);try{typeof D=="object"&&D!==null&&D.name==="InvalidStateError"&&(D.message==="View transition was skipped because document visibility state is hidden."||D.message==="Skipping view transition because document visibility state has become hidden."||D.message==="Skipping view transition because viewport size changed."||D.message==="Transition was aborted because of invalid state")&&(D=null),D!==null&&N(D)}finally{s(),c(),v()}}),Y.finished.finally(function(){for(var D=0;D<J.length;D++)J[D].cancel();U.__reactViewTransition===Y&&(U.__reactViewTransition=null),w()}),Y}catch{return s(),c(),v(),null}}function Wl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Wl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:Q({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Wl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),s=[],c=0;c<i.length;c++){var d=i[c].effect;d!==null&&d.target===e&&d.pseudoElement===t&&s.push(i[c])}return s},Wl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Gg(e){return{name:e,group:new Wl("group",e),imagePair:new Wl("image-pair",e),old:new Wl("old",e),new:new Wl("new",e)}}function Dn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Dn.prototype.addEventListener=function(e,t,i){var s=null,c=null;if(!(i!=null&&typeof i!="boolean"&&(s=i.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var d=this._eventListeners;if(Xg(d,e,t,i)===-1){var v=this,w=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(w=function(N){v.removeEventListener(e,t,i),typeof t=="function"?t.call(this,N):t.handleEvent(N)}),s!==null&&(c=v.removeEventListener.bind(v,e,t,i),s.addEventListener("abort",c,{once:!0}),c=s.removeEventListener.bind(s,"abort",c)),s=Ga(i),d.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:w,cleanup:c}),m(this._fragmentFiber.child,!1,Xx,e,w,s)}this._eventListeners=d}};function Xx(e,t,i,s){return A(e).addEventListener(t,i,s),!1}Dn.prototype.removeEventListener=function(e,t,i){var s=this._eventListeners;if(s!==null&&(t=Xg(s,e,t,i),t!==-1)){var c=s[t];i=c.attachedListener;var d=c.cleanup;c=Ga(c.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Fx,e,i,c),s.splice(t,1),d!==null&&d()}};function Fx(e,t,i,s){return A(e).removeEventListener(t,i,s),!1}function Ga(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Qg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Xg(e,t,i,s){if(e.length===0)return-1;s=Qg(s);for(var c=0;c<e.length;c++){var d=e[c];if(d.type===t&&d.listener===i&&Qg(d.optionsOrUseCapture)===s)return c}return-1}Dn.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=A(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var s=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var c=0;c<i.length;c++){var d=i[c];s.addEventListener(d.type,d.attachedListener,Ga(d.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),i)for(c=0;c<i.length;c++)d=i[c],s.removeEventListener(d.type,d.attachedListener,Ga(d.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)},Dn.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Fg,e,void 0,void 0)};function Fg(e,t){return e.tag===6?!1:(e=A(e),aS(e,t))}Dn.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Vf,t,void 0,void 0);for(var i=t.length-1;0<=i&&!Fg(t[i],e);i--);};function Vf(e,t){return t.push(e),!1}Dn.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=A(e),e=Yr(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Zx,e,void 0,void 0))};function Zx(e,t){return e.tag===6?!1:(e=A(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Dn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Kx,e,void 0,void 0)};function Kx(e,t){return e.tag===6||(e=A(e),t.observe(e)),!1}Dn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Jx,e,void 0,void 0);for(var i=t=0;i<ii.length;i++){var s=ii[i];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):ii[t++]=s}ii.length=t}};function Jx(e,t){return e.tag===6||(e=A(e),t.unobserve(e)),!1}var ii=[],Yf=!1;function $x(e,t,i){ii.push({fragmentInstance:e,observer:t,instance:i}),Yf||(Yf=!0,rS(function(){Yf=!1;var s=ii;ii=[];for(var c=0;c<s.length;c++){var d=s[c];d.observer.unobserve(d.instance)}}))}Dn.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Px,e,void 0,void 0),e};function Px(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=A(e),t.push.apply(t,e.getClientRects());return!1}Dn.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:A(t).getRootNode(e)},Dn.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];m(this._fragmentFiber.child,!1,Vf,i,void 0,void 0);var s=A(t);if(i.length===0){if(i=s,x(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var c=s=i.compareDocumentPosition(e);return i===e?c=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=k(t)[1],i===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=A(i).compareDocumentPosition(e),c=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),c|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=A(i[0]),c=A(i[i.length-1]);var d=x(this._fragmentFiber)?t.parentElement:s;if(d==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=d.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,d=d.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY;var v=t.compareDocumentPosition(e),w=c.compareDocumentPosition(e),N=v&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=s&&d&&v&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||d&&c===e||N||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!d&&c===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:v,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Wx(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Wx(e,t,i,s,c){var d=Ti(c);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!d)e:{for(;d!==null;){if(d.tag===7&&(d===t||d.alternate===t)){i=!0;break e}d=d.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(d===null)return d=c.ownerDocument,c===d||c===d.documentElement||c===d.body;e:{for(d=t,t=S(t);d!==null;){if(!(d.tag!==5&&d.tag!==3&&d.tag!==27||d!==t&&d.alternate!==t)){d=!0;break e}d=d.return}d=!1}return d}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!d)&&!(t=d===i)&&(t=O(i,d,te),t===null?t=!1:(m(t,!0,H,d,i),d=E,E=null,t=d!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!d)&&!(t=d===s)&&(t=O(s,d,te),t===null?t=!1:(m(t,!0,$,d,s),d=E,M=E=null,t=d!==null)),t):!1}function Zg(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Dn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(r(566));var t=[];m(this._fragmentFiber.child,!1,Vf,t,void 0,void 0);var i=e!==!1;if(t.length===0){var s=k(this._fragmentFiber);if(s=i?s[1]||s[0]||S(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=A(s),Zg(e,i);return}if(s=A(s),s.nodeType!==9){if(s.nodeType===11){i="host"in s?s.host:null,i!==null&&i.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=i?t.length-1:0;s!==(i?-1:t.length);){var c=t[s];c.tag===6?(c=A(c),Zg(c,i)):A(c).scrollIntoView(e),s+=i?-1:1}};function eS(e,t){return e=A(e),Kg(e,t),!1}function Kg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Jg(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];e.addEventListener(c.type,c.attachedListener,Ga(c.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(d){for(var v=0,w=0;w<ii.length;w++){var N=ii[w];(N.fragmentInstance!==t||N.observer!==d||N.instance!==e)&&(ii[v++]=N)}ii.length=v,d.observe(e)}),Kg(e,t))}function tS(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];e.removeEventListener(c.type,c.attachedListener,Ga(c.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(d){typeof d.rootMargin=="string"?$x(t,d,e):d.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Gf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Gf(i),Ol(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function nS(e,t,i,s){for(;e.nodeType===1;){var c=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Xi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Fn(e.nextSibling),e===null)break}return null}function iS(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Fn(e.nextSibling),e===null))return null;return e}function $g(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Fn(e.nextSibling),e===null))return null;return e}function Qf(e){return e.data==="$?"||e.data==="$~"}function Xf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function lS(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Fn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Ff=null;function Pg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Fn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function Wg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function aS(e,t){function i(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return s}function rS(e){Ug(function(){Ug(function(t){return e(t)})})}function ey(e,t,i){switch(t=Yr(i),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function ty(e,t,i){for(var s in i){var c=i[s];i.hasOwnProperty(s)&&c!=null&&ot(e,t,s,null,Mx,c)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Je&&(e.onclick=null),Ol(e)}function Zf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ol(e)}var Zn=new Map,ny=new Set;function Gr(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Ui=de.d;de.d={f:sS,r:uS,D:oS,C:cS,L:fS,m:dS,X:pS,S:hS,M:mS};function sS(){var e=Ui.f(),t=Mu();return e||t}function uS(e){var t=_l(e);t!==null&&t.tag===5&&t.type==="form"?lm(t):Ui.r(e)}var Qa=typeof document>"u"?null:document;function iy(e,t,i){var s=Qa;if(s&&typeof t=="string"&&t){var c=jn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof i=="string"&&(c+='[crossorigin="'+i+'"]'),ny.has(c)||(ny.add(c),e={rel:e,crossOrigin:i,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),Pt(t,"link",e),Nt(t),s.head.appendChild(t)))}}function oS(e){Ui.D(e),iy("dns-prefetch",e,null)}function cS(e,t){Ui.C(e,t),iy("preconnect",e,t)}function fS(e,t,i){Ui.L(e,t,i);var s=Qa;if(s&&e&&t){var c='link[rel="preload"][as="'+jn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(c+='[imagesrcset="'+jn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(c+='[imagesizes="'+jn(i.imageSizes)+'"]')):c+='[href="'+jn(e)+'"]';var d=c;switch(t){case"style":d=Xa(e);break;case"script":d=Fa(e)}if(!(Zn.has(d)||(e=Q({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Zn.set(d,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(Qr(d))||t==="script"&&s.querySelector(Xr(d))))){var v=s.createElement("link");Pt(v,"link",e),t==="style"&&(v[jl]=!0,v.onload=v.onerror=function(){Os(v)}),Nt(v),s.head.appendChild(v)}}}function dS(e,t){Ui.m(e,t);var i=Qa;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+jn(s)+'"][href="'+jn(e)+'"]',d=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Fa(e)}if(!Zn.has(d)&&(e=Q({rel:"modulepreload",href:e},t),Zn.set(d,e),i.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Xr(d)))return}s=i.createElement("link"),Pt(s,"link",e),Nt(s),i.head.appendChild(s)}}}function hS(e,t,i){Ui.S(e,t,i);var s=Qa;if(s&&e){var c=dn(s).hoistableStyles,d=Xa(e);t=t||"default";var v=c.get(d);if(!v){var w={loading:0,preload:null};if(v=s.querySelector(Qr(d)))w.loading=5;else{e=Q({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Zn.get(d))&&Kf(e,i);var N=v=s.createElement("link");Nt(N),Pt(N,"link",e),N._p=new Promise(function(U,Y){N.onload=U,N.onerror=Y}),N.addEventListener("load",function(){w.loading|=1}),N.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Vu(v,t,s)}v={type:"stylesheet",instance:v,count:1,state:w},c.set(d,v)}}}function pS(e,t){Ui.X(e,t);var i=Qa;if(i&&e){var s=dn(i).hoistableScripts,c=Fa(e),d=s.get(c);d||(d=i.querySelector(Xr(c)),d||(e=Q({src:e,async:!0},t),(t=Zn.get(c))&&Jf(e,t),d=i.createElement("script"),Nt(d),Pt(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function mS(e,t){Ui.M(e,t);var i=Qa;if(i&&e){var s=dn(i).hoistableScripts,c=Fa(e),d=s.get(c);d||(d=i.querySelector(Xr(c)),d||(e=Q({src:e,async:!0,type:"module"},t),(t=Zn.get(c))&&Jf(e,t),d=i.createElement("script"),Nt(d),Pt(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function ly(e,t,i,s){var c=(c=wt.current)?Gr(c):null;if(!c)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=Xa(i.href),t=dn(c).hoistableStyles,s=t.get(i),s||(s={type:"style",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Xa(i.href);var d=dn(c).hoistableStyles,v=d.get(e);if(v||(c=c.ownerDocument||c,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,v),(d=c.querySelector(Qr(e)))?d._p||(v.instance=d,v.state.loading=5):(d=Zn.get(e),d||(d={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Zn.set(e,d)),gS(c,e,d,v.state))),t&&s===null)throw Error(r(528,""));return v}if(t&&s!==null)throw Error(r(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=Fa(i),t=dn(c).hoistableScripts,s=t.get(i),s||(s={type:"script",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Xa(e){return'href="'+jn(e)+'"'}function Qr(e){return'link[rel="stylesheet"]['+e+"]"}function ay(e){return Q({},e,{"data-precedence":e.precedence,precedence:null})}function gS(e,t,i,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[jl]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[jl]=!0,t.onload=t.onerror=Os.bind(null,t),Pt(t,"link",i),Nt(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function Fa(e){return'[src="'+jn(e)+'"]'}function Xr(e){return"script[async]"+e}function ry(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+jn(i.href)+'"]');if(s)return t.instance=s,Nt(s),s;var c=Q({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Nt(s),Pt(s,"style",c),Vu(s,i.precedence,e),t.instance=s;case"stylesheet":c=Xa(i.href);var d=e.querySelector(Qr(c));if(d)return t.state.loading|=4,t.instance=d,Nt(d),d;s=ay(i),(c=Zn.get(c))&&Kf(s,c),d=(e.ownerDocument||e).createElement("link"),Nt(d);var v=d;return v._p=new Promise(function(w,N){v.onload=w,v.onerror=N}),Pt(d,"link",s),t.state.loading|=4,Vu(d,i.precedence,e),t.instance=d;case"script":return d=Fa(i.src),(c=e.querySelector(Xr(d)))?(t.instance=c,Nt(c),c):(s=i,(c=Zn.get(d))&&(s=Q({},i),Jf(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),Nt(c),Pt(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Vu(s,i.precedence,e));return t.instance}function Vu(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,d=c,v=0;v<s.length;v++){var w=s[v];if(w.dataset.precedence===t)d=w;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Kf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Jf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Yu=null;function sy(e,t,i){if(Yu===null){var s=new Map,c=Yu=new Map;c.set(i,s)}else c=Yu,s=c.get(i),s||(s=new Map,c.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),c=0;c<i.length;c++){var d=i[c];if(!(d[Xi]||d[Et]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var v=d.getAttribute(t)||"";v=e+v;var w=s.get(v);w?w.push(d):s.set(v,[d])}}return s}function $f(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function yS(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function uy(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function oy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function cy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function fy(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=cy(t),e.suspenseyImages.push(t)),e=xS.bind(e),t.decode().then(e,e))}function vS(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var c=Xa(s.href),d=t.querySelector(Qr(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fr.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=d,Nt(d);return}d=t.ownerDocument||t,s=ay(s),(c=Zn.get(c))&&Kf(s,c),d=d.createElement("link"),Nt(d);var v=d;v._p=new Promise(function(w,N){v.onload=w,v.onerror=N}),Pt(d,"link",s),i.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Fr.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Gu=0;function bS(e,t){return e.stylesheets&&e.count===0&&Xu(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Xu(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Gu===0&&(Gu=62500*Lx());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xu(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Gu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function dy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Xu(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Fr(){this.count--,dy(this)}function xS(){this.imgCount--,dy(this)}var Qu=null;function Xu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qu=new Map,t.forEach(SS,e),Qu=null,Fr.call(e))}function SS(e,t){if(!(t.state.loading&4)){var i=Qu.get(e);if(i)var s=i.get(null);else{i=new Map,Qu.set(e,i);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var v=c[d];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(i.set(v.dataset.precedence,v),s=v)}s&&i.set(null,s)}c=t.instance,v=c.getAttribute("data-precedence"),d=i.get(v)||s,d===s&&i.set(null,c),i.set(v,c),this.count++,s=Fr.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Za={$$typeof:ae,Provider:null,Consumer:null,_currentValue:it,_currentValue2:it,_threadCount:0};function wS(e,t,i,s,c,d,v,w,N){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Al(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Al(0),this.hiddenUpdates=Al(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.transitionTypes=null,this.incompleteTransitions=new Map}function hy(e,t,i,s,c,d,v,w,N,U,Y,J){return e=new wS(e,t,i,v,N,U,Y,J,w),t=1,d===!0&&(t|=24),d=bn(3,null,null,t),e.current=d,d.stateNode=e,t=fc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:i,cache:t},mc(d),e}function py(e){return e?(e=xa,e):xa}function my(e,t,i,s,c,d){c=py(c),s.context===null?s.context=c:s.pendingContext=c,s=nl(t),s.payload={element:i},d=d===void 0?null:d,d!==null&&(s.callback=d),i=il(e,s,t),i!==null&&(kn(i,e,t),Er(i,e,t))}function gy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Pf(e,t){gy(e,t),(e=e.alternate)&&gy(e,t)}function yy(e){if(e.tag===13||e.tag===31){var t=Dl(e,67108864);t!==null&&kn(t,e,67108864),Pf(e,67108864)}}function vy(e){if(e.tag===13||e.tag===31){var t=Mn();t=Cl(t);var i=Dl(e,t);i!==null&&kn(i,e,t),Pf(e,t)}}var Ka=!0;function kS(e,t,i,s){var c=W.T;W.T=null;var d=de.p;try{de.p=2,Wf(e,t,i,s)}finally{de.p=d,W.T=c}}function ES(e,t,i,s){var c=W.T;W.T=null;var d=de.p;try{de.p=8,Wf(e,t,i,s)}finally{de.p=d,W.T=c}}function Wf(e,t,i,s){if(Ka){var c=ed(s);if(c===null)Rf(e,t,s,Fu,i),xy(e,s);else if(AS(c,e,t,i,s))s.stopPropagation();else if(xy(e,s),t&4&&-1<TS.indexOf(e)){for(;c!==null;){var d=_l(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var v=si(d.pendingLanes);if(v!==0){var w=d;for(w.pendingLanes|=2,w.entangledLanes|=2;v;){var N=1<<31-fn(v);w.entanglements[1]|=N,v&=~N}bi(d),(tt&6)===0&&(zu=qt()+500,Hr(0))}}break;case 31:case 13:w=Dl(d,2),w!==null&&kn(w,d,2),Mu(),Pf(d,2)}if(d=ed(s),d===null&&Rf(e,t,s,Fu,i),d===c)break;c=d}c!==null&&s.stopPropagation()}else Rf(e,t,s,null,i)}}function ed(e){return e=Hn(e),td(e)}var Fu=null;function td(e){if(Fu=null,e=Ti(e),e!==null){var t=o(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=h(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Fu=e,null}function by(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(at()){case An:return 2;case Rt:return 8;case Ii:case Do:return 32;case Ss:return 268435456;default:return 32}default:return 32}}var nd=!1,ml=null,gl=null,yl=null,Zr=new Map,Kr=new Map,vl=[],TS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function xy(e,t){switch(e){case"focusin":case"focusout":ml=null;break;case"dragenter":case"dragleave":gl=null;break;case"mouseover":case"mouseout":yl=null;break;case"pointerover":case"pointerout":Zr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kr.delete(t.pointerId)}}function Jr(e,t,i,s,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:d,targetContainers:[c]},t!==null&&(t=_l(t),t!==null&&yy(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function AS(e,t,i,s,c){switch(t){case"focusin":return ml=Jr(ml,e,t,i,s,c),!0;case"dragenter":return gl=Jr(gl,e,t,i,s,c),!0;case"mouseover":return yl=Jr(yl,e,t,i,s,c),!0;case"pointerover":var d=c.pointerId;return Zr.set(d,Jr(Zr.get(d)||null,e,t,i,s,c)),!0;case"gotpointercapture":return d=c.pointerId,Kr.set(d,Jr(Kr.get(d)||null,e,t,i,s,c)),!0}return!1}function Sy(e){var t=Ti(e.target);if(t!==null){var i=o(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,js(e.priority,function(){vy(i)});return}}else if(t===31){if(t=h(i),t!==null){e.blockedOn=t,js(e.priority,function(){vy(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Zu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=ed(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);Tt=s,i.target.dispatchEvent(s),Tt=null}else return t=_l(i),t!==null&&yy(t),e.blockedOn=i,!1;t.shift()}return!0}function wy(e,t,i){Zu(e)&&i.delete(t)}function CS(){nd=!1,ml!==null&&Zu(ml)&&(ml=null),gl!==null&&Zu(gl)&&(gl=null),yl!==null&&Zu(yl)&&(yl=null),Zr.forEach(wy),Kr.forEach(wy)}function Ku(e,t){e.blockedOn===t&&(e.blockedOn=null,nd||(nd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,CS)))}var Ju=null;function ky(e){Ju!==e&&(Ju=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ju===e&&(Ju=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(td(s||i)===null)continue;break}var d=_l(i);d!==null&&(e.splice(t,3),t-=3,Dc(d,{pending:!0,data:c,method:i.method,action:s},s,c))}}))}function Ja(e){function t(N){return Ku(N,e)}ml!==null&&Ku(ml,e),gl!==null&&Ku(gl,e),yl!==null&&Ku(yl,e),Zr.forEach(t),Kr.forEach(t);for(var i=0;i<vl.length;i++){var s=vl[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<vl.length&&(i=vl[0],i.blockedOn===null);)Sy(i),i.blockedOn===null&&vl.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var c=i[s],d=i[s+1],v=c[ln]||null;if(typeof d=="function")v||ky(i);else if(v){var w=null;if(d&&d.hasAttribute("formAction")){if(c=d,v=d[ln]||null)w=v.formAction;else if(td(c)!==null)continue}else w=v.action;typeof w=="function"?i[s+1]=w:(i.splice(s,3),s-=3),ky(i)}}}function Ey(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(v){return c=v})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function id(e){this._internalRoot=e}$u.prototype.render=id.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var i=t.current,s=Mn();my(i,s,e,t,null,null)},$u.prototype.unmount=id.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;my(e.current,2,null,e,null,null),Mu(),t[Ei]=null}};function $u(e){this._internalRoot=e}$u.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ns();e={blockedOn:null,target:e,priority:t};for(var i=0;i<vl.length&&t!==0&&t<vl[i].priority;i++);vl.splice(i,0,e),i===0&&Sy(e)}};var Ty=l.version;if(Ty!=="19.3.1")throw Error(r(527,Ty,"19.3.1"));de.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var NS={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pu.isDisabled&&Pu.supportsFiber)try{kl=Pu.inject(NS),cn=Pu}catch{}}return Pr.createRoot=function(e,t){if(!u(e))throw Error(r(299));var i=!1,s="",c=pm,d=mm,v=gm;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(v=t.onRecoverableError)),t=hy(e,1,!1,null,null,i,s,null,c,d,v,Ey),e[Ei]=t.current,qf(e),new id(t)},Pr.hydrateRoot=function(e,t,i){if(!u(e))throw Error(r(299));var s=!1,c="",d=pm,v=mm,w=gm,N=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(d=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError),i.formState!==void 0&&(N=i.formState)),t=hy(e,1,!0,t,i??null,s,c,N,d,v,w,Ey),t.context=py(null),i=t.current,s=Mn(),s=Cl(s),c=nl(s),c.callback=null,il(i,c,s),i=s,t.current.lanes=i,Nn(t,i),bi(t),e[Ei]=t.current,qf(e),new $u(t)},Pr.version="19.3.1",Pr}var My;function BS(){if(My)return rd.exports;My=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),rd.exports=LS(),rd.exports}var US=BS();async function ct(n,l){const a=await fetch("/dsh-bot/api"+n,{...l,headers:{accept:"application/json",...l?.headers??{}}}),r=await a.json().catch(()=>({}));return{status:a.status,body:r&&typeof r=="object"?r:{}}}async function cs(n,l){const a=await fetch(n,{...l,headers:{accept:"application/json",...l?.headers??{}}}),r=await a.json().catch(()=>({}));return{status:a.status,body:r&&typeof r=="object"?r:{}}}function Jv(n,l){return typeof n.message=="string"&&n.message!==""?n.message:l}const HS=/^(?:Name|名字)\s*[::]\s*(.+?)\s*$/i,IS=/^(?:Style|风格)\s*[::]\s*(.+?)\s*$/i,VS=/^(?:Task|任务)\s*[::]\s*(.+?)\s*$/i;function YS(n,l,a){const r=[];return n.trim()!==""&&r.push(`Name: ${n.trim()}`),l.trim()!==""&&r.push(`Style: ${l.trim()}`),a.trim()!==""&&r.push(`Task: ${a.trim()}`),r.join(`
10
-
11
- `)}function GS(n){const l={name:"",style:"",task:""};for(const a of n.split(`
12
- `)){const r=HS.exec(a),u=IS.exec(a),o=VS.exec(a);r&&l.name===""?l.name=r[1]??"":u&&l.style===""?l.style=u[1]??"":o&&l.task===""&&(l.task=o[1]??"")}return l}const QS={"activity.status.preparing":"Preparing call","activity.status.waiting":"Waiting for tool result","activity.status.running":"Running (confirmed)","activity.status.worker":"Waiting for Worker","activity.status.background":"Background job (last known)","activity.status.backgroundDetail":"Background job · last known state","activity.status.succeeded":"Completed","activity.status.failed":"Failed","activity.status.cancelled":"Cancelled","activity.status.unknown":"Outcome unknown","activity.ticket.scheduling":"Waiting for Worker scheduling","activity.ticket.needsUser":"Waiting for you","activity.ticket.ready":"Worker returned; awaiting review","activity.pendingCount":"{count} pending activities","activity.thinking":"Thinking","activity.reasoning":"Reasoning","activity.waitingModel":"Waiting for model response","activity.syncing":"Syncing","activity.connectionUnavailable":"Connection unavailable","activity.lastKnown":"last known","activity.lastKnownSuffix":" · last known","activity.staleSummary":"{phase} · last known: {text}","activity.count.active":"Active","activity.count.failed":"Failed","activity.count.cancelled":"Cancelled","activity.count.unknown":"Unknown","activity.title":"Activity","activity.titleOne":"1 action","activity.titleWithCount":"{count} actions","activity.resyncing":"Resyncing · last known state","activity.connectionLastKnown":"Connection unavailable · last known state","activity.generating":"Generating response; no new tool execution evidence","activity.runCommand":"Run command","activity.updatePlan":"Update plan","activity.planComplete":"complete (plan record)","activity.callRequested":"Call requested; process start not confirmed","activity.jobRegistered":"registered, not proof of completion or continued liveness","activity.latestReport":"Latest report","activity.cwdRecorded":"Recorded working directory","activity.cwdRequested":"Requested working directory","activity.cwdSessionDefault":"Session default directory (not execution confirmation)","activity.callRecorded":"Call recorded","activity.callWait":"Call wait","activity.fullArgs":"Full arguments (redacted)","activity.toolResult":"Tool result (redacted)","activity.emptyResult":"(empty result)"},XS={"activity.status.preparing":"准备调用","activity.status.waiting":"等待工具结果","activity.status.running":"执行中(已确认)","activity.status.worker":"等待 Worker","activity.status.background":"后台任务(最后已知)","activity.status.backgroundDetail":"后台任务 · 最后已知状态","activity.status.succeeded":"完成","activity.status.failed":"失败","activity.status.cancelled":"已取消","activity.status.unknown":"结果未知","activity.ticket.scheduling":"等待 Worker 调度","activity.ticket.needsUser":"等待用户","activity.ticket.ready":"Worker 已返回,待确认","activity.pendingCount":"{count} 项待完成活动","activity.thinking":"思考中","activity.reasoning":"思考记录","activity.waitingModel":"等待模型响应","activity.syncing":"正在同步","activity.connectionUnavailable":"连接不可用","activity.lastKnown":"最后已知","activity.lastKnownSuffix":" · 最后已知","activity.staleSummary":"{phase} · 最后已知: {text}","activity.count.active":"活动中","activity.count.failed":"失败","activity.count.cancelled":"取消","activity.count.unknown":"未知","activity.title":"活动","activity.titleOne":"1 个操作","activity.titleWithCount":"{count} 个操作","activity.resyncing":"正在恢复同步 · 最后已知状态","activity.connectionLastKnown":"连接不可用 · 最后已知状态","activity.generating":"正在生成回复;尚无新的工具执行证据","activity.runCommand":"执行命令","activity.updatePlan":"更新计划","activity.planComplete":"项完成(计划记录)","activity.callRequested":"已收到调用请求;尚无进程启动确认","activity.jobRegistered":"已登记,不代表完成或持续存活","activity.latestReport":"最新报告","activity.cwdRecorded":"执行记录目录","activity.cwdRequested":"请求目录","activity.cwdSessionDefault":"会话默认目录(非执行确认)","activity.callRecorded":"调用记录时间","activity.callWait":"调用等待耗时","activity.fullArgs":"完整参数(已脱敏)","activity.toolResult":"工具返回(已脱敏)","activity.emptyResult":"(空结果)"},$v={en:QS,zh:XS},FS={"bot.waiting":"Waiting","bot.running":"Running","bot.stopped":"Stopped","bot.stoppedBackground":"This turn stopped. Background work is still running.","bot.retry":"Retry","bot.thinking":"Thinking","bot.replying":"Replying","bot.processed":"Done","bot.untitled":"Untitled","inbox.received":"sent a message","inbox.open":"Open bot messages, {who}: {line}","inbox.lead":"These are the words bots sent each other. They do not include the other bot's persona, memory, or permissions.","inbox.empty":"No bot messages yet.","inbox.other":"another bot","inbox.sentTo":"Sent to {name}","inbox.hop":"Hop {hop}","inbox.source":"Source"},ZS={"bot.waiting":"等待操作","bot.running":"运行中","bot.stopped":"已停下","bot.stoppedBackground":"这一轮已经停下。后台还在跑。","bot.retry":"重试","bot.thinking":"正在想","bot.replying":"正在回复","bot.processed":"已处理","bot.untitled":"未命名","inbox.received":"发来一条消息","inbox.open":"打开 BOT 消息,{who}:{line}","inbox.lead":"这里是 BOT 之间传来的正文,不带对方的人格、记忆或权限。","inbox.empty":"还没有 BOT 消息。","inbox.other":"另一个 BOT","inbox.sentTo":"发给 {name}","inbox.hop":"第 {hop} 跳","inbox.source":"来源"},Pv={en:FS,zh:ZS},KS={"app.title":"DSH Bot","lang.switch":"中文","nav.back":"Back","nav.sessions":"Sessions","nav.botMessages":"Bot messages","nav.official":"Official client","nav.where":"Session location","nav.mainSession":"Main session","nav.worker":"Worker session","nav.pick":"Pick a session on the left, or create one.","nav.empty":"This session has no messages yet.","load.messages":"Loading messages…","load.messagesPct":"Loading messages… {pct}%","load.aria":"Loading messages","file.close":"Close","file.loading":"Reading the file…","file.error":"This file could not be opened","file.truncated":"Only the first 2000 lines are shown.","turn.rail":"Turns","turn.jump":"Jump to item {index}","basis.plain":"Ordinary session","basis.facts":"{head} · {count} facts","health.up":"Runtime is reachable","health.down":"Runtime is unreachable","health.modelReady":"The model catalog is available. You can send.","health.loading":"Reading the model catalog.","health.noProvider":"No model provider is configured, so execution is off.","health.catalogUnreadable":"The model catalog could not be read.","health.usageReady":"The usage endpoint returned data.","health.usageOff":"Usage is not connected.","health.sameSession":"The official client is at the site root. This page is /dsh-bot/. It is the same session.","health.primaryUnready":"This process has not issued a session cookie yet.","health.primaryDown":"The runtime could not be reached.","health.usageMissing":"The usage plugin is not installed.","health.usageUpstream":"The usage upstream is unavailable.","health.sessionUnreadable":"Could not tell whether the session is still running."},JS={"app.title":"DSH Bot","lang.switch":"English","nav.back":"返回","nav.sessions":"会话","nav.botMessages":"BOT 消息","nav.official":"原生界面","nav.where":"会话位置","nav.mainSession":"主会话","nav.worker":"执行会话","nav.pick":"从左边选一个会话,或新建一个。","nav.empty":"这个会话还没有消息。","load.messages":"正在加载消息…","load.messagesPct":"正在加载消息… {pct}%","load.aria":"正在加载消息","file.close":"关闭","file.loading":"正在读取文件…","file.error":"无法打开此文件","file.truncated":"只显示了前 2000 行。","turn.rail":"回合","turn.jump":"跳到第 {index} 处","basis.plain":"普通会话","basis.facts":"{head} · {count} 条事实","health.up":"主运行时可达","health.down":"主运行时不可达","health.modelReady":"模型目录可用,可以发送。","health.loading":"正在读取模型目录。","health.noProvider":"未配置模型提供方,执行已禁用","health.catalogUnreadable":"无法读取模型目录。","health.usageReady":"用量接口已返回数据。","health.usageOff":"用量未接入","health.sameSession":"原生界面在站点根路径,这里是 /dsh-bot/。同一个会话。","health.primaryUnready":"主运行时尚未交出启动令牌","health.primaryDown":"主运行时不可达","health.usageMissing":"用量插件未接入","health.usageUpstream":"用量上游不可用","health.sessionUnreadable":"无法读取会话是否仍在运行"},Wv={en:KS,zh:JS},$S={"composer.mention":"Mention a bot","composer.noBot":"No matching bot","composer.interrupt":"Sending interrupts this reply","composer.mentionHint":"Message, or type @ to mention another bot","composer.task":"Message, or describe a task","composer.pick":"Choose a session","composer.add":"Add a file or a command","composer.command":"Insert a command","composer.filesLater":"Attaching files is not available yet.","composer.cancel":"Cancel","composer.send":"Send","composer.notSent":"The task was not sent.","composer.supplyFailed":"Not sent."},PS={"composer.mention":"提及 BOT","composer.noBot":"没有匹配的 BOT","composer.interrupt":"发送会打断这一句","composer.mentionHint":"发消息,输入 @ 提及另一个 BOT","composer.task":"发消息,或描述一个任务","composer.pick":"选择一个会话","composer.add":"添加文件或调用指令","composer.command":"调用指令","composer.filesLater":"附带文件还不可用。","composer.cancel":"取消","composer.send":"发送","composer.notSent":"任务没有发送。","composer.supplyFailed":"没有送出。"},eb={en:$S,zh:PS},WS={"new.title":"New bot","new.close":"Close","new.lead":"The name shows in the list and is the bot's own name. Style and task become its persona.","new.name":"Bot name","new.style":"Bot style","new.task":"Bot task","new.namePlaceholder":"for example: Guide","new.stylePlaceholder":"for example: brief and direct","new.taskPlaceholder":"for example: turn the user's notes into short sentences","new.cancel":"Cancel","new.create":"Create","new.creating":"Creating","new.nameRequired":"Write this bot's name first.","new.created":'Created "{name}".',"new.createFailed":"Could not create the session.","new.personaFailed":"The session was created, but the persona was not applied.","session.search":"Search sessions","session.searchPlaceholder":"Search sessions","session.none":"No sessions yet.","session.noMatch":"No matching sessions.","session.running":"In progress","session.blank":"Blank","session.archived":"Archived","session.hide":"Hide","session.show":"Show","session.blankCount":"Blank sessions · {count}","session.archiveAll":"Archive all","session.purgeAll":"Delete all","session.archive":"Archive","session.purge":"Delete","session.archiveLabel":"Archive blank session {name}","session.purgeLabel":"Delete blank session {name}","session.archiveConfirm":"Archive {count} blank sessions? Sessions that already have messages stay. You can restore archived sessions from the official client.","session.purgeOneConfirm":'Delete "{name}" permanently? The log is removed from disk and cannot be restored from the archive.',"session.purgeAllConfirm":"Permanently delete {count} blank sessions? Logs are removed from disk and cannot be restored. Sessions that already have messages stay.","session.notBlankArchive":"This session already has content, so it cannot be removed as a blank session.","session.archiveFailed":"Could not remove this blank session.","session.archiveSomeFailed":"Some blank sessions could not be removed.","session.purgeNotBlank":"Only a blank session can be deleted permanently.","session.purgeFailed":"Could not delete this session permanently.","session.purgeSomeFailed":"Some blank sessions could not be deleted permanently.","session.listUnavailable":"The session list is unavailable.","session.unnamed":"New session","session.blankName":"Blank session","local.mark":"Me","local.here":"This machine","local.down":"Runtime unreachable"},ew={"new.title":"新建 BOT","new.close":"关闭","new.lead":"名字会显示在左侧列表里,也是这个 bot 自己的名字。风格和任务写进它的人格。","new.name":"Bot 名字","new.style":"Bot 风格","new.task":"Bot 任务","new.namePlaceholder":"例如:狗子","new.stylePlaceholder":"例如:幽默风趣","new.taskPlaceholder":"例如:把用户的话写成短句","new.cancel":"取消","new.create":"创建","new.creating":"正在创建","new.nameRequired":"先写上这个 bot 的名字。","new.created":"已创建「{name}」。","new.createFailed":"未能创建会话","new.personaFailed":"会话已创建,人格没有套上。","session.search":"搜索会话","session.searchPlaceholder":"搜索会话","session.none":"还没有会话。","session.noMatch":"没有匹配的会话。","session.running":"进行中","session.blank":"空白","session.archived":"已归档","session.hide":"收起","session.show":"展开","session.blankCount":"空白会话 · {count}","session.archiveAll":"全部归档","session.purgeAll":"全部彻底删除","session.archive":"归档","session.purge":"彻底删除","session.archiveLabel":"归档空白会话 {name}","session.purgeLabel":"彻底删除空白会话 {name}","session.archiveConfirm":"归档 {count} 个空白会话?已经有消息的会话会保留。归档后可以在原生界面的已归档列表里恢复。","session.purgeOneConfirm":"彻底删除「{name}」?日志会从磁盘去掉,不能从已归档列表恢复。","session.purgeAllConfirm":"彻底删除 {count} 个空白会话?日志会从磁盘去掉,不能恢复。已经有消息的会话会保留。","session.notBlankArchive":"这个会话已经有内容,不能当作空白会话删除。","session.archiveFailed":"没能删除这个空白会话。","session.archiveSomeFailed":"有的空白会话没能删除。","session.purgeNotBlank":"只有空白会话可以彻底删除。","session.purgeFailed":"没能彻底删除这个会话。","session.purgeSomeFailed":"有的空白会话没能彻底删除。","session.listUnavailable":"会话列表不可用","session.unnamed":"新会话","session.blankName":"空白会话","local.mark":"本","local.here":"本机","local.down":"主运行时不可达"},tb={en:WS,zh:ew},tw={"question.waiting":"Waiting for your answer","question.aborted":"This question was cancelled before you answered.","question.failed":"This question could not be completed.","question.skipped":"Skipped","question.answered":"Answered","question.multiSelect":"You can choose more than one option.","question.custom":"Other: {text}","question.customLabel":"Other","question.customPlaceholder":"Type a custom answer","question.skip":"Skip","question.submit":"Submit answers","question.submitting":"Submitting…","question.submitFailed":"The answer could not be submitted.","question.incomplete":"Answer or skip each question before submitting.","question.recommended":"Recommended","question.remaining":"{time} remaining","question.waitingNoTimer":"Waiting, no timer","question.takeTime":"Need more time","question.continued":"You can still answer","question.planTitle":"Plan review","question.viewFull":"View full plan","question.hidePlan":"Hide full plan","question.requestChanges":"Request changes","question.approvePlan":"Approve","question.changeComments":"What should change?","question.changePlaceholder":"Describe the changes you want","question.changesNeeded":"Please describe the changes you want.","question.allow":"Allow","question.reject":"Reject","question.alwaysAllow":"Always allow","question.approvalAnswered":"Decision recorded"},nw={"question.waiting":"等待你的回答","question.aborted":"这个问题在回答前被取消了。","question.failed":"这个问题未能完成。","question.skipped":"已跳过","question.answered":"已回答","question.multiSelect":"可以选择多个选项。","question.custom":"其他:{text}","question.customLabel":"其他","question.customPlaceholder":"输入自定义回答","question.skip":"跳过","question.submit":"提交回答","question.submitting":"正在提交…","question.submitFailed":"回答未能提交。","question.incomplete":"请先回答或跳过每一项再提交。","question.recommended":"推荐","question.remaining":"剩余 {time}","question.waitingNoTimer":"等待中,无计时","question.takeTime":"再等一等","question.continued":"现在仍可以回答","question.planTitle":"计划审阅","question.viewFull":"查看完整计划","question.hidePlan":"收起完整计划","question.requestChanges":"请求修改","question.approvePlan":"批准","question.changeComments":"需要怎样修改?","question.changePlaceholder":"描述你希望改动的地方","question.changesNeeded":"请先描述你希望改动的地方。","question.allow":"允许","question.reject":"拒绝","question.alwaysAllow":"始终允许","question.approvalAnswered":"已记录决定"},nb={en:tw,zh:nw},iw={"approval.title":"Tool approval","approval.allowOnce":"Allow once","approval.reject":"Reject","approval.waiting":"Waiting for your answer","approval.allowed":"Allowed once","approval.rejected":"Rejected","approval.cancelled":"This request was cancelled.","approval.failed":"This request could not be completed.","approval.submitFailed":"The decision could not be submitted."},lw={"approval.title":"工具许可","approval.allowOnce":"允许一次","approval.reject":"拒绝","approval.waiting":"等待你的回答","approval.allowed":"已允许一次","approval.rejected":"已拒绝","approval.cancelled":"这个请求已被取消。","approval.failed":"这个请求未能完成。","approval.submitFailed":"决定未能提交。"},ib={en:iw,zh:lw},aw={"permission.title":"Permissions","permission.open":"Session permissions","permission.current":"Current preset","permission.confirmTitle":"Confirm this permission","permission.confirmFull":"Give this session full access?","permission.confirmAuto":"Turn on Auto for this session?","permission.confirm":"Confirm","permission.cancel":"Cancel","permission.unavailable":"Official permission presets are not available on this host.","permission.failed":"The permission could not be changed.","permission.close":"Close","permission.preset.readOnly":"Read Only","permission.preset.workspaceWrite":"Workspace Write","permission.preset.fullAccess":"Full access","permission.preset.auto":"Auto review"},rw={"permission.title":"权限","permission.open":"会话权限","permission.current":"当前预设","permission.confirmTitle":"确认此项权限","permission.confirmFull":"为此会话开启完全访问?","permission.confirmAuto":"为此会话开启自动审阅?","permission.confirm":"确认","permission.cancel":"取消","permission.unavailable":"此主机未提供官方权限预设。","permission.failed":"权限未能更改。","permission.close":"关闭","permission.preset.readOnly":"只读","permission.preset.workspaceWrite":"工作区可写","permission.preset.fullAccess":"完全访问","permission.preset.auto":"自动审阅"},lb={en:aw,zh:rw},sw={"auth.title":"Authorization","auth.open":"Credentials","auth.empty":"No authorization flows are available.","auth.start":"Start","auth.writeVault":"Write to vault","auth.cancel":"Cancel","auth.secretMask":"••••••••","auth.unavailable":"Official authorization is not available on this host.","auth.failed":"Authorization could not be completed.","auth.close":"Close"},uw={"auth.title":"授权","auth.open":"凭据","auth.empty":"当前没有可进行的授权流程。","auth.start":"开始","auth.writeVault":"写入保险库","auth.cancel":"取消","auth.secretMask":"••••••••","auth.unavailable":"此主机未提供官方授权。","auth.failed":"授权未能完成。","auth.close":"关闭"},ab={en:sw,zh:uw},ow={"cua.title":"Computer Use permissions","cua.open":"Computer Use","cua.system":"System permissions","cua.accessibility":"Accessibility","cua.screenRecording":"Screen recording","cua.granted":"Granted","cua.missing":"Not granted","cua.request":"Request","cua.openSettings":"Open system settings","cua.grants":"Always-allow list","cua.blocked":"Refused applications","cua.revoke":"Revoke","cua.askAgain":"Ask again","cua.emptyGrants":"No saved application grants.","cua.emptyBlocked":"No refused applications.","cua.failed":"Computer Use permissions could not be updated.","cua.close":"Close"},cw={"cua.title":"计算机使用权限","cua.open":"计算机使用","cua.system":"系统权限","cua.accessibility":"辅助功能","cua.screenRecording":"屏幕录制","cua.granted":"已授予","cua.missing":"未授予","cua.request":"请求","cua.openSettings":"打开系统设置","cua.grants":"始终允许列表","cua.blocked":"已拒绝的应用","cua.revoke":"撤销","cua.askAgain":"再次询问","cua.emptyGrants":"没有已保存的应用授权。","cua.emptyBlocked":"没有已拒绝的应用。","cua.failed":"计算机使用权限未能更新。","cua.close":"关闭"},rb={en:ow,zh:cw},fw={"work.status.accepted":"Accepted","work.status.enqueued":"Enqueued","work.status.started":"Started","work.status.waitingBudget":"Waiting for budget","work.fact.waitingBudget":"Worker admission is paused pending a sufficient budget grant. Waiting time does not consume runtime.","work.status.needs_user":"Needs you","work.status.ready":"Candidate","work.status.delivered":"Delivered","work.status.cancelled":"Cancelled","work.status.failed":"Failed","work.ticket":"Ticket","work.preview.startedMany":"Started · {count}","work.placeholder.many":"Background work is running. You can say something else.","work.placeholder.started":"Background work has started. You can say something else.","work.placeholder.needsUser":"This box is still an ordinary message. Answer the ticket on the card above.","work.placeholder.ready":"Send a message. The result becomes delivered only after the assistant writes it into the chat.","work.placeholder.failed":"This ticket has failed. You can say something else.","work.fact.revision":"Generation {revision}","work.fact.accepted":"The ticket is recorded and is not on the execution queue yet.","work.fact.enqueued":"It is on the execution queue. The worker has not seen the task yet.","work.fact.elapsed":"Elapsed {time}","work.fact.wall":"Background limit is 10 minutes.","work.fact.needsUser":"This round has ended.","work.fact.ready":"This is not the reply in the chat yet.","work.fact.delivered":"The text is in the assistant reply.","work.fact.failed":"This ticket has failed.","work.fact.sameWorker":"It is still the same worker session.","work.fact.restart":"It returns to started after the worker sees the task again.","work.budgetFallback":"This one was not accepted. Unfinished tickets already hit the host concurrency limit.","work.openWorker":"Open the worker session","work.questionEmpty":"The worker asked a question.","work.questionStale":"The previous question is void.","work.answerLabel":"Reply to this ticket","work.answerSubmit":"Reply to this ticket","work.cancelTitle":"Cancellation note","work.taskTitle":"Task","work.generation":"Generation {revision}","work.duration":"Duration {value}","work.material":"Material {hash}","work.minutes":"{count} min","work.seconds":"{count} s","work.milliseconds":"{count} ms"},dw={"work.status.accepted":"已受理","work.status.enqueued":"已派工","work.status.started":"已开始","work.status.waitingBudget":"等待预算","work.fact.waitingBudget":"Worker 已暂停下一步,等待足够的新预算;等待时间不计入运行时长。","work.status.needs_user":"需要用户","work.status.ready":"候选","work.status.delivered":"已交付","work.status.cancelled":"已取消","work.status.failed":"失败","work.ticket":"工单","work.preview.startedMany":"已开始 · {count} 张","work.placeholder.many":"后台都在跑,可以直接说别的","work.placeholder.started":"后台已开始,可以直接说别的","work.placeholder.needsUser":"这里仍是普通消息。回答工单用上面的卡片","work.placeholder.ready":"发消息。结果要由助手写进对话,才会变成已交付","work.placeholder.failed":"这张工单已经失败,可以直接说别的","work.fact.revision":"第 {revision} 代","work.fact.accepted":"工单已记下,还没进入执行队列","work.fact.enqueued":"已进入执行队列,执行会话还没有看到任务","work.fact.elapsed":"已进行 {time}","work.fact.wall":"后台上限 10 分钟","work.fact.needsUser":"这一轮已经结束","work.fact.ready":"这还不是对话里的答复","work.fact.delivered":"正文在对话里的助手回复中","work.fact.failed":"这张工单已经失败","work.fact.sameWorker":"还是原来的执行会话","work.fact.restart":"执行会话再次看到任务后,才会回到已开始","work.budgetFallback":"这张没有接住。未结束工单已经达到宿主并发上限。","work.openWorker":"打开执行会话","work.questionEmpty":"执行会话问了一个问题。","work.questionStale":"上一问已作废","work.answerLabel":"对这张工单的回答","work.answerSubmit":"回复这张工单","work.cancelTitle":"取消说明","work.taskTitle":"执行任务","work.generation":"第 {revision} 代","work.duration":"时长 {value}","work.material":"材料 {hash}","work.minutes":"{count} 分钟","work.seconds":"{count} 秒","work.milliseconds":"{count} 毫秒"},sb={en:fw,zh:dw},ub={en:{"image.untitled":"Image","image.open":"Preview image: {name}","image.enlarge":"Click to enlarge","image.fit":"Fit to screen","image.original":"Original size","image.close":"Close image preview","image.scroll":"Original image. Scroll to inspect details.","image.openLink":"Open image link","image.unavailable":"Image unavailable; the file may have been removed.","image.retry":"Retry image"},zh:{"image.untitled":"图片","image.open":"预览图片:{name}","image.enlarge":"点击放大","image.fit":"适应屏幕","image.original":"原始大小","image.close":"关闭图片预览","image.scroll":"原始图片,可滚动查看细节。","image.openLink":"打开图片链接","image.unavailable":"图片不可用,文件可能已被清理。","image.retry":"重试图片"}},hw={...tb.en,...Wv.en,...eb.en,...Pv.en,...sb.en,...$v.en,...nb.en,...ib.en,...lb.en,...ab.en,...rb.en,...ub.en},pw={...tb.zh,...Wv.zh,...eb.zh,...Pv.zh,...sb.zh,...$v.zh,...nb.zh,...ib.zh,...lb.zh,...ab.zh,...rb.zh,...ub.zh},Dy={en:hw,zh:pw},ob="dsh-bot.locale";function mw(){try{const n=localStorage.getItem(ob);if(n==="en"||n==="zh")return n}catch{}return"en"}function gw(n){try{localStorage.setItem(ob,n)}catch{}typeof document<"u"&&(document.documentElement.lang=n==="zh"?"zh-CN":"en")}function cb(n,l,a){const r=Dy[n][l]??Dy.en[l];return a?r.replace(/\{(\w+)\}/g,(u,o)=>a[o]??""):r}function Si(n,l){return cb("en",n,l)}const yw={loading:"health.loading",no_provider:"health.noProvider",catalog_unreadable:"health.catalogUnreadable",primary_unready:"health.primaryUnready",primary_down:"health.primaryDown",usage_not_installed:"health.usageMissing",usage_unconfigured:"health.usageUpstream",session_unreadable:"health.sessionUnreadable"};function vw(n,l,a=Si){const r=yw[n];return r?a(r):l}const fb=L.createContext({locale:"en",setLocale:()=>{},t:Si});function bw({children:n}){const[l,a]=L.useState(()=>mw()),r=L.useCallback(f=>{gw(f),a(f)},[]),u=L.useCallback((f,h)=>cb(l,f,h),[l]),o=L.useMemo(()=>({locale:l,setLocale:r,t:u}),[l,r,u]);return b.jsx(fb.Provider,{value:o,children:n})}function Ye(){return L.useContext(fb)}const xw={accepted:"work.status.accepted",enqueued:"work.status.enqueued",started:"work.status.started",waiting_budget:"work.status.waitingBudget",needs_user:"work.status.needs_user",ready:"work.status.ready",delivered:"work.status.delivered",cancelled:"work.status.cancelled",failed:"work.status.failed"},Sw=new Set(["delivered","cancelled"]),ww=new Set(["accepted","enqueued","started","needs_user","waiting_budget"]);function db(n,l=Si){const a=xw[n];return a?l(a):n}function hb(n){return n.replace(/^\uFEFF/,"").trimStart().startsWith("[foundations:ticket]")}function eh(n){const l=n.replace(/^\uFEFF/,"").replace(/\r\n/g,`
13
- `).trimStart();if(!l.startsWith("[foundations:briefing]"))return null;const a=l.slice(22).replace(/^\n/,""),r=a.indexOf(`
14
- ---
15
- `);if(r<0)return null;const u=[],o={};for(const g of a.slice(0,r).split(`
16
- `)){const y=/^(briefing_revision|budget_wall_ms|budget_max_tokens|material_sha256):\s*(.*)$/.exec(g);y?.[1]?o[y[1]]=(y[2]??"").trim():g.trim()!==""&&u.push(g.trim())}const f=Number(o.briefing_revision),h=Number(o.budget_wall_ms),p=Number(o.budget_max_tokens);return{revision:Number.isFinite(f)&&f>0?f:1,wallMs:Number.isFinite(h)&&h>0?h:null,maxTokens:Number.isFinite(p)&&p>0?p:null,material:o.material_sha256??"",notes:u,body:a.slice(r+5).trim(),cancel:u.some(g=>g.startsWith("This is a cancellation note")||g.startsWith("这是取消说明"))}}function na(n){return n.startsWith("worker-")&&n.length>7}function kw(n){return na(n)?n.slice(7):""}function Ew(n){const l=n.signals;if(!l||typeof l!="object"||Array.isArray(l))return{};const a={};for(const[r,u]of Object.entries(l))a[r]=Array.isArray(u)?u.filter(o=>typeof o=="string"):[];return a}function Tw(n){const l=n.cards;if(!l||typeof l!="object"||Array.isArray(l))return{};const a={};for(const[r,u]of Object.entries(l))a[r]=Cw({cards:u});return a}function Aw(n){const l=n.work&&typeof n.work=="object"&&!Array.isArray(n.work)?n.work:n;return!("signals"in l)&&!("cards"in l)?null:{signals:Ew(l),cards:Tw(l)}}function Cw(n){return Array.isArray(n.cards)?n.cards.flatMap(l=>{if(!l||typeof l!="object")return[];const a=l,r=typeof a.summary=="string"?a.summary:"",u=Nw(a,r);return u?[u]:[]}):[]}function Nw(n,l="",a=Si){const r=n.ticket;if(!r||typeof r!="object")return null;const u=r;if(typeof u.id!="string"||typeof u.status!="string")return null;const o=Array.isArray(n.attempts)?n.attempts:[],f=typeof u.active_attempt_id=="string"?u.active_attempt_id:"",h=o.find(S=>S&&typeof S=="object"&&S.id===f),p=Array.isArray(n.events)?n.events.flatMap(Lw):[],g=typeof u.child_session_id=="string"?u.child_session_id:"";let y=u.waiting_budget===!0;if(typeof u.budget_json=="string")try{y||=JSON.parse(u.budget_json).quota?.waiting===!0}catch{}const m=l.trim()||a("work.ticket");return{id:u.id,status:y&&["started","enqueued"].includes(u.status)?"waiting_budget":u.status,revision:typeof u.briefing_revision=="number"?u.briefing_revision:1,summary:m,childSessionId:g.startsWith("worker-")?g:null,startedAt:typeof h?.started_at=="string"?h.started_at:null,events:p}}function pb(n){const l=n.filter(r=>!Sw.has(r.status)),a=n.find(r=>r.status==="delivered");return a?[...l,a]:l}function mb(n){return n.some(l=>ww.has(l.status))}function Ly(n,l,a=!1){return a?!1:n&&!mb(l)}const jw=new Set(["accepted","enqueued","started"]);function Ow(n,l=!1){if(l)return"run";let a=!1,r=!1;for(const u of n)u.status==="delivered"||u.status==="cancelled"||(u.status==="needs_user"||u.status==="waiting_budget"?a=!0:jw.has(u.status)&&(r=!0));return a?"wait":r?"run":null}function cd(n,l=Date.now(),a=Si){const r=n.filter(f=>f.status==="started");if(r.length>1)return a("work.preview.startedMany",{count:String(r.length)});const u=vb(n);if(!u||u.status==="ready")return"";const o=db(u.status,a);if(u.status==="started"){const f=yb(u.startedAt,l);return f?`${o} · ${f}`:o}return o}function _w(n,l=Si){if(n.filter(u=>u.status==="started").length>1)return l("work.placeholder.many");const r=vb(n);return r?r.status==="started"?l("work.placeholder.started"):r.status==="waiting_budget"?l("work.fact.waitingBudget"):r.status==="needs_user"?l("work.placeholder.needsUser"):r.status==="ready"?l("work.placeholder.ready"):r.status==="failed"?l("work.placeholder.failed"):null:null}function zw(n,l,a=Si){const r=[a("work.fact.revision",{revision:String(n.revision)})];if(n.status==="accepted"&&r.push(a("work.fact.accepted")),n.status==="enqueued"&&r.push(a("work.fact.enqueued")),n.status==="started"){const o=yb(n.startedAt,l);o&&r.push(a("work.fact.elapsed",{time:o})),r.push(a("work.fact.wall"))}n.status==="waiting_budget"&&r.push(a("work.fact.waitingBudget")),n.status==="needs_user"&&r.push(a("work.fact.needsUser")),n.status==="ready"&&r.push(a("work.fact.ready")),n.status==="delivered"&&r.push(a("work.fact.delivered")),n.status==="failed"&&r.push(a("work.fact.failed")),n.revision>1&&(n.status==="enqueued"||n.status==="accepted")&&(r.push(a("work.fact.sameWorker")),r.push(a("work.fact.restart")));const u=Dw(n);return u&&r.push(u),r}function qw(n){const l=n.events.filter(a=>a.kind==="question"&&a.text.trim()!=="");if(n.status==="needs_user")return{text:l.filter(r=>r.revision===n.revision&&r.applyStatus!=="stale").at(-1)?.text??"",stale:!1};if(n.revision>1&&(n.status==="enqueued"||n.status==="accepted"||n.status==="started")){const a=[...l].reverse().find(r=>r.applyStatus==="stale");if(a)return{text:a.text,stale:!0}}return null}function gb(n){if(n.name!=="foundations_dispatch"||n.result.trim()==="")return null;const l=th(n.result);return l?l.ok===!1?null:typeof l.ticketId=="string"&&l.ticketId!==""?l.ticketId:null:/"ticketId"\s*:\s*"([^"]+)"/.exec(n.result)?.[1]??null}function Rw(n){if(n.name!=="foundations_dispatch"||n.result.trim()==="")return!1;const l=th(n.result);return l?l.ok===!1&&l.code==="BUDGET":n.result.includes('"BUDGET"')||/concurrency limit/i.test(n.result)}function Mw(n,l=Si){const a=th(n);return a&&typeof a.message=="string"&&a.message!==""?a.message:l("work.budgetFallback")}function yb(n,l){if(!n)return"";const a=Date.parse(n);if(!Number.isFinite(a))return"";const r=Math.max(0,Math.floor((l-a)/1e3)),u=Math.floor(r/60),o=r%60;return`${u}:${String(o).padStart(2,"0")}`}function vb(n){const l=pb(n),a=["waiting_budget","needs_user","started","enqueued","accepted","ready","failed"];for(const r of a){const u=l.find(o=>o.status===r);if(u)return u}return l[0]??null}function Dw(n){return n.events.filter(a=>a.kind==="progress"&&a.applyStatus==="applied"&&a.revision===n.revision&&a.text.trim()!=="").at(-1)?.text??""}function Lw(n){if(!n||typeof n!="object")return[];const l=n;return typeof l.event_id!="string"||typeof l.kind!="string"?[]:[{eventId:l.event_id,kind:l.kind,applyStatus:typeof l.apply_status=="string"?l.apply_status:"",revision:typeof l.briefing_revision=="number"?l.briefing_revision:0,text:typeof l.text=="string"?l.text:""}]}function th(n){try{const l=JSON.parse(n);return!l||typeof l!="object"||Array.isArray(l)?null:l}catch{return null}}var nh=Kv();function Bw({sessionId:n,path:l,line:a,onClose:r}){const[u,o]=L.useState({status:"loading",text:"",eof:!0}),{t:f}=Ye(),h=l.split("/").filter(Boolean).at(-1)??l,p=Hw(h);return L.useEffect(()=>{const g=document.body.style.overflow;document.body.style.overflow="hidden";const y=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",y),()=>{document.body.style.overflow=g,document.removeEventListener("keydown",y)}},[r]),L.useEffect(()=>{const g=new AbortController;o({status:"loading",text:"",eof:!0});const y=`/file?sessionId=${encodeURIComponent(n)}&path=${encodeURIComponent(l)}`;return ct(y,{signal:g.signal}).then(m=>{if(g.signal.aborted)return;const S=typeof m.body.text=="string"?m.body.text:"";if(m.status!==200){o({status:"error",text:"",eof:!0});return}o({status:"ready",text:S,eof:m.body.eof!==!1})}).catch(()=>{g.signal.aborted||o({status:"error",text:"",eof:!0})}),()=>g.abort()},[n,l]),nh.createPortal(b.jsxs("div",{className:"file-modal",role:"presentation",children:[b.jsx("div",{className:"file-modal-mask",onClick:r}),b.jsxs("div",{className:"file-modal-card",role:"dialog","aria-modal":"true","aria-label":h,tabIndex:-1,children:[b.jsxs("header",{className:"file-modal-head",children:[b.jsxs("div",{className:"file-modal-title",children:[b.jsx("strong",{children:h}),l!==h?b.jsx("span",{children:l}):null]}),b.jsx("button",{type:"button",className:"file-modal-close","aria-label":f("file.close"),onClick:r,children:b.jsx(Iw,{})})]}),b.jsx(Uw,{state:u,language:p,line:a})]})]}),document.body)}function Uw({state:n,language:l,line:a}){const{t:r}=Ye(),[u,o]=L.useState(!1);if(n.status==="loading")return b.jsx("p",{className:"file-modal-status",children:r("file.loading")});if(n.status==="error")return b.jsx("p",{className:"file-modal-status",children:r("file.error")});const f=n.text===""?[]:n.text.split(`
17
- `);return b.jsxs("div",{className:"file-preview","data-code-preview":"",children:[b.jsxs("div",{className:"file-preview-banner",children:[b.jsx("span",{className:"file-preview-lang",children:l||"Code"}),b.jsx("button",{type:"button",className:"diff-copy","aria-label":u?"Copied":"Copy",onClick:()=>{navigator.clipboard.writeText(n.text).then(()=>{o(!0),window.setTimeout(()=>o(!1),1e3)})},children:u?b.jsx(Yw,{}):b.jsx(Vw,{})})]}),b.jsx("div",{className:"file-preview-scroll",children:b.jsx("pre",{children:b.jsx("code",{style:{"--line-width":`${Math.max(2,String(f.length).length)}ch`},children:f.map((h,p)=>b.jsx("span",{className:a===p+1?"source-line current":"source-line",children:h},p))})})}),n.eof?null:b.jsx("p",{className:"file-modal-note",children:r("file.truncated")})]})}function Hw(n){const l=n.split(".").pop()?.toLowerCase()??"";return{py:"python",ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",md:"markdown",css:"css",html:"html",json:"json",sh:"bash",yml:"yaml",yaml:"yaml",go:"go",rs:"rust",rb:"ruby",c:"c"}[l]??""}function Iw(){return b.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:b.jsx("path",{d:"M4.2 4.2L11.8 11.8M11.8 4.2L4.2 11.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function Vw(){return b.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[b.jsx("rect",{x:"5.2",y:"5.2",width:"7.2",height:"7.6",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),b.jsx("path",{d:"M10.2 5.2V3.8A1.3 1.3 0 0 0 8.9 2.5H3.8A1.3 1.3 0 0 0 2.5 3.8v5.1A1.3 1.3 0 0 0 3.8 10.2H5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})]})}function Yw(){return b.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:b.jsx("path",{d:"M3.5 8.2L6.4 11.1L12.5 4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Gw({onClose:n,onCreated:l}){const[a,r]=L.useState(""),[u,o]=L.useState(""),[f,h]=L.useState(""),[p,g]=L.useState(!1),[y,m]=L.useState(""),{locale:S,setLocale:x,t:k}=Ye();function T(E){r(E)}async function A(){if(p)return;const E=a.trim();if(E===""){m(k("new.nameRequired"));return}g(!0),m("");const M=await ct("/sessions",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({name:E})}),H=typeof M.body.sessionId=="string"?M.body.sessionId:"";if(!H){const Q=M.body.upstream;m(Q?.message||String(M.body.error||k("new.createFailed"))),g(!1);return}const $=YS(E,u,f),te=await cs("/dsh-bot/api/sessions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:H,personaText:$,idempotencyKey:crypto.randomUUID()})}),O=te.body.ok===!0?k("new.created",{name:E}):Jv(te.body,k("new.personaFailed"));l(H,O,E)}return b.jsx("div",{className:"setup-mask",role:"presentation",onMouseDown:n,children:b.jsxs("form",{className:"setup-card",role:"dialog","aria-labelledby":"new-session-title",onMouseDown:E=>E.stopPropagation(),onSubmit:E=>{E.preventDefault(),A()},children:[b.jsxs("div",{className:"setup-head",children:[b.jsx("h2",{id:"new-session-title",children:k("new.title")}),b.jsx("button",{type:"button",className:"setup-close","aria-label":k("new.close"),onClick:n,children:"×"})]}),b.jsx("p",{className:"setup-lead",children:k("new.lead")}),b.jsx("label",{htmlFor:"setup-name",children:k("new.name")}),b.jsx("input",{id:"setup-name",value:a,placeholder:k("new.namePlaceholder"),onChange:E=>T(E.target.value)}),b.jsx("label",{htmlFor:"setup-style",children:k("new.style")}),b.jsx("input",{id:"setup-style",value:u,placeholder:k("new.stylePlaceholder"),onChange:E=>o(E.target.value)}),b.jsx("label",{htmlFor:"setup-task",children:k("new.task")}),b.jsx("textarea",{id:"setup-task",rows:3,value:f,placeholder:k("new.taskPlaceholder"),onChange:E=>h(E.target.value)}),y?b.jsx("p",{className:"setup-error",children:y}):null,b.jsxs("div",{className:"setup-actions",children:[b.jsx("button",{type:"button",onClick:()=>x(S==="en"?"zh":"en"),children:k("lang.switch")}),b.jsx("button",{type:"button",onClick:n,children:k("new.cancel")}),b.jsx("button",{type:"submit",className:"primary",disabled:p||a.trim()==="",children:k(p?"new.creating":"new.create")})]})]})})}function Qw(n,l){const{t:a}=Ye(),[r,u]=L.useState("");return L.useEffect(()=>{if(n===""){u("");return}let o=!1;return(async()=>{const f=await cs(`/dsh-bot/api/status?sessionId=${encodeURIComponent(n)}`),h=await cs(`/dsh-bot/api/memory?sessionId=${encodeURIComponent(n)}`);if(o||f.body.ok!==!0)return;const p=f.body.binding;if((p&&typeof p=="object"?p.kind:f.body.kind)!=="bot"){u(a("basis.plain"));return}const y=typeof f.body.personaText=="string"?f.body.personaText.trim():"",m=GS(y),S=[m.name,m.style,m.task].filter(T=>T!=="").join(" · "),k=(Array.isArray(h.body.facts)?h.body.facts:[]).filter(T=>T&&typeof T=="object"&&T.status==="active").length;u(k>0?a("basis.facts",{head:S||"BOT",count:String(k)}):S||"BOT")})(),()=>{o=!0}},[n,l,a]),r}function wo(n){const l=n.replace(/\r\n/g,`
18
- `);if(!l.startsWith("[foundations:message]"))return null;const a=l.slice(21).replace(/^\n/,""),r=a.indexOf(`
19
- ---
20
- `);if(r<0)return null;const u={},o=[];for(const f of a.slice(0,r).split(`
21
- `)){const h=/^(id|from|correlation|causation|hop):\s*(.*)$/.exec(f);h?.[1]?u[h[1]]=(h[2]??"").trim():f.trim()!==""&&o.push(f.trim())}return u.from?{id:u.id??"",from:u.from,correlation:u.correlation??"",causation:u.causation??"",hop:u.hop??"",note:o.join(" "),body:a.slice(r+5).trim()}:null}function bb(n,l){return l!==""&&l!==n?l:n.startsWith("session-")&&n.length>18?`${n.slice(0,12)}…${n.slice(-4)}`:n}const Xw=new Set(["foundations_send","foundations_reply"]);function xb(n){const l=[];for(const a of n){if(a.kind==="user"){const u=wo(a.text);if(!u)continue;l.push({kind:"in",id:a.id,seq:a.seq,time:a.time,mail:u});continue}if(a.kind!=="tool"||!Xw.has(a.name))continue;const r=Jw(a);r&&l.push(r)}return l.sort((a,r)=>a.seq-r.seq||(a.kind===r.kind?0:a.kind==="in"?-1:1)),l}function Fw(n){const l=xb(n);if(!l.some(u=>u.kind==="in"))return n.slice();const r=new Set(l.filter(u=>u.kind==="out").map(u=>u.id));return n.filter(u=>!r.has(u.id))}function Zw(n,l){const a=n.filter(o=>o.kind==="in"),r=a.at(-1);if(!r)return null;const u=r.mail.body.replace(/\s+/g," ").trim();return{who:l(r.mail.from)||"BOT",preview:u.length>72?`${u.slice(0,71)}…`:u,count:a.length}}function Kw(n,l){if(n.target)return n.target;if(!n.correlation)return"";for(let a=l.length-1;a>=0;a-=1){const r=l[a];if(!(!r||r.seq>n.seq)&&r.kind==="in"&&r.mail.correlation===n.correlation)return r.mail.from}return""}function Jw(n){let l;try{const r=JSON.parse(n.args);if(!r||typeof r!="object"||Array.isArray(r))return null;l=r}catch{return null}const a=typeof l.text=="string"?l.text.trim():"";return a?{kind:"out",id:n.id,seq:n.seq,text:a,target:typeof l.targetSessionId=="string"?l.targetSessionId:"",correlation:typeof l.correlationId=="string"?l.correlationId:""}:null}function $w(n,l){const a={};return(n[n.length-1]===""?[...n,""]:n).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const Pw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ww=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ek={};function By(n,l){return(ek.jsx?Ww:Pw).test(n)}const tk=/[ \t\n\f\r]/g;function nk(n){return typeof n=="object"?n.type==="text"?Uy(n.value):!1:Uy(n)}function Uy(n){return n.replace(tk,"")===""}class gs{constructor(l,a,r){this.normal=a,this.property=l,r&&(this.space=r)}}gs.prototype.normal={};gs.prototype.property={};gs.prototype.space=void 0;function Sb(n,l){const a={},r={};for(const u of n)Object.assign(a,u.property),Object.assign(r,u.normal);return new gs(a,r,l)}function Rd(n){return n.toLowerCase()}class Tn{constructor(l,a){this.attribute=a,this.property=l}}Tn.prototype.attribute="";Tn.prototype.booleanish=!1;Tn.prototype.boolean=!1;Tn.prototype.commaOrSpaceSeparated=!1;Tn.prototype.commaSeparated=!1;Tn.prototype.defined=!1;Tn.prototype.mustUseProperty=!1;Tn.prototype.number=!1;Tn.prototype.overloadedBoolean=!1;Tn.prototype.property="";Tn.prototype.spaceSeparated=!1;Tn.prototype.space=void 0;let ik=0;const ze=sa(),Ut=sa(),Md=sa(),re=sa(),yt=sa(),aa=sa(),Ln=sa();function sa(){return 2**++ik}const Dd=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Ut,commaOrSpaceSeparated:Ln,commaSeparated:aa,number:re,overloadedBoolean:Md,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),fd=Object.keys(Dd);class ih extends Tn{constructor(l,a,r,u){let o=-1;if(super(l,a),Hy(this,"space",u),typeof r=="number")for(;++o<fd.length;){const f=fd[o];Hy(this,fd[o],(r&Dd[f])===Dd[f])}}}ih.prototype.defined=!0;function Hy(n,l,a){a&&(n[l]=a)}function er(n){const l={},a={};for(const[r,u]of Object.entries(n.properties)){const o=new ih(r,n.transform(n.attributes||{},r),u,n.space);n.mustUseProperty&&n.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),l[r]=o,a[Rd(r)]=r,a[Rd(o.attribute)]=r}return new gs(l,a,n.space)}const wb=er({properties:{ariaActiveDescendant:null,ariaAtomic:Ut,ariaAutoComplete:null,ariaBusy:Ut,ariaChecked:Ut,ariaColCount:re,ariaColIndex:re,ariaColSpan:re,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Ut,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Ut,ariaFlowTo:yt,ariaGrabbed:Ut,ariaHasPopup:null,ariaHidden:Ut,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:re,ariaLive:null,ariaModal:Ut,ariaMultiLine:Ut,ariaMultiSelectable:Ut,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:re,ariaPressed:Ut,ariaReadOnly:Ut,ariaRelevant:null,ariaRequired:Ut,ariaRoleDescription:yt,ariaRowCount:re,ariaRowIndex:re,ariaRowSpan:re,ariaSelected:Ut,ariaSetSize:re,ariaSort:null,ariaValueMax:re,ariaValueMin:re,ariaValueNow:re,ariaValueText:null,role:null},transform(n,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function kb(n,l){return l in n?n[l]:l}function Eb(n,l){return kb(n,l.toLowerCase())}const lk=er({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:aa,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alpha:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:yt,autoFocus:ze,autoPlay:ze,blocking:yt,capture:null,charSet:null,checked:ze,cite:null,className:yt,closedBy:null,colorSpace:null,cols:re,colSpan:re,command:null,commandFor:null,content:null,contentEditable:Ut,controls:ze,controlsList:yt,coords:re|aa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Md,draggable:Ut,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:yt,height:re,hidden:Md,high:re,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:yt,itemRef:yt,itemScope:ze,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:re,manifest:null,max:null,maxLength:re,media:null,method:null,min:null,minLength:re,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:re,pattern:null,ping:yt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:yt,required:ze,reversed:ze,rows:re,rowSpan:re,sandbox:yt,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootCustomElementRegistry:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shadowRootSerializable:ze,shape:null,size:re,sizes:null,slot:null,span:re,spellCheck:Ut,src:null,srcDoc:null,srcLang:null,srcSet:null,start:re,step:null,style:null,tabIndex:re,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Ut,width:re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:re,borderColor:null,bottomMargin:re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:re,leftMargin:re,link:null,longDesc:null,lowSrc:null,marginHeight:re,marginWidth:re,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:re,rules:null,scheme:null,scrolling:Ut,standby:null,summary:null,text:null,topMargin:re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:re,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ze,disablePictureInPicture:ze,disableRemotePlayback:ze,exportParts:aa,part:yt,prefix:null,property:null,results:re,security:null,unselectable:null},space:"html",transform:Eb}),ak=er({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ln,accentHeight:re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:re,amplitude:re,arabicForm:null,ascent:re,attributeName:null,attributeType:null,azimuth:re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:re,by:null,calcMode:null,capHeight:re,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:re,diffuseConstant:re,direction:null,display:null,dur:null,divisor:re,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:re,enableBackground:null,end:null,event:null,exponent:re,externalResourcesRequired:null,fill:null,fillOpacity:re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:aa,g2:aa,glyphName:aa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:re,horizOriginX:re,horizOriginY:re,id:null,ideographic:re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:re,k:re,k1:re,k2:re,k3:re,k4:re,kernelMatrix:Ln,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:re,overlineThickness:re,paintOrder:null,panose1:null,path:null,pathLength:re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:re,pointsAtY:re,pointsAtZ:re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ln,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ln,rev:Ln,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ln,requiredFeatures:Ln,requiredFonts:Ln,requiredFormats:Ln,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:re,specularExponent:re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:re,strikethroughThickness:re,string:null,stroke:null,strokeDashArray:Ln,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:re,strokeOpacity:re,strokeWidth:null,style:null,surfaceScale:re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ln,tabIndex:re,tableValues:null,target:null,targetX:re,targetY:re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ln,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:re,underlineThickness:re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:re,values:null,vAlphabetic:re,vMathematical:re,vectorEffect:null,vHanging:re,vIdeographic:re,version:null,vertAdvY:re,vertOriginX:re,vertOriginY:re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:kb}),Tb=er({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,l){return"xlink:"+l.slice(5).toLowerCase()}}),Ab=er({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Eb}),Cb=er({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,l){return"xml:"+l.slice(3).toLowerCase()}}),rk={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},sk=/[A-Z]/g,Iy=/-[a-z]/g,uk=/^data[-\w.:]+$/i;function ok(n,l){const a=Rd(l);let r=l,u=Tn;if(a in n.normal)return n.property[n.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&uk.test(l)){if(l.charAt(4)==="-"){const o=l.slice(5).replace(Iy,fk);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=l.slice(4);if(!Iy.test(o)){let f=o.replace(sk,ck);f.charAt(0)!=="-"&&(f="-"+f),l="data"+f}}u=ih}return new u(r,l)}function ck(n){return"-"+n.toLowerCase()}function fk(n){return n.charAt(1).toUpperCase()}const dk=Sb([wb,lk,Tb,Ab,Cb],"html"),lh=Sb([wb,ak,Tb,Ab,Cb],"svg");function hk(n){return n.join(" ").trim()}var Vy=/\/\*(?:[^*]|\*(?!\/))*\*\//g,pk=/\n/g,mk=/^\s*/,gk=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,yk=/^:\s*/,vk=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,bk=/^[;\s]*/,xk=`
22
- `,Yy="/",Gy="*",Wr="",Sk="comment",wk="declaration";function kk(n,l){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];l=l||{};var a=1,r=1;function u(k){var T=k.match(pk);T&&(a+=T.length);var A=k.lastIndexOf(xk);r=~A?k.length-A:r+k.length}function o(){var k={line:a,column:r};return function(T){return T.position=new f(k),g(),T}}function f(k){this.start=k,this.end={line:a,column:r},this.source=l.source}f.prototype.content=n;function h(k){var T=new Error(l.source+":"+a+":"+r+": "+k);if(T.reason=k,T.filename=l.source,T.line=a,T.column=r,T.source=n,!l.silent)throw T}function p(k){var T=k.exec(n);if(T){var A=T[0];return u(A),n=n.slice(A.length),T}}function g(){p(mk)}function y(k){for(var T;T=m();)k.push(T);return k}function m(){var k=o();if(!(Yy!=n.charAt(0)||Gy!=n.charAt(1))){for(var T=2;Wr!=n.charAt(T)&&(Gy!=n.charAt(T)||Yy!=n.charAt(T+1));)++T;if(T+=2,Wr===n.charAt(T-1))return h("End of comment missing");var A=n.slice(2,T-2);return r+=2,u(A),n=n.slice(T),r+=2,k({type:Sk,comment:A})}}function S(){var k=o(),T=p(gk);if(T){if(m(),!p(yk))return h("property missing ':'");var A=p(vk),E=k({type:wk,property:T[0].replace(Vy,Wr).trim(),value:A?A[0].replace(Vy,Wr).trim():Wr});return p(bk),E}}function x(){var k=[];y(k);for(var T;T=S();)k.push(T),y(k);return k}return g(),x()}function Ek(n,l){let a=null;if(!n||typeof n!="string")return a;const r=kk(n),u=typeof l=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:f,value:h}=o;u?l(f,h,o):h&&(a=a??{},a[f]=h)}),a}const Nb=jb("end"),ah=jb("start");function jb(n){return l;function l(a){const r=a&&a.position&&a.position[n]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Tk(n){const l=ah(n),a=Nb(n);if(l&&a)return{start:l,end:a}}function ls(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Qy(n.position):"start"in n||"end"in n?Qy(n):"line"in n||"column"in n?Ld(n):""}function Ld(n){return Xy(n&&n.line)+":"+Xy(n&&n.column)}function Qy(n){return Ld(n&&n.start)+"-"+Ld(n&&n.end)}function Xy(n){return n&&typeof n=="number"?n:1}class ko extends Error{constructor(l,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let u="",o={},f=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof l=="string"?u=l:!o.cause&&l&&(f=!0,u=l.message,o.cause=l),!o.ruleId&&!o.source&&typeof r=="string"){const p=r.indexOf(":");p===-1?o.ruleId=r:(o.source=r.slice(0,p),o.ruleId=r.slice(p+1))}if(!o.place&&o.ancestors){const p=o.ancestors[o.ancestors.length-1];p&&(o.place=p.position)}const h=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=h?h.line:void 0,this.name=ls(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=f&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(ko.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});const rh={}.hasOwnProperty,Ak=new Map,Ck=/[A-Z]/g,Nk=/-([a-z])/g,jk=new Set(["table","tbody","thead","tfoot","tr"]),Ok=new Set(["td","th"]),Ob="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _k(n,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=l.filePath||void 0;let r;if(l.development){if(typeof l.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Uk(a,l.jsxDEV)}else{if(typeof l.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof l.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Bk(a,l.jsx,l.jsxs)}const u={Fragment:l.Fragment,ancestors:[],components:l.components||{},create:r,elementAttributeNameCase:l.elementAttributeNameCase||"react",evaluater:l.createEvaluater?l.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?lh:dk,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},o=_b(u,n,void 0);return o&&typeof o!="string"?o:u.create(n,u.Fragment,{children:o||void 0},void 0)}function _b(n,l,a){if(l.type==="element")return zk(n,l,a);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return qk(n,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return Mk(n,l,a);if(l.type==="mdxjsEsm")return Rk(n,l);if(l.type==="root")return Dk(n,l,a);if(l.type==="text")return Lk(n,l)}function zk(n,l,a){const r=n.schema;let u=r;l.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=lh,n.schema=u),n.ancestors.push(l);const o=qb(n,l.tagName,!1),f=Hk(n,l);let h=uh(n,l);return jk.has(l.tagName)&&(h=h.filter(function(p){return typeof p=="string"?!nk(p):!0})),zb(n,f,o,l),sh(f,h),n.ancestors.pop(),n.schema=r,n.create(l,o,f,a)}function qk(n,l){if(l.data&&l.data.estree&&n.evaluater){const r=l.data.estree.body[0];return r.type,n.evaluater.evaluateExpression(r.expression)}fs(n,l.position)}function Rk(n,l){if(l.data&&l.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(l.data.estree);fs(n,l.position)}function Mk(n,l,a){const r=n.schema;let u=r;l.name==="svg"&&r.space==="html"&&(u=lh,n.schema=u),n.ancestors.push(l);const o=l.name===null?n.Fragment:qb(n,l.name,!0),f=Ik(n,l),h=uh(n,l);return zb(n,f,o,l),sh(f,h),n.ancestors.pop(),n.schema=r,n.create(l,o,f,a)}function Dk(n,l,a){const r={};return sh(r,uh(n,l)),n.create(l,n.Fragment,r,a)}function Lk(n,l){return l.value}function zb(n,l,a,r){typeof a!="string"&&a!==n.Fragment&&n.passNode&&(l.node=r)}function sh(n,l){if(l.length>0){const a=l.length>1?l:l[0];a&&(n.children=a)}}function Bk(n,l,a){return r;function r(u,o,f,h){const g=Array.isArray(f.children)?a:l;return h?g(o,f,h):g(o,f)}}function Uk(n,l){return a;function a(r,u,o,f){const h=Array.isArray(o.children),p=ah(r);return l(u,o,f,h,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function Hk(n,l){const a={};let r,u;for(u in l.properties)if(u!=="children"&&rh.call(l.properties,u)){const o=Vk(n,u,l.properties[u]);if(o){const[f,h]=o;n.tableCellAlignToStyle&&f==="align"&&typeof h=="string"&&Ok.has(l.tagName)?r=h:a[f]=h}}if(r){const o=a.style||(a.style={});o[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function Ik(n,l){const a={};for(const r of l.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&n.evaluater){const o=r.data.estree.body[0];o.type;const f=o.expression;f.type;const h=f.properties[0];h.type,Object.assign(a,n.evaluater.evaluateExpression(h.argument))}else fs(n,l.position);else{const{name:u}=r;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&n.evaluater){const h=r.value.data.estree.body[0];h.type,o=n.evaluater.evaluateExpression(h.expression)}else fs(n,l.position);else o=r.value===null?!0:r.value;a[u]=o}return a}function uh(n,l){const a=[];let r=-1;const u=n.passKeys?new Map:Ak;for(;++r<l.children.length;){const o=l.children[r];let f;if(n.passKeys){const p=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(p){const g=u.get(p)||0;f=p+"-"+g,u.set(p,g+1)}}const h=_b(n,o,f);h!==void 0&&a.push(h)}return a}function Vk(n,l,a){if(a==null||typeof a=="number"&&Number.isNaN(a))return;const r=ok(n.schema,l);return Array.isArray(a)&&(a=r.commaSeparated?$w(a):hk(a)),r.property==="style"?["style",typeof a=="object"?n.stylePropertyNameCase==="dom"?a:Gk(a):Yk(n,String(a))]:[n.elementAttributeNameCase==="react"&&r.space?rk[r.property]||r.property:r.attribute,a]}function Yk(n,l){const a={};try{Ek(l,function(r,u){if(r&&u){let o=r;o.slice(0,2)!=="--"&&(o=o.toLowerCase(),n.stylePropertyNameCase==="dom"&&(o.slice(0,4)==="-ms-"&&(o=o.slice(1)),o=o.replace(Nk,Fk))),a[o]=u}})}catch(r){if(n.ignoreInvalidStyle)return{};const u=r,o=new ko("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:u,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=n.filePath||void 0,o.url=Ob+"#cannot-parse-style-attribute",o}return a}function qb(n,l,a){let r;if(!a)r={type:"Literal",value:l};else if(l.includes(".")){const u=l.split(".");let o=-1,f;for(;++o<u.length;){const h=By(u[o])?{type:"Identifier",name:u[o]}:{type:"Literal",value:u[o]};f=f?{type:"MemberExpression",object:f,property:h,computed:!!(o&&h.type==="Literal"),optional:!1}:h}r=f}else r=By(l)&&!/^[a-z]/.test(l)?{type:"Identifier",name:l}:{type:"Literal",value:l};if(r.type==="Literal"){const u=r.value;return rh.call(n.components,u)?n.components[u]:u}if(n.evaluater)return n.evaluater.evaluateExpression(r);fs(n)}function fs(n,l){const a=new ko("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:l,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=n.filePath||void 0,a.url=Ob+"#cannot-handle-mdx-estrees-without-createevaluater",a}function Gk(n){const l={};let a;for(a in n)rh.call(n,a)&&(l[Qk(a)]=n[a]);return l}function Qk(n){if(n.slice(0,2)==="--")return n;let l=n.replace(Ck,Xk);return l.slice(0,3)==="ms-"&&(l="-"+l),l}function Xk(n){return"-"+n.toLowerCase()}function Fk(n,l){return l.toUpperCase()}const dd={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Zk={};function Eo(n,l){const a=Zk,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Rb(n,r,u)}function Rb(n,l,a){if(Kk(n)){if("value"in n)return n.type==="html"&&!a?"":n.value;if(l&&"alt"in n&&n.alt)return n.alt;if("children"in n)return Fy(n.children,l,a)}return Array.isArray(n)?Fy(n,l,a):""}function Fy(n,l,a){const r=[];let u=-1;for(;++u<n.length;)r[u]=Rb(n[u],l,a);return r.join("")}function Kk(n){return!!(n&&typeof n=="object")}const Zy=document.createElement("i");function oh(n){const l="&"+n+";";Zy.innerHTML=l;const a=Zy.textContent;return a.charCodeAt(a.length-1)===59&&n!=="semi"||a===l?!1:a}function ai(n,l,a,r){const u=n.length;let o=0,f;if(l<0?l=-l>u?0:u+l:l=l>u?u:l,a=a>0?a:0,r.length<1e4)f=Array.from(r),f.unshift(l,a),n.splice(...f);else for(a&&n.splice(l,a);o<r.length;)f=r.slice(o,o+1e4),f.unshift(l,0),n.splice(...f),o+=1e4,l+=1e4}function Kn(n,l){return n.length>0?(ai(n,n.length,0,l),n):l}const Ky={}.hasOwnProperty;function Mb(n){const l={};let a=-1;for(;++a<n.length;)Jk(l,n[a]);return l}function Jk(n,l){let a;for(a in l){const u=(Ky.call(n,a)?n[a]:void 0)||(n[a]={}),o=l[a];let f;if(o)for(f in o){Ky.call(u,f)||(u[f]=[]);const h=o[f];$k(u[f],Array.isArray(h)?h:h?[h]:[])}}}function $k(n,l){let a=-1;const r=[];for(;++a<l.length;)(l[a].add==="after"?n:r).push(l[a]);ai(n,0,0,r)}function Db(n,l){const a=Number.parseInt(n,l);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function ri(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const en=wl(/[A-Za-z]/),tn=wl(/[\dA-Za-z]/),Pk=wl(/[#-'*+\--9=?A-Z^-~]/);function oo(n){return n!==null&&(n<32||n===127)}const Bd=wl(/\d/),Wk=wl(/[\dA-Fa-f]/),Lb=wl(/[!-/:-@[-`{-~]/);function Ce(n){return n!==null&&n<-2}function vt(n){return n!==null&&(n<0||n===32)}function Be(n){return n===-2||n===-1||n===32}const ys=wl(new RegExp("\\p{P}|\\p{S}","u")),ra=wl(/\s/);function wl(n){return l;function l(a){return a!==null&&a>-1&&n.test(String.fromCharCode(a))}}function tr(n){const l=[];let a=-1,r=0,u=0;for(;++a<n.length;){const o=n.charCodeAt(a);let f="";if(o===37&&tn(n.charCodeAt(a+1))&&tn(n.charCodeAt(a+2)))u=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(f=String.fromCharCode(o));else if(o>55295&&o<57344){const h=n.charCodeAt(a+1);o<56320&&h>56319&&h<57344?(f=String.fromCharCode(o,h),u=1):f="�"}else f=String.fromCharCode(o);f&&(l.push(n.slice(r,a),encodeURIComponent(f)),r=a+u+1,f=""),u&&(a+=u,u=0)}return l.join("")+n.slice(r)}function $e(n,l,a,r){const u=r?r-1:1/0;let o=0;return f;function f(p){return Be(p)?(n.enter(a),h(p)):l(p)}function h(p){return Be(p)&&o++<u?(n.consume(p),h):(n.exit(a),l(p))}}function Bb(n,l,a,r,u,o){let f=0;return h;function h(y){return Be(y)?(n.enter(r),p(y)):g(y)}function p(y){return Be(y)&&f<o?(n.consume(y),f++,p):(n.exit(r),g(y))}function g(y){return f>=u?l(y):a(y)}}const eE={tokenize:tE};function tE(n){const l=n.attempt(this.parser.constructs.contentInitial,r,u);let a;return l;function r(h){if(h===null){n.consume(h);return}return n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),$e(n,l,"linePrefix")}function u(h){return n.enter("paragraph"),o(h)}function o(h){const p=n.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(h)}function f(h){if(h===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(h);return}return Ce(h)?(n.consume(h),n.exit("chunkText"),o):(n.consume(h),f)}}let co=class{constructor(){this.index=new Map,this.map=[]}add(l,a,r){Jy(this,l,a,r,!1)}addBefore(l,a,r){Jy(this,l,a,r,!0)}consume(l){if(this.map.sort(function(o,f){return o[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(l.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),l.length=this.map[a][0];r.push(l.slice()),l.length=0;let u=r.pop();for(;u;){for(const o of u)l.push(o);u=r.pop()}this.map.length=0,this.index.clear()}};function Jy(n,l,a,r,u){if(a===0&&r.length===0)return;const o=n.index.get(l);if(o){o[1]+=a,u?(r.push(...o[2]),o[2]=r):o[2].push(...r);return}const f=[l,a,r];n.map.push(f),n.index.set(l,f)}const nE={tokenize:iE},$y={tokenize:lE};function iE(n){const l=this,a=[];let r=0,u,o,f;return h;function h(H){if(r<a.length){const $=a[r];return l.containerState=$[1],n.attempt($[0].continuation,p,g)(H)}return g(H)}function p(H){if(r++,l.containerState._closeFlow){l.containerState._closeFlow=void 0,u&&M();const $=l.events.length;let te=$,O;for(;te--;)if(l.events[te][0]==="exit"&&l.events[te][1].type==="chunkFlow"){O=l.events[te][1].end;break}E(r);let Q=$;for(;Q<l.events.length;)l.events[Q][1].end={...O},Q++;const ne=new co;return ne.add(te+1,0,l.events.slice($)),ne.add($,Q-$,[]),ne.consume(l.events),g(H)}return h(H)}function g(H){if(r===a.length){if(!u)return S(H);if(u.currentConstruct&&u.currentConstruct.concrete)return k(H);l.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return l.containerState={},n.check($y,y,m)(H)}function y(H){return u&&M(),E(r),S(H)}function m(H){return l.parser.lazy[l.now().line]=r!==a.length,f=l.now().offset,k(H)}function S(H){return l.containerState={},n.attempt($y,x,k)(H)}function x(H){return r++,a.push([l.currentConstruct,l.containerState]),S(H)}function k(H){if(H===null){u&&M(),E(0),n.consume(H);return}return u=u||l.parser.flow(l.now()),n.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:o}),T(H)}function T(H){if(H===null){A(n.exit("chunkFlow"),!0),E(0),n.consume(H);return}return Ce(H)?(n.consume(H),A(n.exit("chunkFlow")),r=0,l.interrupt=void 0,h):(n.consume(H),T)}function A(H,$){const te=l.sliceStream(H);if($&&te.push(null),H.previous=o,o&&(o.next=H),o=H,u.defineSkip(H.start),u.write(te),l.parser.lazy[H.start.line]){let O=u.events.length;for(;O--;)if(u.events[O][1].start.offset<f&&(!u.events[O][1].end||u.events[O][1].end.offset>f))return;const Q=l.events.length;let ne=Q,he,_;for(;ne--;)if(l.events[ne][0]==="exit"&&l.events[ne][1].type==="chunkFlow"){if(he){_=l.events[ne][1].end;break}he=!0}for(E(r),O=Q;O<l.events.length;)l.events[O][1].end={..._},O++;const Z=new co;Z.add(ne+1,0,l.events.slice(Q)),Z.add(Q,O-Q,[]),Z.consume(l.events)}}function E(H){let $=a.length;for(;$-- >H;){const te=a[$];l.containerState=te[1],te[0].exit.call(l,n)}a.length=H}function M(){u.write([null]),o=void 0,u=void 0,l.containerState._closeFlow=void 0}}function lE(n,l,a){return $e(n,n.attempt(this.parser.constructs.document,l,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Sl(n){if(n===null||vt(n)||ra(n))return 1;if(ys(n))return 2}function To(n,l,a){const r=[];let u=-1;for(;++u<n.length;){const o=n[u].resolveAll;o&&!r.includes(o)&&(l=o(l,a),r.push(o))}return l}const Ud={name:"attention",resolveAll:aE,tokenize:rE};function aE(n,l){let a=-1,r;for(;++a<n.length;)if(n[a][0]==="enter"&&n[a][1].type==="attentionSequence"&&n[a][1]._close){let u=a;for(;u--;)if(n[u][0]==="exit"&&n[u][1].type==="attentionSequence"&&n[u][1]._open&&l.sliceSerialize(n[u][1]).charCodeAt(0)===l.sliceSerialize(n[a][1]).charCodeAt(0)){if((n[u][1]._close||n[a][1]._open)&&(n[a][1].end.offset-n[a][1].start.offset)%3&&!((n[u][1].end.offset-n[u][1].start.offset+n[a][1].end.offset-n[a][1].start.offset)%3))continue;const o=n[u][1].end.offset-n[u][1].start.offset>1&&n[a][1].end.offset-n[a][1].start.offset>1?2:1,f={...n[u][1].end},h={...n[a][1].start};Py(f,-o),Py(h,o);const p={type:o>1?"strongSequence":"emphasisSequence",start:f,end:{...n[u][1].end}},g={type:o>1?"strongSequence":"emphasisSequence",start:{...n[a][1].start},end:h},y={type:o>1?"strongText":"emphasisText",start:{...n[u][1].end},end:{...n[a][1].start}},m={type:o>1?"strong":"emphasis",start:{...p.start},end:{...g.end}};n[u][1].end={...p.start},n[a][1].start={...g.end},r=[],n[u][1].end.offset-n[u][1].start.offset&&(r=Kn(r,[["enter",n[u][1],l],["exit",n[u][1],l]])),r=Kn(r,[["enter",m,l],["enter",p,l],["exit",p,l],["enter",y,l]]),r=Kn(r,To(l.parser.constructs.insideSpan.null,n.slice(u+1,a),l)),r=Kn(r,[["exit",y,l],["enter",g,l],["exit",g,l],["exit",m,l]]);let S=0;n[a][1].end.offset-n[a][1].start.offset&&(S=2,r=Kn(r,[["enter",n[a][1],l],["exit",n[a][1],l]])),ai(n,u-1,a-u+3,r),a=u+r.length-S-2;break}}for(a=-1;++a<n.length;)n[a][1].type==="attentionSequence"&&(n[a][1].type="data");return n}function rE(n,l){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=Sl(r);let o;return f;function f(p){return o=p,n.enter("attentionSequence"),h(p)}function h(p){if(p===o)return n.consume(p),h;const g=n.exit("attentionSequence"),y=Sl(p),m=!y||y===2&&u||a.includes(p)&&p!==42&&p!==95,S=!u||u===2&&y||a.includes(r)&&r!==42&&r!==95;return g._open=!!(o===42?m:m&&(u||!S)),g._close=!!(o===42?S:S&&(y||!m)),l(p)}}function Py(n,l){n.column+=l,n.offset+=l,n._bufferIndex+=l}const sE={name:"autolink",tokenize:uE};function uE(n,l,a){let r=0;return u;function u(x){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(x),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),o}function o(x){return en(x)?(n.consume(x),f):x===64?a(x):g(x)}function f(x){return x===43||x===45||x===46||tn(x)?(r=1,h(x)):g(x)}function h(x){return x===58?(n.consume(x),r=0,p):(x===43||x===45||x===46||tn(x))&&r++<32?(n.consume(x),h):(r=0,g(x))}function p(x){return x===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(x),n.exit("autolinkMarker"),n.exit("autolink"),l):x===null||x===32||x===60||oo(x)?a(x):(n.consume(x),p)}function g(x){return x===64?(n.consume(x),y):Pk(x)?(n.consume(x),g):a(x)}function y(x){return tn(x)?m(x):a(x)}function m(x){return x===46?(n.consume(x),r=0,y):x===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(x),n.exit("autolinkMarker"),n.exit("autolink"),l):S(x)}function S(x){if((x===45||tn(x))&&r++<63){const k=x===45?S:m;return n.consume(x),k}return a(x)}}const vs={partial:!0,tokenize:oE};function oE(n,l,a){return r;function r(o){return Be(o)?$e(n,u,"linePrefix")(o):u(o)}function u(o){return o===null||Ce(o)?l(o):a(o)}}const Ub={continuation:{tokenize:fE},exit:dE,name:"blockQuote",tokenize:cE};function cE(n,l,a){const r=this;return u;function u(f){if(f===62){const h=r.containerState;return h.open||(n.enter("blockQuote",{_container:!0}),h.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),o}return a(f)}function o(f){return Be(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),l):(n.exit("blockQuotePrefix"),l(f))}}function fE(n,l,a){const r=this;return u;function u(f){return Be(f)?$e(n,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):o(f)}function o(f){return n.attempt(Ub,l,a)(f)}}function dE(n){n.exit("blockQuote")}const Hb={name:"characterEscape",tokenize:hE};function hE(n,l,a){return r;function r(o){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(o),n.exit("escapeMarker"),u}function u(o){return Lb(o)?(n.enter("characterEscapeValue"),n.consume(o),n.exit("characterEscapeValue"),n.exit("characterEscape"),l):a(o)}}const Ib={name:"characterReference",tokenize:pE};function pE(n,l,a){const r=this;let u=0,o,f;return h;function h(m){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(m),n.exit("characterReferenceMarker"),p}function p(m){return m===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(m),n.exit("characterReferenceMarkerNumeric"),g):(n.enter("characterReferenceValue"),o=31,f=tn,y(m))}function g(m){return m===88||m===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(m),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),o=6,f=Wk,y):(n.enter("characterReferenceValue"),o=7,f=Bd,y(m))}function y(m){if(m===59&&u){const S=n.exit("characterReferenceValue");return f===tn&&!oh(r.sliceSerialize(S))?a(m):(n.enter("characterReferenceMarker"),n.consume(m),n.exit("characterReferenceMarker"),n.exit("characterReference"),l)}return f(m)&&u++<o?(n.consume(m),y):a(m)}}const Hd={partial:!0,tokenize:mE};function mE(n,l,a){const r=this;return u;function u(f){return f===null?a(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),o)}function o(f){return r.parser.lazy[r.now().line]?a(f):l(f)}}const Wy={concrete:!0,name:"codeFenced",tokenize:gE};function gE(n,l,a){const r=this,u={partial:!0,tokenize:te};let o=0,f=0,h;return p;function p(O){return g(O)}function g(O){const Q=r.events[r.events.length-1];return o=Q&&Q[1].type==="linePrefix"?Q[2].sliceSerialize(Q[1],!0).length:0,h=O,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),y(O)}function y(O){return O===h?(f++,n.consume(O),y):f<3?a(O):(n.exit("codeFencedFenceSequence"),Be(O)?$e(n,m,"whitespace")(O):m(O))}function m(O){return O===null||Ce(O)?(n.exit("codeFencedFence"),r.interrupt?l(O):n.check(Hd,T,$)(O)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),S(O))}function S(O){return O===null||Ce(O)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),m(O)):Be(O)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),$e(n,x,"whitespace")(O)):O===96&&O===h?a(O):(n.consume(O),S)}function x(O){return O===null||Ce(O)?m(O):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||Ce(O)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),m(O)):O===96&&O===h?a(O):(n.consume(O),k)}function T(O){return n.attempt(u,$,A)(O)}function A(O){return n.enter("lineEnding"),n.consume(O),n.exit("lineEnding"),E}function E(O){return o>0&&Be(O)?$e(n,M,"linePrefix",o+1)(O):M(O)}function M(O){return O===null||Ce(O)?n.check(Hd,T,$)(O):(n.enter("codeFlowValue"),H(O))}function H(O){return O===null||Ce(O)?(n.exit("codeFlowValue"),M(O)):(n.consume(O),H)}function $(O){return n.exit("codeFenced"),l(O)}function te(O,Q,ne){let he=0;return _;function _(ae){return O.enter("lineEnding"),O.consume(ae),O.exit("lineEnding"),Z}function Z(ae){return O.enter("codeFencedFence"),Be(ae)?$e(O,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):P(ae)}function P(ae){return ae===h?(O.enter("codeFencedFenceSequence"),Se(ae)):ne(ae)}function Se(ae){return ae===h?(he++,O.consume(ae),Se):he>=f?(O.exit("codeFencedFenceSequence"),Be(ae)?$e(O,Re,"whitespace")(ae):Re(ae)):ne(ae)}function Re(ae){return ae===null||Ce(ae)?(O.exit("codeFencedFence"),Q(ae)):ne(ae)}}}const hd={name:"codeIndented",tokenize:vE},yE={partial:!0,tokenize:bE};function vE(n,l,a){return r;function r(h){return n.enter("codeIndented"),Bb(n,u,a,"linePrefix",4,4)(h)}function u(h){return h===null?f(h):Ce(h)?n.attempt(yE,u,f)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||Ce(h)?(n.exit("codeFlowValue"),u(h)):(n.consume(h),o)}function f(h){return n.exit("codeIndented"),l(h)}}function bE(n,l,a){const r=this;return u;function u(f){return r.parser.lazy[r.now().line]?a(f):Ce(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),u):Bb(n,l,o,"linePrefix",4,4)(f)}function o(f){return Ce(f)?u(f):a(f)}}const xE={name:"codeText",previous:wE,resolve:SE,tokenize:kE};function SE(n){let l=n.length-4,a=3,r,u;if((n[a][1].type==="lineEnding"||n[a][1].type==="space")&&(n[l][1].type==="lineEnding"||n[l][1].type==="space")){for(r=a;++r<l;)if(n[r][1].type==="codeTextData"){n[a][1].type="codeTextPadding",n[l][1].type="codeTextPadding",a+=2,l-=2;break}}for(r=a-1,l++;++r<=l;)u===void 0?r!==l&&n[r][1].type!=="lineEnding"&&(u=r):(r===l||n[r][1].type==="lineEnding")&&(n[u][1].type="codeTextData",r!==u+2&&(n[u][1].end=n[r-1][1].end,n.splice(u+2,r-u-2),l-=r-u-2,r=u+2),u=void 0);return n}function wE(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kE(n,l,a){let r=0,u,o;return f;function f(m){return n.enter("codeText"),n.enter("codeTextSequence"),h(m)}function h(m){return m===96?(n.consume(m),r++,h):(n.exit("codeTextSequence"),p(m))}function p(m){return m===null?a(m):m===32?(n.enter("space"),n.consume(m),n.exit("space"),p):m===96?(o=n.enter("codeTextSequence"),u=0,y(m)):Ce(m)?(n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),p):(n.enter("codeTextData"),g(m))}function g(m){return m===null||m===32||m===96||Ce(m)?(n.exit("codeTextData"),p(m)):(n.consume(m),g)}function y(m){return m===96?(n.consume(m),u++,y):u===r?(n.exit("codeTextSequence"),n.exit("codeText"),l(m)):(o.type="codeTextData",g(m))}}class EE{constructor(l){this.left=l?[...l]:[],this.right=[]}get(l){if(l<0||l>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+l+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return l<this.left.length?this.left[l]:this.right[this.right.length-l+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(l,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(l,r):l>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-l+this.left.length).reverse():this.left.slice(l).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(l,a,r){const u=a||0;this.setCursor(Math.trunc(l));const o=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&es(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(l){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(l)}pushMany(l){this.setCursor(Number.POSITIVE_INFINITY),es(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),es(this.right,l.reverse())}setCursor(l){if(!(l===this.left.length||l>this.left.length&&this.right.length===0||l<0&&this.left.length===0))if(l<this.left.length){const a=this.left.splice(l,Number.POSITIVE_INFINITY);es(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-l,Number.POSITIVE_INFINITY);es(this.left,a.reverse())}}}function es(n,l){let a=0;if(l.length<1e4)n.push(...l);else for(;a<l.length;)n.push(...l.slice(a,a+1e4)),a+=1e4}function Vb(n){const l={};let a=-1,r,u,o,f,h,p,g;const y=new EE(n);for(;++a<y.length;){for(;a in l;)a=l[a];if(r=y.get(a),a&&r[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(p=r[1]._tokenizer.events,o=0,o<p.length&&p[o][1].type==="lineEndingBlank"&&(o+=2),o<p.length&&p[o][1].type==="content"))for(;++o<p.length&&p[o][1].type!=="content";)p[o][1].type==="chunkText"&&(p[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(l,TE(y,a)),a=l[a],g=!0);else if(r[1]._container){for(o=a,u=void 0;o--;)if(f=y.get(o),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(u&&(y.get(u)[1].type="lineEndingBlank"),f[1].type="lineEnding",u=o);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;u&&(r[1].end={...y.get(u)[1].start},h=y.slice(u,a),h.unshift(r),y.splice(u,a-u+1,h))}}return ai(n,0,Number.POSITIVE_INFINITY,y.slice(0)),!g}function TE(n,l){const a=n.get(l)[1],r=n.get(l)[2];let u=l-1;const o=[];let f=a._tokenizer;f||(f=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const h=f.events,p=[],g={};let y,m,S=-1,x=a,k=0,T=0;const A=[T];for(;x;){for(;n.get(++u)[1]!==x;);o.push(u),x._tokenizer||(y=r.sliceStream(x),x.next||y.push(null),m&&f.defineSkip(x.start),x._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(y),x._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=a;++S<h.length;)h[S][0]==="exit"&&h[S-1][0]==="enter"&&h[S][1].type===h[S-1][1].type&&h[S][1].start.line!==h[S][1].end.line&&(T=S+1,A.push(T),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(f.events=[],x?(x._tokenizer=void 0,x.previous=void 0):A.pop(),S=A.length;S--;){const E=h.slice(A[S],A[S+1]),M=o.pop();p.push([M,M+E.length-1]),n.splice(M,2,E)}for(p.reverse(),S=-1;++S<p.length;)g[k+p[S][0]]=k+p[S][1],k+=p[S][1]-p[S][0]-1;return g}const AE={resolve:NE,tokenize:jE},CE={partial:!0,tokenize:OE};function NE(n){return Vb(n),n}function jE(n,l){let a;return r;function r(h){return n.enter("content"),a=n.enter("chunkContent",{contentType:"content"}),u(h)}function u(h){return h===null?o(h):Ce(h)?n.check(CE,f,o)(h):(n.consume(h),u)}function o(h){return n.exit("chunkContent"),n.exit("content"),l(h)}function f(h){return n.consume(h),n.exit("chunkContent"),a.next=n.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function OE(n,l,a){const r=this;return u;function u(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),$e(n,o,"linePrefix")}function o(f){if(f===null||Ce(f))return a(f);const h=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(f):n.interrupt(r.parser.constructs.flow,a,l)(f)}}function Yb(n,l,a,r,u,o,f,h,p){const g=p||Number.POSITIVE_INFINITY;let y=0;return m;function m(E){return E===60?(n.enter(r),n.enter(u),n.enter(o),n.consume(E),n.exit(o),S):E===null||E===32||E===41||oo(E)?a(E):(n.enter(r),n.enter(f),n.enter(h),n.enter("chunkString",{contentType:"string"}),T(E))}function S(E){return E===62?(n.enter(o),n.consume(E),n.exit(o),n.exit(u),n.exit(r),l):(n.enter(h),n.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===62?(n.exit("chunkString"),n.exit(h),S(E)):E===null||E===60||Ce(E)?a(E):(n.consume(E),E===92?k:x)}function k(E){return E===60||E===62||E===92?(n.consume(E),x):x(E)}function T(E){return!y&&(E===null||E===41||vt(E))?(n.exit("chunkString"),n.exit(h),n.exit(f),n.exit(r),l(E)):y<g&&E===40?(n.consume(E),y++,T):E===41?(n.consume(E),y--,T):E===null||E===32||E===40||oo(E)?a(E):(n.consume(E),E===92?A:T)}function A(E){return E===40||E===41||E===92?(n.consume(E),T):T(E)}}function Gb(n,l,a,r,u,o){const f=this;let h=0,p;return g;function g(x){return n.enter(r),n.enter(u),n.consume(x),n.exit(u),n.enter(o),y}function y(x){return h>999||x===null||x===91||x===93&&!p||x===94&&!h&&"_hiddenFootnoteSupport"in f.parser.constructs?a(x):x===93?(n.exit(o),n.enter(u),n.consume(x),n.exit(u),n.exit(r),l):Ce(x)?(n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||Ce(x)||h++>999?(n.exit("chunkString"),y(x)):(n.consume(x),p||(p=!Be(x)),x===92?S:m)}function S(x){return x===91||x===92||x===93?(n.consume(x),h++,m):m(x)}}function Qb(n,l,a,r,u,o){let f;return h;function h(S){return S===34||S===39||S===40?(n.enter(r),n.enter(u),n.consume(S),n.exit(u),f=S===40?41:S,p):a(S)}function p(S){return S===f?(n.enter(u),n.consume(S),n.exit(u),n.exit(r),l):(n.enter(o),g(S))}function g(S){return S===f?(n.exit(o),p(f)):S===null?a(S):Ce(S)?(n.enter("lineEnding"),n.consume(S),n.exit("lineEnding"),$e(n,g,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===f||S===null||Ce(S)?(n.exit("chunkString"),g(S)):(n.consume(S),S===92?m:y)}function m(S){return S===f||S===92?(n.consume(S),y):y(S)}}function as(n,l){let a;return r;function r(u){return Ce(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),a=!0,r):Be(u)?$e(n,r,a?"linePrefix":"lineSuffix")(u):l(u)}}const _E={name:"definition",tokenize:qE},zE={partial:!0,tokenize:RE};function qE(n,l,a){const r=this;let u;return o;function o(x){return n.enter("definition"),f(x)}function f(x){return Gb.call(r,n,h,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function h(x){return u=ri(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(n.enter("definitionMarker"),n.consume(x),n.exit("definitionMarker"),p):a(x)}function p(x){return vt(x)?as(n,g)(x):g(x)}function g(x){return Yb(n,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function y(x){return n.attempt(zE,m,m)(x)}function m(x){return Be(x)?$e(n,S,"whitespace")(x):S(x)}function S(x){return x===null||Ce(x)?(n.exit("definition"),r.parser.defined.push(u),l(x)):a(x)}}function RE(n,l,a){return r;function r(h){return vt(h)?as(n,u)(h):a(h)}function u(h){return Qb(n,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function o(h){return Be(h)?$e(n,f,"whitespace")(h):f(h)}function f(h){return h===null||Ce(h)?l(h):a(h)}}const ME={name:"hardBreakEscape",tokenize:DE};function DE(n,l,a){return r;function r(o){return n.enter("hardBreakEscape"),n.consume(o),u}function u(o){return Ce(o)?(n.exit("hardBreakEscape"),l(o)):a(o)}}const LE={name:"headingAtx",resolve:BE,tokenize:UE};function BE(n,l){let a=n.length-2,r=3;if(n[r][1].type==="whitespace"&&(r+=2),a-2>r&&n[a][1].type==="whitespace"&&(a-=2),n[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&n[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r){const u={type:"atxHeadingText",start:n[r][1].start,end:n[a][1].end},o={type:"chunkText",start:n[r][1].start,end:n[a][1].end,contentType:"text"};ai(n,r,a-r+1,[["enter",u,l],["enter",o,l],["exit",o,l],["exit",u,l]])}return n}function UE(n,l,a){let r=0;return u;function u(y){return n.enter("atxHeading"),o(y)}function o(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&r++<6?(n.consume(y),f):y===null||vt(y)?(n.exit("atxHeadingSequence"),h(y)):a(y)}function h(y){return y===35?(n.enter("atxHeadingSequence"),p(y)):y===null||Ce(y)?(n.exit("atxHeading"),l(y)):Be(y)?$e(n,h,"whitespace")(y):(n.enter("atxHeadingText"),g(y))}function p(y){return y===35?(n.consume(y),p):(n.exit("atxHeadingSequence"),h(y))}function g(y){return y===null||y===35||vt(y)?(n.exit("atxHeadingText"),h(y)):(n.consume(y),g)}}const Xb=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Id=["pre","script","style","textarea"],HE={concrete:!0,name:"htmlFlow",resolveTo:VE,tokenize:YE},IE={partial:!0,tokenize:GE};function VE(n){let l=n.length;for(;l--&&!(n[l][0]==="enter"&&n[l][1].type==="htmlFlow"););return l>1&&n[l-2][1].type==="linePrefix"&&(n[l][1].start=n[l-2][1].start,n[l+1][1].start=n[l-2][1].start,n.splice(l-2,2)),n}function YE(n,l,a){const r=this;let u,o,f,h,p;return g;function g(z){return y(z)}function y(z){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(z),m}function m(z){return z===33?(n.consume(z),S):z===47?(n.consume(z),o=!0,T):z===63?(n.consume(z),u=3,r.interrupt?l:j):en(z)?(n.consume(z),f=String.fromCharCode(z),A):a(z)}function S(z){return z===45?(n.consume(z),u=2,x):z===91?(n.consume(z),u=5,h=0,k):en(z)?(n.consume(z),u=4,r.interrupt?l:j):a(z)}function x(z){return z===45?(n.consume(z),r.interrupt?l:j):a(z)}function k(z){const q="CDATA[";return z===q.charCodeAt(h++)?(n.consume(z),h===q.length?r.interrupt?l:P:k):a(z)}function T(z){return en(z)?(n.consume(z),f=String.fromCharCode(z),A):a(z)}function A(z){if(z===null||z===47||z===62||vt(z)){const q=z===47,ee=f.toLowerCase();return!q&&!o&&Id.includes(ee)?(u=1,r.interrupt?l(z):P(z)):Xb.includes(f.toLowerCase())?(u=6,q?(n.consume(z),E):r.interrupt?l(z):P(z)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(z):o?M(z):H(z))}return z===45||tn(z)?(n.consume(z),f+=String.fromCharCode(z),A):a(z)}function E(z){return z===62?(n.consume(z),r.interrupt?l:P):a(z)}function M(z){return Be(z)?(n.consume(z),M):_(z)}function H(z){return z===47?(n.consume(z),_):z===58||z===95||en(z)?(n.consume(z),$):Be(z)?(n.consume(z),H):_(z)}function $(z){return z===45||z===46||z===58||z===95||tn(z)?(n.consume(z),$):te(z)}function te(z){return z===61?(n.consume(z),O):Be(z)?(n.consume(z),te):H(z)}function O(z){return z===null||z===60||z===61||z===62||z===96?a(z):z===34||z===39?(n.consume(z),p=z,Q):Be(z)?(n.consume(z),O):ne(z)}function Q(z){return z===p?(n.consume(z),p=null,he):z===null||Ce(z)?a(z):(n.consume(z),Q)}function ne(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||vt(z)?te(z):(n.consume(z),ne)}function he(z){return z===47||z===62||Be(z)?H(z):a(z)}function _(z){return z===62?(n.consume(z),Z):a(z)}function Z(z){return z===null||Ce(z)?P(z):Be(z)?(n.consume(z),Z):a(z)}function P(z){return z===45&&u===2?(n.consume(z),G):z===60&&u===1?(n.consume(z),se):z===62&&u===4?(n.consume(z),Pe):z===63&&u===3?(n.consume(z),j):z===93&&u===5?(n.consume(z),ke):Ce(z)&&(u===6||u===7)?(n.exit("htmlFlowData"),n.check(IE,ht,Se)(z)):z===null||Ce(z)?(n.exit("htmlFlowData"),Se(z)):(n.consume(z),P)}function Se(z){return n.check(Hd,Re,ht)(z)}function Re(z){return n.enter("lineEnding"),n.consume(z),n.exit("lineEnding"),ae}function ae(z){return z===null||Ce(z)?Se(z):(n.enter("htmlFlowData"),P(z))}function G(z){return z===45?(n.consume(z),j):P(z)}function se(z){return z===47?(n.consume(z),f="",ue):P(z)}function ue(z){if(z===62){const q=f.toLowerCase();return Id.includes(q)?(n.consume(z),Pe):P(z)}return en(z)&&f.length<8?(n.consume(z),f+=String.fromCharCode(z),ue):P(z)}function ke(z){return z===93?(n.consume(z),j):P(z)}function j(z){return z===62?(n.consume(z),Pe):z===45&&u===2?(n.consume(z),j):P(z)}function Pe(z){return z===null||Ce(z)?(n.exit("htmlFlowData"),ht(z)):(n.consume(z),Pe)}function ht(z){return n.exit("htmlFlow"),l(z)}}function GE(n,l,a){return r;function r(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),n.attempt(vs,l,a)}}const QE={name:"htmlText",tokenize:XE};function XE(n,l,a){const r=this;let u,o,f;return h;function h(j){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(j),p}function p(j){return j===33?(n.consume(j),g):j===47?(n.consume(j),te):j===63?(n.consume(j),H):en(j)?(n.consume(j),ne):a(j)}function g(j){return j===45?(n.consume(j),y):j===91?(n.consume(j),o=0,k):en(j)?(n.consume(j),M):a(j)}function y(j){return j===45?(n.consume(j),x):a(j)}function m(j){return j===null?a(j):j===45?(n.consume(j),S):Ce(j)?(f=m,se(j)):(n.consume(j),m)}function S(j){return j===45?(n.consume(j),x):m(j)}function x(j){return j===62?G(j):j===45?S(j):m(j)}function k(j){const Pe="CDATA[";return j===Pe.charCodeAt(o++)?(n.consume(j),o===Pe.length?T:k):a(j)}function T(j){return j===null?a(j):j===93?(n.consume(j),A):Ce(j)?(f=T,se(j)):(n.consume(j),T)}function A(j){return j===93?(n.consume(j),E):T(j)}function E(j){return j===62?G(j):j===93?(n.consume(j),E):T(j)}function M(j){return j===null||j===62?G(j):Ce(j)?(f=M,se(j)):(n.consume(j),M)}function H(j){return j===null?a(j):j===63?(n.consume(j),$):Ce(j)?(f=H,se(j)):(n.consume(j),H)}function $(j){return j===62?G(j):H(j)}function te(j){return en(j)?(n.consume(j),O):a(j)}function O(j){return j===45||tn(j)?(n.consume(j),O):Q(j)}function Q(j){return Ce(j)?(f=Q,se(j)):Be(j)?(n.consume(j),Q):G(j)}function ne(j){return j===45||tn(j)?(n.consume(j),ne):j===47||j===62||vt(j)?he(j):a(j)}function he(j){return j===47?(n.consume(j),G):j===58||j===95||en(j)?(n.consume(j),_):Ce(j)?(f=he,se(j)):Be(j)?(n.consume(j),he):G(j)}function _(j){return j===45||j===46||j===58||j===95||tn(j)?(n.consume(j),_):Z(j)}function Z(j){return j===61?(n.consume(j),P):Ce(j)?(f=Z,se(j)):Be(j)?(n.consume(j),Z):he(j)}function P(j){return j===null||j===60||j===61||j===62||j===96?a(j):j===34||j===39?(n.consume(j),u=j,Se):Ce(j)?(f=P,se(j)):Be(j)?(n.consume(j),P):(n.consume(j),Re)}function Se(j){return j===u?(n.consume(j),u=void 0,ae):j===null?a(j):Ce(j)?(f=Se,se(j)):(n.consume(j),Se)}function Re(j){return j===null||j===34||j===39||j===60||j===61||j===96?a(j):j===47||j===62||vt(j)?he(j):(n.consume(j),Re)}function ae(j){return j===47||j===62||vt(j)?he(j):a(j)}function G(j){return j===62?(n.consume(j),n.exit("htmlTextData"),n.exit("htmlText"),l):a(j)}function se(j){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),ue}function ue(j){return Be(j)?$e(n,ke,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):ke(j)}function ke(j){return n.enter("htmlTextData"),f(j)}}const ch={name:"labelEnd",resolveAll:JE,resolveTo:$E,tokenize:PE},FE={tokenize:WE},ZE={tokenize:eT},KE={tokenize:tT};function JE(n){let l=-1;const a=[];for(;++l<n.length;){const r=n[l][1];if(a.push(n[l]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",l+=u}}return n.length!==a.length&&ai(n,0,n.length,a),n}function $E(n,l){let a=n.length,r=0,u,o,f;for(;a--;){const y=n[a][1];if(u){if(y.type==="link"||y.type==="labelLink"&&y._inactive)break;n[a][0]==="enter"&&y.type==="labelLink"&&(y._inactive=!0)}else if(o){if(n[a][0]==="enter"&&(y.type==="labelImage"||y.type==="labelLink")&&!y._balanced&&(u=a,y.type!=="labelLink")){r=2;break}}else y.type==="labelEnd"&&(o=a)}const h={type:n[u][1].type==="labelLink"?"link":"image",start:{...n[u][1].start},end:{...n[n.length-1][1].end}},p={type:"label",start:{...n[u][1].start},end:{...n[o][1].end}},g={type:"labelText",start:{...n[u+r+2][1].end},end:{...n[o-2][1].start}};return f=[["enter",h,l],["enter",p,l]],f=Kn(f,n.slice(u+1,u+r+3)),f=Kn(f,[["enter",g,l]]),f=Kn(f,To(l.parser.constructs.insideSpan.null,n.slice(u+r+4,o-3),l)),f=Kn(f,[["exit",g,l],n[o-2],n[o-1],["exit",p,l]]),f=Kn(f,n.slice(o+1)),f=Kn(f,[["exit",h,l]]),ai(n,u,n.length,f),n}function PE(n,l,a){const r=this,u=r._labelStarts;let o,f;if(u){for(;u.length>0&&u[u.length-1]._balanced;)u.pop();o=u[u.length-1]}return h;function h(S){return o?o._inactive?m(S):(f=r.parser.defined.includes(ri(r.sliceSerialize({start:o.end,end:r.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(S),n.exit("labelMarker"),n.exit("labelEnd"),p):a(S)}function p(S){return S===40?n.attempt(FE,y,f?y:m)(S):S===91?n.attempt(ZE,y,f?g:m)(S):f?y(S):m(S)}function g(S){return n.attempt(KE,y,m)(S)}function y(S){return u.pop(),l(S)}function m(S){return o._balanced=!0,a(S)}}function WE(n,l,a){return r;function r(m){return n.enter("resource"),n.enter("resourceMarker"),n.consume(m),n.exit("resourceMarker"),u}function u(m){return vt(m)?as(n,o)(m):o(m)}function o(m){return m===41?y(m):Yb(n,f,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function f(m){return vt(m)?as(n,p)(m):y(m)}function h(m){return a(m)}function p(m){return m===34||m===39||m===40?Qb(n,g,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):y(m)}function g(m){return vt(m)?as(n,y)(m):y(m)}function y(m){return m===41?(n.enter("resourceMarker"),n.consume(m),n.exit("resourceMarker"),n.exit("resource"),l):a(m)}}function eT(n,l,a){const r=this;return u;function u(h){return Gb.call(r,n,o,f,"reference","referenceMarker","referenceString")(h)}function o(h){return r.parser.defined.includes(ri(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?l(h):a(h)}function f(h){return a(h)}}function tT(n,l,a){return r;function r(o){return n.enter("reference"),n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),u}function u(o){return o===93?(n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),n.exit("reference"),l):a(o)}}const nT={name:"labelStartImage",resolveAll:ch.resolveAll,tokenize:iT};function iT(n,l,a){const r=this;let u;return o;function o(p){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(p),n.exit("labelImageMarker"),f}function f(p){return p===91?(n.enter("labelMarker"),n.consume(p),n.exit("labelMarker"),u=n.exit("labelImage"),h):a(p)}function h(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(p):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(u),l(p))}}const lT={name:"labelStartLink",resolveAll:ch.resolveAll,tokenize:aT};function aT(n,l,a){const r=this;let u;return o;function o(h){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(h),n.exit("labelMarker"),u=n.exit("labelLink"),f}function f(h){return h===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(h):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(u),l(h))}}const pd={name:"lineEnding",tokenize:rT};function rT(n,l){return a;function a(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),$e(n,l,"linePrefix")}}const ro={name:"thematicBreak",tokenize:sT};function sT(n,l,a){let r=0,u;return o;function o(g){return n.enter("thematicBreak"),f(g)}function f(g){return u=g,h(g)}function h(g){return g===u?(n.enter("thematicBreakSequence"),p(g)):r>=3&&(g===null||Ce(g))?(n.exit("thematicBreak"),l(g)):a(g)}function p(g){return g===u?(n.consume(g),r++,p):(n.exit("thematicBreakSequence"),Be(g)?$e(n,h,"whitespace")(g):h(g))}}const En={continuation:{tokenize:fT},exit:hT,name:"list",tokenize:cT},uT={partial:!0,tokenize:pT},oT={partial:!0,tokenize:dT};function cT(n,l,a){const r=this,u=r.events[r.events.length-1];let o=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,f=0;return h;function h(x){const k=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:Bd(x)){if(r.containerState.type||(r.containerState.type=k,n.enter(k,{_container:!0})),k==="listUnordered")return n.enter("listItemPrefix"),x===42||x===45?n.check(ro,a,g)(x):g(x);if(!r.interrupt||x===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(x)}return a(x)}function p(x){return Bd(x)&&++f<10?(n.consume(x),p):(!r.interrupt||f<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(n.exit("listItemValue"),g(x)):a(x)}function g(x){return n.enter("listItemMarker"),n.consume(x),n.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,n.check(vs,r.interrupt?a:y,n.attempt(uT,S,m))}function y(x){return r.containerState.initialBlankLine=!0,o++,S(x)}function m(x){return Be(x)?(n.enter("listItemPrefixWhitespace"),n.consume(x),n.exit("listItemPrefixWhitespace"),S):a(x)}function S(x){return r.containerState.size=o+r.sliceSerialize(n.exit("listItemPrefix"),!0).length,l(x)}}function fT(n,l,a){const r=this;return r.containerState._closeFlow=void 0,n.check(vs,u,o);function u(h){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$e(n,l,"listItemIndent",r.containerState.size+1)(h)}function o(h){return r.containerState.furtherBlankLines||!Be(h)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,f(h)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n.attempt(oT,l,f)(h))}function f(h){return r.containerState._closeFlow=!0,r.interrupt=void 0,$e(n,n.attempt(En,l,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function dT(n,l,a){const r=this;return $e(n,u,"listItemIndent",r.containerState.size+1);function u(o){const f=r.events[r.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===r.containerState.size?l(o):a(o)}}function hT(n){n.exit(this.containerState.type)}function pT(n,l,a){const r=this;return $e(n,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(o){const f=r.events[r.events.length-1];return!Be(o)&&f&&f[1].type==="listItemPrefixWhitespace"?l(o):a(o)}}const ev={name:"setextUnderline",resolveTo:mT,tokenize:gT};function mT(n,l){const a=new co;let r=n.length,u,o,f;for(;r--;)if(n[r][0]==="enter"){if(n[r][1].type==="content"){u=r;break}n[r][1].type==="paragraph"&&(o=r)}else n[r][1].type==="content"&&a.add(r,1,[]),!f&&n[r][1].type==="definition"&&(f=r);const h={type:"setextHeading",start:{...n[u][1].start},end:{...n[n.length-1][1].end}};return n[o][1].type="setextHeadingText",f?(a.add(o,0,[["enter",h,l]]),a.add(f+1,0,[["exit",n[u][1],l]]),n[u][1].end={...n[f][1].end}):n[u][1]=h,a.add(n.length,0,[["exit",h,l]]),a.consume(n),n}function gT(n,l,a){const r=this;let u;return o;function o(g){let y=r.events.length,m;for(;y--;)if(r.events[y][1].type!=="lineEnding"&&r.events[y][1].type!=="linePrefix"&&r.events[y][1].type!=="content"){m=r.events[y][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(n.enter("setextHeadingLine"),u=g,f(g)):a(g)}function f(g){return n.enter("setextHeadingLineSequence"),h(g)}function h(g){return g===u?(n.consume(g),h):(n.exit("setextHeadingLineSequence"),Be(g)?$e(n,p,"lineSuffix")(g):p(g))}function p(g){return g===null||Ce(g)?(n.exit("setextHeadingLine"),l(g)):a(g)}}const yT={tokenize:vT};function vT(n){const l=this,a=n.attempt(vs,r,n.attempt(this.parser.constructs.flowInitial,u,$e(n,n.attempt(this.parser.constructs.flow,u,n.attempt(AE,u)),"linePrefix")));return a;function r(o){if(o===null){n.consume(o);return}return n.enter("lineEndingBlank"),n.consume(o),n.exit("lineEndingBlank"),l.currentConstruct=void 0,a}function u(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),l.currentConstruct=void 0,a}}const bT={resolveAll:Zb()},xT=Fb("string"),ST=Fb("text");function Fb(n){return{resolveAll:Zb(n==="text"?wT:void 0),tokenize:l};function l(a){const r=this,u=this.parser.constructs[n],o=a.attempt(u,f,h);return f;function f(y){return g(y)?o(y):h(y)}function h(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return g(y)?(a.exit("data"),o(y)):(a.consume(y),p)}function g(y){if(y===null)return!0;const m=u[y];let S=-1;if(m)for(;++S<m.length;){const x=m[S];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function Zb(n){return l;function l(a,r){let u=-1,o;for(;++u<=a.length;)o===void 0?a[u]&&a[u][1].type==="data"&&(o=u,u++):(!a[u]||a[u][1].type!=="data")&&(u!==o+2&&(a[o][1].end=a[u-1][1].end,a.splice(o+2,u-o-2),u=o+2),o=void 0);return n?n(a,r):a}}function wT(n,l){const a=new co;let r=0;for(;++r<=n.length;)if((r===n.length||n[r][1].type==="lineEnding")&&n[r-1][1].type==="data"){const u=n[r-1][1],o=l.sliceStream(u);let f=o.length,h=-1,p=0,g;for(;f--;){const y=o[f];if(typeof y=="string"){for(h=y.length;y.charCodeAt(h-1)===32;)p++,h--;if(h)break;h=-1}else if(y===-2)g=!0,p++;else if(y!==-1){f++;break}}if(l._contentTypeTextTrailing&&r===n.length&&(p=0),p){const y={type:r===n.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:f?h:u.start._bufferIndex+h,_index:u.start._index+f,line:u.end.line,column:u.end.column-p,offset:u.end.offset-p},end:{...u.end}};u.end={...y.start},u.start.offset===u.end.offset?Object.assign(u,y):a.add(r,0,[["enter",y,l],["exit",y,l]])}r++}return a.consume(n),n}const kT={42:En,43:En,45:En,48:En,49:En,50:En,51:En,52:En,53:En,54:En,55:En,56:En,57:En,62:Ub},ET={91:_E},TT={[-2]:hd,[-1]:hd,32:hd},AT={35:LE,42:ro,45:[ev,ro],60:HE,61:ev,95:ro,96:Wy,126:Wy},CT={38:Ib,92:Hb},NT={[-5]:pd,[-4]:pd,[-3]:pd,33:nT,38:Ib,42:Ud,60:[sE,QE],91:lT,92:[ME,Hb],93:ch,95:Ud,96:xE},jT={null:[Ud,bT]},OT={null:[42,95]},_T={null:[]},zT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:OT,contentInitial:ET,disable:_T,document:kT,flow:AT,flowInitial:TT,insideSpan:jT,string:CT,text:NT},Symbol.toStringTag,{value:"Module"}));function qT(n,l,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const u={},o=[];let f=[],h=[];const p={attempt:Q(te),check:Q(O),consume:M,enter:H,exit:$,interrupt:Q(O,{interrupt:!0})},g={code:null,containerState:{},defineSkip:T,events:[],now:k,parser:n,previous:null,sliceSerialize:S,sliceStream:x,write:m};let y=l.tokenize.call(g,p);return l.resolveAll&&o.push(l),g;function m(Z){return f=Kn(f,Z),A(),f[f.length-1]!==null?[]:(ne(l,0),g.events=To(o,g.events,g),g.events)}function S(Z,P){return MT(x(Z),P)}function x(Z){return RT(f,Z)}function k(){const{_bufferIndex:Z,_index:P,line:Se,column:Re,offset:ae}=r;return{_bufferIndex:Z,_index:P,line:Se,column:Re,offset:ae}}function T(Z){u[Z.line]=Z.column,_()}function A(){for(;r._index<f.length;){const Z=f[r._index];if(typeof Z=="string"){const P=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<Z.length;)E(Z.charCodeAt(r._bufferIndex))}else E(Z)}}function E(Z){y=y(Z)}function M(Z){Ce(Z)?(r.line++,r.column=1,r.offset+=Z===-3?2:1,_()):Z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===f[r._index].length&&(r._bufferIndex=-1,r._index++)),g.previous=Z}function H(Z,P){const Se=P||{};return Se.type=Z,Se.start=k(),g.events.push(["enter",Se,g]),h.push(Se),Se}function $(Z){const P=h.pop();return P.end=k(),g.events.push(["exit",P,g]),P}function te(Z,P){ne(Z,P.from)}function O(Z,P){P.restore()}function Q(Z,P){return Se;function Se(Re,ae,G){let se,ue,ke,j;return Array.isArray(Re)?ht(Re):"tokenize"in Re?ht([Re]):Pe(Re);function Pe(fe){return ge;function ge(Te){const Ne=Te!==null&&fe[Te],Ee=Te!==null&&fe.null,W=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return ht(W)(Te)}}function ht(fe){return se=fe,ue=0,fe.length===0?G:z(fe[ue])}function z(fe){return ge;function ge(Te){return j=he(),ke=fe,fe.partial||(g.currentConstruct=fe),fe.name&&g.parser.constructs.disable.null.includes(fe.name)?ee():fe.tokenize.call(P?Object.assign(Object.create(g),P):g,p,q,ee)(Te)}}function q(fe){return Z(ke,j),ae}function ee(fe){return j.restore(),++ue<se.length?z(se[ue]):G}}}function ne(Z,P){Z.resolveAll&&!o.includes(Z)&&o.push(Z),Z.resolve&&ai(g.events,P,g.events.length-P,Z.resolve(g.events.slice(P),g)),Z.resolveTo&&(g.events=Z.resolveTo(g.events,g))}function he(){const Z=k(),P=g.previous,Se=g.currentConstruct,Re=g.events.length,ae=Array.from(h);return{from:Re,restore:G};function G(){r=Z,g.previous=P,g.currentConstruct=Se,g.events.length=Re,h=ae,_()}}function _(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function RT(n,l){const a=l.start._index,r=l.start._bufferIndex,u=l.end._index,o=l.end._bufferIndex;let f;if(a===u)f=[n[a].slice(r,o)];else{if(f=n.slice(a,u),r>-1){const h=f[0];typeof h=="string"?f[0]=h.slice(r):f.shift()}o>0&&f.push(n[u].slice(0,o))}return f}function MT(n,l){let a=-1;const r=[];let u;for(;++a<n.length;){const o=n[a];let f;if(typeof o=="string")f=o;else switch(o){case-5:{f="\r";break}case-4:{f=`
23
- `;break}case-3:{f=`\r
24
- `;break}case-2:{f=l?" ":" ";break}case-1:{if(!l&&u)continue;f=" ";break}default:f=String.fromCharCode(o)}u=o===-2,r.push(f)}return r.join("")}function DT(n){const r={constructs:Mb([zT,...(n||{}).extensions||[]]),content:u(eE),defined:[],document:u(nE),flow:u(yT),lazy:{},string:u(xT),text:u(ST)};return r;function u(o){return f;function f(h){return qT(r,o,h)}}}function LT(n){for(;!Vb(n););return n}const tv=/[\0\t\n\r]/g;function BT(){let n=1,l="",a=!0,r;return u;function u(o,f,h){o=l+(typeof o=="string"?o.toString():new TextDecoder(f||void 0).decode(o));const p=[];let g=0;for(l="",a&&(o.charCodeAt(0)===65279&&g++,a=void 0);g<o.length;){tv.lastIndex=g;const y=tv.exec(o),m=y&&y.index!==void 0?y.index:o.length,S=o.charCodeAt(m);if(!y){l=o.slice(g);break}if(S===10&&g===m&&r)p.push(-3),r=void 0;else switch(r&&(p.push(-5),r=void 0),g<m&&(p.push(o.slice(g,m)),n+=m-g),S){case 0:{p.push(65533),n++;break}case 9:{const x=Math.ceil(n/4)*4;for(p.push(-2);n++<x;)p.push(-1);break}case 10:{p.push(-4),n=1;break}default:r=!0,n=1}g=m+1}return h&&(r&&p.push(-5),l&&p.push(l),p.push(null)),p}}const UT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function HT(n){return n.replace(UT,IT)}function IT(n,l,a){if(l)return l;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),o=u===120||u===88;return Db(a.slice(o?2:1),o?16:10)}return oh(a)||n}const Kb={}.hasOwnProperty;function VT(n,l,a){return l&&typeof l=="object"&&(a=l,l=void 0),YT(a)(LT(DT(a).document().write(BT()(n,l,!0))))}function YT(n){const l={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:f(lt),autolinkProtocol:_,autolinkEmail:_,atxHeading:f(_t),blockQuote:f(W),characterEscape:_,characterReference:_,codeFenced:f(de),codeFencedFenceInfo:h,codeFencedFenceMeta:h,codeIndented:f(de,h),codeText:f(it,h),codeTextData:_,data:_,codeFlowValue:_,definition:f(nn),definitionDestinationString:h,definitionLabelString:h,definitionTitleString:h,emphasis:f(we),hardBreakEscape:f(pt),hardBreakTrailing:f(pt),htmlFlow:f(Ke,h),htmlFlowData:_,htmlText:f(Ke,h),htmlTextData:_,image:f(qe),label:h,link:f(lt),listItem:f(un),listItemValue:x,listOrdered:f(wt,S),listUnordered:f(wt),paragraph:f(Ht),reference:q,referenceString:h,resourceDestinationString:h,resourceTitleString:h,setextHeading:f(_t),strong:f(It),thematicBreak:f(Vt)},exit:{atxHeading:g(),atxHeadingSequence:O,autolink:g(),autolinkEmail:Ee,autolinkProtocol:Ne,blockQuote:g(),characterEscapeValue:Z,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ge,characterReference:Te,codeFenced:g(E),codeFencedFence:A,codeFencedFenceInfo:k,codeFencedFenceMeta:T,codeFlowValue:Z,codeIndented:g(M),codeText:g(G),codeTextData:Z,data:Z,definition:g(),definitionDestinationString:te,definitionLabelString:H,definitionTitleString:$,emphasis:g(),hardBreakEscape:g(Se),hardBreakTrailing:g(Se),htmlFlow:g(Re),htmlFlowData:Z,htmlText:g(ae),htmlTextData:Z,image:g(ue),label:j,labelText:ke,lineEnding:P,link:g(se),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:ee,resourceDestinationString:Pe,resourceTitleString:ht,resource:z,setextHeading:g(he),setextHeadingLineSequence:ne,setextHeadingText:Q,strong:g(),thematicBreak:g()}};Jb(l,(n||{}).mdastExtensions||[]);const a={};return r;function r(X){let ie={type:"root",children:[],position:void 0};const ve={stack:[ie],tokenStack:[],config:l,enter:p,exit:y,buffer:h,resume:m,data:a},be=[],kt=[];let _e=-1;for(;++_e<X.length;)if(kt.push(X[_e]),X[_e][1].type==="listOrdered"||X[_e][1].type==="listUnordered")if(X[_e][0]==="enter")be.push(kt.length-1);else{const bt=be.pop();o(kt,bt)}for(X=kt,_e=-1;++_e<X.length;){const bt=l[X[_e][0]];X[_e][0]==="enter"&&l.beforeEnter.length>0&&u(l.beforeEnter,{...ve,sliceSerialize:X[_e][2].sliceSerialize},X[_e][1]),Kb.call(bt,X[_e][1].type)&&bt[X[_e][1].type].call({...ve,sliceSerialize:X[_e][2].sliceSerialize},X[_e][1]),X[_e][0]==="exit"&&l.afterExit.length>0&&u(l.afterExit,{...ve,sliceSerialize:X[_e][2].sliceSerialize},X[_e][1])}if(ve.tokenStack.length>0){const bt=ve.tokenStack[ve.tokenStack.length-1];(bt[1]||nv).call(ve,void 0,bt[0])}for(ie.position={start:xl(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:xl(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<l.transforms.length;)ie=l.transforms[_e](ie)||ie;return ie}function u(X,ie,ve){let be=-1;for(;++be<X.length;)X[be].call(ie,ve)}function o(X,ie){const ve=X.length-1;let be=ie-1,kt=-1,_e=!1,bt,mt,Yt,vn;const Bn=[];for(;++be<=ve;){const at=X[be];switch(at[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{at[0]==="enter"?kt++:kt--,vn=void 0;break}case"lineEndingBlank":{at[0]==="enter"&&(bt&&!vn&&!kt&&!Yt&&(Yt=be),vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vn=void 0}if(!kt&&at[0]==="enter"&&at[1].type==="listItemPrefix"||kt===-1&&at[0]==="exit"&&(at[1].type==="listUnordered"||at[1].type==="listOrdered")){if(bt){let An=be;for(mt=void 0;An--;){const Rt=X[An];if(Rt[1].type==="lineEnding"||Rt[1].type==="lineEndingBlank"){if(Rt[0]==="exit")continue;mt&&(X[mt][1].type="lineEndingBlank",_e=!0),Rt[1].type="lineEnding",mt=An}else if(!(Rt[1].type==="linePrefix"||Rt[1].type==="blockQuotePrefix"||Rt[1].type==="blockQuotePrefixWhitespace"||Rt[1].type==="blockQuoteMarker"||Rt[1].type==="listItemIndent"))break}Yt&&(!mt||Yt<mt)&&(bt._spread=!0),bt.end=Object.assign({},mt?X[mt][1].start:at[1].end),Bn.push({at:mt||be,event:["exit",bt,at[2]]})}if(at[1].type==="listItemPrefix"){const An={type:"listItem",_spread:!1,start:Object.assign({},at[1].start),end:void 0};bt=An,Bn.push({at:be,event:["enter",An,at[2]]}),Yt=void 0,vn=!0}}}const ua=X.splice(ie);let qt=0;for(be=-1;++be<ua.length;){for(;qt<Bn.length&&Bn[qt].at===ie+be;)X.push(Bn[qt++].event);X.push(ua[be])}X[ie][1]._spread=_e}function f(X,ie){return ve;function ve(be){p.call(this,X(be),be),ie&&ie.call(this,be)}}function h(){this.stack.push({type:"fragment",children:[]})}function p(X,ie,ve){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([ie,ve||void 0]),X.position={start:xl(ie.start),end:void 0}}function g(X){return ie;function ie(ve){X&&X.call(this,ve),y.call(this,ve)}}function y(X,ie){const ve=this.stack.pop(),be=this.tokenStack.pop();if(!be)throw new Error("Cannot close `"+X.type+"` ("+ls({start:X.start,end:X.end})+"): it’s not open");be[0].type!==X.type&&(ie?ie.call(this,X,be[0]):(be[1]||nv).call(this,X,be[0])),ve.position.end=xl(X.end)}function m(){return Eo(this.stack.pop())}function S(){this.data.expectingFirstListItemValue=!0}function x(X){if(this.data.expectingFirstListItemValue){const ie=this.stack[this.stack.length-2];ie.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function k(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.lang=X}function T(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.meta=X}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.value=X.replace(/(\r?\n|\r)$/g,"")}function H(X){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ie,ve.identifier=ri(this.sliceSerialize(X)).toLowerCase()}function $(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.title=X}function te(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.url=X}function O(X){const ie=this.stack[this.stack.length-1];if(!ie.depth){const ve=this.sliceSerialize(X).length;ie.depth=ve}}function Q(){this.data.setextHeadingSlurpLineEnding=!0}function ne(X){const ie=this.stack[this.stack.length-1];ie.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function he(){this.data.setextHeadingSlurpLineEnding=void 0}function _(X){const ve=this.stack[this.stack.length-1].children;let be=ve[ve.length-1];(!be||be.type!=="text")&&(be=on(),be.position={start:xl(X.start),end:void 0},ve.push(be)),this.stack.push(be)}function Z(X){const ie=this.stack.pop();ie.value+=this.sliceSerialize(X),ie.position.end=xl(X.end)}function P(X){const ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=ie.children[ie.children.length-1];ve.position.end=xl(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&l.canContainEols.includes(ie.type)&&(_.call(this,X),Z.call(this,X))}function Se(){this.data.atHardBreak=!0}function Re(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.value=X}function ae(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.value=X}function G(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.value=X}function se(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=ie,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function ue(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=ie,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function ke(X){const ie=this.sliceSerialize(X),ve=this.stack[this.stack.length-2];ve.label=HT(ie),ve.identifier=ri(ie).toLowerCase()}function j(){const X=this.stack[this.stack.length-1],ie=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const be=X.children;ve.children=be}else ve.alt=ie}function Pe(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.url=X}function ht(){const X=this.resume(),ie=this.stack[this.stack.length-1];ie.title=X}function z(){this.data.inReference=void 0}function q(){this.data.referenceType="collapsed"}function ee(X){const ie=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ie,ve.identifier=ri(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function fe(X){this.data.characterReferenceType=X.type}function ge(X){const ie=this.sliceSerialize(X),ve=this.data.characterReferenceType;let be;ve?(be=Db(ie,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):be=oh(ie);const kt=this.stack[this.stack.length-1];kt.value+=be}function Te(X){const ie=this.stack.pop();ie.position.end=xl(X.end)}function Ne(X){Z.call(this,X);const ie=this.stack[this.stack.length-1];ie.url=this.sliceSerialize(X)}function Ee(X){Z.call(this,X);const ie=this.stack[this.stack.length-1];ie.url="mailto:"+this.sliceSerialize(X)}function W(){return{type:"blockquote",children:[],position:void 0}}function de(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function it(){return{type:"inlineCode",value:"",position:void 0}}function nn(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function we(){return{type:"emphasis",children:[],position:void 0}}function _t(){return{type:"heading",depth:0,children:[],position:void 0}}function pt(){return{type:"break",position:void 0}}function Ke(){return{type:"html",value:"",position:void 0}}function qe(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function lt(){return{type:"link",title:null,url:"",children:[],position:void 0}}function wt(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[],position:void 0}}function un(X){return{type:"listItem",spread:X._spread,checked:null,children:[],position:void 0}}function Ht(){return{type:"paragraph",children:[],position:void 0}}function It(){return{type:"strong",children:[],position:void 0}}function on(){return{type:"text",value:"",position:void 0}}function Vt(){return{type:"thematicBreak",position:void 0}}}function xl(n){return{line:n.line,column:n.column,offset:n.offset}}function Jb(n,l){let a=-1;for(;++a<l.length;){const r=l[a];Array.isArray(r)?Jb(n,r):GT(n,r)}}function GT(n,l){let a;for(a in l)if(Kb.call(l,a))switch(a){case"canContainEols":{const r=l[a];r&&n[a].push(...r);break}case"transforms":{const r=l[a];r&&n[a].push(...r);break}case"afterExit":case"beforeEnter":{const r=l[a];r&&n[a].push(r);break}case"enter":case"exit":{const r=l[a];r&&Object.assign(n[a],r);break}}}function nv(n,l){throw n?new Error("Cannot close `"+n.type+"` ("+ls({start:n.start,end:n.end})+"): a different token (`"+l.type+"`, "+ls({start:l.start,end:l.end})+") is open"):new Error("Cannot close document, a token (`"+l.type+"`, "+ls({start:l.start,end:l.end})+") is still open")}function QT(n){const l=this;l.parser=a;function a(r){return VT(r,{...l.data("settings"),...n,extensions:l.data("micromarkExtensions")||[],mdastExtensions:l.data("fromMarkdownExtensions")||[]})}}function XT(n,l){const a={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(l),!0)};return n.patch(l,a),n.applyData(l,a)}function FT(n,l){const a={type:"element",tagName:"br",properties:{},children:[]};return n.patch(l,a),[n.applyData(l,a),{type:"text",value:`
25
- `}]}function ZT(n,l){const a=l.value?l.value+`
26
- `:"",r={},u=l.lang?l.lang.split(/\s+/):[];u.length>0&&(r.className=["language-"+u[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return l.meta&&(o.data={meta:l.meta}),n.patch(l,o),o=n.applyData(l,o),o={type:"element",tagName:"pre",properties:{},children:[o]},n.patch(l,o),o}function KT(n,l){const a={type:"element",tagName:"del",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function JT(n,l){const a={type:"element",tagName:"em",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function $T(n,l){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",r=String(l.identifier).toUpperCase(),u=tr(r.toLowerCase()),o=n.footnoteOrder.indexOf(r);let f,h=n.footnoteCounts.get(r);h===void 0?(h=0,n.footnoteOrder.push(r),f=n.footnoteOrder.length):f=o+1,h+=1,n.footnoteCounts.set(r,h);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+u,id:a+"fnref-"+u+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(l,p);const g={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(l,g),n.applyData(l,g)}function PT(n,l){const a={type:"element",tagName:"h"+l.depth,properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function WT(n,l){if(n.options.allowDangerousHtml){const a={type:"raw",value:l.value};return n.patch(l,a),n.applyData(l,a)}}function $b(n,l){const a=l.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+r}];const u=n.all(l),o=u[0];o&&o.type==="text"?o.value="["+o.value:u.unshift({type:"text",value:"["});const f=u[u.length-1];return f&&f.type==="text"?f.value+=r:u.push({type:"text",value:r}),u}function eA(n,l){const a=String(l.identifier).toUpperCase(),r=n.definitionById.get(a);if(!r)return $b(n,l);const u={src:tr(r.url||""),alt:l.alt};r.title!==null&&r.title!==void 0&&(u.title=r.title);const o={type:"element",tagName:"img",properties:u,children:[]};return n.patch(l,o),n.applyData(l,o)}function tA(n,l){const a={src:tr(l.url)};l.alt!==null&&l.alt!==void 0&&(a.alt=l.alt),l.title!==null&&l.title!==void 0&&(a.title=l.title);const r={type:"element",tagName:"img",properties:a,children:[]};return n.patch(l,r),n.applyData(l,r)}function nA(n,l){const a={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};n.patch(l,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return n.patch(l,r),n.applyData(l,r)}function iA(n,l){const a=String(l.identifier).toUpperCase(),r=n.definitionById.get(a);if(!r)return $b(n,l);const u={href:tr(r.url||"")};r.title!==null&&r.title!==void 0&&(u.title=r.title);const o={type:"element",tagName:"a",properties:u,children:n.all(l)};return n.patch(l,o),n.applyData(l,o)}function lA(n,l){const a={href:tr(l.url)};l.title!==null&&l.title!==void 0&&(a.title=l.title);const r={type:"element",tagName:"a",properties:a,children:n.all(l)};return n.patch(l,r),n.applyData(l,r)}function aA(n,l,a){const r=n.all(l),u=a?rA(a):Pb(l),o={},f=[];if(typeof l.checked=="boolean"){const y=r[0];let m;y&&y.type==="element"&&y.tagName==="p"?m=y:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let h=-1;for(;++h<r.length;){const y=r[h];(u||h!==0||y.type!=="element"||y.tagName!=="p")&&f.push({type:"text",value:`
27
- `}),y.type==="element"&&y.tagName==="p"&&!u?f.push(...y.children):f.push(y)}const p=r[r.length-1];p&&(u||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
28
- `});const g={type:"element",tagName:"li",properties:o,children:f};return n.patch(l,g),n.applyData(l,g)}function rA(n){let l=!1;if(n.type==="list"){l=n.spread||!1;const a=n.children;let r=-1;for(;!l&&++r<a.length;)l=Pb(a[r])}return l}function Pb(n){const l=n.spread;return l??n.children.length>1}function sA(n,l){const a={},r=n.all(l);let u=-1;for(typeof l.start=="number"&&l.start!==1&&(a.start=l.start);++u<r.length;){const f=r[u];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const o={type:"element",tagName:l.ordered?"ol":"ul",properties:a,children:n.wrap(r,!0)};return n.patch(l,o),n.applyData(l,o)}function uA(n,l){const a={type:"element",tagName:"p",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function oA(n,l){const a={type:"root",children:n.wrap(n.all(l))};return n.patch(l,a),n.applyData(l,a)}function cA(n,l){const a={type:"element",tagName:"strong",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function fA(n,l){const a=n.all(l),r=a.shift(),u=[];if(r){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([r],!0)};n.patch(l.children[0],f),u.push(f)}if(a.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(a,!0)},h=ah(l.children[1]),p=Nb(l.children[l.children.length-1]);h&&p&&(f.position={start:h,end:p}),u.push(f)}const o={type:"element",tagName:"table",properties:{},children:n.wrap(u,!0)};return n.patch(l,o),n.applyData(l,o)}function dA(n,l,a){const r=a?a.children:void 0,o=(r?r.indexOf(l):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,h=f?f.length:l.children.length;let p=-1;const g=[];for(;++p<h;){const m=l.children[p],S={},x=f?f[p]:void 0;x&&(S.align=x);let k={type:"element",tagName:o,properties:S,children:[]};m&&(k.children=n.all(m),n.patch(m,k),k=n.applyData(m,k)),g.push(k)}const y={type:"element",tagName:"tr",properties:{},children:n.wrap(g,!0)};return n.patch(l,y),n.applyData(l,y)}function hA(n,l){const a={type:"element",tagName:"td",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}const iv=9,lv=32;function pA(n){const l=String(n),a=/\r?\n|\r/g;let r=a.exec(l),u=0;const o=[];for(;r;)o.push(av(l.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(l);return o.push(av(l.slice(u),u>0,!1)),o.join("")}function av(n,l,a){let r=0,u=n.length;if(l){let o=n.codePointAt(r);for(;o===iv||o===lv;)r++,o=n.codePointAt(r)}if(a){let o=n.codePointAt(u-1);for(;o===iv||o===lv;)u--,o=n.codePointAt(u-1)}return u>r?n.slice(r,u):""}function mA(n,l){const a={type:"text",value:pA(String(l.value))};return n.patch(l,a),n.applyData(l,a)}function gA(n,l){const a={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(l,a),n.applyData(l,a)}const yA={blockquote:XT,break:FT,code:ZT,delete:KT,emphasis:JT,footnoteReference:$T,heading:PT,html:WT,imageReference:eA,image:tA,inlineCode:nA,linkReference:iA,link:lA,listItem:aA,list:sA,paragraph:uA,root:oA,strong:cA,table:fA,tableCell:hA,tableRow:dA,text:mA,thematicBreak:gA,toml:Wu,yaml:Wu,definition:Wu,footnoteDefinition:Wu};function Wu(){}const Wb=-1,Ao=0,rs=1,fo=2,fh=3,dh=4,hh=5,ph=6,e0=7,t0=8,{defineProperty:vA}=Object,n0=typeof self=="object"?self:globalThis,rv=(n,l)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new n0[n](l)},bA=(n,l)=>{const a=(u,o)=>(n.set(o,u),u),r=u=>{if(n.has(u))return n.get(u);const[o,f]=l[u];switch(o){case Ao:case Wb:return a(f,u);case rs:{const h=a([],u);for(const p of f)h.push(r(p));return h}case fo:{const h=a({},u);for(const[p,g]of f){const y=r(p),m=r(g);y==="__proto__"?vA(h,y,{value:m,configurable:!0,enumerable:!0,writable:!0}):h[y]=m}return h}case fh:return a(new Date(f),u);case dh:{const{source:h,flags:p}=f;return a(new RegExp(h,p),u)}case hh:{const h=a(new Map,u);for(const[p,g]of f)h.set(r(p),r(g));return h}case ph:{const h=a(new Set,u);for(const p of f)h.add(r(p));return h}case e0:{const{name:h,message:p}=f;return a(typeof n0[h]=="function"?rv(h,p):new Error(p),u)}case t0:return a(BigInt(f),u);case"BigInt":return a(Object(BigInt(f)),u);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:h}=new Uint8Array(f);return a(new DataView(h),f)}case"-0":return-0}return a(rv(o,f),u)};return r},sv=n=>bA(new Map,n)(0),ia="",{toString:xA}={},{keys:SA,is:wA}=Object,ts=n=>{const l=typeof n;if(l!=="object"||!n)return[Ao,l];const a=xA.call(n).slice(8,-1);switch(a){case"Array":return[rs,ia];case"Object":return[fo,ia];case"Date":return[fh,ia];case"RegExp":return[dh,ia];case"Map":return[hh,ia];case"Set":return[ph,ia];case"DataView":return[rs,a]}return a.includes("Array")?[rs,a]:n instanceof Error?[e0,n.name||"Error"]:[fo,a]},eo=([n,l])=>n===Ao&&(l==="function"||l==="symbol"),kA=(n,l,a,r)=>{const u=(f,h)=>{const p=r.push(f)-1;return a.set(h,p),p},o=f=>{if(a.has(f))return a.get(f);let[h,p]=ts(f);switch(h){case Ao:{let y=f;switch(p){case"bigint":h=t0,y=f.toString();break;case"number":if(!f&&wA(f,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return u([Wb],f)}return u([h,y],f)}case rs:{if(p){let S=f;return p==="DataView"?S=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(S=new Uint8Array(f)),u([p,[...S]],f)}const y=[],m=u([h,y],f);for(const S of f)y.push(o(S));return m}case fo:{if(p)switch(p){case"BigInt":return u([p,f.toString()],f);case"Boolean":case"Number":case"String":return u([p,f.valueOf()],f)}if(l&&"toJSON"in f)return o(f.toJSON());const y=[],m=u([h,y],f);for(const S of SA(f))(n||!eo(ts(f[S])))&&y.push([o(S),o(f[S])]);return m}case fh:return u([h,isNaN(f.getTime())?ia:f.toISOString()],f);case dh:{const{source:y,flags:m}=f;return u([h,{source:y,flags:m}],f)}case hh:{const y=[],m=u([h,y],f);for(const[S,x]of f)(n||!(eo(ts(S))||eo(ts(x))))&&y.push([o(S),o(x)]);return m}case ph:{const y=[],m=u([h,y],f);for(const S of f)(n||!eo(ts(S)))&&y.push(o(S));return m}}const{message:g}=f;return u([h,{name:p,message:g}],f)};return o},uv=(n,{json:l,lossy:a}={})=>{const r=[];return kA(!(l||a),!!l,new Map,r)(n),r},ho=typeof structuredClone=="function"?(n,l)=>l&&("json"in l||"lossy"in l)?sv(uv(n,l)):structuredClone(n):(n,l)=>sv(uv(n,l));function EA(n,l){const a=[{type:"text",value:"↩"}];return l>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),a}function TA(n,l){return"Back to reference "+(n+1)+(l>1?"-"+l:"")}function AA(n){const l=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=n.options.footnoteBackContent||EA,r=n.options.footnoteBackLabel||TA,u=n.options.footnoteLabel||"Footnotes",o=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let p=-1;for(;++p<n.footnoteOrder.length;){const g=n.footnoteById.get(n.footnoteOrder[p]);if(!g)continue;const y=n.all(g),m=String(g.identifier).toUpperCase(),S=tr(m.toLowerCase());let x=0;const k=[],T=n.footnoteCounts.get(m);for(;T!==void 0&&++x<=T;){k.length>0&&k.push({type:"text",value:" "});let M=typeof a=="string"?a:a(p,x);typeof M=="string"&&(M={type:"text",value:M}),k.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+S+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(p,x),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const A=y[y.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const M=A.children[A.children.length-1];M&&M.type==="text"?M.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:l+"fn-"+S},children:n.wrap(y,!0)};n.patch(g,E),h.push(E)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ho(f),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
29
- `},{type:"element",tagName:"ol",properties:{},children:n.wrap(h,!0)},{type:"text",value:`
30
- `}]}}const Co=(function(n){if(n==null)return OA;if(typeof n=="function")return No(n);if(typeof n=="object")return Array.isArray(n)?CA(n):NA(n);if(typeof n=="string")return jA(n);throw new Error("Expected function, string, or object as test")});function CA(n){const l=[];let a=-1;for(;++a<n.length;)l[a]=Co(n[a]);return No(r);function r(...u){let o=-1;for(;++o<l.length;)if(l[o].apply(this,u))return!0;return!1}}function NA(n){const l=n;return No(a);function a(r){const u=r;let o;for(o in n)if(u[o]!==l[o])return!1;return!0}}function jA(n){return No(l);function l(a){return a&&a.type===n}}function No(n){return l;function l(a,r,u){return!!(_A(a)&&n.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function OA(){return!0}function _A(n){return n!==null&&typeof n=="object"&&"type"in n}const i0=[],zA=!0,ss=!1,Vd="skip";function Yd(n,l,a,r){if(!n||typeof n!="object")throw new Error("Unexpected value `"+n+"` for `tree`, expected node");let u=!0,o,f,h,p;if(typeof a=="function"||a&&typeof a=="object"?(o=l,f=a,r&&(u=!1)):(f=l,a&&(u=!1)),typeof f=="function")h=f;else if(f&&typeof f=="object"){if(!(f.enter===null||f.enter===void 0))if(typeof f.enter=="function")h=f.enter;else throw new Error("Unexpected value `"+f.enter+"` for `visitors.enter`, expected optional visitor");if(typeof f.exit=="function")p=f.exit;else throw new Error("Unexpected value `"+f.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+f+"` for `enter` or `visitors`, expected visitor or object with visitors");const g=Co(o),y=u?1:-1;m(n,void 0,[])();function m(S,x,k){const T=S&&typeof S=="object"?S:{};if(typeof T.type=="string"){const E=typeof T.tagName=="string"?T.tagName:typeof T.name=="string"?T.name:void 0;Object.defineProperty(A,"name",{value:"node ("+(S.type+(E?"<"+E+">":""))+")"})}return A;function A(){const E=!o||g(S,x,k[k.length-1]||void 0);let M=i0;if(h&&E&&(M=ov(h(S,k,x)),M[0]===ss))return M;if("children"in S&&S.children){const H=S;if(H.children&&M[0]!==Vd){let $=(u?-1:H.children.length)+y;const te=[...k,H];for(;$>-1&&$<H.children.length;){const O=H.children[$],Q=m(O,$,te)();if(Q[0]===ss)return Q;$=typeof Q[1]=="number"?Q[1]:$+y}}}if(p&&E){const H=ov(p(S,k,x));if(H[0]===Vd)throw new Error("Unexpected value `"+H[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(H[0]===ss||typeof H[1]=="number")return H}return M}}}function ov(n){return Array.isArray(n)?n:typeof n=="number"?[zA,n]:n==null?i0:[n]}function jo(n,l,a,r){let u,o,f;o=l,f=a,typeof o=="function"?Yd(n,u,Gd(o),f):Yd(n,u,qA(o),f)}function qA(n){return!n||typeof n!="object"?n:{enter:typeof n.enter=="function"?Gd(n.enter):n.enter,exit:typeof n.exit=="function"?Gd(n.exit):n.exit}}function Gd(n){return l;function l(a,r,u){return n(a,u,r[r.length-1])}}const Qd={}.hasOwnProperty,RA={};function MA(n,l){const a=l||RA,r=new Map,u=new Map,o=new Map,f={...yA,...a.handlers},h={all:g,applyData:LA,definitionById:r,footnoteById:u,footnoteCounts:o,footnoteOrder:[],handlers:f,one:p,options:a,patch:DA,wrap:UA};return jo(n,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const m=y.type==="definition"?r:u,S=String(y.identifier).toUpperCase();m.has(S)||m.set(S,y)}}),h;function p(y,m){const S=y.type,x=h.handlers[S];if(Qd.call(h.handlers,S)&&x)return x(h,y,m);if(h.options.passThrough&&h.options.passThrough.includes(S)){if("children"in y){const{children:T,...A}=y,E=ho(A);return E.children=h.all(y),E}return ho(y)}return(h.options.unknownHandler||BA)(h,y,m)}function g(y){const m=[];if("children"in y){const S=y.children;let x=-1;for(;++x<S.length;){const k=h.one(S[x],y);if(k){if(x&&S[x-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=cv(k.value)),!Array.isArray(k)&&k.type==="element")){const T=k.children[0];T&&T.type==="text"&&(T.value=cv(T.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function DA(n,l){n.position&&(l.position=Tk(n))}function LA(n,l){let a=l;if(n&&n.data){const r=n.data.hName,u=n.data.hChildren,o=n.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const f="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:f}}a.type==="element"&&o&&Object.assign(a.properties,ho(o)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function BA(n,l){const a=l.data||{},r="value"in l&&!(Qd.call(a,"hProperties")||Qd.call(a,"hChildren"))?{type:"text",value:l.value}:{type:"element",tagName:"div",properties:{},children:n.all(l)};return n.patch(l,r),n.applyData(l,r)}function UA(n,l){const a=[];let r=-1;for(l&&a.push({type:"text",value:`
31
- `});++r<n.length;)r&&a.push({type:"text",value:`
32
- `}),a.push(n[r]);return l&&n.length>0&&a.push({type:"text",value:`
33
- `}),a}function cv(n){let l=0,a=n.charCodeAt(l);for(;a===9||a===32;)l++,a=n.charCodeAt(l);return n.slice(l)}function fv(n,l){const a=MA(n,l),r=a.one(n,void 0),u=AA(a),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return u&&o.children.push({type:"text",value:`
34
- `},u),o}function HA(n,l){return n&&"run"in n?async function(a,r){const u=fv(a,{file:r,...l});await n.run(u,r)}:function(a,r){return fv(a,{file:r,...n||l})}}function dv(n){if(n)throw n}var md,hv;function IA(){if(hv)return md;hv=1;var n=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=function(g){return typeof Array.isArray=="function"?Array.isArray(g):l.call(g)==="[object Array]"},o=function(g){if(!g||l.call(g)!=="[object Object]")return!1;var y=n.call(g,"constructor"),m=g.constructor&&g.constructor.prototype&&n.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!y&&!m)return!1;var S;for(S in g);return typeof S>"u"||n.call(g,S)},f=function(g,y){a&&y.name==="__proto__"?a(g,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):g[y.name]=y.newValue},h=function(g,y){if(y==="__proto__")if(n.call(g,y)){if(r)return r(g,y).value}else return;return g[y]};return md=function p(){var g,y,m,S,x,k,T=arguments[0],A=1,E=arguments.length,M=!1;for(typeof T=="boolean"&&(M=T,T=arguments[1]||{},A=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});A<E;++A)if(g=arguments[A],g!=null)for(y in g)m=h(T,y),S=h(g,y),T!==S&&(M&&S&&(o(S)||(x=u(S)))?(x?(x=!1,k=m&&u(m)?m:[]):k=m&&o(m)?m:{},f(T,{name:y,newValue:p(M,k,S)})):typeof S<"u"&&f(T,{name:y,newValue:S}));return T},md}var VA=IA();const gd=OS(VA);function Xd(n){if(typeof n!="object"||n===null)return!1;const l=Object.getPrototypeOf(n);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function YA(){const n=[],l={run:a,use:r};return l;function a(...u){let o=-1;const f=u.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);h(null,...u);function h(p,...g){const y=n[++o];let m=-1;if(p){f(p);return}for(;++m<u.length;)(g[m]===null||g[m]===void 0)&&(g[m]=u[m]);u=g,y?GA(y,h)(...g):f(null,...g)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return n.push(u),l}}function GA(n,l){let a;return r;function r(...f){const h=n.length>f.length;let p;h&&f.push(u);try{p=n.apply(this,f)}catch(g){const y=g;if(h&&a)throw y;return u(y)}h||(p&&p.then&&typeof p.then=="function"?p.then(o,u):p instanceof Error?u(p):o(p))}function u(f,...h){a||(a=!0,l(f,...h))}function o(f){u(null,f)}}const xi={basename:QA,dirname:XA,extname:FA,join:ZA,sep:"/"};function QA(n,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');bs(n);let a=0,r=-1,u=n.length,o;if(l===void 0||l.length===0||l.length>n.length){for(;u--;)if(n.codePointAt(u)===47){if(o){a=u+1;break}}else r<0&&(o=!0,r=u+1);return r<0?"":n.slice(a,r)}if(l===n)return"";let f=-1,h=l.length-1;for(;u--;)if(n.codePointAt(u)===47){if(o){a=u+1;break}}else f<0&&(o=!0,f=u+1),h>-1&&(n.codePointAt(u)===l.codePointAt(h--)?h<0&&(r=u):(h=-1,r=f));return a===r?r=f:r<0&&(r=n.length),n.slice(a,r)}function XA(n){if(bs(n),n.length===0)return".";let l=-1,a=n.length,r;for(;--a;)if(n.codePointAt(a)===47){if(r){l=a;break}}else r||(r=!0);return l<0?n.codePointAt(0)===47?"/":".":l===1&&n.codePointAt(0)===47?"//":n.slice(0,l)}function FA(n){bs(n);let l=n.length,a=-1,r=0,u=-1,o=0,f;for(;l--;){const h=n.codePointAt(l);if(h===47){if(f){r=l+1;break}continue}a<0&&(f=!0,a=l+1),h===46?u<0?u=l:o!==1&&(o=1):u>-1&&(o=-1)}return u<0||a<0||o===0||o===1&&u===a-1&&u===r+1?"":n.slice(u,a)}function ZA(...n){let l=-1,a;for(;++l<n.length;)bs(n[l]),n[l]&&(a=a===void 0?n[l]:a+"/"+n[l]);return a===void 0?".":KA(a)}function KA(n){bs(n);const l=n.codePointAt(0)===47;let a=JA(n,!l);return a.length===0&&!l&&(a="."),a.length>0&&n.codePointAt(n.length-1)===47&&(a+="/"),l?"/"+a:a}function JA(n,l){let a="",r=0,u=-1,o=0,f=-1,h,p;for(;++f<=n.length;){if(f<n.length)h=n.codePointAt(f);else{if(h===47)break;h=47}if(h===47){if(!(u===f-1||o===1))if(u!==f-1&&o===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",r=0):(a=a.slice(0,p),r=a.length-1-a.lastIndexOf("/")),u=f,o=0;continue}}else if(a.length>0){a="",r=0,u=f,o=0;continue}}l&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+n.slice(u+1,f):a=n.slice(u+1,f),r=f-u-1;u=f,o=0}else h===46&&o>-1?o++:o=-1}return a}function bs(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const $A={cwd:PA};function PA(){return"/"}function Fd(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function WA(n){if(typeof n=="string")n=new URL(n);else if(!Fd(n)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(n.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return eC(n)}function eC(n){if(n.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const l=n.pathname;let a=-1;for(;++a<l.length;)if(l.codePointAt(a)===37&&l.codePointAt(a+1)===50){const r=l.codePointAt(a+2);if(r===70||r===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(l)}const yd=["history","path","basename","stem","extname","dirname"];class l0{constructor(l){let a;l?Fd(l)?a={path:l}:typeof l=="string"||tC(l)?a={value:l}:a=l:a={},this.cwd="cwd"in a?"":$A.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<yd.length;){const o=yd[r];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let u;for(u in a)yd.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?xi.basename(this.path):void 0}set basename(l){bd(l,"basename"),vd(l,"basename"),this.path=xi.join(this.dirname||"",l)}get dirname(){return typeof this.path=="string"?xi.dirname(this.path):void 0}set dirname(l){pv(this.basename,"dirname"),this.path=xi.join(l||"",this.basename)}get extname(){return typeof this.path=="string"?xi.extname(this.path):void 0}set extname(l){if(vd(l,"extname"),pv(this.dirname,"extname"),l){if(l.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(l.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=xi.join(this.dirname,this.stem+(l||""))}get path(){return this.history[this.history.length-1]}set path(l){Fd(l)&&(l=WA(l)),bd(l,"path"),this.path!==l&&this.history.push(l)}get stem(){return typeof this.path=="string"?xi.basename(this.path,this.extname):void 0}set stem(l){bd(l,"stem"),vd(l,"stem"),this.path=xi.join(this.dirname||"",l+(this.extname||""))}fail(l,a,r){const u=this.message(l,a,r);throw u.fatal=!0,u}info(l,a,r){const u=this.message(l,a,r);return u.fatal=void 0,u}message(l,a,r){const u=new ko(l,a,r);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(l){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(l||void 0).decode(this.value)}}function vd(n,l){if(n&&n.includes(xi.sep))throw new Error("`"+l+"` cannot be a path: did not expect `"+xi.sep+"`")}function bd(n,l){if(!n)throw new Error("`"+l+"` cannot be empty")}function pv(n,l){if(!n)throw new Error("Setting `"+l+"` requires `path` to be set too")}function tC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const nC=(function(n){const r=this.constructor.prototype,u=r[n],o=function(){return u.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),iC={}.hasOwnProperty;class mh extends nC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=YA()}copy(){const l=new mh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];l.use(...r)}return l.data(gd(!0,{},this.namespace)),l}data(l,a){return typeof l=="string"?arguments.length===2?(wd("data",this.frozen),this.namespace[l]=a,this):iC.call(this.namespace,l)&&this.namespace[l]||void 0:l?(wd("data",this.frozen),this.namespace=l,this):this.namespace}freeze(){if(this.frozen)return this;const l=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=a.call(l,...r);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(l){this.freeze();const a=to(l),r=this.parser||this.Parser;return xd("parse",r),r(String(a),a)}process(l,a){const r=this;return this.freeze(),xd("process",this.parser||this.Parser),Sd("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(o,f){const h=to(l),p=r.parse(h);r.run(p,h,function(y,m,S){if(y||!m||!S)return g(y);const x=m,k=r.stringify(x,S);rC(k)?S.value=k:S.result=k,g(y,S)});function g(y,m){y||!m?f(y):o?o(m):a(void 0,m)}}}processSync(l){let a=!1,r;return this.freeze(),xd("processSync",this.parser||this.Parser),Sd("processSync",this.compiler||this.Compiler),this.process(l,u),gv("processSync","process",a),r;function u(o,f){a=!0,dv(o),r=f}}run(l,a,r){mv(l),this.freeze();const u=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?o(void 0,r):new Promise(o);function o(f,h){const p=to(a);u.run(l,p,g);function g(y,m,S){const x=m||l;y?h(y):f?f(x):r(void 0,x,S)}}}runSync(l,a){let r=!1,u;return this.run(l,a,o),gv("runSync","run",r),u;function o(f,h){dv(f),u=h,r=!0}}stringify(l,a){this.freeze();const r=to(a),u=this.compiler||this.Compiler;return Sd("stringify",u),mv(l),u(l,r)}use(l,...a){const r=this.attachers,u=this.namespace;if(wd("use",this.frozen),l!=null)if(typeof l=="function")p(l,a);else if(typeof l=="object")Array.isArray(l)?h(l):f(l);else throw new TypeError("Expected usable value, not `"+l+"`");return this;function o(g){if(typeof g=="function")p(g,[]);else if(typeof g=="object")if(Array.isArray(g)){const[y,...m]=g;p(y,m)}else f(g);else throw new TypeError("Expected usable value, not `"+g+"`")}function f(g){if(!("plugins"in g)&&!("settings"in g))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");h(g.plugins),g.settings&&(u.settings=gd(!0,u.settings,g.settings))}function h(g){let y=-1;if(g!=null)if(Array.isArray(g))for(;++y<g.length;){const m=g[y];o(m)}else throw new TypeError("Expected a list of plugins, not `"+g+"`")}function p(g,y){let m=-1,S=-1;for(;++m<r.length;)if(r[m][0]===g){S=m;break}if(S===-1)r.push([g,...y]);else if(y.length>0){let[x,...k]=y;const T=r[S][1];Xd(T)&&Xd(x)&&(x=gd(!0,T,x)),r[S]=[g,x,...k]}}}}const lC=new mh().freeze();function xd(n,l){if(typeof l!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Sd(n,l){if(typeof l!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function wd(n,l){if(l)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function mv(n){if(!Xd(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function gv(n,l,a){if(!a)throw new Error("`"+n+"` finished async. Use `"+l+"` instead")}function to(n){return aC(n)?n:new l0(n)}function aC(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function rC(n){return typeof n=="string"||sC(n)}function sC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const uC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",yv=[],vv={allowDangerousHtml:!0},oC=/^(https?|ircs?|mailto|xmpp)$/i,cC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function fC(n){const l=dC(n),a=hC(n);return pC(l.runSync(l.parse(a),a),n)}function dC(n){const l=n.rehypePlugins||yv,a=n.remarkPlugins||yv,r=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...vv}:vv;return lC().use(QT).use(a).use(HA,r).use(l)}function hC(n){const l=n.children||"",a=new l0;return typeof l=="string"&&(a.value=l),a}function pC(n,l){const a=l.allowedElements,r=l.allowElement,u=l.components,o=l.disallowedElements,f=l.skipHtml,h=l.unwrapDisallowed,p=l.urlTransform||mC;for(const y of cC)Object.hasOwn(l,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+uC+y.id,void 0);return jo(n,g),_k(n,{Fragment:b.Fragment,components:u,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function g(y,m,S){if(y.type==="raw"&&S&&typeof m=="number")return f?S.children.splice(m,1):S.children[m]={type:"text",value:y.value},m;if(y.type==="element"){let x;for(x in dd)if(Object.hasOwn(dd,x)&&Object.hasOwn(y.properties,x)){const k=y.properties[x],T=dd[x];(T===null||T.includes(y.tagName))&&(y.properties[x]=p(String(k||""),x,y))}}if(y.type==="element"){let x=a?!a.includes(y.tagName):o?o.includes(y.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(y,m,S)),x&&S&&typeof m=="number")return h&&y.children?S.children.splice(m,1,...y.children):S.children.splice(m,1),m}}}function mC(n){const l=n.indexOf(":"),a=n.indexOf("?"),r=n.indexOf("#"),u=n.indexOf("/");return l===-1||u!==-1&&l>u||a!==-1&&l>a||r!==-1&&l>r||oC.test(n.slice(0,l))?n:""}function bv(n,l){const a=String(n);if(typeof l!="string")throw new TypeError("Expected character");let r=0,u=a.indexOf(l);for(;u!==-1;)r++,u=a.indexOf(l,u+l.length);return r}function gC(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function yC(n,l,a){const u=Co((a||{}).ignore||[]),o=vC(l);let f=-1;for(;++f<o.length;)Yd(n,h);function h(g,y,m){if(g.type==="text"&&typeof m=="number")return p(g,y,m);if(u(g,m,y[y.length-1]))return Vd}function p(g,y,m){const S=y[y.length-1],x=o[f][0],k=o[f][1];let T=0,A=!1,E=[];x.lastIndex=0;let M=x.exec(g.value);for(;M;){const $=M.index,te={index:M.index,input:M.input,stack:[...y,g]};let O=k(...M,te);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1)x.lastIndex=$+1;else{if(T!==$&&H({type:"text",value:g.value.slice(T,$)}),Array.isArray(O))for(const Q of O)H(Q);else O&&H(O);T=$+M[0].length,A=!0}if(!x.global)break;M=x.exec(g.value)}return A?(T<g.value.length&&H({type:"text",value:g.value.slice(T)}),S.children.splice(m,1,...E)):E=[g],m+E.length;function H($){const te=E[E.length-1];te&&te.type==="text"&&$.type==="text"?te.value+=$.value:E.push($)}}}function vC(n){if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const l=[],a=!n[0]||Array.isArray(n[0])?n:[n];let r=-1;for(;++r<a.length;){const u=a[r];l.push([bC(u[0]),xC(u[1])])}return l}function bC(n){return typeof n=="string"?new RegExp(gC(n),"g"):n}function xC(n){return typeof n=="function"?n:function(){return n}}const kd="phrasing",Ed=["autolink","link","image","label"];function SC(){return{transforms:[NC],enter:{literalAutolink:kC,literalAutolinkEmail:Td,literalAutolinkHttp:Td,literalAutolinkWww:Td},exit:{literalAutolink:CC,literalAutolinkEmail:AC,literalAutolinkHttp:EC,literalAutolinkWww:TC}}}function wC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:kd,notInConstruct:Ed},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:kd,notInConstruct:Ed},{character:":",before:"[ps]",after:"\\/",inConstruct:kd,notInConstruct:Ed}]}}function kC(n){this.enter({type:"link",title:null,url:"",children:[],position:void 0},n)}function Td(n){this.config.enter.autolinkProtocol.call(this,n)}function EC(n){this.config.exit.autolinkProtocol.call(this,n)}function TC(n){this.config.exit.data.call(this,n);const l=this.stack[this.stack.length-1];l.type,l.url="http://"+this.sliceSerialize(n)}function AC(n){this.config.exit.autolinkEmail.call(this,n)}function CC(n){this.exit(n)}function NC(n){yC(n,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),jC],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),zC],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),_C],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),OC]],{ignore:["link","linkReference"]})}function jC(n,l,a,r,u){if(!MC(u))return!1;let o="";if(/^w/i.test(l)&&(a=l+a,l="",o="http://"),ys(a.charCodeAt(0))||!qC(a))return!1;const f=RC(a+r),h={type:"link",title:null,url:o+l+f[0],children:[{type:"text",value:l+f[0],position:void 0}],position:void 0};return f[1]?[h,{type:"text",value:f[1],position:void 0}]:h}function OC(n,l,a){return/[\d\-_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+l+"@"+a,children:[{type:"text",value:l+"@"+a,position:void 0}],position:void 0}}function _C(n,l,a){if(/[\d\-_]$/.test(a))return!1;const r="mailto:"+l+"@"+a;return{type:"link",title:null,url:r,children:[{type:"text",value:r,position:void 0}],position:void 0}}function zC(n,l,a,r,u){if(/[\d\-_]$/.test(a)||r&&(!/[A-Za-z]$/.test(r)||u.input.charAt(u.index+n.length)==="@"))return!1;const o="xmpp:"+l+"@"+a+(r||"");return{type:"link",title:null,url:o,children:[{type:"text",value:o,position:void 0}],position:void 0}}function qC(n){const l=n.split(".");return!(l.length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[\dA-Za-z]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[\dA-Za-z]/.test(l[l.length-2])))}function RC(n){let l=n.length;for(;l>0;){const f=n.charCodeAt(l-1);if(f===33||f===34||f===38||f===39||f===41||f===44||f===46||f===58||f===59||f===60||f===62||f===63||f===93||f===125)l--;else break}if(l===n.length)return[n,void 0];let a=n.slice(l);n=n.slice(0,l);let r=a.indexOf(")");const u=bv(n,"(");let o=bv(n,")");for(;r!==-1&&u>o;)n+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),o++;return[n,a]}function MC(n){const l=n.input.charCodeAt(n.index-1);return n.index===0||ra(l)||ys(l)}a0.peek=GC;function DC(){this.buffer()}function LC(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function BC(){this.buffer()}function UC(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function HC(n){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ri(this.sliceSerialize(n)).toLowerCase(),a.label=l}function IC(n){this.exit(n)}function VC(n){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ri(this.sliceSerialize(n)).toLowerCase(),a.label=l}function YC(n){this.exit(n)}function GC(){return"["}function a0(n,l,a,r){const u=a.createTracker(r);let o=u.move("[^");const f=a.enter("footnoteReference"),h=a.enter("reference");return o+=u.move(a.safe(a.associationId(n),{after:"]",before:o})),h(),f(),o+=u.move("]"),o}function QC(){return{enter:{gfmFootnoteCallString:DC,gfmFootnoteCall:LC,gfmFootnoteDefinitionLabelString:BC,gfmFootnoteDefinition:UC},exit:{gfmFootnoteCallString:HC,gfmFootnoteCall:IC,gfmFootnoteDefinitionLabelString:VC,gfmFootnoteDefinition:YC}}}function XC(n){let l=!1;return n&&n.firstLineBlank&&(l=!0),{handlers:{footnoteDefinition:a,footnoteReference:a0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,o,f){const h=o.createTracker(f);let p=h.move("[^");const g=o.enter("footnoteDefinition"),y=o.enter("label");return p+=h.move(o.safe(o.associationId(r),{before:p,after:"]"})),y(),p+=h.move("]:"),r.children&&r.children.length>0&&(h.shift(4),p+=h.move((l?`
35
- `:" ")+o.indentLines(o.containerFlow(r,h.current()),l?r0:FC))),g(),p}}function FC(n,l,a){return l===0?n:r0(n,l,a)}function r0(n,l,a){return(a?"":" ")+n}const ZC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];gh.attention=WC;gh.peek=eN;function KC(){return{canContainEols:["delete"],enter:{strikethrough:$C},exit:{strikethrough:PC}}}function JC(){return{handlers:{delete:gh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ZC}]}}function $C(n){this.enter({type:"delete",children:[],position:void 0},n)}function PC(n){this.exit(n)}function gh(n,l,a,r){const u=a.createTracker(r),o=a.stack.includes("strikethrough")?"~":"~~",f=a.enter("strikethrough");let h=u.move(o);return h+=a.containerPhrasing(n,{...u.current(),before:h,after:"~"}),h+=u.move(o),f(),h}function WC(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function eN(){return"~"}function tN(n){return n.length}function nN(n,l){const a=l||{},r=(a.align||[]).concat(),u=a.stringLength||tN,o=[],f=[],h=[],p=[];let g=0,y=-1;for(;++y<n.length;){const T=[],A=[];let E=-1;for(n[y].length>g&&(g=n[y].length);++E<n[y].length;){const M=iN(n[y][E]);if(a.alignDelimiters!==!1){const H=u(M);A[E]=H,(p[E]===void 0||H>p[E])&&(p[E]=H)}T.push(M)}f[y]=T,h[y]=A}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<g;)o[m]=xv(r[m]);else{const T=xv(r);for(;++m<g;)o[m]=T}m=-1;const S=[],x=[];for(;++m<g;){const T=o[m];let A="",E="";T===99?(A=":",E=":"):T===108?A=":":T===114&&(E=":");let M=a.alignDelimiters===!1?1:Math.max(1,p[m]-A.length-E.length);const H=A+"-".repeat(M)+E;a.alignDelimiters!==!1&&(M=A.length+M+E.length,M>p[m]&&(p[m]=M),x[m]=M),S[m]=H}f.splice(1,0,S),h.splice(1,0,x),y=-1;const k=[];for(;++y<f.length;){const T=f[y],A=h[y],E=a.fillRows===!1?Math.max(1,f[y===1?0:y].length):g;m=-1;const M=[];for(;++m<E;){const H=T[m]||"";let $="",te="";if(a.alignDelimiters!==!1){const O=p[m]-(A[m]||0),Q=o[m];if(Q===114)$=" ".repeat(O);else if(Q===99){const ne=O/2;O%2?($=" ".repeat(ne+.5),te=" ".repeat(ne-.5)):($=" ".repeat(ne),te=$)}else te=" ".repeat(O)}a.delimiterStart!==!1&&!m&&M.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&H==="")&&(a.delimiterStart!==!1||m)&&M.push(" "),a.alignDelimiters!==!1&&M.push($),M.push(H),a.alignDelimiters!==!1&&M.push(te),a.padding!==!1&&M.push(" "),(a.delimiterEnd!==!1||m!==E-1)&&M.push("|")}k.push(a.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return k.join(`
36
- `)}function iN(n){return n==null?"":String(n)}function xv(n){const l=typeof n=="string"?n.codePointAt(0):0;return l===67||l===99?99:l===76||l===108?108:l===82||l===114?114:0}const lN=Co(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function aN(n,l,a,r){const u=a.enter("blockquote"),o=a.createTracker(r);o.move("> "),o.shift(2);const f=a.indentLines(a.containerFlow(n,o.current()),rN);return u(),f}function rN(n,l,a){return">"+(a?"":" ")+n}function sN(n,l){return Sv(n,l.inConstruct,!0)&&!Sv(n,l.notInConstruct,!1)}function Sv(n,l,a){if(typeof l=="string"&&(l=[l]),!l||l.length===0)return a;let r=-1;for(;++r<l.length;)if(n.includes(l[r]))return!0;return!1}function wv(n,l,a,r){let u=-1;for(;++u<a.unsafe.length;){const o=a.unsafe[u];if(o.character===`
37
- `&&!o.before&&!o.after&&sN(a.stack,o))return/[\t ]/.test(r.before)?"":" "}return`\\
38
- `}function uN(n,l){const a=String(n);let r=a.indexOf(l),u=r,o=0,f=0;if(typeof l!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===u?++o>f&&(f=o):o=1,u=r+l.length,r=a.indexOf(l,u);return f}function oN(n,l){return!!(l.options.fences===!1&&n.value&&!n.lang&&/[^\n\r ]/.test(n.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(n.value))}function cN(n){const l=n.options.fence||"`";if(l!=="`"&&l!=="~")throw new Error("Cannot serialize code with `"+l+"` for `options.fence`, expected `` ` `` or `~`");return l}function fN(n,l,a,r){const u=cN(a),o=n.value||"";if(oN(n,a)){const m=a.enter("codeIndented"),S=a.indentLines(o,dN);return m(),S}const f=a.createTracker(r),h=u.repeat(Math.max(uN(o,u)+1,3)),p=a.enter("codeFenced"),g=u==="`"?"GraveAccent":"Tilde";let y=f.move(h);if(n.lang){const m=a.enter(`codeFencedLang${g}`);y+=f.move(a.safe(n.lang,{before:y,after:" ",encode:["`"],...f.current()})),m()}if(n.lang&&n.meta){const m=a.enter(`codeFencedMeta${g}`);y+=f.move(" "),y+=f.move(a.safe(n.meta,{before:y,after:`
39
- `,encode:["`"],...f.current()})),m()}return y+=f.move(`
40
- `),o&&(y+=f.move(o+`
41
- `)),y+=f.move(h),p(),y}function dN(n,l,a){return(a?"":" ")+n}function yh(n){const l=n.options.quote||'"';if(l!=='"'&&l!=="'")throw new Error("Cannot serialize title with `"+l+"` for `options.quote`, expected `\"`, or `'`");return l}function hN(n,l,a,r){const u=yh(a),o=u==='"'?"Quote":"Apostrophe",f=a.enter("definition");let h=a.enter("label");const p=a.createTracker(r);let g=p.move("[");return g+=p.move(a.safe(a.associationId(n),{before:g,after:"]",...p.current()})),g+=p.move("]: "),h(),!n.url||/[\0- \u007F]/.test(n.url)?(h=a.enter("destinationLiteral"),g+=p.move("<"),g+=p.move(a.safe(n.url,{before:g,after:">",...p.current()})),g+=p.move(">")):(h=a.enter("destinationRaw"),g+=p.move(a.safe(n.url,{before:g,after:n.title?" ":`
42
- `,...p.current()}))),h(),n.title&&(h=a.enter(`title${o}`),g+=p.move(" "+u),g+=p.move(a.safe(n.title,{before:g,after:u,...p.current()})),g+=p.move(u),h()),f(),g}function pN(n){const l=n.options.emphasis||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize emphasis with `"+l+"` for `options.emphasis`, expected `*`, or `_`");return l}function po(n){const l=n.codePointAt(0);return l===void 0?"":String.fromCodePoint(l)}function Wa(n){const l=n.codePointAt(n.length-2);return l!==void 0&&l>65535?n.slice(-2):n.slice(-1)}function s0(n){return"&#x"+n.toString(16).toUpperCase()+";"}function kv(n,l,a){const r=Sl(n),u=Sl(l);return r===void 0?u===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function mN(n){if(n.charCodeAt(0)!==60)return;const l=n.charCodeAt(1);if(l===33){const h=n.charCodeAt(2);return h===45?2:h===91?5:en(h)?4:void 0}if(l===63)return 3;const a=l===47,r=a?2:1;let u=r,o=n.charCodeAt(u);if(!en(o))return;for(;o===45||tn(o);)o=n.charCodeAt(++u);const f=n.slice(r,u).toLowerCase();return!a&&o!==47&&Id.includes(f)?1:Xb.includes(f)?6:7}const u0=new Map([["*",!1],["_",!0]]);function gN(n,l,a){const r=new Set;for(const o of n){const f=a.get(o);if(f&&o.attention&&l.some(h=>h.attention===o.attention))for(const h of f.tokens)r.add(h.attention)}const u=[];for(const o of n)o.attention&&r.delete(o.attention)&&u.push(o.attention);return u.reverse(),u}function o0(n,l,a){const r=[],u=new Map,o=new Map;let f=0;for(;f<n.length;){if(!n[f].attention){f++;continue}const h=n[f].value.charAt(0),p=u0.get(h);let g=f+1;for(;g<n.length&&n[g].attention&&n[g].value.charAt(0)===h;)g++;const y=f?n[f-1].value:l,m=Sl(y.charCodeAt(y.length-1)),S=Sl((g<n.length?n[g].value:a).charCodeAt(0)),x=!S||S===2&&!!m,k=!m||m===2&&!!S,T={tokens:n.slice(f,g),markers:[],start:0,end:0,open:p?x&&(!!m||!k):x,close:p?k&&(!!S||!x):k,split:p!==void 0};for(const A of T.tokens){u.set(A,[...T.tokens]),o.set(A,T);let E=A.value.length;for(;E--;)T.markers.push(A)}T.end=T.markers.length,r.push(T),f=g}for(vN(r,u),f=-1;++f<n.length;){const h=u.get(n[f]);if(h)return{attention:gN(n,h,o),index:f}}}function no(n,l){const a=n[l?0:n.length-1];if(!a||a.attention)return;const r=l?po(a.value):Wa(a.value),u=s0(r.codePointAt(0));if(l)a.value=u+a.value.slice(r.length);else{let o=a.value.slice(0,a.value.length-r.length),f=0;for(;o.charCodeAt(o.length-1-f)===92;)f++;f%2&&(o+="\\"),a.value=o+u}}function yN(n,l,a,r,u){for(const o of a.attention){const f=l.get(o)||o.sequences[0];for(const h of o.sequences){if(h===f)continue;const p=new Map(l);p.set(o,h);const g=Oo(n,p,r,u),y=o0(g,r,u);if(!y||y.index>a.index)return{chosen:p,mistake:y,tokens:g}}}}function vN(n,l){const a=new Map;for(const r of n){const u=r.tokens[0].value.charAt(0);let o=a.get(u);o||(o=[],a.set(u,o));let f=r.close?o.length:0;for(;f--&&r.start<r.end;){const h=o[f],p=h.end-h.start,g=r.end-r.start;if(r.split?(h.close||r.open)&&g%3&&!((p+g)%3):p!==h.markers.length||p!==g)continue;const y=r.split?p>1&&g>1?2:1:g,m=h.markers.slice(h.end-y,h.end),S=r.markers.slice(r.start,r.start+y),x=m[0],k=S[0];if(x===m[y-1]&&x.value.length===y&&k===S[y-1]&&k.value.length===y&&x.attention===k.attention)l.delete(x),l.delete(k);else{const T=[...new Set([...m,...S])];for(const A of T){const E=l.get(A);E&&E.push(...T)}}h.end-=y,r.start+=y,h.start===h.end&&o.splice(f,1),f=o.length}r.open&&r.start<r.end&&o.push(r)}}function bN(n,l,a){if(l.length===0)throw new Error("Cannot serialize `"+n+"` as attention without markers, expected one or more markers");if(a.length===0)throw new Error("Cannot serialize `"+n+"` as attention without sizes, expected one or more sizes");for(const u of a)if(!Number.isSafeInteger(u)||u<1)throw new Error("Cannot serialize `"+n+"` as attention with `"+u+"` as size, expected positive integer");const r=[];for(const u of l){if(u.length!==1)throw new Error("Cannot serialize `"+n+"` as attention with `"+u+"` as marker, expected a single ascii character");if(!Lb(u.charCodeAt(0)))throw new Error("Cannot serialize `"+n+"` as attention with `"+u+"` as marker, expected ascii punctuation");for(const o of a)r.push(u.repeat(o))}return r}function xN(n,l,a){const r=l.indexStack,u=n.children||[],o=[];let f=-1,h=a.before;r.push(-1);let p=l.createTracker(a);for(;++f<u.length;){const g=u[f];let y;if(r[r.length-1]=f,f+1<u.length){let x=l.handle.handlers[u[f+1].type];x&&x.peek&&(x=x.peek),y=x?po(x(u[f+1],n,l,{before:"",after:"",...p.current()})):""}else y=a.after;const m=o[o.length-1];typeof m=="string"&&(h==="\r"||h===`
43
- `)&&g.type==="html"&&mN(g.value)!==7&&(o[o.length-1]=m.replace(/(\r?\n|\r)$/," "),h=" ",p=l.createTracker(a),p.move(_o(o,a.before,a.after)));const S=l.handle.handlers[g.type];if(S&&S.attention){const x=vh(g,S.attention,l,p);if(!x)continue;o.push(x),h=Wa(x.sequences[0])}else{const x=l.handle(g,n,l,{...p.current(),after:y,before:h});if(!x)continue;p.move(x),o.push(x),h=Wa(x)}}return r.pop(),o}function vh(n,l,a,r){const{construct:u,markers:o,sizes:f}=l(n,a),h=bN(n.type,o,f),p=h[0],g=a.enter(u),y=a.createTracker(r.current());y.move(p);const m=xN(n,a,{...y.current(),before:p,after:p});if(g(),m.length!==0)return r.move(p),r.move(_o(m,p,p)),r.move(p),{children:m,sequences:h}}function Ev(n,l,a,r){let u=Oo(n,l,a,r),o=o0(u,a,r);for(;o;){const f=yN(n,l,o,a,r);if(!f)return;l=f.chosen,u=f.tokens,o=f.mistake}return u}function c0(n,l,a,r){let u=a,o=-1;for(;++o<n.length;){const f=n[o];if(typeof f=="string"){u="";continue}const h=o===n.length-1?r:"",p=f.sequences.find(function(g){const y=g.charAt(0);return y!==u.charAt(0)&&y!==h.charAt(0)||n.length===1&&u0.has(y)&&g.length>a.length})||f.sequences[0];p!==f.sequences[0]&&l.set(f,p),c0(f.children,l,p,p),u=p}}function Oo(n,l,a,r){const u=[];let o,f=Wa(a),h=-1;for(;++h<n.length;){const p=n[h];if(typeof p=="string"){const H={value:p,attention:void 0};o&&o===po(p)&&no([H],!0),o=void 0,u.push(H),H.value&&(f=Wa(H.value));continue}const g=l.get(p)||p.sequences[0],y=g.charAt(0),m=n[h+1],S=f,x=po(m===void 0?r:typeof m=="string"?m:l.get(m)||m.sequences[0]),k=Oo(p.children,l,g,g),T=k[0].value,A=kv(S.charCodeAt(S.length-1),T.charCodeAt(0),y);A.inside&&no(k,!0);const E=Wa(k[k.length-1].value),M=kv(x.charCodeAt(0),E.charCodeAt(E.length-1),y);M.inside&&no(k,!1),A.outside&&S!==`
44
- `&&S!=="\r"&&no(u,!1),M.outside&&(o=x),u.push({value:g,attention:p},...k,{value:g,attention:p}),f=g.charAt(g.length-1)}return u}function _o(n,l,a){const r=new Map;c0(n,r,l,a);const u=(r.size>0?Ev(n,r,l,a):void 0)||Ev(n,new Map,l,a)||Oo(n,new Map,l,a);let o="";for(const f of u)o+=f.value;return o}bh.attention=f0;bh.peek=SN;function bh(n,l,a,r){const u=a.enter("phrasing"),o=vh(n,f0,a,a.createTracker(r)),f=o?_o([o],r.before,r.after):"";return u(),f}function f0(n,l){return{construct:"emphasis",markers:pN(l)==="*"?["*","_"]:["_","*"],sizes:[1]}}function SN(n,l,a){return a.options.emphasis||"*"}function wN(n,l){let a=!1;return jo(n,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,ss}),!!((!n.depth||n.depth<3)&&Eo(n)&&(l.options.setext||a))}function kN(n,l,a,r){const u=Math.max(Math.min(6,n.depth||1),1),o=a.createTracker(r);if(wN(n,a)){const m=a.enter("headingSetext"),S=a.enter("phrasing"),x=a.containerPhrasing(n,{...o.current(),before:`
45
- `,after:`
46
- `});return S(),m(),x+`
47
- `+(u===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
48
- `))+1))}const f="#".repeat(u),h=a.enter("headingAtx"),p=a.enter("phrasing");o.move(f+" ");let g=a.containerPhrasing(n,{before:"# ",after:`
49
- `,...o.current()});const y=g.charCodeAt(0);return(y===9||y===32)&&(g=s0(y)+g.slice(1)),g=g?f+" "+g:f,a.options.closeAtx&&(g+=" "+f),p(),h(),g}d0.peek=EN;function d0(n){return n.value||""}function EN(){return"<"}h0.peek=TN;function h0(n,l,a,r){const u=yh(a),o=u==='"'?"Quote":"Apostrophe",f=a.enter("image");let h=a.enter("label");const p=a.createTracker(r);let g=p.move("![");return g+=p.move(a.safe(n.alt,{before:g,after:"]",...p.current()})),g+=p.move("]("),h(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(h=a.enter("destinationLiteral"),g+=p.move("<"),g+=p.move(a.safe(n.url,{before:g,after:">",...p.current()})),g+=p.move(">")):(h=a.enter("destinationRaw"),g+=p.move(a.safe(n.url,{before:g,after:n.title?" ":")",...p.current()}))),h(),n.title&&(h=a.enter(`title${o}`),g+=p.move(" "+u),g+=p.move(a.safe(n.title,{before:g,after:u,...p.current()})),g+=p.move(u),h()),g+=p.move(")"),f(),g}function TN(){return"!"}p0.peek=AN;function p0(n,l,a,r){const u=n.referenceType,o=a.enter("imageReference");let f=a.enter("label");const h=a.createTracker(r);let p=h.move("![");const g=a.safe(n.alt,{before:p,after:"]",...h.current()});p+=h.move(g+"]["),f();const y=a.stack;a.stack=y.filter(function(S){return S!=="phrasing"}),f=a.enter("reference");const m=a.safe(a.associationId(n),{before:p,after:"]",...h.current()});return f(),a.stack=y,o(),u==="full"||!g||g!==m?p+=h.move(m+"]"):u==="shortcut"?p=p.slice(0,-1):p+=h.move("]"),p}function AN(){return"!"}m0.peek=CN;function m0(n,l,a){let r=n.value||"",u="`",o=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(r);)u+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<a.unsafe.length;){const f=a.unsafe[o],h=a.compilePattern(f);if(!f.atBreak)continue;let p;for(;p=h.exec(r);){let g=p.index;r.charCodeAt(g)===10&&r.charCodeAt(g-1)===13&&g--,r=r.slice(0,g)+" "+r.slice(p.index+1)}}return u+r+u}function CN(){return"`"}function g0(n,l){const a=Eo(n);return!!(!l.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(a===n.url||"mailto:"+a===n.url)&&/^[a-z][+\-.a-z]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}y0.peek=NN;function y0(n,l,a,r){const u=yh(a),o=u==='"'?"Quote":"Apostrophe",f=a.createTracker(r);if(g0(n,a)){const k=a.stack;a.stack=k.filter(function(E){return E!=="phrasing"});const T=a.enter("autolink");let A=f.move("<");return A+=f.move(a.containerPhrasing(n,{before:A,after:">",...f.current()})),A+=f.move(">"),T(),a.stack=k,A}const h=a.enter("link");let p=a.enter("label"),g=f.move("[");const y=a.containerPhrasing(n,{before:g,after:"](",...f.current()});g+=f.move(y),p(),g+=f.move("](");const m=/[\0- \u007F]/.test(n.url),S=r.before.charAt(r.before.length-1);let x=n.title||void 0;if(!x&&!m&&(S===`
50
- `||S==="\r")){let k=0;for(;k<y.length&&y.charCodeAt(k)!==93;)k+=y.charCodeAt(k)===92?2:1;y.charCodeAt(k+1)===58&&(x="")}return!n.url&&typeof x=="string"||m?(p=a.enter("destinationLiteral"),g+=f.move("<"),g+=f.move(a.safe(n.url,{before:g,after:">",...f.current()})),g+=f.move(">")):(p=a.enter("destinationRaw"),g+=f.move(a.safe(n.url,{before:g,after:typeof x=="string"?" ":")",...f.current()}))),p(),typeof x=="string"&&(p=a.enter(`title${o}`),g+=f.move(" "+u),g+=f.move(a.safe(x,{before:g,after:u,...f.current()})),g+=f.move(u),p()),g+=f.move(")"),h(),g}function NN(n,l,a){return g0(n,a)?"<":"["}v0.peek=jN;function v0(n,l,a,r){const u=n.referenceType,o=a.enter("linkReference");let f=a.enter("label");const h=a.createTracker(r);let p=h.move("[");const g=a.containerPhrasing(n,{before:p,after:"]",...h.current()});p+=h.move(g+"]["),f();const y=a.stack;a.stack=y.filter(function(S){return S!=="phrasing"}),f=a.enter("reference");const m=a.safe(a.associationId(n),{before:p,after:"]",...h.current()});return f(),a.stack=y,o(),u==="full"||!g||g!==m?p+=h.move(m+"]"):u==="shortcut"?p=p.slice(0,-1):p+=h.move("]"),p}function jN(){return"["}function xh(n){const l=n.options.bullet||"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bullet`, expected `*`, `+`, or `-`");return l}function ON(n){const l=xh(n),a=n.options.bulletOther;if(!a)return l==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===l)throw new Error("Expected `bullet` (`"+l+"`) and `bulletOther` (`"+a+"`) to be different");return a}function _N(n){const l=n.options.bulletOrdered||".";if(l!=="."&&l!==")")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOrdered`, expected `.` or `)`");return l}function b0(n){const l=n.options.rule||"*";if(l!=="*"&&l!=="-"&&l!=="_")throw new Error("Cannot serialize rules with `"+l+"` for `options.rule`, expected `*`, `-`, or `_`");return l}function zN(n,l,a,r){const u=a.enter("list"),o=a.bulletCurrent;let f=n.ordered?_N(a):xh(a);const h=n.ordered?f==="."?")":".":ON(a);let p=l&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),b0(a)===f&&y){let m=-1;for(;++m<n.children.length;){const S=n.children[m];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(f=h),a.bulletCurrent=f;const g=a.containerFlow(n,r);return a.bulletLastUsed=f,a.bulletCurrent=o,u(),g}function qN(n){const l=n.options.listItemIndent||"one";if(l!=="tab"&&l!=="one"&&l!=="mixed")throw new Error("Cannot serialize items with `"+l+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return l}function RN(n,l,a,r){const u=qN(a);let o=a.bulletCurrent||xh(a);l&&l.type==="list"&&l.ordered&&(o=(typeof l.start=="number"&&l.start>-1?l.start:1)+(a.options.incrementListMarker===!1?0:l.children.indexOf(n))+o);let f=o.length+1;(u==="tab"||u==="mixed"&&(l&&l.type==="list"&&l.spread||n.spread))&&(f=Math.ceil(f/4)*4);const h=a.createTracker(r);h.move(o+" ".repeat(f-o.length)),h.shift(f);const p=a.enter("listItem"),g=a.indentLines(a.containerFlow(n,h.current()),y);return p(),g;function y(m,S,x){return S?(x?"":" ".repeat(f))+m:(x?o:o+" ".repeat(f-o.length))+m}}function MN(n,l,a,r){const u=a.enter("paragraph"),o=a.enter("phrasing"),f=a.containerPhrasing(n,r);return o(),u(),f}function DN(n,l,a,r){if(!n.children.some(function(h){return lN(h)}))return a.containerFlow(n,r);const o=a.enter("phrasing"),f=a.containerPhrasing(n,r);return o(),f}function LN(n){const l=n.options.strong||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize strong with `"+l+"` for `options.strong`, expected `*`, or `_`");return l}Sh.attention=x0;Sh.peek=BN;function Sh(n,l,a,r){const u=a.enter("phrasing"),o=vh(n,x0,a,a.createTracker(r)),f=o?_o([o],r.before,r.after):"";return u(),f}function x0(n,l){return{construct:"strong",markers:LN(l)==="*"?["*","_"]:["_","*"],sizes:[2]}}function BN(n,l,a){return a.options.strong||"*"}function UN(n,l,a,r){const u=l?l.children:[],o=a.indexStack[a.indexStack.length-1];return a.safe(n.value,{...r,afterNode:u[o+1],beforeNode:u[o-1]})}function HN(n){const l=n.options.ruleRepetition||3;if(l<3)throw new Error("Cannot serialize rules with repetition `"+l+"` for `options.ruleRepetition`, expected `3` or more");return l}function IN(n,l,a){const r=(b0(a)+(a.options.ruleSpaces?" ":"")).repeat(HN(a));return a.options.ruleSpaces?r.slice(0,-1):r}const Zd={blockquote:aN,break:wv,code:fN,definition:hN,emphasis:bh,hardBreak:wv,heading:kN,html:d0,image:h0,imageReference:p0,inlineCode:m0,link:y0,linkReference:v0,list:zN,listItem:RN,paragraph:MN,root:DN,strong:Sh,text:UN,thematicBreak:IN};function VN(){return{enter:{table:YN,tableData:Tv,tableHeader:Tv,tableRow:QN},exit:{codeText:XN,table:GN,tableData:Ad,tableHeader:Ad,tableRow:Ad}}}function YN(n){const l=n._align;this.enter({type:"table",align:l.map(function(a){return a==="none"?null:a}),children:[],position:void 0},n),this.data.inTable=!0}function GN(n){this.exit(n),this.data.inTable=void 0}function QN(n){this.enter({type:"tableRow",children:[],position:void 0},n)}function Ad(n){this.exit(n)}function Tv(n){this.enter({type:"tableCell",children:[],position:void 0},n)}function XN(n){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,FN));const a=this.stack[this.stack.length-1];a.type,a.value=l,this.exit(n)}function FN(n,l){return l==="|"?l:n}function ZN(n){const l=n||{},{tableCellPadding:a,tablePipeAlign:r,stringLength:u}=l,o=a?" ":"|";return{handlers:{inlineCode:S,table:f,tableCell:p,tableRow:h},join:[KN],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
51
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function f(x,k,T,A){const E=y(x,T,A),M=E[0];if(M){let H=x.align?x.align.length:0,$=-1;if(!H)for(;++$<E.length;)E[$].length>H&&(H=E[$].length);for(;M.length<H;)M.push("")}return g(E,x.align)}function h(x,k,T,A){const E=m(x,T,A),M=g([E]);return M.slice(0,M.indexOf(`
52
- `))}function p(x,k,T,A){const E=T.enter("tableCell"),M=T.enter("phrasing"),H=T.containerPhrasing(x,{...A,before:o,after:o});return M(),E(),H}function g(x,k){return nN(x,{align:k,alignDelimiters:r,fillRows:!1,padding:a,stringLength:u})}function y(x,k,T){const{children:A}=x;let E=-1;const M=[],H=k.enter("table");for(;++E<A.length;)M[E]=m(A[E],k,T);return H(),M}function m(x,k,T){const{children:A}=x;let E=-1;const M=[],H=k.enter("tableRow");for(;++E<A.length;)M[E]=p(A[E],x,k,T);return H(),M}function S(x,k,T){const A=Zd.inlineCode(x,k,T);if(!T.stack.includes("tableCell"))return A;const E=[];let M=0,H=A.indexOf("|");for(;H!==-1;){let $=H;for(;$>M&&A.charCodeAt($-1)===92;)$--;E.push(A.slice(M,H)),(H-$)%2===0&&E.push("\\"),M=H,H=A.indexOf("|",H+1)}return E.push(A.slice(M)),E.join("")}}function KN(n,l,a,r){if(n.type==="table"&&a.type==="listItem"&&a.spread===!1&&(l.type==="definition"||l.type==="heading"&&JN(l,r)||l.type==="paragraph"||l.type==="table"))return 1}function JN(n,l){let a=!1;return jo(n,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return a=!0,ss}),!!((!n.depth||n.depth<3)&&Eo(n)&&(l.options.setext||a))}function $N(){return{exit:{taskListCheckValueChecked:Av,taskListCheckValueUnchecked:Av,paragraph:WN}}}function PN(){return{handlers:{paragraph:e2},join:[t2]}}function Av(n){const l=this.stack[this.stack.length-2];l.type,l.checked=n.type==="taskListCheckValueChecked"}function WN(n){const l=this.stack[this.stack.length-2];if(l&&l.type==="listItem"&&typeof l.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const u=l.children;let o=-1,f;for(;++o<u.length;){const h=u[o];if(h.type==="paragraph"){f=h;break}}f===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start={...r.position.start}))}}this.exit(n)}function e2(n,l,a,r){if(!l||l.type!=="listItem"||S0(l)!==n)return Zd.paragraph(n,l,a,r);const u="["+(l.checked?"x":" ")+"] ",o=a.createTracker(r);o.move(u);const f=Zd.paragraph(n.children.length>0?n:{type:"paragraph",children:[{type:"text",value:" "}]},l,a,{...r,...o.current()});return u+f}function t2(n,l,a){if(!(n.type==="definition"&&a.type==="listItem"))return;const r=S0(a);if(r&&a.children.indexOf(n)<a.children.indexOf(r))return 0}function S0(n){if(typeof n.checked=="boolean")for(const l of n.children){if(l.type==="paragraph")return l;if(l.type!=="definition")return}}function n2(){return[SC(),QC(),KC(),VN(),$N()]}function i2(n){return{extensions:[wC(),XC(n),JC(),ZN(n),PN()]}}const l2={tokenize:c2,partial:!0},w0={tokenize:f2,partial:!0},k0={tokenize:d2,partial:!0},E0={tokenize:h2,partial:!0},a2={tokenize:p2,partial:!0},T0={name:"wwwAutolink",tokenize:u2,previous:C0},A0={name:"protocolAutolink",tokenize:o2,previous:N0},Hi={name:"emailAutolink",tokenize:s2,previous:j0},wi={};function r2(){return{text:wi}}let ea=48;for(;ea<123;)wi[ea]=Hi,ea++,ea===58?ea=65:ea===91&&(ea=97);wi[43]=Hi;wi[45]=Hi;wi[46]=Hi;wi[95]=Hi;wi[72]=[Hi,A0];wi[104]=[Hi,A0];wi[87]=[Hi,T0];wi[119]=[Hi,T0];function s2(n,l,a){const r=this;let u,o;return f;function f(m){return!Kd(m)||!j0.call(r,r.previous)||wh(r.events)?a(m):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),h(m))}function h(m){return Kd(m)?(n.consume(m),h):m===64?(n.consume(m),p):a(m)}function p(m){return m===46?n.check(a2,y,g)(m):m===45||m===95||tn(m)?(o=!0,n.consume(m),p):y(m)}function g(m){return n.consume(m),u=!0,p}function y(m){return o&&u&&en(r.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),l(m)):a(m)}}function u2(n,l,a){const r=this;return u;function u(f){return f!==87&&f!==119||!C0.call(r,r.previous)||wh(r.events)?a(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(l2,n.attempt(w0,n.attempt(k0,o),a),a)(f))}function o(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),l(f)}}function o2(n,l,a){const r=this;let u="",o=!1;return f;function f(m){return(m===72||m===104)&&N0.call(r,r.previous)&&!wh(r.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),u+=String.fromCodePoint(m),n.consume(m),h):a(m)}function h(m){if(en(m)&&u.length<5)return u+=String.fromCodePoint(m),n.consume(m),h;if(m===58){const S=u.toLowerCase();if(S==="http"||S==="https")return n.consume(m),p}return a(m)}function p(m){return m===47?(n.consume(m),o?g:(o=!0,p)):a(m)}function g(m){return m===null||oo(m)||vt(m)||ra(m)||ys(m)?a(m):n.attempt(w0,n.attempt(k0,y),a)(m)}function y(m){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),l(m)}}function c2(n,l,a){let r=0;return u;function u(f){return(f===87||f===119)&&r<3?(r++,n.consume(f),u):f===46&&r===3?(n.consume(f),o):a(f)}function o(f){return f===null?a(f):l(f)}}function f2(n,l,a){let r,u,o;return f;function f(g){return g===46||g===95?n.check(E0,p,h)(g):g===null||vt(g)||ra(g)||g!==45&&ys(g)?p(g):(o=!0,n.consume(g),f)}function h(g){return g===95?r=!0:(u=r,r=void 0),n.consume(g),f}function p(g){return u||r||!o?a(g):l(g)}}function d2(n,l){let a=0,r=0;return u;function u(f){return f===40?(a++,n.consume(f),u):f===41&&r<a?o(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(E0,l,o)(f):f===null||vt(f)||ra(f)?l(f):(n.consume(f),u)}function o(f){return f===41&&r++,n.consume(f),u}}function h2(n,l,a){return r;function r(h){return h===33||h===34||h===39||h===41||h===42||h===44||h===46||h===58||h===59||h===63||h===95||h===126?(n.consume(h),r):h===38?(n.consume(h),o):h===93?(n.consume(h),u):h===60||h===null||vt(h)||ra(h)?l(h):a(h)}function u(h){return h===null||h===40||h===91||vt(h)||ra(h)?l(h):r(h)}function o(h){return en(h)?f(h):a(h)}function f(h){return h===59?(n.consume(h),r):en(h)?(n.consume(h),f):a(h)}}function p2(n,l,a){return r;function r(o){return n.consume(o),u}function u(o){return tn(o)?a(o):l(o)}}function C0(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||vt(n)}function N0(n){return!en(n)}function j0(n){return!(n===47||Kd(n))}function Kd(n){return n===43||n===45||n===46||n===95||tn(n)}function wh(n){let l=n.length,a=!1;for(;l--;){const r=n[l][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return n.length>0&&!a&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const m2={tokenize:k2,partial:!0};function g2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:x2,continuation:{tokenize:S2},exit:w2}},text:{91:{name:"gfmFootnoteCall",tokenize:b2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:y2,resolveTo:v2}}}}function y2(n,l,a){const r=this;let u=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let f;for(;u--;){const p=r.events[u][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return h;function h(p){if(!f||!f._balanced)return a(p);const g=ri(r.sliceSerialize({start:f.end,end:r.now()}));return g.codePointAt(0)!==94||!o.includes(g.slice(1))?a(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),l(p))}}function v2(n,l){let a=n.length;for(;a--;)if(n[a][1].type==="labelImage"&&n[a][0]==="enter"){n[a][1];break}n[a+1][1].type="data",n[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},n[a+3][1].start),end:Object.assign({},n[n.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},n[a+3][1].end),end:Object.assign({},n[a+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},h=[n[a+1],n[a+2],["enter",r,l],n[a+3],n[a+4],["enter",u,l],["exit",u,l],["enter",o,l],["enter",f,l],["exit",f,l],["exit",o,l],n[n.length-2],n[n.length-1],["exit",r,l]];return n.splice(a,n.length-a+1,...h),n}function b2(n,l,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,f;return h;function h(m){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(m),n.exit("gfmFootnoteCallLabelMarker"),p}function p(m){return m!==94?a(m):(n.enter("gfmFootnoteCallMarker"),n.consume(m),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",g)}function g(m){if(o>999||m===93&&!f||m===null||m===91||vt(m))return a(m);if(m===93){n.exit("chunkString");const S=n.exit("gfmFootnoteCallString");return u.includes(ri(r.sliceSerialize(S)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(m),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),l):a(m)}return vt(m)||(f=!0),o++,n.consume(m),m===92?y:g}function y(m){return m===91||m===92||m===93?(n.consume(m),o++,g):g(m)}}function x2(n,l,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,f=0,h;return p;function p(k){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),g}function g(k){return k===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):a(k)}function y(k){if(f>999||k===93&&!h||k===null||k===91||vt(k))return a(k);if(k===93){n.exit("chunkString");const T=n.exit("gfmFootnoteDefinitionLabelString");return o=ri(r.sliceSerialize(T)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),S}return vt(k)||(h=!0),f++,n.consume(k),k===92?m:y}function m(k){return k===91||k===92||k===93?(n.consume(k),f++,y):y(k)}function S(k){return k===58?(n.enter("definitionMarker"),n.consume(k),n.exit("definitionMarker"),u.includes(o)||u.push(o),$e(n,x,"gfmFootnoteDefinitionWhitespace")):a(k)}function x(k){return l(k)}}function S2(n,l,a){return n.check(vs,l,n.attempt(m2,l,a))}function w2(n){n.exit("gfmFootnoteDefinition")}function k2(n,l,a){const r=this;return $e(n,u,"gfmFootnoteDefinitionIndent",5);function u(o){const f=r.events[r.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?l(o):a(o)}}function E2(n){let a=(n||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:u};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(f,h){let p=-1;for(;++p<f.length;)if(f[p][0]==="enter"&&f[p][1].type==="strikethroughSequenceTemporary"&&f[p][1]._close){let g=p;for(;g--;)if(f[g][0]==="exit"&&f[g][1].type==="strikethroughSequenceTemporary"&&f[g][1]._open&&f[p][1].end.offset-f[p][1].start.offset===f[g][1].end.offset-f[g][1].start.offset){f[p][1].type="strikethroughSequence",f[g][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},f[g][1].start),end:Object.assign({},f[p][1].end)},m={type:"strikethroughText",start:Object.assign({},f[g][1].end),end:Object.assign({},f[p][1].start)},S=[["enter",y,h],["enter",f[g][1],h],["exit",f[g][1],h],["enter",m,h]],x=h.parser.constructs.insideSpan.null;x&&ai(S,S.length,0,To(x,f.slice(g+1,p),h)),ai(S,S.length,0,[["exit",m,h],["enter",f[p][1],h],["exit",f[p][1],h],["exit",y,h]]),ai(f,g-1,p-g+3,S),p=g+S.length-2;break}}for(p=-1;++p<f.length;)f[p][1].type==="strikethroughSequenceTemporary"&&(f[p][1].type="data");return f}function o(f,h,p){const g=this.previous,y=this.events;let m=0;return S;function S(k){return g===126&&y[y.length-1][1].type!=="characterEscape"?p(k):(f.enter("strikethroughSequenceTemporary"),x(k))}function x(k){const T=Sl(g);if(k===126)return m>1?p(k):(f.consume(k),m++,x);if(m<2&&!a)return p(k);const A=f.exit("strikethroughSequenceTemporary"),E=Sl(k);return A._open=!E||E===2&&!!T,A._close=!T||T===2&&!!E,h(k)}}}class T2{constructor(){this.map=[],this.index=new Map}add(l,a,r){A2(this,l,a,r)}consume(l){if(this.map.sort(function(o,f){return o[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(l.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),l.length=this.map[a][0];r.push(l.slice()),l.length=0;let u=r.pop();for(;u;){for(const o of u)l.push(o);u=r.pop()}this.map.length=0,this.index.clear()}}function A2(n,l,a,r){if(a===0&&r.length===0)return;const u=n.index.get(l);if(u){u[1]+=a,u[2].push(...r);return}const o=[l,a,r];n.map.push(o),n.index.set(l,o)}function C2(n,l){let a=!1;const r=[];for(;l<n.length;){const u=n[l];if(a){if(u[0]==="enter")u[1].type==="tableContent"&&r.push(n[l+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(n[l-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(a=!0);l+=1}return r}function N2(){return{flow:{null:{name:"table",tokenize:j2,resolveAll:O2}}}}function j2(n,l,a){const r=this;let u=0,o=0,f;return h;function h(_){let Z=r.events.length-1;for(;Z>-1;){const{type:Re}=r.events[Z][1];if(Re==="lineEnding"||Re==="linePrefix")Z--;else break}const P=Z>-1?r.events[Z][1].type:null,Se=P==="tableHead"||P==="tableRow"?O:p;return Se===O&&r.parser.lazy[r.now().line]?a(_):Se(_)}function p(_){return n.enter("tableHead"),n.enter("tableRow"),g(_)}function g(_){return _===124||(f=!0,o+=1),y(_)}function y(_){return _===null?a(_):Ce(_)?o>1?(o=0,r.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),x):a(_):Be(_)?$e(n,y,"whitespace")(_):(o+=1,f&&(f=!1,u+=1),_===124?(n.enter("tableCellDivider"),n.consume(_),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),m(_)))}function m(_){return _===null||_===124||vt(_)?(n.exit("data"),y(_)):(n.consume(_),_===92?S:m)}function S(_){return _===92||_===124?(n.consume(_),m):m(_)}function x(_){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(_):(n.enter("tableDelimiterRow"),f=!1,Be(_)?$e(n,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):k(_))}function k(_){return _===45||_===58?A(_):_===124?(f=!0,n.enter("tableCellDivider"),n.consume(_),n.exit("tableCellDivider"),T):te(_)}function T(_){return Be(_)?$e(n,A,"whitespace")(_):A(_)}function A(_){return _===58?(o+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(_),n.exit("tableDelimiterMarker"),E):_===45?(o+=1,E(_)):_===null||Ce(_)?$(_):te(_)}function E(_){return _===45?(n.enter("tableDelimiterFiller"),M(_)):te(_)}function M(_){return _===45?(n.consume(_),M):_===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(_),n.exit("tableDelimiterMarker"),H):(n.exit("tableDelimiterFiller"),H(_))}function H(_){return Be(_)?$e(n,$,"whitespace")(_):$(_)}function $(_){return _===124?k(_):_===null||Ce(_)?!f||u!==o?te(_):(n.exit("tableDelimiterRow"),n.exit("tableHead"),l(_)):te(_)}function te(_){return a(_)}function O(_){return n.enter("tableRow"),Q(_)}function Q(_){return _===124?(n.enter("tableCellDivider"),n.consume(_),n.exit("tableCellDivider"),Q):_===null||Ce(_)?(n.exit("tableRow"),l(_)):Be(_)?$e(n,Q,"whitespace")(_):(n.enter("data"),ne(_))}function ne(_){return _===null||_===124||vt(_)?(n.exit("data"),Q(_)):(n.consume(_),_===92?he:ne)}function he(_){return _===92||_===124?(n.consume(_),ne):ne(_)}}function O2(n,l){let a=-1,r=!0,u=0,o=[0,0,0,0],f=[0,0,0,0],h=!1,p=0,g,y,m;const S=new T2;for(;++a<n.length;){const x=n[a],k=x[1];x[0]==="enter"?k.type==="tableHead"?(h=!1,p!==0&&(Cv(S,l,p,g,y),y=void 0,p=0),g={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},S.add(a,0,[["enter",g,l]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,m=void 0,o=[0,0,0,0],f=[0,a+1,0,0],h&&(h=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},S.add(a,0,[["enter",y,l]])),u=k.type==="tableDelimiterRow"?2:y?3:1):u&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,f[2]===0&&(o[1]!==0&&(f[0]=f[1],m=io(S,l,o,u,void 0,m),o=[0,0,0,0]),f[2]=a)):k.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(f[0]=f[1],m=io(S,l,o,u,void 0,m)),o=f,f=[o[1],a,0,0])):k.type==="tableHead"?(h=!0,p=a):k.type==="tableRow"||k.type==="tableDelimiterRow"?(p=a,o[1]!==0?(f[0]=f[1],m=io(S,l,o,u,a,m)):f[1]!==0&&(m=io(S,l,f,u,a,m)),u=0):u&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(f[3]=a)}for(p!==0&&Cv(S,l,p,g,y),S.consume(l.events),a=-1;++a<l.events.length;){const x=l.events[a];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=C2(l.events,a))}return n}function io(n,l,a,r,u,o){const f=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",h="tableContent";a[0]!==0&&(o.end=Object.assign({},$a(l.events,a[0])),n.add(a[0],0,[["exit",o,l]]));const p=$a(l.events,a[1]);if(o={type:f,start:Object.assign({},p),end:Object.assign({},p)},n.add(a[1],0,[["enter",o,l]]),a[2]!==0){const g=$a(l.events,a[2]),y=$a(l.events,a[3]),m={type:h,start:Object.assign({},g),end:Object.assign({},y)};if(n.add(a[2],0,[["enter",m,l]]),r!==2){const S=l.events[a[2]],x=l.events[a[3]];if(S[1].end=Object.assign({},x[1].end),S[1].type="chunkText",S[1].contentType="text",a[3]>a[2]+1){const k=a[2]+1,T=a[3]-a[2]-1;n.add(k,T,[])}}n.add(a[3]+1,0,[["exit",m,l]])}return u!==void 0&&(o.end=Object.assign({},$a(l.events,u)),n.add(u,0,[["exit",o,l]]),o=void 0),o}function Cv(n,l,a,r,u){const o=[],f=$a(l.events,a);u&&(u.end=Object.assign({},f),o.push(["exit",u,l])),r.end=Object.assign({},f),o.push(["exit",r,l]),n.add(a+1,0,o)}function $a(n,l){const a=n[l],r=a[0]==="enter"?"start":"end";return a[1][r]}const _2={name:"tasklistCheck",tokenize:q2};function z2(){return{text:{91:_2}}}function q2(n,l,a){const r=this;return u;function u(p){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),o)}function o(p){return vt(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):a(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),h):a(p)}function h(p){return Ce(p)?l(p):Be(p)?n.check({tokenize:R2},l,a)(p):a(p)}}function R2(n,l,a){return $e(n,r,"whitespace");function r(u){return u===null?a(u):l(u)}}function M2(n){return Mb([r2(),g2(),E2(n),N2(),z2()])}const D2={};function L2(n){const l=this,a=n||D2,r=l.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),f=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(M2(a)),o.push(n2()),f.push(i2(a))}function O0(n=128){const l=new Set,a=new Set,r=()=>{for(const u of a)u()};return{has:u=>l.has(u),fail(u){l.has(u)||u.length>4096||(l.add(u),l.size>n&&l.delete(l.values().next().value),r())},retry(u){l.delete(u)&&r()},subscribe(u){return a.add(u),()=>{a.delete(u)}}}}const _0=L.createContext(null);function B2({children:n}){const[l]=L.useState(O0);return b.jsx(_0.Provider,{value:l,children:n})}function U2({src:n,alt:l="",title:a}){const{t:r}=Ye(),u=L.useContext(_0),[o]=L.useState(O0),f=u??o,h=L.useSyncExternalStore(f.subscribe,()=>f.has(n??""),()=>!1),[p,g]=L.useState(null),y=h||p===n,[m,S]=L.useState(!1),[x,k]=L.useState(!1),T=L.useRef(null),A=L.useRef(null),E=L.useRef(null),M=L.useRef(null),H=l||r("image.untitled");L.useEffect(()=>{if(!m||y)return;const O=document.activeElement instanceof HTMLElement?document.activeElement:null,Q=document.body.style.overflow;document.body.style.overflow="hidden",A.current?.focus();const ne=_=>{if(_.key==="Escape"&&(_.preventDefault(),_.stopPropagation(),S(!1)),_.key!=="Tab")return;const Z=[...T.current?.querySelectorAll('button, [href], [tabindex="0"]')??[]],P=Z[0],Se=Z.at(-1);_.shiftKey&&(document.activeElement===P||!T.current?.contains(document.activeElement))?(_.preventDefault(),Se?.focus()):!_.shiftKey&&(document.activeElement===Se||!T.current?.contains(document.activeElement))&&(_.preventDefault(),P?.focus())},he=_=>{T.current?.contains(_.target)||A.current?.focus()};return document.addEventListener("keydown",ne,!0),document.addEventListener("focusin",he),()=>{document.removeEventListener("keydown",ne,!0),document.removeEventListener("focusin",he),document.body.style.overflow=Q,O?.isConnected?O.focus():E.current?.focus()}},[m,y]),L.useEffect(()=>{k(!1),S(!1)},[n]);function $(){k(O=>!O),M.current&&(M.current.scrollLeft=0,M.current.scrollTop=0)}function te(){n&&(f.fail(n),g(n)),S(!1)}if(!n||y){const O=n?.split(/[?#]/)[0]?.split("/").at(-1);return b.jsxs("span",{className:"image-unavailable",role:"status",children:[b.jsx("strong",{children:l||O||r("image.untitled")}),b.jsx("span",{children:r("image.unavailable")}),n&&b.jsx("button",{ref:E,type:"button",onClick:()=>{S(!1),g(null),f.retry(n)},children:r("image.retry")})]})}return b.jsxs(b.Fragment,{children:[b.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("image.open",{name:H}),"aria-haspopup":"dialog","aria-expanded":m,title:r("image.open",{name:H}),onClick:()=>{k(!1),S(!0)},children:[b.jsx("img",{className:"image-preview-thumbnail",src:n,alt:l,title:a,loading:"lazy",onError:te}),b.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:r("image.enlarge")})]}),m&&nh.createPortal(b.jsx("div",{className:"image-lightbox",onClick:O=>{O.target===O.currentTarget&&S(!1)},children:b.jsxs("div",{ref:T,className:"image-lightbox-dialog",role:"dialog","aria-modal":"true","aria-label":H,children:[b.jsxs("header",{className:"image-lightbox-toolbar",children:[b.jsx("span",{className:"image-lightbox-name",title:H,children:H}),b.jsx("button",{type:"button",onClick:$,"aria-pressed":x,children:r(x?"image.fit":"image.original")}),b.jsx("button",{ref:A,type:"button",onClick:()=>S(!1),"aria-label":r("image.close"),children:r("image.close")})]}),b.jsx("div",{ref:M,className:x?"image-lightbox-stage original":"image-lightbox-stage",tabIndex:0,role:"region","aria-label":r(x?"image.scroll":"image.fit"),children:b.jsx("img",{src:n,alt:l,title:a,draggable:!1,onError:te})})]})}),document.body)]})}function H2({text:n,language:l}){const[a,r]=L.useState(!1);return b.jsxs("div",{className:"code-block",children:[b.jsxs("div",{className:"code-banner",children:[b.jsx("span",{className:"code-lang",children:l||"Code block"}),b.jsx("button",{type:"button",className:"code-copy","aria-label":a?"Copied":"Copy",onClick:()=>{navigator.clipboard.writeText(n).then(()=>{r(!0),window.setTimeout(()=>r(!1),1e3)})},children:a?"Copied":"Copy"})]}),b.jsx("pre",{children:b.jsx("code",{children:n})})]})}function I2({children:n}){const l=L.Children.toArray(n)[0];if(L.isValidElement(l)){const a=l,r=String(a.props.children??"").replace(/\n$/,""),u=/language-([\w-]+)/.exec(a.props.className??"");return b.jsx(H2,{text:r,language:u?.[1]})}return b.jsx("pre",{children:n})}function V2(n){if(!n||/^[a-z][a-z0-9+.-]*:/i.test(n)||n.startsWith("#")||n.startsWith("//")||n.startsWith("?"))return null;const l=n.indexOf("#"),a=l<0?n:n.slice(0,l);if(a.includes("?"))return null;let r;try{r=decodeURIComponent(a)}catch{return null}const u=/:(\d+)$/.exec(r);if(u&&(r=r.slice(0,-u[0].length)),!r||/[\u0000-\u001f\\]/.test(r)||r.split("/").includes(".."))return null;const o=u?Number(u[1]):void 0;return o!=null&&Number.isSafeInteger(o)&&o>0?{path:r,line:o}:{path:r}}const z0=L.createContext({streaming:!1}),Y2={pre:I2,img({src:n,alt:l,title:a}){const r=typeof n=="string"&&n!==""&&!/^(?:[a-z][a-z0-9+.-]*:|\/|#|\?)/i.test(n);return b.jsx(U2,{src:r?`/dsh-bot/${n.replace(/^\.\//,"")}`:n||void 0,alt:l,title:a})},code({className:n,children:l}){return b.jsx("code",{className:n,children:l})},table({children:n}){return b.jsx("div",{className:"table-scroll",children:b.jsx("table",{children:n})})},a({href:n,children:l,node:a}){const{streaming:r,onOpenFile:u}=L.useContext(z0),{t:o}=Ye();if(a?.children.some(h=>h.type==="element"&&h.tagName==="img"))return b.jsxs("span",{className:"image-preview-linked",children:[l,b.jsx("a",{href:n,target:"_blank",rel:"noreferrer",children:o("image.openLink")})]});const f=r?null:V2(n);return f&&u?b.jsx("button",{type:"button",className:"file-mention",title:f.path,onClick:()=>u(f.path,f.line),children:l}):b.jsx("a",{href:n,target:"_blank",rel:"noreferrer",children:l})}};function G2(n,l){if(!l)return n;const a=n.match(/```/g);return a&&a.length%2===1?`${n}
53
- \`\`\``:n}function zo({text:n,streaming:l=!1,onOpenFile:a}){const r=L.useMemo(()=>({streaming:l,onOpenFile:a}),[l,a]);return b.jsx(z0.Provider,{value:r,children:b.jsx("div",{className:l?"markdown streaming":"markdown",children:b.jsx(fC,{remarkPlugins:[L2],components:Y2,children:G2(n,l)})})})}function Q2({mail:n,label:l,onOpenFile:a}){const{t:r}=Ye(),u=bb(n.from,l),o=/^\d+$/.test(n.hop)?n.hop:"",f=[n.id?`id ${n.id}`:"",`from ${n.from}`,n.correlation?`correlation ${n.correlation}`:"",n.causation?`causation ${n.causation}`:""].filter(Boolean).join(`
54
- `);return b.jsxs("article",{className:"mail-card",children:[b.jsxs("header",{className:"mail-head",children:[b.jsx("span",{className:"bot-badge",children:"BOT"}),b.jsxs("span",{className:"mail-who",children:[b.jsx("strong",{children:u}),b.jsx("span",{children:r("inbox.received")})]}),o?b.jsx("span",{className:"mail-hop",children:r("inbox.hop",{hop:o})}):null]}),n.body?b.jsx("div",{className:"mail-body",children:b.jsx(zo,{text:n.body,onOpenFile:a})}):null,b.jsx("p",{className:"mail-note",children:r("inbox.lead")}),f?b.jsxs("details",{className:"mail-details",children:[b.jsx("summary",{children:r("inbox.source")}),b.jsx("pre",{children:f})]}):null]})}function X2({who:n,preview:l,time:a,mark:r,onOpen:u}){const{t:o}=Ye(),f=l||o("inbox.received");return b.jsxs("div",{className:"inbox-line","data-turn":r,children:[b.jsxs("button",{type:"button",className:"inbox-entry",onClick:u,"aria-label":o("inbox.open",{who:n,line:f}),children:[b.jsx("span",{className:"inbox-icon",children:b.jsx($2,{})}),b.jsxs("span",{className:"inbox-copy",children:[b.jsx("strong",{children:n}),b.jsx("span",{children:f})]})]}),a?b.jsx("time",{children:a}):null]})}function F2({items:n,botLabel:l,onOpenFile:a}){const{locale:r}=Ye();return b.jsxs("div",{className:"bot-chat",children:[b.jsx(K2,{}),n.length===0?b.jsx(J2,{}):null,n.map(u=>u.kind==="in"?b.jsxs("div",{className:"mail-row",children:[b.jsx(Q2,{mail:u.mail,label:l(u.mail.from),onOpenFile:a}),mo(u.time,r)?b.jsx("time",{children:mo(u.time,r)}):null]},u.id):b.jsx(Z2,{item:u,items:n,botLabel:l},u.id))]})}function Z2({item:n,items:l,botLabel:a}){const{t:r,locale:u}=Ye(),o=Kw(n,l),f=o?bb(o,a(o)):r("inbox.other");return b.jsxs("div",{className:"bot-out",children:[b.jsx("div",{className:"user-bubble",children:n.text}),b.jsx("span",{children:r("inbox.sentTo",{name:f})}),mo(n.time,u)?b.jsx("time",{children:mo(n.time,u)}):null]})}function K2(){const{t:n}=Ye();return b.jsx("p",{className:"bot-chat-lead",children:n("inbox.lead")})}function J2(){const{t:n}=Ye();return b.jsx("p",{className:"empty-thread",children:n("inbox.empty")})}function mo(n,l){if(!n)return"";const a=new Date(n);return Number.isNaN(a.getTime())?"":a.toLocaleTimeString(l==="zh"?"zh-CN":"en",{hour:"2-digit",minute:"2-digit"})}function $2(){return b.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[b.jsx("path",{d:"M4 13.2 6.4 5.5h11.2L20 13.2",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),b.jsx("path",{d:"M4 13.2h4.1l1.1 2h5.6l1.1-2H20V19a1.4 1.4 0 0 1-1.4 1.4H5.4A1.4 1.4 0 0 1 4 19Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})]})}function P2({root:n,marks:l,busyId:a}){const r=L.useRef(null),[u,o]=L.useState(l.at(-1)?.id??""),[f,h]=L.useState(null),[p,g]=L.useState({top:!1,bottom:!1}),y=l.map(x=>x.id).join("\0");L.useEffect(()=>{const x=n.current;if(!x||l.length<2)return;const k=()=>{const T=x.getBoundingClientRect().top,A=x.scrollHeight-x.scrollTop-x.clientHeight<48;let E=l[0]?.id??"";if(A)E=l.at(-1)?.id??E;else for(const M of l){const H=x.querySelector(`[data-turn="${CSS.escape(M.id)}"]`);H instanceof HTMLElement&&H.getBoundingClientRect().top-T<=36&&(E=M.id)}o(M=>M===E?M:E)};return k(),x.addEventListener("scroll",k,{passive:!0}),()=>x.removeEventListener("scroll",k)},[n,l,y]),L.useEffect(()=>{const x=r.current,k=x?.querySelector('[aria-current="true"]');if(!x||!k)return;const T=k.offsetTop-(x.clientHeight-k.offsetHeight)/2;x.scrollTop=Math.max(0,T);const A=x.scrollTop>1,E=x.scrollTop<x.scrollHeight-x.clientHeight-1;g(M=>M.top===A&&M.bottom===E?M:{top:A,bottom:E})},[u,y]);const{t:m}=Ye();if(l.length<2)return null;const S=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;return b.jsx("nav",{ref:r,className:["turn-rail",p.top?"fade-top":"",p.bottom?"fade-bottom":""].filter(Boolean).join(" "),"aria-label":m("turn.rail"),onMouseLeave:()=>h(null),children:l.map((x,k)=>{const T=x.id===u;return b.jsx("button",{type:"button",className:["turn-mark",T?"active":"",x.id===f?"preview":"",x.id===a?"busy":""].filter(Boolean).join(" "),"aria-current":T?"true":void 0,"aria-label":m("turn.jump",{index:String(k+1)}),onMouseEnter:()=>h(x.id),onFocus:()=>h(x.id),onBlur:()=>h(A=>A===x.id?null:A),onClick:()=>{n.current?.querySelector(`[data-turn="${CSS.escape(x.id)}"]`)?.scrollIntoView({block:"start",behavior:S?"auto":"smooth"})}},x.id)})})}function W2(n){let l=!1,a=n.visible!==!1,r=!1,u=!1,o=!1,f=0,h=0,p="",g=!1,y=()=>{},m=null;function S(A){const E=JSON.stringify(A);E!==p&&(p=E,g=n.active?.(A)===!0,n.apply(A))}function x(){if(y(),l||!a)return;const A=r?6e4:g?1500:Math.min(15e3,2e3*2**Math.min(h,3));y=n.schedule(()=>{k()},A)}async function k(){if(l||!a)return;if(u){o=!0;return}y(),u=!0;const A=f;m=new AbortController;const E=m,M=n.schedule(()=>E.abort(),1e4);try{const H=await n.fetch(m.signal);!l&&a&&A===f&&S(H),h=Math.min(h+1,3)}catch{h=Math.min(h+1,3)}finally{M(),u=!1,o?(o=!1,k()):x()}}const T={ingest(A){l||!a||(f++,r=!0,h=0,S(A),x())},disconnected(){r=!1,h=0,x()},setVisible(A){a!==A&&(a=A,A||(r=!1),f++,y(),m?.abort(),a&&(h=0,k()))},close(){l=!0,f++,y(),m?.abort()},refresh:k};return k(),T}function q0(n,l=Date.now){let a=null,r=0,u=null,o=0;const f={invalidate(){o++,a=null},get(){if(a&&l()-r<3e4)return Promise.resolve(a);if(u)return u;const h=o,p=n().then(g=>h!==o?(u=null,f.get()):(h===o&&(a=g,r=l()),g)).finally(()=>{u===p&&(u=null)});return u=p,p}};return f}const us=new Set(["preparing","waiting","running","worker"]),R0=new Set([...us,"background"]),ej=/(?:password|passwd|passphrase|secret|token|api[-_]?key|authorization|cookie|credential|private[-_]?key)/i;function Xe(n){if(/^\s*[\[{]/.test(n))try{const l=JSON.parse(n);if(l&&typeof l=="object")return JSON.stringify(go(l),null,2)}catch{}return n.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g,"").replace(/-----BEGIN [^-]*PRIVATE KEY-----[\s\S]*?(?:-----END [^-]*PRIVATE KEY-----|$)/g,"[REDACTED PRIVATE KEY]").replace(/(https?:\/\/)[^\s/@]+:[^\s/@]+@/gi,"$1[REDACTED]@").replace(/\b(Bearer|Basic)\s+[A-Za-z0-9+/_.=~-]+/gi,"$1 [REDACTED]").replace(/\b(?:sk-|gh[pousr]_|github_pat_|xox[baprs]-)[A-Za-z0-9_-]+/g,"[REDACTED]").replace(/("[^"\n]*(?:password|passwd|passphrase|secret|token|api[-_]?key|authorization|cookie|credential|private[-_]?key)[^"\n]*"\s*:\s*)("(?:\\.|[^"\\])*"?|[^,}\n]+)/gi,'$1"[REDACTED]"').replace(/((?:--)?[A-Za-z_][A-Za-z0-9_-]*(?:password|passwd|secret|token|api[-_]?key|authorization|cookie|credential)[A-Za-z0-9_-]*\s*(?:=|:\s*|\s+))('[^']*'?|"(?:\\.|[^"\\])*"?|[^\s,;]+)/gi,"$1[REDACTED]").replace(/((?:--)?(?:password|passwd|secret|token|api[-_]?key|authorization|cookie|credential)\s*(?:=|:\s*|\s+))('[^']*'?|"(?:\\.|[^"\\])*"?|[^\s,;]+)/gi,"$1[REDACTED]")}function go(n){return Array.isArray(n)?n.map(go):n&&typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,a])=>[l,ej.test(l)?"[REDACTED]":go(a)])):typeof n=="string"?Xe(n):n}function tj(n){try{return JSON.stringify(go(JSON.parse(n)),null,2)}catch{return Xe(n)}}function ds(n){try{const l=JSON.parse(n);return l&&typeof l=="object"&&!Array.isArray(l)?l:{}}catch{return{}}}function kh(n){return["bash","shell","pwsh","powershell"].includes(n.toLowerCase())}function qo(n,l,a,r=""){if(/^TOOL_(NOT_STARTED|OUTCOME_UNKNOWN)$/.test(r))return"unknown";if(/ABORT|CANCEL/i.test(r))return"cancelled";if(a)return"failed";if(kh(n)){if(/^\[stopped: .+\]$/m.test(l))return"cancelled";if(/^\[(?:timed out after .+|killed by signal: .+|sandbox: .+)\]$/m.test(l))return"failed";const u=/^\[exit code: (-?\d+)\]$/m.exec(l);if(u)return Number(u[1])!==0?"failed":"succeeded";if(/^started background job \S+/m.test(l)||/^\[still running after \d+ms; moved to background job .+\]$/m.test(l))return"background"}return"succeeded"}function Eh(n){return n.status?n.status:n.resultReceived||n.result!==""?qo(n.name,n.result,n.error):n.running?"waiting":"unknown"}const nj={preparing:"activity.status.preparing",waiting:"activity.status.waiting",running:"activity.status.running",worker:"activity.status.worker",background:"activity.status.backgroundDetail",succeeded:"activity.status.succeeded",failed:"activity.status.failed",cancelled:"activity.status.cancelled",unknown:"activity.status.unknown"};function Nv(n,l=Si){return l(nj[n])}function os(n,l,a=[]){const r=ds(n.args),u=ds(n.result),o=kh(n.name),f=o&&typeof r.command=="string"?Xe(r.command):"",h=typeof r.description=="string"?Xe(r.description):"",p=n.meta&&typeof n.meta=="object"?n.meta:{},g=typeof p.cwd=="string"?p.cwd:typeof r.workdir=="string"?r.workdir:l,y=typeof p.cwd=="string"||!g||g.startsWith("/")||!l?g:l.replace(/\/$/,"")+"/"+g,m=y?Xe(y):"",S=typeof u.ticketId=="string"?u.ticketId:"",x=a.find(E=>E.id===S);let k=Eh(n);x&&n.name==="foundations_dispatch"?k=x.status==="failed"?"failed":x.status==="cancelled"?"cancelled":x.status==="delivered"?"succeeded":"worker":n.name==="foundations_dispatch"&&k==="succeeded"&&S&&(k="worker");const T=n.name==="todo_write"&&Array.isArray(r.todos)?r.todos.flatMap(E=>{if(!E||typeof E!="object")return[];const M=E;return typeof M.content=="string"&&typeof M.status=="string"?[{content:Xe(M.content),status:M.status}]:[]}):[],A=o?/^\[exit code: (-?\d+)\]$/m.exec(n.result):null;return{status:k,command:f,description:h,cwd:m,cwdSource:typeof p.cwd=="string"?"recorded":typeof r.workdir=="string"?"requested":"session",todos:T,title:n.name==="todo_write"?"todo_write":Xe(n.name),args:tj(n.args),output:Xe(n.result),exitCode:A?Number(A[1]):null,ticket:x,ticketId:S,latestReport:x?.events.filter(E=>E.revision===x.revision&&E.applyStatus!=="stale").at(-1)?.text??"",jobId:o?/(?:^started background job |moved to background job )([^\s\]]+)/m.exec(n.result)?.[1]??"":""}}const ij="ask_user_question";function M0(n){return n.replace(/-/g,"_").toLowerCase()===ij}function lj(n,l=!1){const a=n.match(/^(.*?)\s*[\((]\s*(Recommended|推荐|建議)\s*[\))]\s*$/i);return{label:n,displayLabel:a?.[1]?.trim()?a[1].trim():n,recommended:l||!!a}}function Cd(n,l,a=""){return n?l.startsWith("zh")&&typeof n.zh=="string"&&n.zh!==""?n.zh:typeof n[l]=="string"&&n[l]!==""?n[l]:n.en||a:a}function aj(n){if(!n||typeof n!="object")return;const l=n;if(l.kind==="plan-review"&&typeof l.approve=="string"){const a={kind:"plan-review",approve:l.approve};return typeof l.callId=="string"&&l.callId!==""&&(a.callId=l.callId),a}if(l.kind==="approval"&&typeof l.approve=="string"&&typeof l.reject=="string"){const a={kind:"approval",approve:l.approve,reject:l.reject};if(typeof l.always=="string"&&l.always!==""&&(a.always=l.always),l.subject&&typeof l.subject=="object"){const r=l.subject;typeof r.name=="string"&&r.name!==""&&(a.subject={name:r.name},typeof r.icon=="string"&&r.icon!==""&&(a.subject.icon=r.icon))}if(l.display&&typeof l.display=="object"){const r=l.display,u=Nd(r.question);if(u){a.display={question:u};const o=Nd(r.detail);o&&(a.display.detail=o);const f=Nd(r.approve);f&&(a.display.approve=f)}}return a}}function Nd(n){if(!n||typeof n!="object"||typeof n.en!="string")return;const l={en:n.en};for(const[a,r]of Object.entries(n))typeof r=="string"&&(l[a]=r);return l}function D0(n){const l=n[0];if(!l||n.length!==1||l.multiSelect||l.intent?.kind!=="plan-review")return;const a=l.options.find(u=>u.label===l.intent?.approve);if(!a)return;const r=l.options.find(u=>u.label!==a.label);if(!(l.options.length>2))return{item:l,approve:a,decline:r,plan:l.detail}}function L0(n){const l=n[0];if(!l||n.length!==1||l.multiSelect||l.intent?.kind!=="approval")return;const a=l.intent,r=l.options.find(f=>f.label===a.approve),u=l.options.find(f=>f.label===a.reject);if(!r||!u)return;const o=a.always?l.options.find(f=>f.label===a.always):void 0;return{item:l,intent:a,approve:r,reject:u,always:o}}function la(n){return typeof n=="string"?n:""}function rj(n){return Array.isArray(n)?n.flatMap(l=>{if(!l||typeof l!="object")return[];const a=l;return typeof a.label!="string"?[]:[{label:a.label,description:la(a.description),recommended:a.recommended===!0}]}):[]}function sj(n){return Array.isArray(n)?n.flatMap((l,a)=>{if(!l||typeof l!="object")return[];const r=l,u=la(r.question);if(!u)return[];const o=la(r.id);return[{id:o===""?`question-${a+1}`:o,question:u,detail:la(r.detail),header:la(r.header),options:rj(r.options),multiSelect:r.multi_select===!0||r.multiSelect===!0,intent:aj(r.intent)}]}):[]}function uj(n){const l=new Map,a=ds(n),r=Array.isArray(a.answers)?a.answers:Array.isArray(a)?a:[];for(const u of r){if(!u||typeof u!="object")continue;const o=u,f=la(o.id);if(!f)continue;const h=Array.isArray(o.selected)?o.selected.flatMap(p=>typeof p=="string"?[p]:[]):[];l.set(f,{selected:h,custom:la(o.custom)})}return l}function oj(n){const l=n.errorCode??"";return/ASK_ABORTED|ABORT|CANCEL/i.test(l)||/aborted before the user answered/i.test(n.result)}function B0(n){if(!n)return!1;const l=ds(n);return!!(l&&l.pending===!0)}function cj(n){return B0(n.result)?!1:!!(n.resultReceived||n.result!==""||n.error||n.errorCode)}function fj(n){const l=n.timeout;if(!(typeof l!="number"||!Number.isFinite(l)||l<=0))return l>1e3?l:l*1e3}function xs(n){if(!M0(n.name))return null;const l=ds(n.args),a=sj(l.questions),r=uj(n.result),u=oj(n),o=B0(n.result),f=cj(n),h=f&&n.error&&!u,p=o?"continued":f?u?"aborted":h?"failed":"answered":"open",g=fj(l),y=o?"continued":p==="open"&&g?"counting":"none",m=a.map(k=>{const T=r.get(k.id),A=T?.selected??[],E=T?.custom??"";return{...k,selected:A,custom:E,skipped:p==="answered"&&A.length===0&&!E}}),S=m.find(k=>k.header)?.header||m[0]?.question||n.name,x=D0(m)?"plan-review":L0(m)?"approval":"question";return{callId:n.callId,state:p,wait:y,timeoutMs:g,title:S,questions:m,presentation:x}}function U0(n){return n==="open"||n==="continued"}const dj=new Set(["accepted","enqueued","started","needs_user","ready"]),hj=new Set(["delivered","failed","cancelled"]),pj={preparing:"activity.status.preparing",waiting:"activity.status.waiting",running:"activity.status.running",worker:"activity.status.worker",background:"activity.status.background",succeeded:"activity.status.succeeded",failed:"activity.status.failed",cancelled:"activity.status.cancelled",unknown:"activity.status.unknown"},mj={accepted:"activity.ticket.scheduling",enqueued:"activity.ticket.scheduling",started:"activity.status.worker",needs_user:"activity.ticket.needsUser",ready:"activity.ticket.ready"};function Jd(n){const{segments:l,drafting:a,currentTurn:r,tickets:u=[],t:o=Si}=n,f=[],h=[],p=new Set,g=S=>r==null||S===r,y=S=>o(pj[S]);for(const S of l){if(S.kind!=="tool")continue;const x=os(S,void 0,u),k=xs(S);if(k&&U0(k.state)&&a&&g(S.turn)){f.push({text:o("question.waiting"),moving:!0});continue}if(x.status==="worker"&&x.ticket)continue;if(x.status==="worker"&&x.ticketId){if(p.has(x.ticketId))continue;p.add(x.ticketId)}const T=x.description||x.command||x.title,A={text:`${y(x.status)}: ${T}`,moving:x.status!=="background"};if(x.status==="background"){a&&g(S.turn)&&h.push(A);continue}us.has(x.status)&&(!a||!g(S.turn)||f.push(A))}n.pendingApprovals?.some(S=>S.state==="open")&&f.push({text:o("approval.waiting"),moving:!0});for(const S of u){if(p.has(S.id)||hj.has(S.status)||!dj.has(S.status))continue;p.add(S.id);const x=mj[S.status];x&&f.push({text:`${o(x)}: ${S.summary}`,moving:["accepted","enqueued","started"].includes(S.status)})}let m=f.find(S=>S.text===o("question.waiting"))??f.at(-1);if(f.length>1&&m&&(m={text:`${o("activity.pendingCount",{count:String(f.length)})} · ${m.text}`,moving:f.some(S=>S.moving)}),!m&&h.length&&(m=h.at(-1)),!m&&a){const S=l.filter(x=>g(x.turn));m=S.some(x=>x.kind==="think"&&x.running)?{text:o("activity.thinking"),moving:!0}:S.some(x=>x.kind==="assistant"&&x.streaming)?{text:o("bot.replying"),moving:!0}:{text:o("activity.waitingModel"),moving:!0}}if(!m)return null;if(n.connectionPhase&&n.connectionPhase!=="live"){const S=["restoring","connecting","syncing"].includes(n.connectionPhase);m={text:o("activity.staleSummary",{phase:o(S?"activity.syncing":"activity.connectionUnavailable"),text:m.text}),moving:!1}}return{...m,text:Xe(m.text).replace(/\s+/g," ").trim()}}function gj(n){const{t:l}=Ye(),a=Jd({...n,t:l}),[r,u]=L.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return L.useEffect(()=>{const o=()=>u(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",o),o(),()=>document.removeEventListener("visibilitychange",o)},[]),a?b.jsxs("div",{className:"composer-activity",role:"status","aria-live":"polite","aria-atomic":"true","data-moving":a.moving&&r?"true":"false",children:[b.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:b.jsx("path",{d:"M3 4h10M3 8h10M3 12h6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})}),b.jsx("span",{className:"composer-activity-text",title:a.text,children:a.text})]}):null}function H0(n,l){return n==="workspace-write"?l("permission.preset.workspaceWrite"):n==="read-only"||n==="readonly"?l("permission.preset.readOnly"):n==="danger-full-access"?l("permission.preset.fullAccess"):n==="auto"?l("permission.preset.auto"):n}function jv(n,l,a){const r=H0(n,a);return r!==n?r:l&&l!==""?l:n}function Th({title:n,closeLabel:l,onClose:a,children:r}){L.useEffect(()=>{if(typeof document>"u")return;const o=document.body.style.overflow;document.body.style.overflow="hidden";const f=h=>{h.key==="Escape"&&a()};return document.addEventListener("keydown",f),()=>{document.body.style.overflow=o,document.removeEventListener("keydown",f)}},[a]);const u=b.jsxs("div",{className:"settings-drawer",children:[b.jsx("div",{className:"settings-drawer-mask",onClick:a}),b.jsxs("div",{className:"settings-drawer-sheet",role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[b.jsx("div",{className:"settings-drawer-handle","aria-hidden":"true"}),b.jsxs("div",{className:"settings-head",children:[b.jsx("h3",{children:n}),b.jsx("button",{type:"button",className:"user-question-skip",onClick:a,children:l})]}),b.jsx("div",{className:"settings-drawer-body",children:r})]})]});return typeof document>"u"||!document.body?u:nh.createPortal(u,document.body)}function yj({sessionId:n,current:l,onClose:a,onChanged:r}){const{t:u}=Ye(),[o,f]=L.useState(null),[h,p]=L.useState(null),[g,y]=L.useState(""),[m,S]=L.useState(!1);L.useEffect(()=>{ct(`/permissions?sessionId=${encodeURIComponent(n)}`).then(E=>f(E.body))},[n]);async function x(E){S(!0),y("");try{const M=await ct("/permissions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:n,name:E})});if(M.status===200&&M.body.ok!==!1){f(M.body),p(null),typeof M.body.currentValue=="string"&&r?.(M.body.currentValue);return}y(typeof M.body.message=="string"?M.body.message:u("permission.failed"))}catch{y(u("permission.failed"))}finally{S(!1)}}function k(E){if(!(E.value===o?.currentValue||E.value==="custom")){if(E.value==="danger-full-access"||E.value==="auto"){p(E);return}x(E.value)}}const T=o?.options??[],A=T.find(E=>E.value===(o?.currentValue??l));return b.jsxs(Th,{title:u("permission.title"),closeLabel:u("permission.close"),onClose:a,children:[o&&o.available===!1?b.jsx("p",{className:"user-question-hint",children:u("permission.unavailable")}):null,o?.currentValue||l?b.jsxs("p",{className:"user-question-hint",children:[u("permission.current"),":"," ",jv(o?.currentValue??l??"",A?.name,u)||"—"]}):null,b.jsx("ul",{className:"user-question-options",children:T.map(E=>b.jsx("li",{children:b.jsxs("button",{type:"button",className:E.value===o?.currentValue?"user-question-option selected":"user-question-option",disabled:m||E.value==="custom",onClick:()=>k(E),children:[b.jsx("span",{className:"user-question-option-label",children:jv(E.value,E.name,u)}),E.description?b.jsx("span",{className:"user-question-option-desc",children:E.description}):null]})},E.value))}),h?b.jsxs("div",{className:"settings-confirm",children:[b.jsx("p",{className:"user-question-text",children:u("permission.confirmTitle")}),b.jsx("p",{className:"user-question-hint",children:h.value==="auto"?u("permission.confirmAuto"):u("permission.confirmFull")}),b.jsxs("div",{className:"user-question-row",children:[b.jsx("button",{type:"button",className:"user-question-skip",disabled:m,onClick:()=>p(null),children:u("permission.cancel")}),b.jsx("button",{type:"button",className:"user-question-submit",disabled:m,onClick:()=>{x(h.value)},children:u("permission.confirm")})]})]}):null,g?b.jsx("p",{className:"user-question-status exception",children:g}):null]})}function vj({onClose:n,authorization:l,catalog:a}){const{t:r}=Ye(),[u,o]=L.useState(!0),[f,h]=L.useState([]),[p,g]=L.useState([]),[y,m]=L.useState([]),[S,x]=L.useState({}),[k,T]=L.useState(""),[A,E]=L.useState(!1),[M]=L.useState(()=>q0(async()=>{const _=await ct("/authorization");if(_.status!==200)throw new Error("Authorization catalog unavailable");return _.body})),H=a??M,$=L.useRef(!0),te=L.useRef(0);async function O(_=!1){if(document.hidden)return;_&&H.invalidate();const Z=++te.current;try{const P=await H.get();if(!$.current||Z!==te.current)return;o(P.available!==!1),h(Array.isArray(P.entries)?P.entries:[]),l||(g(Array.isArray(P.notices)?P.notices:[]),m(Array.isArray(P.prompts)?P.prompts:[]))}catch{$.current&&Z===te.current&&T(r("auth.failed"))}}L.useEffect(()=>{l&&(o(l.available!==!1),(Array.isArray(l.prompts)&&l.prompts.length>0||Array.isArray(l.inFlight)&&l.inFlight.length>0)&&E(!1),g(Array.isArray(l.notices)?l.notices:[]),m(Array.isArray(l.prompts)?l.prompts:[]))},[l]),L.useEffect(()=>{$.current=!0,O();const _=()=>{document.hidden||O(!0)},Z=window.setInterval(()=>{O()},3e4);return document.addEventListener("visibilitychange",_),()=>{$.current=!1,te.current++,window.clearInterval(Z),document.removeEventListener("visibilitychange",_)}},[H,l?.catalogRevision]);async function Q(_,Z){E(!0),T("");try{const P=await ct("/authorization/begin",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:_.key,method:Z})});(P.status!==200||P.body.ok===!1)&&T(typeof P.body.message=="string"?P.body.message:r("auth.failed")),await O(!0)}catch{T(r("auth.failed"))}finally{E(!1)}}async function ne(_,Z=!1,P){E(!0),T("");try{const Se=await ct("/authorization/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({promptId:_.promptId,value:Z?void 0:P??S[_.promptId]??"",declined:Z})});(Se.status!==200||Se.body.ok===!1)&&T(typeof Se.body.message=="string"?Se.body.message:r("auth.failed")),await O(!0)}catch{T(r("auth.failed"))}finally{E(!1)}}async function he(_){E(!0);try{await ct("/authorization/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:_.key})}),await O(!0)}finally{E(!1)}}return b.jsxs(Th,{title:r("auth.title"),closeLabel:r("auth.close"),onClose:n,children:[u?null:b.jsx("p",{className:"user-question-hint",children:r("auth.unavailable")}),u&&f.length===0&&y.length===0?b.jsx("p",{className:"user-question-hint",children:r("auth.empty")}):null,p.map((_,Z)=>b.jsxs("p",{className:"user-question-hint",children:[_.message,_.code?` · ${_.code}`:"",_.url?b.jsxs(b.Fragment,{children:[" ",b.jsx("a",{href:_.url,target:"_blank",rel:"noreferrer",children:_.url})]}):null]},`${_.message}-${Z}`)),y.map(_=>b.jsxs("article",{className:"user-question",children:[b.jsx("p",{className:"user-question-text",children:_.message}),_.kind==="select"?b.jsx("ul",{className:"user-question-options",children:(_.options??[]).map(Z=>b.jsx("li",{children:b.jsxs("button",{type:"button",className:"user-question-option",disabled:A,onClick:()=>{ne(_,!1,Z.id)},children:[b.jsx("span",{className:"user-question-option-label",children:Z.label}),Z.description?b.jsx("span",{className:"user-question-option-desc",children:Z.description}):null]})},Z.id))}):_.kind==="secret"?b.jsxs("label",{className:"user-question-custom",children:[b.jsx("span",{className:"user-question-secret",children:r("auth.secretMask")}),b.jsx("input",{type:"text",className:"user-question-secret-input",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:S[_.promptId]??"",placeholder:_.placeholder,disabled:A,onChange:Z=>x(P=>({...P,[_.promptId]:Z.target.value}))})]}):b.jsx("label",{className:"user-question-custom",children:b.jsx("input",{type:"text",value:S[_.promptId]??"",placeholder:_.placeholder,disabled:A,onChange:Z=>x(P=>({...P,[_.promptId]:Z.target.value}))})}),b.jsxs("div",{className:"user-question-row",children:[b.jsx("button",{type:"button",className:"user-question-skip",disabled:A,onClick:()=>{ne(_,!0)},children:r("auth.cancel")}),_.kind!=="select"?b.jsx("button",{type:"button",className:"user-question-submit",disabled:A||_.kind!=="secret"&&!(S[_.promptId]??"").trim(),onClick:()=>{ne(_)},children:r("auth.writeVault")}):null]})]},_.promptId)),f.map(_=>{const Z={..._,inFlight:_.inFlight||Array.isArray(l?.inFlight)&&l.inFlight.some(P=>JSON.stringify(P)===JSON.stringify(_.key))};return b.jsxs("article",{className:"user-question",children:[b.jsx("p",{className:"user-question-text",children:Z.label}),b.jsxs("div",{className:"user-question-row",children:[Z.methods.map(P=>b.jsx("button",{type:"button",className:"user-question-submit",disabled:A||Z.inFlight,onClick:()=>{Q(Z,P.id)},children:P.label||r("auth.start")},P.id)),Z.inFlight?b.jsx("button",{type:"button",className:"user-question-skip",disabled:A,onClick:()=>{he(Z)},children:r("auth.cancel")}):null]})]},JSON.stringify(Z.key))}),k?b.jsx("p",{className:"user-question-status exception",children:k}):null]})}function bj({onClose:n}){const{t:l,locale:a}=Ye(),[r,u]=L.useState(!1),[o,f]=L.useState(!1),[h,p]=L.useState(null),[g,y]=L.useState([]),[m,S]=L.useState([]),[x,k]=L.useState(""),[T,A]=L.useState(!1);async function E(){const H=await ct(`/cua?locale=${encodeURIComponent(a)}`);f(!0),u(H.body.available===!0);const $=H.body.systemStatus;p($&&typeof $=="object"?$:null);const te=H.body.applications;if(te&&typeof te=="object"){const O=te;y(Array.isArray(O.allowedApps)?O.allowedApps:[]),S(Array.isArray(O.blockedApps)?O.blockedApps:[])}}L.useEffect(()=>{E()},[a]);async function M(H,$={}){A(!0),k("");try{const te=await ct("/cua",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:H,locale:a,...$})});(te.status!==200||te.body.ok===!1)&&k(typeof te.body.message=="string"?te.body.message:l("cua.failed")),await E()}catch{k(l("cua.failed"))}finally{A(!1)}}return o&&!r?null:b.jsxs(Th,{title:l("cua.title"),closeLabel:l("cua.close"),onClose:n,children:[b.jsx("h4",{className:"user-question-header",children:l("cua.system")}),["accessibility","screenRecording"].map(H=>b.jsxs("div",{className:"user-question-row",children:[b.jsxs("p",{className:"user-question-text",children:[l(H==="accessibility"?"cua.accessibility":"cua.screenRecording"),b.jsx("span",{className:"user-question-hint",children:h?.[H]?l("cua.granted"):l("cua.missing")})]}),b.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{M("requestPermission",{permission:H})},children:l("cua.request")}),b.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{M("openSettings",{permission:H})},children:l("cua.openSettings")})]},H)),b.jsx("h4",{className:"user-question-header",children:l("cua.grants")}),g.length===0?b.jsx("p",{className:"user-question-hint",children:l("cua.emptyGrants")}):null,g.map(H=>b.jsxs("div",{className:"user-question-row",children:[b.jsx("p",{className:"user-question-text",children:H.name}),b.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{M("revoke",{id:H.id})},children:l("cua.revoke")})]},H.id)),b.jsx("h4",{className:"user-question-header",children:l("cua.blocked")}),m.length===0?b.jsx("p",{className:"user-question-hint",children:l("cua.emptyBlocked")}):null,m.map(H=>b.jsxs("div",{className:"user-question-row",children:[b.jsx("p",{className:"user-question-text",children:H.name}),b.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{M("retryApproval",{id:H.id})},children:l("cua.askAgain")})]},H.id)),x?b.jsx("p",{className:"user-question-status exception",children:x}):null]})}function xj(n){const l=[],a=new Set;for(const r of n){if(r.kind==="user"){l.push({id:r.id});continue}const u=r.turn??-1;a.has(u)||(a.add(u),l.push({id:`turn:${u}`}))}return l}function I0(n){return Array.isArray(n)?n.filter(l=>l?.type==="text"&&typeof l.text=="string").map(l=>l.text??"").join(`
55
- `).trim():""}function Ah(n){const l=n.message;return l&&typeof l=="object"?l:Array.isArray(n.content)||typeof n.toolCallId=="string"?n:null}function yo(n){if(typeof n=="string")return n;if(n&&typeof n=="object")try{return JSON.stringify(n)}catch{return""}return""}function Qe(n){return typeof n=="number"?n:void 0}function Sj(n){if(!n||typeof n!="object")return null;const l=n;if(l.kind==="error"){const a=typeof l.error?.message=="string"&&l.error.message!==""?l.error.message:"This turn failed",r=typeof l.error?.code=="string"?l.error.code:void 0;return{message:a,...r?{code:r}:{}}}return l.kind==="interrupted"?{message:"The DSH process exited before this turn finished.",code:"INTERRUPTED"}:l.kind==="aborted"&&l.reason?.kind==="hook"&&l.reason.reason==="deepseek-account/signed-out"?{message:"Stopped because you signed out of DeepSeek.",code:"ACCOUNT_SIGNED_OUT"}:null}function Ro(n,l){return`${n??""}:${l??""}`}function hs(n){return n.sort((l,a)=>l.seq-a.seq)}function wj(n,l){const a=n.findIndex(r=>r.kind==="user"&&r.optimistic&&r.text.trim()===l.text.trim());if(a>=0){const r=n.slice(),u=r[a];return!u||u.kind!=="user"?n:(r[a]={...u,optimistic:!1,time:l.time??u.time,seq:l.seq,turn:l.turn},r)}return hs([...n,l])}function kj(n,l){const a=l.trim();if(!a)return"";try{const r=JSON.parse(a),u=typeof r.command=="string"?r.command:"",o=typeof r.description=="string"?r.description:"",f=["path","file_path","file","target_file","target"].map(p=>r[p]).find(p=>typeof p=="string"),h=typeof r.query=="string"?r.query:typeof r.pattern=="string"?r.pattern:typeof r.prompt=="string"?r.prompt:"";return(u||(typeof f=="string"?f:"")||h||o||n).replace(/\s+/g," ").trim()}catch{return a.replace(/\s+/g," ").trim()}}function V0(n){const l=[];let a=[],r=0;const u=()=>{a.length!==0&&(l.push({type:"activity",id:`activity:${r++}`,segments:a}),a=[])};for(const o of n)o.kind==="assistant"?(u(),l.push({type:"text",segment:o})):o.kind==="tool"&&M0(o.name)?(u(),l.push({type:"question",segment:o})):(o.kind==="think"||o.kind==="tool")&&a.push(o);return u(),l}function Ej(n){let l;try{const u=JSON.parse(n.args);if(!u||typeof u!="object")return null;l=u}catch{return null}const a=n.name.toLowerCase(),r=Tj(l,["file_path","path","file"]);if(!r)return null;if(a==="write"){const u=typeof l.content=="string"?l.content:"",o=vo(u).map(f=>({kind:"add",text:f}));return Ov(r,u.length,o,o.length,0)}if(a==="edit"||a==="apply_patch"||a==="str_replace_editor"){const u=typeof l.old_string=="string"?l.old_string:typeof l.old_str=="string"?l.old_str:null,o=typeof l.new_string=="string"?l.new_string:typeof l.new_str=="string"?l.new_str:typeof l.content=="string"?l.content:typeof l.file_text=="string"?l.file_text:"",f=u==null||u===""?vo(o).map(g=>({kind:"add",text:g})):Aj(u,o),h=f.filter(g=>g.kind==="add").length,p=f.filter(g=>g.kind==="del").length;return Ov(r,o.length,f,h,p)}return null}function Ov(n,l,a,r,u){const o=n.split("/").filter(Boolean).at(-1)??n;return{path:n,name:o,language:Cj(o),kilobytes:Math.max(1,Math.ceil(l/1024)),added:r,removed:u,lines:a}}function Tj(n,l){for(const a of l){const r=n[a];if(typeof r=="string"&&r.trim())return r.trim()}return""}function vo(n){return n===""?[]:(n.endsWith(`
56
- `)?n.slice(0,-1):n).split(`
57
- `)}function Aj(n,l){const a=vo(n),r=vo(l);if(a.length>180||r.length>180)return[...a.map(y=>({kind:"del",text:y})),...r.map(y=>({kind:"add",text:y}))];const u=a.length+1,o=r.length+1,f=Array.from({length:u},()=>Array(o).fill(0));for(let y=a.length-1;y>=0;y-=1)for(let m=r.length-1;m>=0;m-=1){const S=f[y],x=f[y+1];!S||!x||(S[m]=a[y]===r[m]?(x[m+1]??0)+1:Math.max(x[m]??0,S[m+1]??0))}const h=[];let p=0,g=0;for(;p<a.length&&g<r.length;)a[p]===r[g]?(h.push({kind:"context",text:a[p]??""}),p+=1,g+=1):(f[p+1]?.[g]??0)>=(f[p]?.[g+1]??0)?(h.push({kind:"del",text:a[p]??""}),p+=1):(h.push({kind:"add",text:r[g]??""}),g+=1);for(;p<a.length;)h.push({kind:"del",text:a[p]??""}),p+=1;for(;g<r.length;)h.push({kind:"add",text:r[g]??""}),g+=1;return h}function Cj(n){const l=n.split(".").pop()?.toLowerCase()??"";return{py:"python",ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",md:"markdown",css:"css",html:"html",json:"json",sh:"bash",yml:"yaml",yaml:"yaml",go:"go",rs:"rust",rb:"ruby"}[l]??""}function Nj(n){return(n.split(`
58
- `).map(a=>a.trim()).find(Boolean)??"").replaceAll("**","")}function Y0(n,l){const a=n.findIndex(m=>m.kind==="tool"&&m.callId===l.callId);if(a<0)return hs([...n,l]);const r=n[a];if(!r||r.kind!=="tool")return n;const u=n.slice(),o=r.resultReceived===!0||l.resultReceived===!0,h=l.resultReceived&&(!r.resultReceived||(l.resultSeq??-1)>(r.resultSeq??-1))?l:r,g=l.callReceived&&(!r.callReceived||(l.callSeq??-1)>(r.callSeq??-1))?l:r,y=(g.name!=="tool"?g.name:l.name)||r.name;return u[a]={...r,seq:!r.callReceived&&r.resultReceived&&l.callReceived?Math.min(r.seq,l.seq):r.seq,id:`tool:${l.callId}`,name:y,args:g.callReceived?g.args:l.args||r.args,callReceived:r.callReceived||l.callReceived,callSeq:g.callSeq,requestedAt:g.requestedAt,resultReceived:o,result:o?h.result:"",error:o?h.error:!1,errorCode:h.errorCode,meta:h.meta,resultSeq:h.resultSeq,settledAt:h.settledAt,status:o?qo(y,h.result,h.error,h.errorCode):l.status??r.status,running:!o&&(l.running||r.running),turn:r.turn??l.turn,step:r.step??l.step},hs(u)}function jj(n,l,a,r,u,o){const f=`live:${l}:`,h=n.segments.filter(y=>y.id.startsWith(f));let p=n.segments.filter(y=>!y.id.startsWith(f)||y.kind==="tool"&&(y.callReceived||y.resultReceived));const g=[];for(const y of a){const m=r+y.index/100;if(y.kind==="reasoning"&&y.text.trim())g.push({kind:"think",id:`${f}think:${y.index}`,text:y.text,running:!0,seq:m,turn:u,step:o});else if(y.kind==="text"&&y.text)g.push({kind:"assistant",id:`${f}text:${y.index}`,text:y.text,streaming:!0,seq:m,turn:u,step:o});else if(y.kind==="tool-call"&&(y.name||y.args||y.id)){const S=y.id||`${f}tool:${y.index}`,x=[...p,...h].find(T=>T.kind==="tool"&&T.callId===S),k=p.findIndex(T=>T.kind==="tool"&&T.callId===S);if(k>=0){const T=p[k];if(T&&T.kind==="tool"&&!T.callReceived&&!T.resultReceived){const A=p.slice();A[k]={...T,name:y.name||T.name,args:y.args||T.args,running:T.resultReceived?!1:T.running,status:T.resultReceived||T.callReceived?T.status:"preparing"},p=A}}else g.push({kind:"tool",id:`${f}tool:${y.index}`,callId:S,name:y.name||x?.name||"tool",args:y.args||x?.args||"",result:x?.result??"",error:x?.error??!1,running:!x?.resultReceived,status:x?.status??"preparing",resultReceived:x?.resultReceived,seq:x?.seq??m,turn:u,step:o})}}return hs([...p,...g])}function G0(n,l,a){const r=n.find(u=>u.index===l);return r?r.kind===a?n:n.map(u=>u.index===l?{...u,kind:a}:u):[...n,{index:l,kind:a,text:"",id:"",name:"",args:""}].sort((u,o)=>u.index-o.index)}function lo(n,l,a,r){return G0(n,l,a).map(o=>o.index===l?r({...o,kind:a}):o)}function Oj(n,l){const a=Qe(l.index)??0,r=typeof l.type=="string"?l.type:"";if(r==="block-start"){const u=l.blockType==="reasoning"||l.blockType==="tool-call"||l.blockType==="text"?l.blockType:"text";return G0(n,a,u)}if(r==="text-delta"||r==="text-chunks"){const u=typeof l.text=="string"?l.text:_v(l.texts);return lo(n,a,"text",o=>({...o,text:o.text+u}))}if(r==="reasoning-delta"||r==="reasoning-chunks"){const u=typeof l.text=="string"?l.text:_v(l.texts);return lo(n,a,"reasoning",o=>({...o,text:o.text+u}))}if(r==="tool-call-delta"||r==="tool-call-chunks"){const u=typeof l.argumentsDelta=="string"?l.argumentsDelta:yo(l.args??l.arguments);return lo(n,a,"tool-call",o=>({...o,id:typeof l.id=="string"&&l.id?l.id:o.id,name:typeof l.name=="string"&&l.name?l.name:o.name,args:r==="tool-call-chunks"&&u?u:o.args+u}))}if(r==="block-end"&&l.block&&typeof l.block=="object"){const u=l.block,o=u.type==="reasoning"||u.type==="tool-call"||u.type==="text"?u.type:"text";return lo(n,a,o,f=>({...f,kind:o,text:typeof u.text=="string"?u.text:f.text,id:u.id||f.id,name:u.name||f.name,args:yo(u.arguments)||f.args}))}return n}function _v(n){return Array.isArray(n)?n.filter(l=>typeof l=="string").join(""):""}function Q0(n,l){const a=l.data??{},r=a.chunk;if(!r||typeof r!="object")return n;const u=Qe(a.turn),o=Qe(a.step),f=Ro(u,o),h=n.live[f]??{seq:l.seq??0,blocks:[]},p=Oj(h.blocks,r),g={...n.live,[f]:{seq:h.seq||l.seq||0,blocks:p}},y=h.seq||l.seq||0;return{...n,live:g,drafting:!0,turn:u??n.turn,segments:jj({...n},f,p,y,u,o)}}function X0(n,l){const a=l.data??{},r=Ah(a),u=r?.content??[],o=Qe(a.turn),f=Qe(a.step),h=Ro(o,f),p={...n.live};delete p[h];let g=n.segments.filter(m=>!m.id.startsWith(`live:${h}:`));g=g.filter(m=>!((m.kind==="think"||m.kind==="assistant")&&m.turn===o&&m.step===f));const y=l.seq??0;return u.forEach((m,S)=>{const x=y+S/100;if(m.type==="reasoning"&&m.text?.trim())g.push({kind:"think",id:`think:${h}:${S}`,text:m.text,running:!1,seq:x,turn:o,step:f});else if(m.type==="text"&&m.text)g.push({kind:"assistant",id:`text:${h}:${S}`,text:m.text,streaming:!1,time:l.time,seq:x,turn:o,step:f,messageId:r?.id});else if(m.type==="tool-call"){const k=m.id||`call:${h}:${S}`,T=g.find(A=>A.kind==="tool"&&A.callId===k);g=g.filter(A=>!(A.kind==="tool"&&A.callId===k)),g.push({...T?.kind==="tool"?T:{},kind:"tool",id:`tool:${k}`,callId:k,name:T?.kind==="tool"&&T.callReceived?T.name:m.name||(T?.kind==="tool"?T.name:"")||"tool",args:T?.kind==="tool"&&T.callReceived?T.args:yo(m.arguments)||(T?.kind==="tool"?T.args:""),result:T?.kind==="tool"?T.result:"",error:T?.kind==="tool"?T.error:!1,running:T?.kind==="tool"?T.running&&!T.resultReceived:!0,status:T?.kind==="tool"?T.resultReceived?qo(m.name||T.name,T.result,T.error,T.errorCode):T.status:"preparing",seq:x,turn:o,step:f})}}),{...n,live:p,segments:hs(g)}}function _j(n,l){const a=l.data??{},r=typeof a.callId=="string"?a.callId:"";if(!r)return n;const u=Qe(a.turn),o=Qe(a.step);return{...n,segments:Y0(n.segments,{kind:"tool",id:`tool:${r}`,callId:r,name:typeof a.name=="string"?a.name:"tool",args:yo(a.arguments),status:n.turnEnds?.[u??-1]?"unknown":"waiting",callReceived:!0,callSeq:l.seq,requestedAt:l.time,result:"",error:!1,running:!0,seq:l.seq??Number.MAX_SAFE_INTEGER,turn:u,step:o})}}function zj(n,l){const a=l.data??{},r=Ah(a),u=r?.toolCallId??(typeof a.callId=="string"?a.callId:"");if(!u)return n;const o=I0(r?.content),f=Qe(a.turn),h=Qe(a.step),p=n.segments.find(g=>g.kind==="tool"&&g.callId===u);return{...n,segments:Y0(n.segments,{kind:"tool",id:`tool:${u}`,callId:u,name:p?.kind==="tool"?p.name:"tool",args:p?.kind==="tool"?p.args:"",result:o,resultReceived:!0,resultSeq:l.seq,settledAt:l.time,meta:a.meta,errorCode:typeof a.error?.code=="string"?a.error.code:void 0,status:qo(p?.kind==="tool"?p.name:"tool",o,r?.isError===!0,typeof a.error?.code=="string"?a.error.code:void 0),error:r?.isError===!0,running:!1,seq:p?.seq??l.seq??Number.MAX_SAFE_INTEGER,turn:f??(p?.kind==="tool"?p.turn:void 0),step:h??(p?.kind==="tool"?p.step:void 0)})}}function qj(n){if(!n||typeof n!="object")return null;const l=n,a=l.value;if(a&&typeof a=="object"&&!Array.isArray(a)){const r=a;if(typeof r.type=="string")return r}return typeof l.type=="string"?l:null}function F0(n,l){let a=l;for(const r of n.segments)r.seq>a&&(a=r.seq);return a+.5}function Rj(n){if(!Array.isArray(n))return[];const l=[];for(const a of n){if(!a||typeof a!="object")continue;const r=a;if(r.type==="chunk"&&r.chunk&&typeof r.chunk=="object"){l.push({time:Qe(r.time)??0,chunk:r.chunk});continue}const u=Qe(r.index)??0,o=Array.isArray(r.texts)?r.texts:Array.isArray(r.args)?r.args:null;if(!o)continue;let f=Qe(r.time0)??0;const h=Array.isArray(r.dt)?r.dt:[];o.forEach((p,g)=>{g>0&&(f+=Qe(h[g-1])??0);const y=typeof p=="string"?p:"";r.type==="text-chunks"?l.push({time:f,chunk:{type:"text-delta",index:u,text:y}}):r.type==="reasoning-chunks"?l.push({time:f,chunk:{type:"reasoning-delta",index:u,text:y}}):r.type==="tool-call-chunks"&&l.push({time:f,chunk:{type:"tool-call-delta",index:u,id:typeof r.id=="string"?r.id:"",...typeof r.name=="string"?{name:r.name}:{},argumentsDelta:y}})})}return l}function Z0(n,l,a,r,u,o){return Q0(n,{seq:o,data:{turn:l,step:a,chunk:u}})}function $d(n,l,a,r=!1){const u=Ro(l,a),o={...n.live};return delete o[u],{...n,live:o,segments:n.segments.filter(f=>f.id.startsWith(`live:${u}:`)?f.kind==="tool"&&(f.callReceived===!0||f.resultReceived===!0):!(r&&f.kind!=="user"&&f.turn===l&&f.step===a&&(f.kind==="assistant"||f.kind==="think")))}}function Mj(n,l){const a=n.streamAttempt;if(!a||l.surfaceOp!=null&&l.surfaceOp!=="append")return!1;const r=l.data??{};return Qe(r.turn)!==a.turn||Qe(r.step)!==a.step?!1:l.seq==null||l.seq>a.startedAfterSeq}function is(n){const l=n.pendingAssistant;return{...l?X0(n,l):n,pendingAssistant:null,streamAttempt:null}}function Dj(n,l,a){return{...n,streamAttempt:null,pendingAssistant:null,segments:n.segments.map(r=>r.kind==="user"||r.turn!==l||r.step!==a?r:r.kind==="think"?{...r,running:!1}:r.kind==="tool"?{...r,running:!1,status:r.resultReceived||!R0.has(Eh(r))?r.status:"unknown"}:r.kind==="assistant"?{...r,streaming:!1}:r)}}function K0(n,l,a){return!!n.turnEnds?.[l]||n.segments.some(r=>r.kind!=="user"&&r.turn===l&&r.step===a&&(r.kind==="tool"?r.callReceived||r.resultReceived:r.kind==="assistant"?!r.id.startsWith("live:")&&!r.streaming:r.kind==="think"&&!r.id.startsWith("live:")&&!r.running))}function Lj(n,l){const a=Qe(l.revision)??n.streamRevision;if(a<n.streamRevision)return n;let r={...n,streamRevision:a};const u=l.activeAttempt;if(!u||typeof u!="object")return{...r,streamAttempt:null};const o=u,f=typeof o.attemptId=="string"?o.attemptId:"",h=Qe(o.turn),p=Qe(o.step),g=Qe(o.startedAfterSeq)??a;if(!f||h==null||p==null)return{...r,streamAttempt:null};if(K0(r,h,p))return{...r,streamAttempt:null};r=$d(r,h,p);const y=Rj(o.stream),m=Math.min(Qe(o.nextIndex)??y.length,y.length),S=F0(r,g);for(let x=0;x<m;x+=1){const k=y[x];k&&(r=Z0(r,h,p,k.time,k.chunk,S))}return{...r,drafting:m>0||r.drafting,streamAttempt:{attemptId:f,turn:h,step:p,nextIndex:m,startedAfterSeq:g}}}function Bj(n,l){const a=typeof l.type=="string"?l.type:"",r=Qe(l.revision),u=typeof l.attemptId=="string"?l.attemptId:"";if(r==null||!u||r<=n.streamRevision)return n;if(a==="start"){const f=Qe(l.turn),h=Qe(l.step);if(f==null||h==null||K0(n,f,h))return n;const p=n.pendingAssistant?is(n):n;return{...$d(p,f,h,!0),drafting:!0,streamRevision:r,streamAttempt:{attemptId:u,turn:f,step:h,nextIndex:0,startedAfterSeq:Qe(l.startedAfterSeq)??n.streamRevision}}}if(r!==n.streamRevision+1)return{...is(n),streamRevision:r};const o=n.streamAttempt;if(!o||n.turnEnds?.[o.turn]||o.attemptId!==u)return{...n,streamRevision:r};if(a==="chunk"){const f=Qe(l.index),h=l.chunk;if(f==null||!h||typeof h!="object")return{...n,streamRevision:r};if(f!==o.nextIndex)return{...is(n),streamRevision:r};const p=Ro(o.turn,o.step),g=n.live[p]?.seq||F0(n,o.startedAfterSeq);return{...Z0(n,o.turn,o.step,Qe(l.time)??0,h,g),streamRevision:r,streamAttempt:{...o,nextIndex:o.nextIndex+1}}}if(a==="end"){const f=l.outcome&&typeof l.outcome=="object"?l.outcome:{},h={...n,streamRevision:r};if(f.kind==="abandoned"){const p={...h,segments:h.segments.map(y=>y.kind==="tool"&&!y.callReceived&&!y.resultReceived&&y.turn===o.turn&&y.step===o.step?{...y,id:`tool:${y.callId}`,running:!1,status:"cancelled"}:y)};return{...$d(p,o.turn,o.step),streamAttempt:null,pendingAssistant:null}}return f.kind==="committed"&&f.eventType==="assistant/message"?{...is(h),streamRevision:r}:{...Dj(h,o.turn,o.step),streamRevision:r}}return{...n,streamRevision:r}}function Uj(n,l,a=!1){const r=Qe(n.pendingAssistant?.data?.turn),u=n.pendingAssistant&&(l==null||r===l)?is(n):n,o=Object.fromEntries(Object.entries(u.live).filter(([f])=>!f.startsWith(`${l??""}:`)));return{...u,live:o,segments:u.segments.filter(f=>!(typeof l=="number"&&f.id.startsWith(`live:${l}:`))||f.kind==="tool").map(f=>f.turn!==l?f:f.kind==="think"?{...f,running:!1}:f.kind==="tool"?{...f,running:!1,status:f.resultReceived||!R0.has(Eh(f))?f.status:a&&!f.callReceived?"cancelled":"unknown"}:f.kind==="assistant"?{...f,streaming:!1}:f)}}function Hj(n,l){const a=l.projections,r=a&&typeof a=="object"?a.values??{}:{},u={...n};typeof r.title=="string"&&(u.title=r.title);const o=r.modelSelection&&typeof r.modelSelection=="object"?r.modelSelection.lastUsed:void 0;o?.model&&(u.model=o.model);const f=r.permissions;if(f&&typeof f=="object"){const p=f,g=p.currentValue??p.preset??p.sandbox;typeof g=="string"&&(u.preset=g)}const h=r.sessionStats;if(h&&typeof h=="object"){const p=h.turns,g=h.steps;typeof p=="number"&&(u.turns=p),typeof g=="number"&&(u.steps=g)}return u}function Ij(n,l){if(typeof l.type!="string")return n;let a=n;const r=l.data??{};if(l.type==="session/title"&&typeof r.title=="string"){const u=r.source&&typeof r.source=="object"?r.source.kind:"";return a.title&&u!=="provider"||(a={...a,title:r.title}),a}if(l.type==="request/context"){const u=typeof r.model=="string"?r.model:"";return u&&(a={...a,model:u}),a}if(l.type==="turn/start"){const u=Qe(r.turn);return a={...a,drafting:!0,turn:u??a.turn,turnStartedAt:typeof l.time=="number"?l.time:Date.now()},a}if(l.type==="turn/end"){const u=Qe(r.turn)??a.turn,o={...a.completed};u!=null&&a.turn===u&&a.turnStartedAt!=null&&typeof l.time=="number"&&(o[u]=Math.max(1,Math.round((l.time-a.turnStartedAt)/1e3)));const f=u==null?null:Sj(r.reason),h=f==null||u==null?a.failures:{...a.failures,[u]:f},p=r.reason&&typeof r.reason=="object"&&typeof r.reason.kind=="string"?r.reason.kind:"",g=u==null?a.turnEnds??{}:{...a.turnEnds??{},[u]:p||a.turnEnds?.[u]||"ended"};return a=Uj(a,u,p==="aborted"),a={...a,drafting:a.turn===u?!1:a.drafting,completed:o,failures:h,turnEnds:g,turnStartedAt:a.turn===u?null:a.turnStartedAt},a}if(l.type==="llm/retry"){const u=Qe(r.turn),o=typeof r.retryId=="string"?r.retryId:"",f=Qe(r.retry);if(u==null||o===""||f==null)return a;const h=r.failure&&typeof r.failure=="object"?r.failure:{},p={retryId:o,retry:f,maxRetries:Qe(r.maxRetries)??null,delayMs:typeof r.delayMs=="number"?r.delayMs:0,message:typeof h.message=="string"?h.message:"Request failed.",...typeof h.code=="string"?{code:h.code}:{},state:"scheduled"},g=a.retries[u]??[];return a={...a,retries:{...a.retries,[u]:[...g.filter(y=>y.retryId!==o||y.retry!==f),p]}},a}if(l.type==="llm/retry-started"){const u=Qe(r.turn),o=typeof r.retryId=="string"?r.retryId:"",f=Qe(r.retry);if(u==null||o===""||f==null)return a;const h=a.retries[u];return h&&(a={...a,retries:{...a.retries,[u]:h.map(p=>p.retryId===o&&p.retry===f?{...p,state:"started"}:p)}}),a}if(l.type==="assistant/live-chunk")return a=Q0(a,l),a;if(l.type==="user/message"){const u=Ah(r);if(!u||u.source?.kind!=="user")return a;const o=I0(u.content);return o&&(a={...a,segments:wj(a.segments,{kind:"user",id:`user:${l.seq??o}`,text:o,time:l.time,seq:l.seq??Number.MAX_SAFE_INTEGER,turn:Qe(r.turn)})}),a}return l.type==="assistant/message"?(Mj(a,l)?a={...a,pendingAssistant:l}:a=X0(a,l),a):l.type==="tool/call"?(a=_j(a,l),a):(l.type==="tool/result"&&(a=zj(a,l)),a)}function Vj(n,l){const a=qj(l)??(l&&typeof l=="object"?l:null);if(!a)return n;let r=n;if(a.type==="snapshot"){r=Hj(r,a);const u=a.assistantStream;u&&typeof u=="object"&&(r=Lj(r,u))}if(a.type==="assistant-stream"){const u=a.frame;u&&typeof u=="object"&&(r=Bj(r,u))}return r}function Yj(n){for(let l=n.length-1;l>=0;l-=1){const a=n[l];if(!a||a.kind==="user"&&hb(a.text))continue;const r=a.kind==="user"?wo(a.text):null,u=a.kind==="user"?eh(a.text):null,f=(r?r.body:u?.body?u.body:a.kind==="user"||a.kind==="assistant"?a.text:a.kind==="tool"?a.result||kj(a.name,a.args):Nj(a.text)).replace(/```[\s\S]*?```/g," ").replace(/^#{1,6}\s+/gm,"").replace(/[|*_`>]/g," ").replace(/\s+/g," ").trim();if(f)return f.slice(0,80)}return""}function bo(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function zv(n,l){if(!bo(n))return;if(l==="ticket.id"){const r=n.ticket;if(!bo(r))return;const u=r.id;return typeof u=="string"&&u!==""?u:void 0}const a=n[l];if(typeof a=="string"&&a!=="")return a;if(typeof a=="number"&&Number.isFinite(a))return String(a)}function ps(n,l){if(!bo(l)||l.t!=="v"&&l.t!=="o"&&l.t!=="l")return n;const a=l;return a.t==="v"?a.v:a.t==="o"?Gj(n,a):Qj(n,a)}function Gj(n,l){const a=bo(n)?{...n}:{};for(const r of l.d??[])delete a[r];for(const[r,u]of Object.entries(l.s))a[r]=ps(a[r],u);return a}function Qj(n,l){const a=l.id,r=Array.isArray(n)?n.slice():[],u=new Set(l.d??[]),o=[],f=new Map;for(const p of r){const g=zv(p,a);g!==void 0&&u.has(g)||(g!==void 0&&f.set(g,o.length),o.push(p))}for(const[p,g]of Object.entries(l.s??{})){const y=f.get(p);if(y===void 0){o.push(ps(void 0,g));continue}o[y]=ps(o[y],g)}if(!l.order)return o;const h=new Map;for(const p of o){const g=zv(p,a);g!==void 0&&h.set(g,p)}return l.order.filter(p=>h.has(p)).map(p=>h.get(p))}const Xj=1,Fj=500,Zj={minMessages:50,minTurns:2},Kj=500,Jj=2e3,$j=256*1024,Pj=6,Wj=3,eO=5e3,tO=8*1024*1024,nO=2e3,iO=500,lO=1e4,jd=3,J0=64*1024*1024,$0="/api/dsh-bot/log/range",aO="/api/dsh-bot/log/manifest",rO="/api/dsh-bot/log/chunk",sO="/api/session/events",uO=3e3,oO=3e4,cO=1e3,fO=15e3;class dO{appliedSeq;headSeq=null;pending=new Map;pendingBytes=0;constructor(l=-1){this.appliedSeq=l}setHead(l){(this.headSeq==null||l>this.headSeq)&&(this.headSeq=l)}push(l){const a=[];for(const o of l)if(!(typeof o.seq!="number"||!Number.isFinite(o.seq))&&!(o.seq<=this.appliedSeq)){if(o.seq===this.appliedSeq+1){a.push(o),this.appliedSeq=o.seq,this.flushPending(a);continue}this.pending.has(o.seq)||(this.pending.set(o.seq,o),this.pendingBytes+=qv(o))}let r=null;(this.pending.size>eO||this.pendingBytes>tO)&&(r={afterSeq:this.appliedSeq,dropped:this.pending.size},this.pending.clear(),this.pendingBytes=0);const u=this.nextGap();return{delivered:a,gapTo:u,overflow:r}}flushPending(l){for(;this.pending.has(this.appliedSeq+1);){const a=this.pending.get(this.appliedSeq+1);if(this.pending.delete(this.appliedSeq+1),!a)break;this.pendingBytes=Math.max(0,this.pendingBytes-qv(a)),l.push(a),this.appliedSeq=a.seq}}nextGap(){if(this.pending.size===0)return null;let l=Number.POSITIVE_INFINITY;for(const a of this.pending.keys())a<l&&(l=a);return Number.isFinite(l)?l:null}}function qv(n){return 64+(typeof n.type=="string"?n.type.length:0)}function Pa(n,l){return{kind:"session",sessionId:n}}function Rv(n){const l=n.addressOf??(r=>Pa(r)),a=n.openingMessages??Xj;return{kind:"ws-follow",open(r,u,o){return new Promise(f=>{const h=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",p=typeof location<"u"?location.host:"127.0.0.1",g=n.url??`${h}//${p}/api/remote.mux`,y=(n.websocket??(A=>new WebSocket(A)))(g),m=`follow-${Math.random().toString(36).slice(2)}`;let S=!1;const x=()=>!S&&y.readyState===1,k=A=>{if(!S){S=!0,o.removeEventListener("abort",T);try{y.close()}catch{}f(A)}},T=()=>k({ok:!1,retryable:!1,code:"ABORTED"});o.addEventListener("abort",T),y.addEventListener("open",()=>{o.aborted||y.send(JSON.stringify({type:"open",streamId:m,endpoint:"session/follow",payload:{args:{request:{address:l(r.sessionId),maxMessages:a,assistantStream:!0,activate:!0}}}}))}),y.addEventListener("message",A=>{let E;try{E=JSON.parse(String(A.data))}catch{return}if(E.streamId===m){if(E.type==="error"){k({ok:!1,retryable:!0,code:"FOLLOW_ERROR",message:E.error?.message});return}if(E.type==="end"){k({ok:!0,throughSeq:-1});return}E.type==="item"&&hO(E.value,u,x)}}),y.addEventListener("close",()=>k({ok:!1,retryable:!0,code:"FOLLOW_CLOSED"})),y.addEventListener("error",()=>k({ok:!1,retryable:!0,code:"FOLLOW_ERROR"}))})}}}function hO(n,l,a){const r=P0(n);if(!r)return;if(r.type==="snapshot"){const o=typeof r.cursor=="number"?r.cursor:-1,f=ms(r.records),h=f.length>0?Math.min(...f.map(g=>g.seq)):o+1,p=r.hasMore===!0;l.opened({firstSeq:h,cursor:o,hasMore:p,...a?{alive:a}:{}}),l.head(o),f.length&&l.events(f),l.ephemeral(r);return}if(r.type==="assistant-stream"){l.ephemeral(r);return}const u=ms(r);u.length&&l.events(u)}function P0(n){if(!n||typeof n!="object")return null;const l=n;if(typeof l.type=="string"&&(l.type==="snapshot"||l.type==="assistant-stream"||l.type==="event"))return l;const a=l.value;return a&&typeof a=="object"&&!Array.isArray(a)?P0(a):l}function ms(n){const l=[];return so(n,l),l.sort((a,r)=>a.seq-r.seq)}function so(n,l){if(!n)return;if(Array.isArray(n)){for(const u of n)so(u,l);return}if(typeof n!="object")return;const a=n;if(a.event&&typeof a.event=="object"){const u=Mv(a.event);u&&l.push(u);return}const r=Mv(a);r&&l.push(r),Array.isArray(a.records)&&so(a.records,l),Array.isArray(a.events)&&so(a.events,l)}function Mv(n){if(!n||typeof n!="object")return null;const l=n;return typeof l.type!="string"||typeof l.seq!="number"?null:{type:l.type,seq:l.seq,time:typeof l.time=="number"?l.time:0,data:l.data,...l.surfaceOp!==void 0?{surfaceOp:l.surfaceOp}:{},...l.sourceEventSeqs!==void 0?{sourceEventSeqs:l.sourceEventSeqs}:{}}}function Dv(n={}){const l=n.fetch??fetch,a=n.url??$0;return{kind:"plugin-range",async fetch(r,u,o){if(r.throughSeq<=r.afterSeq)return{ok:!0,throughSeq:r.throughSeq};let f=r.afterSeq;try{for(;!o.aborted;){const h=new URLSearchParams({sessionId:r.sessionId,afterSeq:String(f),throughSeq:String(r.throughSeq),limit:String(Kj)}),p=await l(`${a}?${h}`,{method:"GET",credentials:"same-origin",signal:o,headers:{accept:"application/json"}});if(p.status===404)return{ok:!1,retryable:!1,code:"ENHANCE_UNAVAILABLE"};if(!p.ok)return{ok:!1,retryable:p.status>=500,code:"RANGE_ERROR",message:`HTTP ${p.status}`};const g=await p.json(),y=ms(g.events);if(y.length&&u.events(y,{throughSeq:r.throughSeq}),g.nextAfterSeq==null)return{ok:!0,throughSeq:r.throughSeq};if(g.nextAfterSeq<=f)return{ok:!1,retryable:!0,code:"RANGE_STALLED"};f=g.nextAfterSeq}return{ok:!1,retryable:!1,code:"ABORTED"}}catch(h){return o.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"RANGE_ERROR",message:h instanceof Error?h.message:String(h)}}}}}async function pO(n=fetch,l=$0,a){try{return(await n(l,{method:"HEAD",credentials:"same-origin",signal:a})).ok}catch{return!1}}const mO=n=>{if(typeof document>"u"||typeof window>"u")return()=>{};let l=document.visibilityState==="hidden"?Date.now():null;const a=()=>l==null?0:Math.max(0,Date.now()-l),r=()=>{if(document.visibilityState==="hidden"){l==null&&(l=Date.now());return}const p=a();l=null,n({reason:"visible",hiddenMs:p})},u=()=>{l==null&&(l=Date.now())},o=p=>{const g=a();l=null,n({reason:"pageshow",hiddenMs:g,persisted:p.persisted})},f=()=>n({reason:"online",hiddenMs:a()}),h=()=>{if(document.visibilityState==="hidden")return;const p=a();l=null,n({reason:"focus",hiddenMs:p})};return document.addEventListener("visibilitychange",r),window.addEventListener("pagehide",u),window.addEventListener("pageshow",o),window.addEventListener("online",f),window.addEventListener("focus",h),()=>{document.removeEventListener("visibilitychange",r),window.removeEventListener("pagehide",u),window.removeEventListener("pageshow",o),window.removeEventListener("online",f),window.removeEventListener("focus",h)}};function gO(){return typeof document<"u"&&document.visibilityState==="hidden"}function Lv(n){return{open(l,a){return yO(n,l,a??{})}}}function yO(n,l,a){const r=new AbortController,u=new Set,o=new Set,f=new Set;let h={phase:"restoring",appliedSeq:-1,headSeq:null,lag:null,fraction:null},p;const g=new Promise(W=>{p=W});let y=!1;const m=W=>{y||(y=!0,p(W))};let S=[],x=!1,k=null;const T=n.raf??(typeof requestAnimationFrame=="function"?requestAnimationFrame:W=>setTimeout(W,0)),A=n.cancelRaf??(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout),E=()=>{k!=null&&(k.kind==="timer"?clearTimeout(k.id):A(k.id),k=null)},M=n.wait??bO,H=n.random??Math.random,$=n.now??Date.now,te=n.isHidden??gO,O=()=>{if(k=null,S.length===0)return;const W=S;S=[];const de={events:W,fromCache:x};x=!1;for(const it of u)it(de)},Q=()=>{E(),O()},ne=(W,de=!1)=>{if(W.length===0||(de&&(x=!0),S.push(...W),k!=null))return;const it={kind:te()?"timer":"raf",id:null};k=it,it.id=it.kind==="timer"?setTimeout(O,0):T(O)},he=W=>{h={...h,...W,lag:(W.headSeq??h.headSeq)==null||(W.appliedSeq??h.appliedSeq)==null?W.lag??h.lag:(W.headSeq??h.headSeq)-(W.appliedSeq??h.appliedSeq)};for(const de of f)de(h)};let _=0,Z=!1,P=0,Se=!0,Re=null,ae=!1,G=null,se=null,ue=!1,ke=$(),j=Number.NEGATIVE_INFINITY;const Pe=async W=>{if(r.signal.aborted)return;if(ae){ae=!1;return}const de=new AbortController;Re=de;const it=()=>de.abort();r.signal.addEventListener("abort",it,{once:!0});try{await M(W,de.signal)}catch{}finally{r.signal.removeEventListener("abort",it),Re===de&&(Re=null)}},ht=()=>{const W=ue;return ue=!1,W},z=W=>{if(!Se||r.signal.aborted)return;Q();const de=$(),it=se?se():!0,nn=de-ke>=oO,we=!it||W.reason==="online"||W.persisted===!0||W.hiddenMs>=uO||W.reason!=="focus"&&nn;if(P=0,_=0,Z=!1,Re){Re.abort();return}if(!G){ae=!0;return}we&&(de-j<cO||(j=de,G.signal.aborted||(ue=!0,G.abort())))};q();async function q(){try{await ee()}finally{Se=!1,Ee()}}async function ee(){const W=await n.checkpoint.getCursor(l);let de=W?.appliedSeq??-1;const it=await n.checkpoint.readEvents(l,-1),nn=vO(it,-1).filter(qe=>qe.seq<=de||de<0);de<0&&nn.length&&(de=nn[nn.length-1].seq);const we=new dO(de);W?.headSeq!=null&&we.setHead(W.headSeq),nn.length&&ne(nn,!0),he({phase:"connecting",appliedSeq:we.appliedSeq,headSeq:we.headSeq});let _t=a.enhancement==="off"?!1:await fe();const pt=()=>({events(qe){const lt=we.push(qe);we.headSeq!=null&&we.appliedSeq>we.headSeq&&we.setHead(we.appliedSeq),lt.delivered.length&&(ne(lt.delivered),n.checkpoint.putEvents(l,lt.delivered),n.checkpoint.setCursor(l,we.appliedSeq,we.headSeq)),he({appliedSeq:we.appliedSeq,headSeq:we.headSeq,fraction:h.fraction}),lt.overflow},head(qe){we.setHead(qe),he({headSeq:we.headSeq,appliedSeq:we.appliedSeq})},progress(qe){const lt=qe.total&&qe.total>0?Math.min(1,qe.loaded/qe.total):null;he({fraction:lt,appliedSeq:we.appliedSeq,headSeq:we.headSeq})},ephemeral(qe){for(const lt of o)lt(qe)},opened(){}}),Ke=async(qe,lt,wt)=>{if(lt<=qe)return{ok:!0,throughSeq:lt};he({phase:"syncing",fraction:h.fraction});const un=lt-qe,Ht=pt(),It=_t&&n.cdc!=null&&(un>Jj||un*128>$j);if(_t&&n.range!=null&&!It&&n.range){const Vt=await n.range.fetch({sessionId:l,afterSeq:qe,throughSeq:lt},Ht,wt);if(Vt.ok||wt.aborted)return Vt;_t=!1}else if(It&&n.cdc){const Vt=await n.cdc.fetch({sessionId:l,afterSeq:qe,throughSeq:lt},Ht,wt);if(Vt.ok||wt.aborted)return Vt;_t=!1}return n.page.fetch({sessionId:l,afterSeq:we.appliedSeq,throughSeq:lt},Ht,wt)};for(;!r.signal.aborted;){if(Z){he({phase:"stalled",appliedSeq:we.appliedSeq,headSeq:we.headSeq,fraction:null});const _e=new AbortController,bt=()=>_e.abort();r.signal.addEventListener("abort",bt);const mt=we.headSeq??we.appliedSeq,Yt=await n.page.fetch({sessionId:l,afterSeq:we.appliedSeq,throughSeq:Math.max(mt,we.appliedSeq)},pt(),_e.signal);r.signal.removeEventListener("abort",bt),Yt.ok&&we.headSeq!=null&&we.appliedSeq>=we.headSeq&&(he({phase:"live",appliedSeq:we.appliedSeq,headSeq:we.headSeq,fraction:null,error:void 0}),m({ok:!0,caughtUpTo:we.appliedSeq})),P+=1;const vn=ao(P,H);await Pe(Math.min(vn,nO)),Z=_>=jd}if(r.signal.aborted)break;he({phase:h.phase==="restoring"?"connecting":h.phase==="live"?"syncing":"connecting"});const qe=new AbortController;G=qe,se=null;const lt=()=>qe.abort();r.signal.addEventListener("abort",lt);const wt=()=>{r.signal.removeEventListener("abort",lt),qe.abort(),G===qe&&(G=null,se=null)};let un=null;const Ht=pt(),It=()=>{G===qe&&(ke=$())},on={events(_e,bt){It(),Ht.events(_e,bt)},head(_e){It(),Ht.head(_e)},progress:Ht.progress,ephemeral(_e){It(),Ht.ephemeral(_e)},opened(_e){It(),un=_e,G===qe&&(se=_e.alive??null),we.setHead(_e.cursor),he({headSeq:_e.cursor,appliedSeq:we.appliedSeq,phase:"syncing"})}},Vt=n.follow.open({sessionId:l},on,qe.signal),X=await Promise.race([Vt.then(_e=>({kind:"done",outcome:_e})),xO(()=>un!=null,qe.signal,M).then(()=>({kind:"opened"}))]),ie=un;if(X.kind==="done"||ie==null||qe.signal.aborted){if(wt(),r.signal.aborted)break;if(ht())continue;_+=1,_>=jd&&(Z=!0),P+=1,await Pe(ao(P,H));continue}_=0,P=0;const ve=ie.firstSeq-1,be=await Ke(we.appliedSeq,ve,qe.signal);if(qe.signal.aborted){if(wt(),r.signal.aborted)break;ht();continue}if(!be.ok&&!be.retryable){he({phase:"error",error:{code:be.code,message:be.message??be.code,retrying:!1},appliedSeq:we.appliedSeq,headSeq:we.headSeq}),m({ok:!1,code:be.code,message:be.message??be.code}),wt();break}if(!be.ok){wt(),he({phase:"stalled",error:{code:be.code,message:be.message??be.code,retrying:!0},appliedSeq:we.appliedSeq,headSeq:we.headSeq}),P+=1,await Pe(ao(P,H));continue}he({phase:"live",appliedSeq:we.appliedSeq,headSeq:we.headSeq,fraction:null,error:void 0}),we.appliedSeq>=ve&&m({ok:!0,caughtUpTo:we.appliedSeq});const kt=await Vt;if(wt(),r.signal.aborted)break;ht()||kt.ok||(_+=1,_>=jd&&(Z=!0),he({phase:"stalled",error:{code:kt.code,message:kt.message??kt.code,retrying:!0}}),P+=1,await Pe(ao(P,H)))}h.phase!=="error"&&he({phase:"closed"}),E()}async function fe(){return a.enhancement==="off"||!n.cdc&&!n.range?!1:n.probe?n.probe():pO()}const ge=(n.onResume??mO)(z),Te=n.livenessMs===void 0?fO:n.livenessMs;let Ne=null;Te!==!1&&Te>0&&(Ne=setInterval(()=>{te()||!G||!se||se()||z({reason:"liveness",hiddenMs:0})},Te),Ne.unref?.());function Ee(){Ne!=null&&clearInterval(Ne),Ne=null}return{onBatch(W){return u.add(W),()=>u.delete(W)},onEphemeral(W){return o.add(W),()=>o.delete(W)},onStatus(W){return f.add(W),W(h),()=>f.delete(W)},get status(){return h},ready:g,close(){ge(),Ee(),r.abort(),E(),he({phase:"closed"})}}}function vO(n,l){const a=[...n].sort((o,f)=>o.seq-f.seq),r=[];let u=l+1;for(const o of a)if(!(o.seq<u)){if(o.seq!==u)break;r.push(o),u=o.seq+1}return r}function ao(n,l){return Math.min(lO,iO*2**Math.max(0,n-1))*(.5+l()*.5)}function bO(n,l){return new Promise((a,r)=>{const u=setTimeout(()=>{l.removeEventListener("abort",o),a()},n),o=()=>{clearTimeout(u),r(new DOMException("Aborted","AbortError"))};l.aborted?o():l.addEventListener("abort",o,{once:!0})})}async function xO(n,l,a){for(;!n()&&!l.aborted;)await a(5,l).catch(()=>{})}function Bv(n={}){const l=n.addressOf??(o=>Pa(o)),a=n.fetch??fetch,r=n.url??sO,u=n.maxMessages??Fj;return{kind:"official-page",async fetch(o,f,h){if(o.throughSeq<=o.afterSeq)return{ok:!0,throughSeq:o.throughSeq};let p=o.throughSeq+1,g=0;const y=o.throughSeq-o.afterSeq;f.progress({loaded:0,total:y,unit:"events"});try{for(;!h.aborted;){const m=await SO(a,r,{address:l(o.sessionId),throughSeq:o.throughSeq,beforeSeq:p,maxMessages:u,turnWindow:Zj},h);if(!m.ok)return m;const S=ms(m.records);S.length&&f.events(S,{throughSeq:o.throughSeq}),g+=S.length,f.progress({loaded:g,total:y,unit:"events"});const x=S.reduce((k,T)=>Math.min(k,T.seq),Number.POSITIVE_INFINITY);if(!m.hasMore||!Number.isFinite(x)||x<=o.afterSeq+1)break;if(x>=p)return{ok:!1,retryable:!0,code:"PAGE_STALLED",message:"Official page did not move."};p=x}return h.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!0,throughSeq:o.throughSeq}}catch(m){return h.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"PAGE_ERROR",message:m instanceof Error?m.message:String(m)}}}}}async function SO(n,l,a,r){const u=await n(l,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",signal:r,body:JSON.stringify({type:"client-request",rpcId:crypto.randomUUID(),method:"session/events",payload:{args:{request:a}}})});let o=null;try{o=await u.json()}catch{o=null}if(!u.ok||o?.result?.ok===!1)return{ok:!1,retryable:u.status>=500||u.status===0,code:"PAGE_ERROR",message:o?.result?.error?.message??`session/events HTTP ${u.status}`};const f=o?.result?.value??o?.result??o;return{ok:!0,records:f?.records??f?.events??f,hasMore:f?.hasMore===!0,cursor:f?.cursor}}async function Uv(n){const l=await crypto.subtle.digest("SHA-256",n);return[...new Uint8Array(l)].map(a=>a.toString(16).padStart(2,"0")).join("")}function Hv(n){const l=n.fetch??fetch,a=n.concurrency??Pj,r=n.retries??Wj,u=n.manifestUrl??aO,o=n.chunkUrl??rO,f=n.wait??TO;return{kind:"cdc-snapshot",async fetch(h,p,g){if(h.throughSeq<=h.afterSeq)return{ok:!0,throughSeq:h.throughSeq};const y=new AbortController,m=()=>y.abort();g.addEventListener("abort",m);try{const S=await wO(l,u,h,y.signal);return S.ok?await kO({manifest:S.value,afterSeq:h.afterSeq,throughSeq:h.throughSeq,sink:p,cache:n.cache,fetchImpl:l,chunkUrl:o,concurrency:a,retries:r,wait:f,signal:y.signal}):S}catch(S){return g.aborted||y.signal.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"CDC_ERROR",message:S instanceof Error?S.message:String(S)}}finally{g.removeEventListener("abort",m),y.signal.aborted||y.abort()}}}}async function wO(n,l,a,r){const u=new URLSearchParams({sessionId:a.sessionId,throughSeq:String(a.throughSeq),afterSeq:String(a.afterSeq)}),o=await n(`${l}?${u}`,{method:"GET",credentials:"same-origin",signal:r,headers:{accept:"application/json"}});if(o.status===404)return{ok:!1,retryable:!1,code:"ENHANCE_UNAVAILABLE"};if(!o.ok)return{ok:!1,retryable:o.status>=500,code:"CDC_MANIFEST",message:`HTTP ${o.status}`};const f=await o.json();return Array.isArray(f.chunks)?{ok:!0,value:f}:{ok:!1,retryable:!0,code:"CDC_MANIFEST"}}async function kO(n){const l=[...n.manifest.chunks].sort((A,E)=>A.fromSeq-E.fromSeq),a=new Map;let r=0;const u=n.manifest.totalSize;n.sink.progress({loaded:r,total:u,unit:"bytes"}),n.sink.head(n.manifest.throughSeq);let o=0;const f=()=>{for(;o<l.length;){const A=l[o];if(!A||!a.has(A.fromSeq))break;const E=(a.get(A.fromSeq)??[]).filter(M=>M.seq>n.afterSeq&&M.seq<=n.throughSeq);E.length&&n.sink.events(E,{throughSeq:n.throughSeq}),o+=1}},h=[];for(const A of l){const E=await n.cache.getChunk(A.hash);E&&await Uv(E)===A.hash?(a.set(A.fromSeq,Iv(E)),r+=A.bytes,n.sink.progress({loaded:r,total:u,unit:"bytes"}),f()):h.push(A)}if(h.length===0)return f(),{ok:!0,throughSeq:n.throughSeq};let p=0,g=0,y=null,m=null;const S=()=>{const A=m;m=null,A?.()},x=()=>new Promise(A=>{if(g===0){A();return}m=A}),k=async A=>{for(let E=0;E<n.retries;E+=1){if(n.signal.aborted||y)return;try{const M=await EO(n.fetchImpl,n.chunkUrl,n.manifest.sessionId,A,n.signal);if(await Uv(M)!==A.hash)throw new Error("hash mismatch");await n.cache.putChunk(A.hash,M),a.set(A.fromSeq,Iv(M)),r+=A.bytes,n.sink.progress({loaded:r,total:u,unit:"bytes"}),f();return}catch(M){if(n.signal.aborted||y)return;if(E+1>=n.retries){y={ok:!1,retryable:!0,code:"CDC_CHUNK_FAILED",message:M instanceof Error?M.message:String(M)};return}await n.wait(50*2**E,n.signal).catch(()=>{})}}},T=()=>{for(;!y&&!n.signal.aborted&&g<n.concurrency&&p<h.length;){const A=h[p];if(p+=1,!A)break;g+=1,k(A).finally(()=>{g-=1,S()})}};for(T();g>0&&!n.signal.aborted;)T(),g>0&&await x();return n.signal.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:y||(f(),{ok:!0,throughSeq:n.throughSeq})}async function EO(n,l,a,r,u){const o=new URLSearchParams({sessionId:a,fromSeq:String(r.fromSeq),toSeq:String(r.toSeq),hash:r.hash}),f=await n(`${l}?${o}`,{method:"GET",credentials:"same-origin",signal:u});if(f.status===404)throw Object.assign(new Error("not found"),{code:"ENHANCE_UNAVAILABLE",status:404});if(!f.ok)throw new Error(`HTTP ${f.status}`);return new Uint8Array(await f.arrayBuffer())}function Iv(n){const l=new TextDecoder().decode(n),a=[];for(const r of l.split(`
59
- `))if(r.trim()!=="")try{a.push(...ms(JSON.parse(r)))}catch{}return a.sort((r,u)=>r.seq-u.seq)}function TO(n,l){return new Promise((a,r)=>{const u=setTimeout(()=>{l.removeEventListener("abort",o),a()},n),o=()=>{clearTimeout(u),r(new DOMException("Aborted","AbortError"))};l.aborted?o():l.addEventListener("abort",o,{once:!0})})}const AO="dsh-bot",CO=2,NO=["log_chunks","log_events","log_cursors"];function jO(n){const l=globalThis.indexedDB;return l?new Promise(a=>{let r=!1;const u=o=>{r||(r=!0,a(o))};try{const o=l.open(AO,CO);o.onupgradeneeded=f=>{const h=o.result;if(f.oldVersion<2){for(const g of["chunks","events"])h.objectStoreNames.contains(g)&&h.deleteObjectStore(g);h.objectStoreNames.contains("log_chunks")||h.createObjectStore("log_chunks").createIndex("byLastUsed","lastUsed"),h.objectStoreNames.contains("log_events")||h.createObjectStore("log_events",{keyPath:["sessionId","seq"]}).createIndex("bySession","sessionId"),h.objectStoreNames.contains("log_cursors")||h.createObjectStore("log_cursors",{keyPath:"sessionId"})}},o.onblocked=()=>u({ok:!1,reason:"blocked"}),o.onsuccess=()=>{const f=o.result;if(f.onversionchange=()=>f.close(),!NO.every(h=>f.objectStoreNames.contains(h))){f.close(),u({ok:!1,reason:"unavailable"});return}u({ok:!0,db:f})},o.onerror=()=>u({ok:!1,reason:"unavailable"})}catch{u({ok:!1,reason:"unavailable"})}}):Promise.resolve({ok:!1,reason:"unavailable"})}function OO(){const n=new Map,l=new Map,a=new Map;let r=0;const u=()=>{const o=[...a.entries()].sort((f,h)=>f[1].lastUsed-h[1].lastUsed);for(;r>J0&&o.length>0;){const f=o.shift();if(!f)break;a.delete(f[0]),r-=f[1].bytes.byteLength}};return{mode:"memory",async getCursor(o){return n.get(o)??null},async setCursor(o,f,h){const p=n.get(o),g=p?Math.max(p.appliedSeq,f):f,y=h==null?p?.headSeq??null:Math.max(p?.headSeq??h,h);n.set(o,{appliedSeq:g,headSeq:y})},async putEvents(o,f){const h=l.get(o)??new Map;for(const p of f)h.set(p.seq,p);l.set(o,h)},async readEvents(o,f=-1){const h=l.get(o);return h?[...h.values()].filter(p=>p.seq>f).sort((p,g)=>p.seq-g.seq):[]},async getChunk(o){const f=a.get(o);return f?(f.lastUsed=Date.now(),f.bytes):null},async putChunk(o,f){const h=a.get(o);h&&(r-=h.bytes.byteLength),a.set(o,{bytes:f,lastUsed:Date.now()}),r+=f.byteLength,u()}}}async function Vv(n){const l=await zO(n);if(l.ok!==!0)return OO();const a=l.db;return{mode:"idb",async getCursor(r){return ta(a,"log_cursors","readonly",u=>li(u.get(r))).then(u=>u?{appliedSeq:u.appliedSeq,headSeq:u.headSeq??null}:null)},async setCursor(r,u,o){await ta(a,"log_cursors","readwrite",async f=>{const h=await li(f.get(r)),p=h?Math.max(h.appliedSeq,u):u,g=o==null?h?.headSeq??null:Math.max(h?.headSeq??o,o);await li(f.put({sessionId:r,appliedSeq:p,headSeq:g,updatedAt:Date.now()}))})},async putEvents(r,u){await ta(a,"log_events","readwrite",async o=>{for(const f of u)await li(o.put({sessionId:r,seq:f.seq,event:f}))})},async readEvents(r,u=-1){return(await ta(a,"log_events","readonly",f=>{const h=f.index("bySession");return li(h.getAll(r))})).map(f=>f.event).filter(f=>f&&f.seq>u).sort((f,h)=>f.seq-h.seq)},async getChunk(r){const u=await ta(a,"log_chunks","readonly",o=>li(o.get(r)));return u?.bytes?(ta(a,"log_chunks","readwrite",o=>li(o.put({...u,lastUsed:Date.now()},r))),u.bytes):null},async putChunk(r,u){await ta(a,"log_chunks","readwrite",async o=>{await li(o.put({bytes:u,lastUsed:Date.now()},r)),await _O(o)})}}}async function _O(n){const l=n.index("byLastUsed"),a=await li(l.getAll()),r=await li(l.getAllKeys());let u=a.reduce((o,f)=>o+(f.bytes?.byteLength??0),0);for(let o=0;o<a.length&&u>J0;o+=1){const f=r[o],h=a[o];f==null||!h||(u-=h.bytes.byteLength,await li(n.delete(f)))}}function zO(n){try{return jO(n)}catch{return Promise.resolve({ok:!1,reason:"unavailable"})}}function ta(n,l,a,r){return new Promise((u,o)=>{const f=n.transaction(l,a),h=f.objectStore(l);Promise.resolve(r(h)).then(u,o),f.onerror=()=>o(f.error)})}function li(n){return new Promise((l,a)=>{n.onsuccess=()=>l(n.result),n.onerror=()=>a(n.error)})}function qO(n,l){const a=Math.max(0,Math.min(l,n.length)),r=/(?:^|\s)@([^\s@()]*)$/.exec(n.slice(0,a));if(!r||r.index==null)return null;const u=r[1]??"";return{start:r.index+r[0].length-u.length-1,query:u}}function RO(n){return n.replace(/[@()\r\n]/g," ").replace(/\s+/g," ").trim()||"Untitled"}function MO(n,l){return`@${RO(n)} (${l})`}function DO(n,l,a,r,u){const o=Math.max(0,Math.min(l,n.length)),f=`${MO(r,u)} `;return{text:n.slice(0,a)+f+n.slice(o),cursor:a+f.length}}function LO(n,l){const a=l.trim().toLowerCase();return n.filter(r=>a===""?!0:r.label.toLowerCase().includes(a)||r.sessionId.toLowerCase().includes(a)).slice(0,8)}const Od=()=>({segments:[],live:{},activity:"",completed:{},failures:{},retries:{},title:"",model:"",preset:"",turns:null,steps:null,drafting:!1,turn:null,turnStartedAt:null,streamAttempt:null,streamRevision:0,pendingAssistant:null,turnEnds:{}});function xo(n,l,a){return vw(n,l,a)}function BO({active:n,progress:l}){const{t:a}=Ye(),[r,u]=L.useState(n),[o,f]=L.useState(!1);if(L.useEffect(()=>{if(n){u(!0);return}f(!1)},[n]),L.useEffect(()=>{if(!r||!n)return;const g=window.requestAnimationFrame(()=>f(!0));return()=>window.cancelAnimationFrame(g)},[r,n]),L.useEffect(()=>{if(n||!r)return;const g=window.setTimeout(()=>u(!1),280);return()=>window.clearTimeout(g)},[n,r]),!r)return null;const h=l!=null&&l.total>0,p=h?Math.min(100,Math.round(l.loaded/l.total*100)):0;return b.jsx("div",{className:o?"chunk-loading visible":"chunk-loading",role:"status",children:b.jsxs("div",{className:"chunk-loading-card",children:[b.jsx("p",{children:b.jsx("span",{className:"shimmer",children:h?a("load.messagesPct",{pct:String(p)}):a("load.messages")})}),b.jsx("div",{className:"chunk-progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":h?l.total:1,"aria-valuenow":h?l.loaded:0,"aria-label":a("load.aria"),children:b.jsx("div",{className:h?"chunk-progress-fill":"chunk-progress-fill indeterminate",style:h?{width:`${p}%`}:void 0})})]})})}function Yv({signal:n}){const{t:l}=Ye();if(!n)return null;const a=n==="wait";return b.jsx("span",{className:a?"bot-dot wait":"bot-dot",role:"img","aria-label":l(a?"bot.waiting":"bot.running")})}function UO(n){const l=[];return n.turns!=null&&l.push(`${n.turns} turns`),n.steps!=null&&l.push(`${n.steps} steps`),l.join(" · ")}function HO({health:n,usage:l,execution:a,model:r}){const{t:u}=Ye(),o=n?.primary?.reachable===!0,f=l&&"code"in l&&typeof l.code=="string"?l.code:"";return b.jsxs("div",{className:"status",children:[b.jsx("p",{children:u(o?"health.up":"health.down")}),r?b.jsx("p",{className:"muted",children:r}):null,b.jsx("p",{className:a.ready?"":"muted",children:a.ready?u("health.modelReady"):xo(a.reason,a.reason,u)}),b.jsx("p",{className:l?.connected?"":"muted",children:l?.connected?u("health.usageReady"):xo(f,l?.error||u("health.usageOff"),u)}),b.jsx("p",{className:"muted",children:u("health.sameSession")})]})}function IO(){return b.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[b.jsx("circle",{cx:"11",cy:"11",r:"6.25",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),b.jsx("path",{d:"M16 16.5L20 20.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})}function Gv(){return b.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:b.jsx("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function VO({preset:n}){return n==="read-only"||n==="readonly"||n==="danger-full-access"||n==="auto"?b.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[b.jsx("path",{d:"M6.6 2.15C7.5 1.81 8.5 1.81 9.4 2.15L13.92 3.84V7.12C13.92 11.61 10.56 13.6 8 14.58C5.44 13.6 2.08 11.61 2.08 7.12V3.84L6.6 2.15Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round"}),n==="danger-full-access"?b.jsx("path",{d:"M8 4.4V9.9M8 10.8V11.8",fill:"none",stroke:"currentColor"}):null,n==="read-only"||n==="readonly"?b.jsx("path",{d:"M5.09 8.14L7.18 10.24C7.27 10.32 7.4 10.31 7.48 10.23L11.51 5.61",fill:"none",stroke:"currentColor"}):null]}):b.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[b.jsx("path",{d:"M6.42 1.68C7.44 1.3 8.56 1.3 9.58 1.68L14.1 3.38C14.29 3.45 14.42 3.63 14.42 3.84V6.49L9.23 2.62C8.44 2.32 7.56 2.32 6.77 2.62L2.58 4.19V7.12C2.58 11.18 5.52 13.06 8 14.04C8.28 13.93 8.56 13.81 8.84 13.67C9.07 13.95 9.33 14.19 9.62 14.41C9.12 14.66 8.64 14.87 8.18 15.04C8.06 15.09 7.94 15.09 7.82 15.04C5.22 14.05 1.58 11.94 1.58 7.12V3.84C1.58 3.63 1.7 3.45 1.9 3.38L6.42 1.68Z",fill:"currentColor"}),b.jsx("path",{d:"M5.26 6.6H10.74M5.26 9.87H8.33",fill:"none",stroke:"currentColor"}),b.jsx("path",{d:"M10.03 13.22C12.15 11.95 14.58 8.9 14.78 8.64C14.41 8.37 13.68 7.83 13.5 8.1C12.4 9.72 11.31 11.34 10.21 12.95C10.15 13.04 10.09 13.13 10.03 13.22Z",fill:"currentColor"})]})}function YO(){return b.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:b.jsx("path",{d:"M12 17V7M7 11.5L12 6.5l5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function Mo({open:n,children:l,className:a}){const[r,u]=L.useState(n),[o,f]=L.useState(n);L.useLayoutEffect(()=>{if(n){u(!0);const g=requestAnimationFrame(()=>f(!0));return()=>cancelAnimationFrame(g)}f(!1),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&u(!1)},[n]);function h(g){g.target!==g.currentTarget||g.propertyName!=="grid-template-rows"||n||u(!1)}const p=["coll-container",o?"expand":"",a].filter(Boolean).join(" ");return b.jsx("div",{className:p,onTransitionEnd:h,children:b.jsx("div",{children:r?l:null})})}function W0({ticket:n,now:l,onSupply:a,onOpen:r}){const{t:u}=Ye(),[o,f]=L.useState(""),[h,p]=L.useState(""),[g,y]=L.useState(!1),m=qw(n),S=n.status==="started"||n.status==="needs_user";return b.jsxs("article",{className:"work-card",children:[b.jsxs("header",{children:[b.jsx("h3",{children:n.summary}),n.status==="ready"?null:b.jsx("span",{className:S?"work-status live":"work-status",children:db(n.status,u)})]}),zw(n,l,u).map(x=>b.jsx("p",{children:x},x)),n.childSessionId?b.jsx("button",{type:"button",className:"work-open",onClick:()=>r(n.childSessionId??""),children:u("work.openWorker")}):null,m?b.jsx("p",{className:m.stale?"stale":"work-question",children:m.text||u("work.questionEmpty")}):null,m?.stale?b.jsx("p",{className:"work-quiet",children:u("work.questionStale")}):null,n.status==="needs_user"?b.jsxs("form",{className:"work-reply",onSubmit:x=>{x.preventDefault();const k=o.trim();!k||g||(y(!0),p(""),a(n.id,k).then(T=>{y(!1),T?p(T):f("")}))},children:[b.jsxs("label",{children:[b.jsx("span",{children:u("work.answerLabel")}),b.jsx("textarea",{value:o,rows:2,disabled:g,onChange:x=>f(x.target.value)})]}),h?b.jsx("p",{className:"work-error",children:h}):null,b.jsx("button",{type:"submit",disabled:g||o.trim()==="",children:u("work.answerSubmit")})]}):null]})}function GO({briefing:n,time:l,mark:a,onOpenFile:r}){const{t:u}=Ye(),[o,f]=L.useState(!1),h=n.body.split(`
60
- `).map(g=>g.trim()).find(Boolean)??"",p=[n.wallMs!=null?u("work.duration",{value:QO(n.wallMs,u)}):"",n.maxTokens!=null?`token ${n.maxTokens.toLocaleString("en-US")}`:"",n.material?u("work.material",{hash:n.material.slice(0,8)}):""].filter(Boolean);return b.jsxs("div",{className:"briefing-row","data-turn":a,children:[b.jsxs("article",{className:o?"briefing-card open":"briefing-card",children:[b.jsxs("button",{type:"button",className:"briefing-toggle","aria-expanded":o,onClick:()=>f(g=>!g),children:[b.jsx("span",{className:"briefing-title",children:n.cancel?u("work.cancelTitle"):u("work.taskTitle")}),b.jsx("span",{className:"briefing-rev",children:u("work.generation",{revision:String(n.revision)})}),b.jsx(XO,{}),h&&!o?b.jsx("span",{className:"briefing-preview",children:h}):null]}),b.jsx(Mo,{open:o,children:b.jsxs("div",{className:"briefing-body",children:[n.body?b.jsx(zo,{text:n.body,onOpenFile:r}):null,p.length?b.jsx("p",{className:"briefing-facts",children:p.join(" · ")}):null,n.notes.map(g=>b.jsx("p",{className:"briefing-note",children:g},g))]})})]}),l?b.jsx("time",{children:l}):null]})}function QO(n,l){return n%6e4===0?l("work.minutes",{count:String(n/6e4)}):n%1e3===0?l("work.seconds",{count:String(n/1e3)}):l("work.milliseconds",{count:String(n)})}function XO(){return b.jsx("svg",{className:"briefing-chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:b.jsx("path",{d:"M4 6.5L8 10.5L12 6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function FO({text:n}){return b.jsx("p",{className:"work-refused",children:n})}function ZO({segment:n}){const[l,a]=L.useState(!1),{t:r}=Ye();return b.jsxs("div",{className:"official-row","data-variant":"think","data-segment":n.id,children:[b.jsxs("button",{type:"button",className:"official-title","aria-expanded":l,onClick:()=>a(!l),children:[b.jsxs("span",{className:"official-leading",children:[b.jsx(e3,{}),b.jsx(So,{})]}),b.jsx("span",{className:"official-label",children:n.running?r("activity.thinking"):r("activity.reasoning")})]}),b.jsx(Mo,{open:l,children:b.jsx("div",{className:"think-body",children:Xe(n.text)})})]})}function KO({segments:n,pending:l=!1,tickets:a=[],cwd:r,connectionPhase:u}){const{t:o}=Ye(),f=l||n.some(S=>S.kind==="think"?S.running:us.has(os(S,r,a).status)),h=n.filter(S=>S.kind==="tool").map(S=>os(S,r,a).status),p=[[o("activity.count.active"),h.filter(S=>us.has(S)).length],[o("activity.count.failed"),h.filter(S=>S==="failed").length],[o("activity.count.cancelled"),h.filter(S=>S==="cancelled").length],[o("activity.count.unknown"),h.filter(S=>S==="unknown").length]].filter(([,S])=>Number(S)>0).map(([S,x])=>`${S} ${x}`).join(" · "),[g,y]=L.useState(()=>f),m=u!=null&&u!=="live";return b.jsxs("section",{className:g?"activity-group open":"activity-group","aria-label":o("activity.title"),"data-state":f?"running":"settled","data-activity-start":n[0]?.id,children:[b.jsxs("button",{type:"button",className:"official-title","aria-expanded":g,onClick:()=>y(S=>!S),children:[b.jsxs("span",{className:"official-leading",children:[b.jsx(Pd,{}),b.jsx(So,{})]}),b.jsx("span",{className:"official-label",children:n.length===1?o("activity.titleOne"):o("activity.titleWithCount",{count:String(n.length)})}),p?b.jsx("span",{className:"activity-status",children:p}):null,m?b.jsx("span",{className:"activity-status",children:["restoring","connecting","syncing"].includes(u??"")?o("activity.resyncing"):o("activity.connectionLastKnown")}):null]}),b.jsx(Mo,{open:g,children:b.jsxs("div",{className:"activity-body",children:[l&&!n.some(S=>S.kind==="think"?S.running:us.has(os(S,r,a).status))?b.jsx("p",{className:"activity-note",children:o("activity.generating")}):null,n.map(S=>S.kind==="think"?b.jsx(ZO,{segment:S},S.id):b.jsx(JO,{segment:S,cwd:r,tickets:a,stale:m},S.callId))]})})]})}function JO(n){const[l,a]=L.useState(!1),[r,u]=L.useState(!1);return b.jsx($O,{...n,open:l,argsOpen:r,onToggle:()=>a(o=>!o),onArgsToggle:()=>u(o=>!o)})}function $O({segment:n,cwd:l,tickets:a=[],stale:r=!1,open:u,argsOpen:o,onToggle:f,onArgsToggle:h}){const p=L.useId(),{t:g,locale:y}=Ye(),m=os(n,l,a),S=Ej({...n,args:m.args,result:m.output}),x=kh(n.name)?g("activity.runCommand"):m.title,k=m.description||(m.todos.length?g("activity.updatePlan"):"")||(m.ticket?Xe(m.ticket.summary):"")||S?.name||x,T=["failed","cancelled","unknown"].includes(m.status);return b.jsx(Qv,{className:"official-row tool-activity",status:m.status,segmentId:n.id,open:u,onToggle:f,panelId:`${p}-tool`,title:b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"official-leading",children:[b.jsx(Pd,{}),b.jsx(So,{})]}),b.jsx("span",{className:"official-label",children:k}),T?b.jsxs("span",{className:"activity-status",children:[Nv(m.status,g),r?g("activity.lastKnownSuffix"):""]}):null]}),children:b.jsxs("div",{className:"activity-detail",children:[m.status!=="succeeded"&&!T?b.jsxs("p",{className:"activity-note",children:[Nv(m.status,g),r?g("activity.lastKnownSuffix"):""]}):null,m.todos.length?b.jsxs("p",{className:"activity-note",children:[m.todos.filter(A=>A.status==="completed").length,"/",m.todos.length," ",g("activity.planComplete")]}):null,b.jsxs("div",{className:"activity-facts",children:[m.title," · ",Xe(n.callId)]}),m.command?b.jsxs("div",{className:"activity-command",children:[b.jsx(uo,{text:m.command}),b.jsx("pre",{children:m.command})]}):null,m.cwd?b.jsxs("p",{className:"activity-facts",children:[m.cwdSource==="recorded"?g("activity.cwdRecorded"):m.cwdSource==="requested"?g("activity.cwdRequested"):g("activity.cwdSessionDefault"),": ",m.cwd]}):null,m.status==="waiting"?b.jsx("p",{className:"activity-note",children:g("activity.callRequested")}):null,m.jobId?b.jsxs("p",{className:"activity-facts",children:["Job: ",Xe(m.jobId)," · ",g("activity.jobRegistered")]}):null,m.ticketId?b.jsxs("p",{className:"activity-facts",children:["Ticket: ",Xe(m.ticketId)," ",m.ticket?.childSessionId?`· Worker: ${Xe(m.ticket.childSessionId)}`:""]}):null,m.latestReport?b.jsxs("p",{className:"activity-note",children:[g("activity.latestReport")," (v",m.ticket?.revision,"): ",Xe(m.latestReport)]}):null,m.todos.length?b.jsx("ul",{className:"activity-todos",children:m.todos.map((A,E)=>b.jsxs("li",{children:[b.jsx("span",{children:A.status})," ",A.content]},E))}):null,n.requestedAt!=null?b.jsxs("p",{className:"activity-facts",children:[g("activity.callRecorded"),":"," ",new Date(n.requestedAt).toLocaleString(y==="zh"?"zh-CN":"en"),n.settledAt!=null?` · ${g("activity.callWait")}: ${Math.max(0,n.settledAt-n.requestedAt)}ms`:""]}):null,m.exitCode!=null?b.jsxs("p",{className:"activity-facts",children:["Exit: ",m.exitCode]}):null,S?b.jsx(PO,{change:S}):null,b.jsx(Qv,{className:"official-row activity-arguments",open:o,onToggle:h,panelId:`${p}-args`,title:b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"official-leading",children:[b.jsx(Pd,{}),b.jsx(So,{})]}),b.jsx("span",{className:"official-label",children:g("activity.fullArgs")})]}),trailing:o?b.jsx(uo,{text:m.args}):null,children:b.jsx("pre",{children:m.args||"{}"})}),n.resultReceived||n.result?b.jsxs("div",{className:"activity-output",children:[b.jsxs("div",{className:"activity-block-head",children:[b.jsx("span",{children:g("activity.toolResult")}),b.jsx(uo,{text:m.output})]}),b.jsx("pre",{children:m.output||g("activity.emptyResult")})]}):null]})})}function Qv({className:n,status:l,segmentId:a,open:r,onToggle:u,panelId:o,title:f,trailing:h,children:p}){return b.jsxs("div",{className:`${n}${r?" open":""}`,"data-state":l,"data-segment":a,children:[b.jsx("button",{type:"button",className:"official-title","aria-expanded":r,"aria-controls":o,onClick:g=>{g.stopPropagation(),u()},children:f}),h,b.jsx("div",{id:o,className:"activity-panel",children:b.jsx(Mo,{open:r,children:p})})]})}function PO({change:n}){const l=n.lines.map(a=>`${a.kind==="del"?"- ":a.kind==="add"?"+ ":" "}${a.text}`).join(`
61
- `);return b.jsxs("div",{className:"diff-card","data-diff":"",children:[b.jsxs("div",{className:"diff-head",children:[b.jsxs("span",{className:"diff-heading",children:[b.jsx("span",{className:"diff-lang",children:n.language||"Code block"}),b.jsx("span",{className:"diff-file",children:n.name})]}),b.jsx(uo,{text:l})]}),b.jsx("div",{className:"diff-body",children:n.lines.map((a,r)=>b.jsx("div",{className:WO(a.kind),children:a.text},r))})]})}function WO(n){return n==="add"?"diff-line added":n==="del"?"diff-line removed":"diff-line same"}function uo({text:n}){const[l,a]=L.useState(!1);return b.jsx("button",{type:"button",className:"diff-copy","aria-label":l?"Copied":"Copy",onClick:r=>{r.stopPropagation(),navigator.clipboard.writeText(Xe(n)).then(()=>{a(!0),window.setTimeout(()=>a(!1),1e3)})},children:l?b.jsx(n3,{}):b.jsx(t3,{})})}function So(){return b.jsx("svg",{className:"chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:b.jsx("path",{d:"M4 6.5L8 10.5L12 6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function e3(){return b.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[b.jsx("path",{d:"M8 1.8c2.8 0 5 2 5 4.6 0 1.6-.8 3-2 3.8-.4.3-.6.7-.6 1.1V12H5.6v-.7c0-.4-.2-.8-.6-1.1-1.2-.8-2-2.2-2-3.8 0-2.6 2.2-4.6 5-4.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),b.jsx("path",{d:"M6.2 13.6h3.6",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Pd(){return b.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:b.jsx("path",{d:"M3.2 4.2h9.6M3.2 8h9.6M3.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})})}function t3(){return b.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[b.jsx("rect",{x:"5.2",y:"5.2",width:"7.2",height:"7.6",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),b.jsx("path",{d:"M10.2 5.2V3.8A1.3 1.3 0 0 0 8.9 2.5H3.8A1.3 1.3 0 0 0 2.5 3.8v5.1A1.3 1.3 0 0 0 3.8 10.2H5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})]})}function n3(){return b.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:b.jsx("path",{d:"M3.5 8.2L6.4 11.1L12.5 4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const i3={aborted:"question.aborted",failed:"question.failed",answered:"question.answered"};function ns(n){return{selected:[...n.selected],custom:n.custom,skipped:n.skipped}}function l3(n){const l=Math.max(0,Math.ceil(n/1e3)),a=Math.floor(l/60),r=l%60;return a>0?`${a}:${String(r).padStart(2,"0")}`:`${r}s`}function a3({item:n,draft:l,interactive:a,disabled:r,onToggle:u}){const{t:o}=Ye();if(!n.options.length)return null;const f=new Set(l.selected);return b.jsx("ul",{className:"user-question-options",children:n.options.map(h=>{const p=f.has(h.label),g=lj(h.label,h.recommended),y=p?"user-question-option selected":"user-question-option",m=b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"user-question-option-label",children:[Xe(h.label),g.recommended?b.jsx("span",{className:"user-question-badge",children:o("question.recommended")}):null]}),h.description?b.jsx("span",{className:"user-question-option-desc",children:Xe(h.description)}):null]});return b.jsx("li",{children:a?b.jsx("button",{type:"button",className:y,"data-selected":p?"true":"false","aria-pressed":n.multiSelect?p:void 0,disabled:r,onClick:()=>u(h.label),children:m}):b.jsx("div",{className:y,"data-selected":p?"true":"false",children:m})},h.label)})})}function Ch({interactive:n,waitLabel:l,onTakeTime:a,busy:r}){const{t:u}=Ye();return l?b.jsxs("div",{className:"user-question-wait",children:[b.jsx("p",{className:"user-question-hint",children:l}),n&&l!==u("question.continued")&&l!==u("question.waitingNoTimer")?b.jsx("button",{type:"button",className:"user-question-skip",disabled:r,onClick:a,children:u("question.takeTime")}):null]}):null}function r3({segment:n,sessionId:l,onCompose:a,remainingMs:r,waitState:u}){const o=xs(n);return o?o.presentation==="plan-review"?b.jsx(u3,{segment:n,sessionId:l,onCompose:a,remainingMs:r,waitState:u}):o.presentation==="approval"?b.jsx(o3,{segment:n,sessionId:l,remainingMs:r,waitState:u}):b.jsx(s3,{segment:n,sessionId:l,remainingMs:r,waitState:u}):null}function Nh(n,l,a,r,u){const{t:o}=Ye(),f=!!(a&&U0(a.state)),[h,p]=L.useState(u==="waiting"||a?.wait==="waiting"),[g,y]=L.useState(u==="continued"||a?.state==="continued"),[m,S]=L.useState(r??a?.timeoutMs),x=L.useRef(null),k=(u==="counting"||a?.wait==="counting"||typeof(r??a?.timeoutMs)=="number")&&!h&&!g;L.useEffect(()=>{u==="waiting"&&p(!0),(u==="continued"||a?.state==="continued")&&y(!0),typeof r=="number"&&(x.current=Date.now()+r,S(r))},[r,u,a?.state]),L.useEffect(()=>{if(!f||!k)return;const E=r??m??a?.timeoutMs;if(typeof E!="number")return;x.current==null&&(x.current=Date.now()+E);const M=()=>{const $=Math.max(0,(x.current??Date.now())-Date.now());return S($),$<=0?(y(!0),n&&ct("/questions/timeout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:n,callId:l})}),!1):!0};if(!M())return;const H=window.setInterval(()=>{M()||window.clearInterval(H)},250);return()=>window.clearInterval(H)},[f,k,n,l,r,m,a?.timeoutMs]);async function T(){p(!0),x.current=null,n&&await ct("/questions/take-time",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:n,callId:l})})}const A=g?o("question.continued"):h?o("question.waitingNoTimer"):k&&typeof m=="number"?o("question.remaining",{time:l3(m)}):null;return{answerable:f,held:h,continued:g,waitLabel:A,takeTime:T,markHeld:()=>p(!0)}}function s3({segment:n,sessionId:l,remainingMs:a,waitState:r}){const{t:u}=Ye(),o=xs(n),f=Nh(l,o.callId,o,a,r),[h,p]=L.useState({}),[g,y]=L.useState(!1),[m,S]=L.useState(""),x=o.questions,k=L.useMemo(()=>{const O={};for(const Q of x)O[Q.id]=h[Q.id]??ns(Q);return O},[h,x]),T=!!l&&f.answerable,A=x.length>1||x.some(O=>O.multiSelect||O.options.length===0);function E(O,Q){f.markHeld(),p(ne=>{const he=x.find(Z=>Z.id===O),_=ne[O]??(he?ns(he):{selected:[],custom:"",skipped:!1});return{...ne,[O]:{..._,...Q}}})}async function M(O){if(!(!l||g)){y(!0),S("");try{const Q=await ct("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,callId:o.callId,answers:O})});if(Q.status===200&&Q.body.ok!==!1||Q.status===409)return;const ne=typeof Q.body.message=="string"?Q.body.message:u("question.submitFailed");S(ne)}catch{S(u("question.submitFailed"))}finally{y(!1)}}}function H(O,Q){return Q.skipped?{id:O.id,selected:[]}:Q.custom.trim()&&(O.multiSelect||Q.selected.length===0||O.options.length===0)?O.multiSelect?{id:O.id,selected:Q.selected,custom:Q.custom}:{id:O.id,selected:[],custom:Q.custom}:Q.selected.length?{id:O.id,selected:[...Q.selected]}:null}function $(){const O=x.map(Q=>H(Q,k[Q.id]??ns(Q)));if(O.some(Q=>Q==null)){S(u("question.incomplete"));return}M(O)}function te(O,Q){if(!T||g)return;if(!O.multiSelect&&x.length===1&&!k[O.id]?.custom){M([{id:O.id,selected:[Q]}]);return}const ne=k[O.id]??ns(O),he=O.multiSelect?ne.selected.includes(Q)?ne.selected.filter(_=>_!==Q):[...ne.selected,Q]:[Q];E(O.id,{selected:he,skipped:!1,custom:O.multiSelect?ne.custom:""})}return b.jsxs("section",{className:"user-question-card","data-segment":n.id,"data-state":f.continued?"continued":o.state,"data-call":o.callId,"data-session":l||void 0,"data-kind":"question",children:[b.jsx(Ch,{interactive:T,waitLabel:f.waitLabel,onTakeTime:()=>{f.takeTime()},busy:g}),o.questions.map(O=>{const Q=k[O.id]??ns(O);return b.jsxs("article",{className:"user-question","data-question":O.id,children:[O.header?b.jsx("h3",{className:"user-question-header",children:Xe(O.header)}):null,b.jsx("p",{className:"user-question-text",children:Xe(O.question)}),O.detail?b.jsx("p",{className:"user-question-hint",children:Xe(O.detail)}):null,O.multiSelect&&f.answerable?b.jsx("p",{className:"user-question-hint",children:u("question.multiSelect")}):null,b.jsx(a3,{item:O,draft:f.answerable?Q:{selected:O.selected,custom:O.custom,skipped:O.skipped},interactive:T,disabled:g,onToggle:ne=>te(O,ne)}),T?b.jsxs("div",{className:"user-question-actions",children:[b.jsxs("label",{className:"user-question-custom",children:[b.jsx("span",{children:u("question.customLabel")}),b.jsx("textarea",{value:Q.custom,disabled:g,rows:2,placeholder:u("question.customPlaceholder"),onChange:ne=>E(O.id,{custom:ne.target.value,skipped:!1})})]}),b.jsx("button",{type:"button",className:"user-question-skip",disabled:g,onClick:()=>{if(x.length===1){M([{id:O.id,selected:[]}]);return}E(O.id,{skipped:!0,selected:[],custom:""})},children:u("question.skip")})]}):null,!T&&O.custom?b.jsx("p",{className:"user-question-hint",children:u("question.custom",{text:Xe(O.custom)})}):null,(O.skipped||Q.skipped)&&(o.state!=="open"||T)?b.jsx("p",{className:"user-question-hint",children:u("question.skipped")}):null]},O.id)}),T&&(A||x.some(O=>(k[O.id]?.custom??"").trim()!==""))?b.jsx("button",{type:"button",className:"user-question-submit",disabled:g,onClick:$,children:u(g?"question.submitting":"question.submit")}):null,m?b.jsx("p",{className:"user-question-status exception",children:m}):null,!f.answerable&&o.state!=="open"&&o.state!=="continued"?b.jsx("p",{className:o.state==="answered"?"user-question-status":"user-question-status exception",children:u(i3[o.state])}):null]})}function u3({segment:n,sessionId:l,onCompose:a,remainingMs:r,waitState:u}){const{t:o}=Ye(),f=xs(n),h=D0(f.questions),p=Nh(l,f.callId,f,r,u),[g,y]=L.useState(!1),[m,S]=L.useState(""),[x,k]=L.useState(!1),[T,A]=L.useState(""),E=!!l&&p.answerable,M=h.item.selected[0],H=M===h.approve.label;async function $(){if(!(!l||x)){k(!0),A("");try{const O=await ct("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,callId:f.callId,answers:[{id:h.item.id,selected:[h.approve.label]}]})});if(O.status===200&&O.body.ok!==!1||O.status===409)return;A(typeof O.body.message=="string"?O.body.message:o("question.submitFailed"))}catch{A(o("question.submitFailed"))}finally{k(!1)}}}async function te(){if(!l||x)return;const O=m.trim();if(!O){A(o("question.changesNeeded"));return}k(!0),A("");try{const Q=await ct("/questions/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,callId:f.callId})});if(Q.status===200&&Q.body.ok!==!1){a?.(O);return}if(Q.status===409){a?.(O);return}A(typeof Q.body.message=="string"?Q.body.message:o("question.submitFailed"))}catch{A(o("question.submitFailed"))}finally{k(!1)}}return b.jsxs("section",{className:"user-question-card","data-segment":n.id,"data-state":p.continued?"continued":f.state,"data-call":f.callId,"data-session":l||void 0,"data-kind":"plan-review",children:[b.jsx("h3",{className:"user-question-header",children:o("question.planTitle")}),b.jsx("p",{className:"user-question-text",children:Xe(h.item.question)}),b.jsx(Ch,{interactive:E,waitLabel:p.waitLabel,onTakeTime:()=>{p.takeTime()},busy:x}),h.plan?g?b.jsx("div",{className:"user-question-plan",children:b.jsx(zo,{text:h.plan})}):b.jsx("p",{className:"user-question-hint",children:Xe(h.plan).split(`
62
- `).filter(Boolean).slice(0,2).join(" ")}):null,h.plan?b.jsx("button",{type:"button",className:"user-question-skip",onClick:()=>y(O=>!O),children:o(g?"question.hidePlan":"question.viewFull")}):null,E?b.jsxs("div",{className:"user-question-actions",children:[b.jsxs("label",{className:"user-question-custom",children:[b.jsx("span",{children:o("question.changeComments")}),b.jsx("textarea",{value:m,disabled:x,rows:3,placeholder:o("question.changePlaceholder"),onChange:O=>{p.markHeld(),S(O.target.value)}})]}),b.jsxs("div",{className:"user-question-row",children:[b.jsx("button",{type:"button",className:"user-question-skip",disabled:x,onClick:()=>{te()},children:o("question.requestChanges")}),b.jsx("button",{type:"button",className:"user-question-submit",disabled:x,onClick:()=>{$()},children:o(x?"question.submitting":"question.approvePlan")})]})]}):M?b.jsx("p",{className:"user-question-status",children:H?o("question.approvePlan"):Xe(M)}):f.state==="aborted"?b.jsx("p",{className:"user-question-status exception",children:o("question.aborted")}):f.state==="failed"?b.jsx("p",{className:"user-question-status exception",children:o("question.failed")}):null,T?b.jsx("p",{className:"user-question-status exception",children:T}):null]})}function o3({segment:n,sessionId:l,remainingMs:a,waitState:r}){const{t:u,locale:o}=Ye(),f=xs(n),h=L0(f.questions),p=Nh(l,f.callId,f,a,r),[g,y]=L.useState(!1),[m,S]=L.useState(""),x=!!l&&p.answerable,k=Cd(h.intent.display?.question,o,h.item.question),T=Cd(h.intent.display?.detail,o,h.item.detail),A=Cd(h.intent.display?.approve,o,h.approve.label),E=h.item.selected[0];async function M(H){if(!(!l||g)){y(!0),S("");try{const $=await ct("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,callId:f.callId,answers:[{id:h.item.id,selected:[H]}]})});if($.status===200&&$.body.ok!==!1||$.status===409)return;S(typeof $.body.message=="string"?$.body.message:u("question.submitFailed"))}catch{S(u("question.submitFailed"))}finally{y(!1)}}}return b.jsxs("section",{className:"user-question-card","data-segment":n.id,"data-state":p.continued?"continued":f.state,"data-call":f.callId,"data-session":l||void 0,"data-kind":"approval",children:[h.intent.subject?.name?b.jsx("h3",{className:"user-question-header",children:Xe(h.intent.subject.name)}):null,b.jsx("p",{className:"user-question-text",children:Xe(k)}),T?b.jsx("p",{className:"user-question-hint",children:Xe(T)}):null,b.jsx(Ch,{interactive:x,waitLabel:p.waitLabel,onTakeTime:()=>{p.takeTime()},busy:g}),x?b.jsxs("div",{className:"user-question-row",children:[b.jsx("button",{type:"button",className:"user-question-skip",disabled:g,onClick:()=>{M(h.reject.label)},children:u("question.reject")}),b.jsx("button",{type:"button",className:"user-question-submit",disabled:g,onClick:()=>{M(h.approve.label)},children:g?u("question.submitting"):Xe(A)||u("question.allow")}),h.always?b.jsx("button",{type:"button",className:"user-question-submit",disabled:g,onClick:()=>{M(h.always.label)},children:u("question.alwaysAllow")}):null]}):E?b.jsx("p",{className:"user-question-status",children:u("question.approvalAnswered")}):f.state==="aborted"?b.jsx("p",{className:"user-question-status exception",children:u("question.aborted")}):f.state==="failed"?b.jsx("p",{className:"user-question-status exception",children:u("question.failed")}):null,m?b.jsx("p",{className:"user-question-status exception",children:m}):null]})}function _d({approval:n,sessionId:l}){const{t:a,locale:r}=Ye(),[u,o]=L.useState(!1),[f,h]=L.useState(""),[p,g]=L.useState(n.state),y=!!l&&p==="open",m=r.startsWith("zh")&&n.displayReason?.zh?n.displayReason.zh:n.displayReason?.en||n.reason;async function S(k){if(!(!l||u)){o(!0),h("");try{const T=await ct("/approvals/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,requestId:n.requestId,outcome:k})});if(T.status===200&&T.body.ok!==!1){g(k);return}if(T.status===409){g(k);return}h(typeof T.body.message=="string"?T.body.message:a("approval.submitFailed"))}catch{h(a("approval.submitFailed"))}finally{o(!1)}}}const x=p==="allowed-once"?a("approval.allowed"):p==="rejected"?a("approval.rejected"):p==="cancelled"?a("approval.cancelled"):p==="unavailable"?a("approval.failed"):null;return b.jsxs("section",{className:"user-question-card","data-kind":"tool-approval","data-state":p,"data-request":n.requestId,"data-session":l||void 0,children:[b.jsx("h3",{className:"user-question-header",children:a("approval.title")}),b.jsx("p",{className:"user-question-text",children:Xe(n.toolName)}),m?b.jsx("p",{className:"user-question-hint",children:Xe(m)}):null,y?b.jsxs("div",{className:"user-question-row",children:[b.jsx("button",{type:"button",className:"user-question-skip",disabled:u,onClick:()=>{S("rejected")},children:a("approval.reject")}),b.jsx("button",{type:"button",className:"user-question-submit",disabled:u,onClick:()=>{S("allowed-once")},children:a(u?"question.submitting":"approval.allowOnce")})]}):x?b.jsx("p",{className:p==="allowed-once"?"user-question-status":"user-question-status exception",children:x}):null,f?b.jsx("p",{className:"user-question-status exception",children:f}):null]})}function c3(n,l){if(!n)return"";const a=new Date(n);return Number.isNaN(a.getTime())?"":a.toLocaleTimeString(l==="zh"?"zh-CN":"en",{hour:"2-digit",minute:"2-digit"})}function f3({sessionId:n,segments:l,completed:a,failures:r,retries:u,turnEnds:o,tickets:f,now:h,canRetry:p,onRetry:g,onSupply:y,onOpenSession:m,onOpenFile:S,onOpenInbox:x,botLabel:k,chat:T=!1,cwd:A,connectionPhase:E,approvals:M=[],questionWaits:H,onCompose:$}){const te=[];let O=null;const Q=()=>{O&&(O.segments.length||r[O.turn]||u[O.turn]?.length)&&te.push(O),O=null};for(const ae of l){if(ae.kind==="user"){Q(),hb(ae.text)||te.push({type:"user",segment:ae});continue}const G=ae.turn??-1;(!O||O.turn!==G)&&(Q(),O={type:"turn",turn:G,seconds:a[G],segments:[]}),O.segments.push(ae)}Q();const ne=new Set(te.flatMap(ae=>ae.type==="turn"?[ae.turn]:[]));for(const ae of Object.keys(r)){const G=Number(ae);ne.has(G)||te.push({type:"turn",turn:G,seconds:a[G],segments:[]})}const he=f.map(ae=>({...ae,summary:Xe(ae.summary),events:ae.events.map(G=>({...G,text:Xe(G.text)}))})),_=pb(he),Z=new Map(he.map(ae=>[ae.id,ae])),P=new Map;for(const ae of te)if(ae.type==="turn"){for(const G of V0(ae.segments))if(G.type==="activity")for(const se of G.segments){if(se.kind!=="tool")continue;const ue=gb(se);ue&&Z.has(ue)&&!P.has(ue)&&P.set(ue,se.id)}}const Se=te.reduce((ae,G)=>G.type==="turn"?Math.max(ae,G.turn):ae,-1),Re=mb(f);return b.jsxs(b.Fragment,{children:[te.map((ae,G)=>ae.type==="user"?b.jsx(d3,{segment:ae.segment,botLabel:k,onOpenInbox:x,onOpenFile:S},ae.segment.id):b.jsx(g3,{sessionId:n,cwd:A,connectionPhase:E,block:ae,index:G,blocks:te,failures:r,retries:u,turnEnds:o,latestTurn:Se,background:Re,byId:Z,anchorAt:P,now:h,canRetry:p,onRetry:g,onSupply:y,onOpenSession:m,onOpenFile:S,chat:T,approvals:M,questionWaits:H,onCompose:$,trailingApprovals:G===te.length-1},`${n}:turn-${ae.turn}`)),_.filter(ae=>!P.has(ae.id)).map(ae=>b.jsx(W0,{ticket:ae,now:h,onSupply:y,onOpen:m},ae.id))]})}function d3({segment:n,botLabel:l,onOpenInbox:a,onOpenFile:r}){const u=wo(n.text),o=eh(n.text),{locale:f}=Ye(),h=c3(n.time,f);if(o)return b.jsx(GO,{briefing:o,time:h,mark:n.id,onOpenFile:r});if(u){const p=Zw([{kind:"in",id:n.id,seq:n.seq,time:n.time,mail:u}],l);return b.jsx(X2,{who:p?.who??"BOT",preview:p?.preview??"",time:h,mark:n.id,onOpen:a})}return b.jsxs("div",{className:"user-row","data-turn":n.id,children:[b.jsx("div",{className:"user-bubble",children:n.text}),h?b.jsx("time",{children:h}):null]})}function h3(n,l,a){for(let r=l-1;r>=0;r-=1){const u=n[r];if(u?.type==="user"&&u.segment&&u.segment.text.trim()!==""){if(wo(u.segment.text)||eh(u.segment.text))continue;if(u.segment.turn==null||u.segment.turn===a)return u.segment.text;break}}return""}function p3(n,l){return n.slice(l+1).some(a=>a.type==="user")}function m3({seconds:n,failure:l,retries:a,prompt:r,continued:u,canRetry:o,onRetry:f,showLabel:h}){const{t:p}=Ye(),[g,y]=L.useState(!1);if(!l&&a.length===0)return null;const m=g||u;return b.jsxs("div",{className:"turn-failure",children:[h?b.jsxs("p",{className:"turn-failed-label",children:["Failed",n!=null?b.jsxs(b.Fragment,{children:[" ","· ",b.jsxs("span",{className:"duration",children:[n,"s"]})]}):null]}):null,a.map(S=>b.jsxs("details",{className:"retry-row",open:S.state==="scheduled",children:[b.jsxs("summary",{children:[S.state==="started"?"Retried model request":"Retrying model request"," (",S.retry,"/",S.maxRetries??"∞",") · ",Math.max(1,Math.ceil(S.delayMs/1e3)),"s"]}),b.jsxs("p",{children:["Retry delay: ",Math.round(S.delayMs),"ms"]}),b.jsxs("p",{children:["Failure reason: ",S.message]})]},`${S.retryId}:${S.retry}`)),l?b.jsxs("p",{className:"turn-error",role:"status",children:[b.jsx("span",{className:"turn-error-title",children:"This turn failed"}),b.jsx("span",{children:l.message}),l.code?b.jsx("code",{children:l.code}):null]}):null,l&&r&&!m?b.jsx("button",{type:"button",className:"retry-turn",disabled:!o,onClick:()=>{y(!0),f(r)},children:p("bot.retry")}):null]})}function g3({sessionId:n,block:l,index:a,blocks:r,failures:u,retries:o,turnEnds:f,latestTurn:h,background:p,byId:g,anchorAt:y,now:m,canRetry:S,onRetry:x,onSupply:k,onOpenSession:T,onOpenFile:A,chat:E=!1,cwd:M,connectionPhase:H,approvals:$=[],questionWaits:te,onCompose:O,trailingApprovals:Q=!1}){const{t:ne}=Ye(),he=V0(l.segments),_=new Set,Z=G=>te?.[G]??te?.[`${n}:${G}`],P=G=>$.filter(se=>_.has(se.requestId)?!1:se.callId&&G.includes(se.callId)?(_.add(se.requestId),!0):!1),Se=()=>Q?$.filter(G=>_.has(G.requestId)?!1:(_.add(G.requestId),!0)):[],Re=he.some(G=>G.type==="activity"),ae=E&&f[l.turn]==="aborted"&&!u[l.turn]&&!(l.turn===h&&p);return b.jsx("div",{children:b.jsxs("div",{"data-turn":`turn:${l.turn}`,children:[he.map(G=>{if(G.type==="text")return b.jsx("div",{"data-segment":G.segment.id,className:G.segment.streaming?"assistant streaming":"assistant",children:b.jsx(zo,{text:G.segment.text,streaming:G.segment.streaming,onOpenFile:A})},G.segment.id);if(G.type==="question"){const ue=Z(G.segment.callId);return b.jsxs(L.Fragment,{children:[b.jsx(r3,{segment:G.segment,sessionId:n,onCompose:O,remainingMs:ue?.remainingMs,waitState:ue?.waitState}),P([G.segment.callId]).map(ke=>b.jsx(_d,{approval:ke,sessionId:n},ke.requestId))]},G.segment.id)}const se=G.segments.filter(ue=>ue.kind==="tool");return b.jsxs(L.Fragment,{children:[b.jsx(KO,{segments:G.segments,cwd:M,tickets:[...g.values()],connectionPhase:H}),P(se.map(ue=>ue.callId)).map(ue=>b.jsx(_d,{approval:ue,sessionId:n},ue.requestId)),se.filter(ue=>Rw(ue)).map(ue=>b.jsx(FO,{text:Xe(Mw(ue.result,ne))},ue.id)),se.flatMap(ue=>{const ke=gb(ue),j=ke?g.get(ke):void 0;return!ke||!j||y.get(ke)!==ue.id?[]:[b.jsx(W0,{ticket:j,now:m,onSupply:k,onOpen:T},j.id)]})]},G.id)}),Se().map(G=>b.jsx(_d,{approval:G,sessionId:n},G.requestId)),ae?b.jsx("p",{className:"work-note",children:ne("bot.stopped")}):null,b.jsx(m3,{seconds:l.seconds,failure:u[l.turn],retries:o[l.turn]??[],prompt:h3(r,a,l.turn),continued:p3(r,a),canRetry:S,onRetry:x,showLabel:!Re}),l.turn===h&&f[l.turn]==="aborted"&&p?b.jsx("p",{className:"work-note",children:ne("bot.stoppedBackground")}):null]})})}function Xv(){const n=location.hash.replace(/^#\/?/,"").split("/");for(let l=0;l<n.length-1;l+=1){const a=n[l],r=n[l+1];if(a==="s"&&r)return decodeURIComponent(r)}return""}function zd(n){try{const l=JSON.parse(sessionStorage.getItem(n)||"{}");return l&&typeof l=="object"?l:{}}catch{return{}}}function Fv(n){if(!n||typeof n!="object"||Array.isArray(n))return{};const l={};for(const[a,r]of Object.entries(n))typeof r=="string"&&r!==""&&(l[a]=r);return l}function qd(n){fetch("/dsh-bot/api/sessions/previews",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(n),keepalive:!0})}function Zv(n){return(n??"").split("/").filter(Boolean).at(-1)??""}function y3(){return new Promise(n=>{const l=location.protocol==="https:"?"wss:":"ws:",a=new WebSocket(`${l}//${location.host}/api/remote.mux`),r=window.setTimeout(()=>{a.close(),n([])},4e3),u=o=>{window.clearTimeout(r),a.close(),n(o)};a.addEventListener("open",()=>{a.send(JSON.stringify({type:"open",streamId:"archive",endpoint:"workspace/follow",payload:{args:{}}}))}),a.addEventListener("message",o=>{try{const f=JSON.parse(String(o.data)),h=f.value?.type==="baseline"?f.value.value?.archivedSessionIds:void 0;if(!Array.isArray(h))return;u(h.filter(p=>typeof p=="string"))}catch{}}),a.addEventListener("error",()=>u([]))})}function v3(){const{t:n,locale:l,setLocale:a}=Ye(),[r,u]=L.useState(Xv),[o,f]=L.useState([]),[h,p]=L.useState(""),[g,y]=L.useState(""),[m,S]=L.useState(!1),[x,k]=L.useState(()=>zd("dsh-bot.titles")),[T,A]=L.useState(()=>zd("dsh-bot.previews")),[E,M]=L.useState(Od),[H,$]=L.useState(""),[te,O]=L.useState(null),[Q,ne]=L.useState(r);Q!==r&&(ne(r),M(Od()));const[he,_]=L.useState(null),[Z,P]=L.useState({ready:!1,reason:"loading"}),[Se,Re]=L.useState(null),[ae,G]=L.useState(null),[se,ue]=L.useState(!1),[ke,j]=L.useState(""),[Pe,ht]=L.useState(0),[z,q]=L.useState(0),[ee,fe]=L.useState(""),[ge,Te]=L.useState(""),[Ne,Ee]=L.useState(!1),[W,de]=L.useState(null),[it,nn]=L.useState([]),[we,_t]=L.useState({}),[pt,Ke]=L.useState(!1),[qe,lt]=L.useState(!1),[wt,un]=L.useState({}),[Ht]=L.useState(()=>q0(async()=>{const C=await ct("/authorization");if(C.status!==200)throw new Error("Authorization catalog unavailable");return{available:C.body.available,entries:C.body.entries}})),It=L.useRef(void 0),on=L.useRef(null),[Vt,X]=L.useState(null),[ie,ve]=L.useState(()=>new Set),[be,kt]=L.useState(!1),[_e,bt]=L.useState(!1),[mt,Yt]=L.useState(!1),[vn,Bn]=L.useState(""),[ua,qt]=L.useState(0),[at,An]=L.useState(()=>new Set),[Rt,Ii]=L.useState({}),[Do,Ss]=L.useState({}),[ws,Lo]=L.useState(!1),[kl,cn]=L.useState({}),[Cn,fn]=L.useState(()=>Date.now()),[oa,ks]=L.useState(""),Es=Qw(r,ua);L.useEffect(()=>{nn([]),_t({});const C=W2({visible:!document.hidden,fetch:async le=>{const oe=await ct(`/interactions?compact=1&sessionId=${encodeURIComponent(r)}`,{signal:le});if(oe.status!==200)throw new Error("Interactions unavailable");return oe.body},active:le=>{const oe=le;return!!(oe.questions?.length||oe.approvals?.some(Ae=>Ae.state==="open")||oe.authorization?.prompts?.length||oe.authorization?.inFlight?.length)},apply:le=>{const oe=le,Ae=Array.isArray(oe.approvals)?oe.approvals:[];nn(Ae);const me={};if(Array.isArray(oe.questions))for(const rt of oe.questions)typeof rt.callId=="string"&&rt.callId!==""&&(me[rt.callId]={remainingMs:rt.remainingMs,waitState:rt.waitState});_t(me);const Ge=oe.authorization,ft=Ge&&typeof Ge=="object"?Ge.prompts:[];lt(Array.isArray(ft)&&ft.length>0);const We=Ge&&typeof Ge=="object"?Ge:{},et=JSON.stringify([We.catalogRevision,We.available]);It.current!==et&&(It.current=et,Ht.invalidate()),un(rt=>JSON.stringify(rt)===JSON.stringify(We)?rt:We)},schedule:(le,oe)=>{const Ae=window.setTimeout(le,oe);return()=>window.clearTimeout(Ae)}});on.current=C;const F=()=>C.setVisible(!document.hidden);return document.addEventListener("visibilitychange",F),()=>{C.close(),on.current===C&&(on.current=null),document.removeEventListener("visibilitychange",F)}},[r,Ht]),L.useEffect(()=>{ct("/cua").then(C=>Ke(C.body.available===!0))},[]);const Vi=L.useRef(null),Yi=L.useRef(null),El=L.useRef(null),si=L.useRef(0),Gi=L.useRef(new Map),ui=L.useRef(0),nr=L.useRef(new Map),Ts=L.useRef(!1),Tl=L.useRef(r),Al=L.useRef(null);Tl.current=r;function Nn(C){return Rt[C.sessionId]||x[C.sessionId]||C.title||Zv(C.cwd)||n("session.unnamed")}function ir(C){const F=o.find(le=>le.sessionId===C);return F?Nn(F):Rt[C]||x[C]||""}const As=xb(E.segments),ki=r!==""&&H!==r&&(te==null||te.phase==="restoring"||te.phase==="connecting"||te.phase==="syncing"&&H!==r),Cs=te?.fraction!=null?{loaded:Math.round(te.fraction*1e3),total:1e3}:null,Cl=te?.phase==="syncing"&&te.fraction!=null,Qi=L.useMemo(()=>Fw(E.segments),[E.segments]),Ns=L.useMemo(()=>xj(Qi),[Qi]),js=r?Nn({sessionId:r,cwd:o.find(C=>C.sessionId===r)?.cwd,title:E.title||null}):n("app.title"),Jn=r?`/#/s/${encodeURIComponent(r)}`:"/";function Et(C){Yt(!1),u(C),Ee(!1),X(null),_(null),Te(""),Bn("");const F=C?`#/s/${encodeURIComponent(C)}`:"#/";location.hash!==F&&history.replaceState(null,"",F)}function ln(C){if(!C||C===r)return;const F=r;Yt(!1),u(C),Ee(!1),X(null),_(null),Te(""),Bn("");const le=`#/s/${encodeURIComponent(C)}`;location.hash!==le&&history.pushState({kind:"worker",owner:F},"",le)}function Ei(){if(Yt(!1),Ee(!1),X(null),history.state?.kind==="worker"){history.back();return}oa&&Et(oa)}L.useEffect(()=>{let C=!1;return y3().then(F=>{C||ve(new Set(F))}),()=>{C=!0}},[]);function lr(C){const F=Aw(C);F&&(cn(F.signals),Ss(F.cards),Lo(!0));const le=C.desk;if(!le||typeof le!="object"||Array.isArray(le))return;const oe=le,Ae=oe.sessions;if(Ae&&typeof Ae=="object"&&!Array.isArray(Ae)){const We=Ae,et=We.result;if(et?.ok!==!0)p(et?.error?.message||String(We.error||n("session.listUnavailable")));else if(p(""),f(et.value?.items??[]),jl(We.previews),!Ts.current){Ts.current=!0;const rt=Fv(We.previews),Je={};for(const[Tt,Hn]of Object.entries(zd("dsh-bot.previews")))!rt[Tt]&&Hn&&(Je[Tt]=Hn);Object.keys(Je).length>0&&qd({previews:Je})}}const me=oe.bots;if(me&&typeof me=="object"&&!Array.isArray(me)&&me.ok===!0){const We=me,et=Array.isArray(We.bots)?We.bots:[],rt=et.flatMap(Tt=>{if(!Tt||typeof Tt!="object")return[];const Hn=Tt.sessionId;return typeof Hn=="string"?[Hn]:[]}),Je={};for(const Tt of et){if(!Tt||typeof Tt!="object")continue;const Hn=Tt.sessionId,oi=Tt.name;typeof Hn=="string"&&typeof oi=="string"&&oi!==""&&(Je[Hn]=oi)}if(rt.length===0&&Array.isArray(We.sessionIds))for(const Tt of We.sessionIds)typeof Tt=="string"&&rt.push(Tt);An(new Set(rt)),Ii(Je)}const Ge=oe.health;if(Ge&&typeof Ge=="object"&&!Array.isArray(Ge)){const We=Ge;Re(We),We.execution&&P({ready:We.execution.ready===!0,reason:We.execution.reason||(We.execution.ready===!0?"":"catalog_unreadable")})}const ft=oe.usage;ft&&typeof ft=="object"&&!Array.isArray(ft)&&G(ft)}L.useEffect(()=>{let C=!1;return(async()=>{try{const F=await ct("/sessions");if(C)return;const le=F.body.result;le?.ok===!0?(p(""),f(le.value?.items??[]),jl(F.body.previews)):F.status!==200&&p(le?.error?.message||n("session.listUnavailable"))}catch{}try{const F=await ct("/sessions/bots");if(C||F.body.ok!==!0)return;const le=Array.isArray(F.body.bots)?F.body.bots:[],oe=le.flatMap(me=>{if(!me||typeof me!="object")return[];const Ge=me.sessionId;return typeof Ge=="string"?[Ge]:[]}),Ae={};for(const me of le){if(!me||typeof me!="object")continue;const Ge=me.sessionId,ft=me.name;typeof Ge=="string"&&typeof ft=="string"&&ft!==""&&(Ae[Ge]=ft)}if(oe.length===0&&Array.isArray(F.body.sessionIds))for(const me of F.body.sessionIds)typeof me=="string"&&oe.push(me);An(new Set(oe)),Ii(Ae)}catch{}})(),()=>{C=!0}},[]),L.useEffect(()=>{let C=!1,F=null,le=0,oe=2e3,Ae,me;const Ge=et=>{let rt;try{rt=JSON.parse(String(et.data))}catch{return null}return rt.ok===!0?rt:null},ft=()=>{if(F?.close(),Ae=void 0,me=void 0,C||document.hidden||typeof EventSource>"u")return;const et=new EventSource(`/dsh-bot/api/live?sessionId=${encodeURIComponent(r)}`);F=et,et.addEventListener("interaction-error",()=>{!C&&F===et&&on.current?.disconnected()}),et.addEventListener("interactions",rt=>{if(C||F!==et)return;const Je=Ge(rt);Je?.sessionId===r&&(oe=2e3,on.current?.ingest(Je))}),et.addEventListener("snapshot",rt=>{if(C||F!==et)return;const Je=Ge(rt);Je&&(oe=2e3,Je.desk!==void 0&&(Ae=Je.desk),Je.work!==void 0&&(me=Je.work),lr(Je))}),et.addEventListener("delta",rt=>{if(C||F!==et)return;const Je=Ge(rt);if(!Je)return;const Tt={ok:!0};Je.desk!==void 0&&Ae!==void 0&&(Ae=ps(Ae,Je.desk),Tt.desk=Ae),Je.work!==void 0&&me!==void 0&&(me=ps(me,Je.work),Tt.work=me),(Tt.desk!==void 0||Tt.work!==void 0)&&lr(Tt)}),et.addEventListener("error",()=>{C||F!==et||(on.current?.disconnected(),et.close(),F===et&&(F=null),le=window.setTimeout(ft,oe),oe=Math.min(15e3,oe*2))})},We=()=>{window.clearTimeout(le),document.hidden?(F?.close(),F=null):(oe=2e3,ft())};return document.addEventListener("visibilitychange",We),ft(),()=>{C=!0,document.removeEventListener("visibilitychange",We),window.clearTimeout(le),F?.close()}},[r]),L.useEffect(()=>{const C=()=>{Yt(!1),Ee(!1),X(null),_(null),Te(""),Bn(""),u(Xv())};return window.addEventListener("hashchange",C),()=>window.removeEventListener("hashchange",C)},[]),L.useEffect(()=>{let C=!1;return Vv().then(le=>{C||(Al.current=Lv({follow:Rv({addressOf:oe=>Pa(oe)}),page:Bv({addressOf:oe=>Pa(oe)}),cdc:Hv({cache:le}),range:Dv(),checkpoint:le}))}),()=>{C=!0}},[]),L.useEffect(()=>{if(!r){$(""),O(null);return}M(Od()),O(null);let C=!1,F=null;return(async()=>{const le=await Vv();if(C)return;const oe=Al.current??Lv({follow:Rv({addressOf:me=>Pa(me)}),page:Bv({addressOf:me=>Pa(me)}),cdc:Hv({cache:le}),range:Dv(),checkpoint:le});Al.current=oe;const Ae=oe.open(r,{enhancement:"auto"});F=Ae,Ae.onBatch(me=>{C||Tl.current!==r||(M(Ge=>{let ft=Ge;for(const We of me.events)ft=Ij(ft,We);return ft}),$(r))}),Ae.onEphemeral(me=>{C||Tl.current!==r||M(Ge=>Vj(Ge,me))}),Ae.onStatus(me=>{C||Tl.current!==r||(O(me),(me.phase==="live"||me.phase==="stalled"||me.phase==="error")&&$(r))})})(),()=>{C=!0,F?.close()}},[r]),L.useEffect(()=>{!r||Q!==r||!E.title||Rt[r]||k(C=>{if(C[r]===E.title)return C;const F={...C,[r]:E.title};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(F)),F})},[r,Q,E.title,Rt]);const Nl=!!r&&at.has(r),an=Nl&&ws?Do[r]??[]:[],ca=Nl&&ws?r:"";L.useEffect(()=>{if(!r||!na(r)){ks("");return}let C=!1;const F=kw(r);return cs(`/dsh-bot/api/work/ticket?id=${encodeURIComponent(F)}`).then(le=>{if(C||le.body.ok!==!0||!le.body.ticket||typeof le.body.ticket!="object")return;const oe=le.body.ticket.owner_session_id;typeof oe=="string"&&ks(oe)}),()=>{C=!0}},[r]);const Xi=an.some(C=>C.status==="started");L.useEffect(()=>{if(!Xi)return;const C=window.setInterval(()=>fn(Date.now()),1e3);return()=>window.clearInterval(C)},[Xi]);function jl(C){const F=Fv(C);Object.keys(F).length!==0&&A(le=>{let oe=!1;const Ae={...le};for(const[me,Ge]of Object.entries(F))Ae[me]||(Ae[me]=Ge,oe=!0);return oe?(sessionStorage.setItem("dsh-bot.previews",JSON.stringify(Ae)),Ae):le})}function Ol(){window.clearTimeout(ui.current),ui.current=0;const C=[...Gi.current];if(Gi.current.clear(),C.length!==0){if(C.length===1){const[F,le]=C[0]??[];F&&le&&qd({sessionId:F,preview:le});return}qd({previews:Object.fromEntries(C)})}}L.useEffect(()=>()=>{Ol()},[]),L.useEffect(()=>{if(!r||Q!==r)return;const C=Yj(E.segments);!C||nr.current.get(r)===C||(nr.current.set(r,C),A(F=>{if(F[r]===C)return F;const le={...F,[r]:C};return sessionStorage.setItem("dsh-bot.previews",JSON.stringify(le)),le}),Gi.current.set(r,C),window.clearTimeout(ui.current),ui.current=window.setTimeout(Ol,400))},[r,Q,E.segments]),L.useEffect(()=>{if(!Ne)return;const C=le=>{const oe=le.target;oe instanceof Node&&El.current?.contains(oe)||Ee(!1)},F=le=>{le.key==="Escape"&&Ee(!1)};return document.addEventListener("pointerdown",C),document.addEventListener("keydown",F),()=>{document.removeEventListener("pointerdown",C),document.removeEventListener("keydown",F)}},[Ne]),L.useEffect(()=>{Yt(!1)},[r]);const Ti=an.map(C=>`${C.id}:${C.status}:${C.revision}`).join(`
63
- `);L.useEffect(()=>{const C=Vi.current;C&&(C.scrollTop=C.scrollHeight)},[E.segments,E.drafting,E.activity,r,mt,Ti]);const Fi=L.useMemo(()=>{const C=g.trim().toLowerCase();return o.filter(F=>na(F.sessionId)||ie.has(F.sessionId)?!1:C?[Nn(F),F.cwd??"",T[F.sessionId]??""].join(" ").toLowerCase().includes(C):!0)},[o,g,x,T,ie,Rt]).filter(C=>!C.blank),dn=L.useMemo(()=>{const C=g.trim().toLowerCase();return o.filter(F=>F.blank!==!0||na(F.sessionId)?!1:C?[Nn(F),F.cwd??""].join(" ").toLowerCase().includes(C):!0)},[o,g,x,Rt]),Nt=be||g.trim()!=="",Os=L.useMemo(()=>!r||!at.has(r)?[]:o.flatMap(C=>!at.has(C.sessionId)||C.sessionId===r||ie.has(C.sessionId)||na(C.sessionId)?[]:[{sessionId:C.sessionId,label:Nn(C)}]),[o,at,r,ie,Rt,x]),$n=r&&at.has(r)?qO(ke,Pe):null,fa=$n?`${$n.start}:${$n.query}`:"",rn=$n?LO(Os,$n.query):[],Ai=$n!=null&&ee!==fa,ar=Math.min(z,Math.max(rn.length-1,0));L.useEffect(()=>{q(0)},[fa]);function rr(C,F){const le=new Set(ie);for(const oe of F)le.add(oe);if(Array.isArray(C))for(const oe of C)typeof oe=="string"&&le.add(oe);ve(le),F.includes(r)&&Et("")}async function _s(C){const F=await ct(`/sessions/${encodeURIComponent(C)}/archive`,{method:"POST"});if(F.status!==200){const le=F.body.upstream;p(le?.message||(F.body.error==="not_blank"?n("session.notBlankArchive"):n("session.archiveFailed")));return}p(""),rr(F.body.archivedSessionIds,[C])}async function Bo(){if(dn.length===0||!window.confirm(n("session.archiveConfirm",{count:String(dn.length)})))return;const C=[];let F=[];for(const le of dn){const oe=await ct(`/sessions/${encodeURIComponent(le.sessionId)}/archive`,{method:"POST"});if(oe.status!==200){const Ae=oe.body.upstream;p(Ae?.message||n("session.archiveSomeFailed"));break}C.push(le.sessionId),F=oe.body.archivedSessionIds}C.length>0&&rr(F,C)}async function Fe(C){const F=o.find(Ae=>Ae.sessionId===C),le=x[C]||Zv(F?.cwd)||n("session.blankName");if(!window.confirm(n("session.purgeOneConfirm",{name:le})))return;const oe=await ct(`/sessions/${encodeURIComponent(C)}/purge`,{method:"POST"});if(oe.status!==200){p(oe.body.error==="not_blank"?n("session.purgeNotBlank"):n("session.purgeFailed"));return}f(Ae=>Ae.filter(me=>me.sessionId!==C)),ve(Ae=>{const me=new Set(Ae);return me.delete(C),me}),r===C&&Et("")}async function zs(){const C=dn.filter(oe=>oe.blank===!0);if(C.length===0||!window.confirm(n("session.purgeAllConfirm",{count:String(C.length)})))return;const F=[];for(const oe of C){if((await ct(`/sessions/${encodeURIComponent(oe.sessionId)}/purge`,{method:"POST"})).status!==200){p(n("session.purgeSomeFailed"));break}F.push(oe.sessionId)}if(F.length===0)return;const le=new Set(F);f(oe=>oe.filter(Ae=>!le.has(Ae.sessionId))),ve(oe=>{const Ae=new Set(oe);for(const me of F)Ae.delete(me);return Ae}),le.has(r)&&Et("")}async function da(C,F,le){bt(!1),le!==""&&(Ii(me=>({...me,[C]:le})),An(me=>new Set([...me,C])),k(me=>{const Ge={...me,[C]:le};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(Ge)),Ge}));const Ae=(await ct("/sessions")).body.result;f(Ae?.value?.items??[]),Et(C),Bn(F),qt(me=>me+1)}function zl(C,F){j(C),ht(F),window.requestAnimationFrame(()=>{const le=Yi.current;le&&(le.focus(),le.setSelectionRange(F,F))})}function Un(C){if(!$n)return;const F=DO(ke,Pe,$n.start,C.label,C.sessionId);zl(F.text,F.cursor)}function hn(C="/"){Ee(!1),j(F=>{const le=F.replace(/\s+$/,"");return le===""?C==="/"?"/":`${C} `:`${le} ${C==="/"?"/":`${C} `}`}),window.requestAnimationFrame(()=>Yi.current?.focus())}async function sr(C){const F=he?.status==="accepted"&&E.drafting,le=ca===r?an:[];if(!r||!C||!Z.ready||Ly(F,le,at.has(r)))return;const oe=E.drafting;j(""),Te(""),si.current+=1;const Ae=Number.MAX_SAFE_INTEGER-si.current;M(ft=>({...ft,drafting:!0,segments:[...ft.segments,{kind:"user",id:`optimistic:${Ae}`,text:C,time:Date.now(),seq:Ae,optimistic:!0}]}));const me=await ct("/tasks",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({sessionId:r,text:C})}),Ge=me.body.task;if(_(Ge??null),me.status!==202){M(We=>({...We,drafting:oe?We.drafting:!1,segments:We.segments.filter(et=>!(et.kind==="user"&&et.optimistic&&et.text===C))}));const ft=me.body.execution;Te(ft?.reason||xo(String(me.body.error||""),n("composer.notSent"),n))}}async function qs(){const C=ke.trim();C&&await sr(C)}async function ur(C,F){const le=await cs("/dsh-bot/api/work/supply",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:r,ticketId:C,text:F})});return le.status!==200||le.body.ok===!1?Jv(le.body,n("composer.supplyFailed")):""}async function Rs(){if(!he||he.status!=="accepted")return;const F=(await ct(`/tasks/${he.id}/cancel?sessionId=${encodeURIComponent(he.sessionId??"")}`,{method:"POST"})).body.task??he;_(F),F.status==="cancelled"&&M(le=>({...le,drafting:!1}))}const ql=he?.status==="accepted"&&E.drafting,ha=Ly(ql,ca===r?an:[],Nl),Ms=!!r&&Z.ready&&ke.trim()!==""&&!ha;function pa(C){if(!at.has(C.sessionId))return null;const F=C.running===!0||C.sessionId===r&&(ql||E.drafting),le=C.sessionId===r&&ca===r?an:(kl[C.sessionId]??[]).map(oe=>({status:oe}));return Ow(le,F)}return b.jsxs("div",{className:r?"shell in-chat":"shell",children:[b.jsxs("aside",{className:"side",children:[b.jsxs("div",{className:"side-top",children:[b.jsx("strong",{className:"brand",children:n("app.title")}),b.jsxs("span",{className:"side-actions",children:[b.jsx("button",{type:"button",className:"icon-btn","aria-label":n("session.search"),onClick:()=>S(C=>!C),children:b.jsx(IO,{})}),b.jsx("button",{type:"button",className:"icon-btn","aria-label":n("new.title"),onClick:()=>bt(!0),children:b.jsx(Gv,{})})]})]}),m?b.jsx("input",{className:"filter",value:g,placeholder:n("session.searchPlaceholder"),onChange:C=>y(C.target.value)}):null,h?b.jsx("p",{className:"note",children:h}):null,vn?b.jsx("p",{className:"note ok",children:vn}):null,b.jsxs("ul",{className:"sessions",children:[Fi.length===0&&dn.length===0?b.jsx("li",{className:"empty",children:o.length?n("session.noMatch"):n("session.none")}):null,Fi.map(C=>{const F=Nn(C);return b.jsx("li",{children:b.jsxs("button",{type:"button",className:C.sessionId===r?"session selected":"session",title:C.cwd||C.sessionId,onClick:()=>Et(C.sessionId),children:[b.jsxs("span",{className:at.has(C.sessionId)?"mark bot-mark":"mark",children:[at.has(C.sessionId)?"BOT":Array.from(F)[0],b.jsx(Yv,{signal:pa(C)})]}),b.jsxs("span",{className:"copy",children:[b.jsx("span",{className:"name",children:F}),b.jsx("span",{className:"preview",children:(C.sessionId===r?cd(an,Cn,n):"")||T[C.sessionId]||(C.running?n("session.running"):"")})]})]})},C.sessionId)}),dn.length>0?b.jsxs("li",{className:"blank-head",children:[b.jsxs("button",{type:"button","aria-expanded":Nt,onClick:()=>kt(C=>!C),children:[n(Nt?"session.hide":"session.show")," ",n("session.blankCount",{count:String(dn.length)})]}),b.jsx("button",{type:"button",onClick:()=>{Bo()},children:n("session.archiveAll")}),b.jsx("button",{type:"button",onClick:()=>{zs()},children:n("session.purgeAll")})]}):null,Nt?dn.map(C=>{const F=Nn(C);return b.jsxs("li",{className:"session-row",children:[b.jsxs("button",{type:"button",className:C.sessionId===r?"session selected":"session",title:C.cwd||C.sessionId,onClick:()=>Et(C.sessionId),children:[b.jsx("span",{className:at.has(C.sessionId)?"mark bot-mark":"mark",children:at.has(C.sessionId)?"BOT":Array.from(F)[0]}),b.jsxs("span",{className:"copy",children:[b.jsx("span",{className:"name",children:F}),b.jsx("span",{className:"preview",children:ie.has(C.sessionId)?n("session.archived"):n("session.blank")})]})]}),ie.has(C.sessionId)?null:b.jsx("button",{type:"button",className:"session-delete","aria-label":n("session.archiveLabel",{name:F}),onClick:()=>{_s(C.sessionId)},children:n("session.archive")}),b.jsx("button",{type:"button",className:"session-delete purge","aria-label":n("session.purgeLabel",{name:F}),onClick:()=>{Fe(C.sessionId)},children:n("session.purge")})]},C.sessionId)}):null]}),se?b.jsx(HO,{health:Se,usage:ae,execution:Z,model:E.model}):null,b.jsxs("div",{className:"me-row",children:[b.jsxs("button",{type:"button",className:"me",onClick:()=>ue(C=>!C),children:[b.jsx("span",{className:"mark me-mark",children:n("local.mark")}),b.jsx("span",{children:Se?.primary?.reachable===!1?n("local.down"):n("local.here")})]}),b.jsx("button",{type:"button",className:"lang-switch",onClick:()=>a(l==="en"?"zh":"en"),children:n("lang.switch")})]})]}),b.jsxs("section",{className:"chat",children:[b.jsxs("header",{className:"chat-head",children:[mt?b.jsx("button",{type:"button",className:"bot-chat-back",onClick:()=>Yt(!1),children:n("nav.back")}):na(r)?b.jsx("button",{type:"button",className:"back",onClick:Ei,children:n("nav.back")}):b.jsx("button",{type:"button",className:"back",onClick:()=>u(""),children:n("nav.sessions")}),r&&at.has(r)?b.jsxs("span",{className:"bot-badge",children:["BOT",b.jsx(Yv,{signal:pa({sessionId:r,running:o.find(C=>C.sessionId===r)?.running})})]}):null,b.jsx("h1",{children:mt?n("nav.botMessages"):js}),!mt&&cd(an,Cn,n)?b.jsx("span",{className:"work-chip",children:cd(an,Cn,n)}):null,b.jsx("a",{href:Jn,children:n("nav.official")})]}),na(r)&&!mt?b.jsxs("nav",{className:"work-crumb","aria-label":n("nav.where"),children:[b.jsx("button",{type:"button",onClick:Ei,children:oa&&ir(oa)||n("nav.mainSession")}),b.jsx("span",{"aria-hidden":"true",children:"/"}),b.jsx("span",{children:n("nav.worker")})]}):null,Es&&!mt?b.jsx("p",{className:"basis",children:Es}):null,b.jsxs("div",{className:"chat-body",children:[b.jsx(BO,{active:ki||Cl,progress:Cs}),b.jsx("div",{className:"scroll",ref:Vi,"aria-busy":ki||Cl||void 0,children:b.jsxs("div",{className:"column",children:[r?null:b.jsx("p",{className:"empty-thread",children:n("nav.pick")}),r&&!ki&&!Cl&&!mt&&Qi.length===0&&an.length===0?b.jsx("p",{className:"empty-thread",children:n("nav.empty")}):null,b.jsx(B2,{children:ki?null:mt?b.jsx(F2,{items:As,botLabel:ir,onOpenFile:(C,F)=>X({path:C,line:F})}):b.jsx(f3,{sessionId:r,cwd:o.find(C=>C.sessionId===r)?.cwd,connectionPhase:te?.phase,segments:Qi,approvals:it,questionWaits:we,onCompose:C=>zl(C,C.length),completed:E.completed,failures:E.failures,retries:E.retries,turnEnds:E.turnEnds,tickets:an,now:Cn,canRetry:!!r&&Z.ready&&!ql,onRetry:C=>{sr(C)},onSupply:ur,onOpenSession:ln,onOpenFile:(C,F)=>X({path:C,line:F}),onOpenInbox:()=>Yt(!0),botLabel:ir,chat:Nl})},r)]})}),mt||ki?null:b.jsx(P2,{root:Vi,marks:Ns,busyId:E.drafting&&E.turn!=null?`turn:${E.turn}`:void 0})]}),b.jsx("div",{className:"composer-wrap",hidden:mt,children:b.jsxs("form",{className:"column",onSubmit:C=>{C.preventDefault(),qs()},children:[r&&!ki?b.jsx(gj,{segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:an,connectionPhase:te?.phase,pendingApprovals:it}):null,b.jsxs("div",{className:"card",children:[Ai?b.jsx("div",{className:"mention-menu",role:"listbox","aria-label":n("composer.mention"),children:rn.length===0?b.jsx("p",{className:"mention-empty",children:n("composer.noBot")}):rn.map((C,F)=>b.jsxs("button",{type:"button",role:"option","aria-selected":F===ar,className:F===ar?"active":"",onMouseDown:le=>{le.preventDefault(),Un(C)},children:[b.jsx("span",{className:"bot-badge",children:"BOT"}),b.jsx("span",{className:"mention-name",children:C.label})]},C.sessionId))}):null,b.jsx("textarea",{ref:Yi,value:ke,rows:1,placeholder:r?Jd({segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:an,pendingApprovals:it,t:n})?.text===n("question.waiting")||Jd({segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:an,pendingApprovals:it,t:n})?.text===n("approval.waiting")?n("question.waiting"):_w(an,n)??(Nl&&ql?n("composer.interrupt"):at.has(r)?n("composer.mentionHint"):n("composer.task")):n("composer.pick"),disabled:!r,onChange:C=>{j(C.target.value),ht(C.target.selectionStart??C.target.value.length)},onSelect:C=>ht(C.currentTarget.selectionStart??0),onKeyDown:C=>{if(!C.nativeEvent.isComposing){if(Ai&&rn.length>0){if(C.key==="ArrowDown"){C.preventDefault(),q(F=>(F+1)%rn.length);return}if(C.key==="ArrowUp"){C.preventDefault(),q(F=>(F-1+rn.length)%rn.length);return}if(C.key==="Enter"||C.key==="Tab"){C.preventDefault();const F=rn[ar];F&&Un(F);return}if(C.key==="Escape"){C.preventDefault(),fe(fa);return}}C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),qs())}}}),b.jsxs("div",{className:"card-row",children:[b.jsxs("div",{className:"tools",ref:El,children:[b.jsx("button",{type:"button",className:"add","aria-label":n("composer.add"),"aria-haspopup":"menu","aria-expanded":Ne,disabled:!r,onClick:()=>Ee(C=>!C),children:b.jsx(Gv,{})}),Ne?b.jsxs("div",{className:"plus-menu",role:"menu",children:[b.jsx("button",{type:"button",role:"menuitem",onClick:()=>hn(),children:n("composer.command")}),b.jsx("button",{type:"button",role:"menuitem",onClick:()=>{Ee(!1),de("permission")},children:n("permission.open")}),b.jsx("button",{type:"button",role:"menuitem",onClick:()=>{Ee(!1),de("authorization")},children:n("auth.open")}),pt?b.jsx("button",{type:"button",role:"menuitem",onClick:()=>{Ee(!1),de("cua")},children:n("cua.open")}):null,b.jsx("p",{className:"plus-note",children:n("composer.filesLater")})]}):null,E.preset?b.jsxs("button",{type:"button",className:"chip",onClick:()=>de("permission"),children:[b.jsx(VO,{preset:E.preset}),H0(E.preset,n)]}):null]}),b.jsxs("div",{className:"trailing",children:[E.model?b.jsx("span",{className:"model",children:E.model}):null,ql?b.jsx("button",{type:"button",className:"stop","aria-label":n("composer.cancel"),onClick:()=>{Rs()},children:b.jsx("span",{className:"stop-icon"})}):null,ha?null:b.jsx("button",{type:"submit",className:"send","aria-label":n("composer.send"),disabled:!Ms,children:b.jsx(YO,{})})]})]})]}),b.jsx("p",{className:"stats",children:ge||(Z.ready?UO(E):xo(Z.reason,Z.reason,n))})]})})]}),W==="permission"&&r?b.jsx(yj,{sessionId:r,current:E.preset,onClose:()=>de(null),onChanged:()=>qt(C=>C+1)}):null,W==="authorization"||qe&&W==null?b.jsx(vj,{authorization:wt,catalog:Ht,onClose:()=>de(null)}):null,W==="cua"&&pt?b.jsx(bj,{onClose:()=>de(null)}):null,r&&Vt?b.jsx(Bw,{sessionId:r,path:Vt.path,line:Vt.line,onClose:()=>X(null)}):null,_e?b.jsx(Gw,{onClose:()=>bt(!1),onCreated:(C,F,le)=>{da(C,F,le)}}):null]})}const e1=document.querySelector("#root");if(!e1)throw new Error("missing root");US.createRoot(e1).render(b.jsx(L.StrictMode,{children:b.jsx(bw,{children:b.jsx(v3,{})})}));