@thready-web/dsh-bot-plugin 0.1.0-beta.10 → 0.1.0-beta.12
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.
- package/README.md +19 -2
- package/dist/approvals.js +19 -1
- package/dist/canvas-compose.js +73 -0
- package/dist/canvas-http.js +379 -0
- package/dist/canvas-skills.js +56 -0
- package/dist/canvas-store.js +1015 -0
- package/dist/canvas-tools.js +380 -0
- package/dist/card-log.js +216 -0
- package/dist/context.js +6 -3
- package/dist/deleting.js +54 -0
- package/dist/desk-ledger.js +18 -0
- package/dist/desk.js +30 -5
- package/dist/http-plugin.js +2 -1
- package/dist/http.js +218 -3
- package/dist/inbox.js +24 -2
- package/dist/index.js +75 -12
- package/dist/questions.js +10 -0
- package/dist/runtime-registry.js +20 -0
- package/dist/session-delete-job.js +77 -0
- package/dist/session-files.js +33 -1
- package/dist/session-wipe.js +204 -0
- package/dist/store.js +46 -3
- package/dist/triggers.js +8 -0
- package/dist/work-admit.js +9 -20
- package/dist/work-child.js +27 -10
- package/dist/work-http.js +19 -0
- package/dist/work-ledger.js +5 -1
- package/dist/work-mock.js +10 -0
- package/dist/work-tickets.js +5 -3
- package/dist/work-tools.js +11 -9
- package/dist/work-worker.js +245 -6
- package/dist/worker-handles.js +33 -0
- package/dist/workspace-files.js +98 -17
- package/package.json +2 -1
- package/public/assets/{SourceEditor-BEQaScgR.js → SourceEditor-BjtoMvcX.js} +3 -3
- package/public/assets/{cssMode-gpcjCFFS.js → cssMode--96PQtWh.js} +1 -1
- package/public/assets/{freemarker2-C1qemGIt.js → freemarker2-Bz-HlISL.js} +1 -1
- package/public/assets/{handlebars-sZqIfAlP.js → handlebars-D9ScJ8AM.js} +1 -1
- package/public/assets/{html-Bn1WXB8L.js → html-Czc0jojJ.js} +1 -1
- package/public/assets/{htmlMode-CvQyXnaW.js → htmlMode-CCww5Z1w.js} +1 -1
- package/public/assets/index-DRCgKxWk.css +1 -0
- package/public/assets/index-ztUdW074.js +72 -0
- package/public/assets/{javascript-Ox4Jg12j.js → javascript-B-yRZSiz.js} +1 -1
- package/public/assets/{jsonMode-DMR7R2dQ.js → jsonMode-ASWsY833.js} +1 -1
- package/public/assets/{liquid-B6HxtpBd.js → liquid-BGoox2vJ.js} +1 -1
- package/public/assets/{mdx--jDhmrXq.js → mdx-DHgvnl_U.js} +1 -1
- package/public/assets/{python-YjG50skX.js → python-BJvVD30_.js} +1 -1
- package/public/assets/{razor-CEcFE3UK.js → razor-0PwR35mu.js} +1 -1
- package/public/assets/{tsMode-g4kTQl09.js → tsMode-3ETp8Gdh.js} +1 -1
- package/public/assets/{typescript-CnHeFmPW.js → typescript-BT0iTK6K.js} +1 -1
- package/public/assets/{xml-BFXMY9nb.js → xml-BTaNc_uT.js} +1 -1
- package/public/assets/{yaml-DNm87nSf.js → yaml-Dr7LW3tK.js} +1 -1
- package/public/index.html +2 -2
- package/skills/ui/baseline-ui/SKILL.md +85 -0
- package/skills/ui/bencium-innovative-ux-designer/SKILL.md +227 -0
- package/skills/ui/better-ui/SKILL.md +133 -0
- package/skills/ui/design-lab/SKILL.md +920 -0
- package/skills/ui/frontend-design/SKILL.md +71 -0
- package/skills/ui/impeccable/SKILL.md +93 -0
- package/skills/ui/interface-design/SKILL.md +320 -0
- package/skills/ui/sources.json +66 -0
- package/skills/ui/ui-design/SKILL.md +41 -0
- package/skills/ui/ui-skills-root/SKILL.md +59 -0
- package/skills/ui/visual-design-foundations/SKILL.md +318 -0
- package/skills/ui/web-design-guidelines/SKILL.md +39 -0
- package/public/assets/index-DRNkUrer.css +0 -1
- package/public/assets/index-DhL5Kdlz.js +0 -63
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SourceEditor-BEQaScgR.js","assets/SourceEditor-CJwK846Z.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function r(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(o){if(o.ep)return;o.ep=!0;const u=r(o);fetch(o.href,u)}})();function yv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gd={exports:{}},os={};var Hy;function gS(){if(Hy)return os;Hy=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(a,o,u){var f=null;if(u!==void 0&&(f=""+u),o.key!==void 0&&(f=""+o.key),"key"in o){u={};for(var m in o)m!=="key"&&(u[m]=o[m])}else u=o;return o=u.ref,{$$typeof:t,type:a,key:f,ref:o!==void 0?o:null,props:u}}return os.Fragment=i,os.jsx=r,os.jsxs=r,os}var Iy;function yS(){return Iy||(Iy=1,gd.exports=gS()),gd.exports}var h=yS(),yd={exports:{}},Le={};var Vy;function bS(){if(Vy)return Le;Vy=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),x=Symbol.iterator;function S(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,E={};function M(R,ne,de){this.props=R,this.context=ne,this.refs=E,this.updater=de||T}M.prototype.isReactComponent={},M.prototype.setState=function(R,ne){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,ne,"setState")},M.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function H(){}H.prototype=M.prototype;function te(R,ne,de){this.props=R,this.context=ne,this.refs=E,this.updater=de||T}var ie=te.prototype=new H;ie.constructor=te,N(ie,M.prototype),ie.isPureReactComponent=!0;var O=Array.isArray;function Q(){}var re={H:null,A:null,T:null,S:null},pe=Object.prototype.hasOwnProperty;function z(R,ne,de){var ye=de.ref;return{$$typeof:t,type:R,key:ne,ref:ye!==void 0?ye:null,props:de}}function Z(R,ne){return z(R.type,ne,R.props)}function W(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function je(R){var ne={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(de){return ne[de]})}var qe=/\/+/g;function le(R,ne){return typeof R=="object"&&R!==null&&R.key!=null?je(""+R.key):ne.toString(36)}function G(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(Q,Q):(R.status="pending",R.then(function(ne){R.status==="pending"&&(R.status="fulfilled",R.value=ne)},function(ne){R.status==="pending"&&(R.status="rejected",R.reason=ne)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function ae(R,ne,de,ye,Oe){var Ce=typeof R;(Ce==="undefined"||Ce==="boolean")&&(R=null);var Se=!1;if(R===null)Se=!0;else switch(Ce){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(R.$$typeof){case t:case i:Se=!0;break;case b:return Se=R._init,ae(Se(R._payload),ne,de,ye,Oe)}}if(Se)return Oe=Oe(R),Se=ye===""?"."+le(R,0):ye,O(Oe)?(de="",Se!=null&&(de=Se.replace(qe,"$&/")+"/"),ae(Oe,ne,de,"",function(Ze){return Ze})):Oe!=null&&(W(Oe)&&(Oe=Z(Oe,de+(Oe.key==null||R&&R.key===Oe.key?"":(""+Oe.key).replace(qe,"$&/")+"/")+Se)),ne.push(Oe)),1;Se=0;var $=ye===""?".":ye+":";if(O(R))for(var me=0;me<R.length;me++)ye=R[me],Ce=$+le(ye,me),Se+=ae(ye,ne,de,Ce,Oe);else if(me=S(R),typeof me=="function")for(R=me.call(R),me=0;!(ye=R.next()).done;)ye=ye.value,Ce=$+le(ye,me++),Se+=ae(ye,ne,de,Ce,Oe);else if(Ce==="object"){if(typeof R.then=="function")return ae(G(R),ne,de,ye,Oe);throw ne=String(R),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return Se}function se(R,ne,de){if(R==null)return R;var ye=[],Oe=0;return ae(R,ye,"","",function(Ce){return ne.call(de,Ce,Oe++)}),ye}function Ne(R){if(R._status===-1){var ne=R._result,de=ne();de.then(function(ye){(R._status===0||R._status===-1)&&(R._status=1,R._result=ye,de.status===void 0&&(de.status="fulfilled",de.value=ye))},function(ye){(R._status===0||R._status===-1)&&(R._status=2,R._result=ye,de.status===void 0&&(de.status="rejected",de.reason=ye))}),R._status===-1&&(R._status=0,R._result=de)}if(R._status===1)return R._result.default;throw R._result}var A=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function et(R){var ne=re.T,de={};de.types=ne!==null?ne.types:null,re.T=de;try{var ye=R(),Oe=re.S;Oe!==null&&Oe(de,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&ye.then(Q,A)}catch(Ce){A(Ce)}finally{ne!==null&&de.types!==null&&(ne.types=de.types),re.T=ne}}function ct(R){var ne=re.T;if(ne!==null){var de=ne.types;de===null?ne.types=[R]:de.indexOf(R)===-1&&de.push(R)}else et(ct.bind(null,R))}var q={map:se,forEach:function(R,ne,de){se(R,function(){ne.apply(this,arguments)},de)},count:function(R){var ne=0;return se(R,function(){ne++}),ne},toArray:function(R){return se(R,function(ne){return ne})||[]},only:function(R){if(!W(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Le.Activity=y,Le.Children=q,Le.Component=M,Le.Fragment=r,Le.Profiler=o,Le.PureComponent=te,Le.StrictMode=a,Le.Suspense=p,Le.ViewTransition=w,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=re,Le.__COMPILER_RUNTIME={__proto__:null,c:function(R){return re.H.useMemoCache(R)}},Le.addTransitionType=ct,Le.cache=function(R){return function(){return R.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(R,ne,de){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ye=N({},R.props),Oe=R.key;if(ne!=null)for(Ce in ne.key!==void 0&&(Oe=""+ne.key),ne)!pe.call(ne,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&ne.ref===void 0||(ye[Ce]=ne[Ce]);var Ce=arguments.length-2;if(Ce===1)ye.children=de;else if(1<Ce){for(var Se=Array(Ce),$=0;$<Ce;$++)Se[$]=arguments[$+2];ye.children=Se}return z(R.type,Oe,ye)},Le.createContext=function(R){return R={$$typeof:f,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:u,_context:R},R},Le.createElement=function(R,ne,de){var ye,Oe={},Ce=null;if(ne!=null)for(ye in ne.key!==void 0&&(Ce=""+ne.key),ne)pe.call(ne,ye)&&ye!=="key"&&ye!=="__self"&&ye!=="__source"&&(Oe[ye]=ne[ye]);var Se=arguments.length-2;if(Se===1)Oe.children=de;else if(1<Se){for(var $=Array(Se),me=0;me<Se;me++)$[me]=arguments[me+2];Oe.children=$}if(R&&R.defaultProps)for(ye in Se=R.defaultProps,Se)Oe[ye]===void 0&&(Oe[ye]=Se[ye]);return z(R,Ce,Oe)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(R){return{$$typeof:m,render:R}},Le.isValidElement=W,Le.lazy=function(R){return{$$typeof:b,_payload:{_status:-1,_result:R},_init:Ne}},Le.memo=function(R,ne){return{$$typeof:g,type:R,compare:ne===void 0?null:ne}},Le.startTransition=et,Le.unstable_useCacheRefresh=function(){return re.H.useCacheRefresh()},Le.use=function(R){return re.H.use(R)},Le.useActionState=function(R,ne,de){return re.H.useActionState(R,ne,de)},Le.useCallback=function(R,ne){return re.H.useCallback(R,ne)},Le.useContext=function(R){return re.H.useContext(R)},Le.useDebugValue=function(){},Le.useDeferredValue=function(R,ne){return re.H.useDeferredValue(R,ne)},Le.useEffect=function(R,ne){return re.H.useEffect(R,ne)},Le.useEffectEvent=function(R){return re.H.useEffectEvent(R)},Le.useId=function(){return re.H.useId()},Le.useImperativeHandle=function(R,ne,de){return re.H.useImperativeHandle(R,ne,de)},Le.useInsertionEffect=function(R,ne){return re.H.useInsertionEffect(R,ne)},Le.useLayoutEffect=function(R,ne){return re.H.useLayoutEffect(R,ne)},Le.useMemo=function(R,ne){return re.H.useMemo(R,ne)},Le.useOptimistic=function(R,ne){return re.H.useOptimistic(R,ne)},Le.useReducer=function(R,ne,de){return re.H.useReducer(R,ne,de)},Le.useRef=function(R){return re.H.useRef(R)},Le.useState=function(R){return re.H.useState(R)},Le.useSyncExternalStore=function(R,ne,de){return re.H.useSyncExternalStore(R,ne,de)},Le.useTransition=function(){return re.H.useTransition()},Le.version="19.3.1",Le}var Yy;function pm(){return Yy||(Yy=1,yd.exports=bS()),yd.exports}var C=pm();const KO=yv(C);var bd={exports:{}},us={},vd={exports:{}},xd={};var Gy;function vS(){return Gy||(Gy=1,(function(t){function i(G,ae){var se=G.length;G.push(ae);e:for(;0<se;){var Ne=se-1>>>1,A=G[Ne];if(0<o(A,ae))G[Ne]=ae,G[se]=A,se=Ne;else break e}}function r(G){return G.length===0?null:G[0]}function a(G){if(G.length===0)return null;var ae=G[0],se=G.pop();if(se!==ae){G[0]=se;e:for(var Ne=0,A=G.length,et=A>>>1;Ne<et;){var ct=2*(Ne+1)-1,q=G[ct],R=ct+1,ne=G[R];if(0>o(q,se))R<A&&0>o(ne,q)?(G[Ne]=ne,G[R]=se,Ne=R):(G[Ne]=q,G[ct]=se,Ne=ct);else if(R<A&&0>o(ne,se))G[Ne]=ne,G[R]=se,Ne=R;else break e}}return ae}function o(G,ae){var se=G.sortIndex-ae.sortIndex;return se!==0?se:G.id-ae.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,m=f.now();t.unstable_now=function(){return f.now()-m}}var p=[],g=[],b=1,y=null,w=3,x=!1,S=!1,T=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function te(G){for(var ae=r(g);ae!==null;){if(ae.callback===null)a(g);else if(ae.startTime<=G)a(g),ae.sortIndex=ae.expirationTime,i(p,ae);else break;ae=r(g)}}function ie(G){if(T=!1,te(G),!S)if(r(p)!==null)S=!0,O||(O=!0,W());else{var ae=r(g);ae!==null&&le(ie,ae.startTime-G)}}var O=!1,Q=-1,re=5,pe=-1;function z(){return N?!0:!(t.unstable_now()-pe<re)}function Z(){if(N=!1,O){var G=t.unstable_now();pe=G;var ae=!0;try{e:{S=!1,T&&(T=!1,M(Q),Q=-1),x=!0;var se=w;try{t:{for(te(G),y=r(p);y!==null&&!(y.expirationTime>G&&z());){var Ne=y.callback;if(typeof Ne=="function"){y.callback=null,w=y.priorityLevel;var A=Ne(y.expirationTime<=G);if(G=t.unstable_now(),typeof A=="function"){y.callback=A,te(G),ae=!0;break t}y===r(p)&&a(p),te(G)}else a(p);y=r(p)}if(y!==null)ae=!0;else{var et=r(g);et!==null&&le(ie,et.startTime-G),ae=!1}}break e}finally{y=null,w=se,x=!1}ae=void 0}}finally{ae?W():O=!1}}}var W;if(typeof H=="function")W=function(){H(Z)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,qe=je.port2;je.port1.onmessage=Z,W=function(){qe.postMessage(null)}}else W=function(){E(Z,0)};function le(G,ae){Q=E(function(){G(t.unstable_now())},ae)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(G){G.callback=null},t.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"):re=0<G?Math.floor(1e3/G):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function(G){switch(w){case 1:case 2:case 3:var ae=3;break;default:ae=w}var se=w;w=ae;try{return G()}finally{w=se}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(G,ae){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var se=w;w=G;try{return ae()}finally{w=se}},t.unstable_scheduleCallback=function(G,ae,se){var Ne=t.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?Ne+se:Ne):se=Ne,G){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=se+A,G={id:b++,callback:ae,priorityLevel:G,startTime:se,expirationTime:A,sortIndex:-1},se>Ne?(G.sortIndex=se,i(g,G),r(p)===null&&G===r(g)&&(T?(M(Q),Q=-1):T=!0,le(ie,se-Ne))):(G.sortIndex=A,i(p,G),S||x||(S=!0,O||(O=!0,W()))),G},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(G){var ae=w;return function(){var se=w;w=ae;try{return G.apply(this,arguments)}finally{w=se}}}})(xd)),xd}var Fy;function xS(){return Fy||(Fy=1,vd.exports=vS()),vd.exports}var wd={exports:{}},pn={};var Qy;function wS(){if(Qy)return pn;Qy=1;var t=pm();function i(b){var y="https://react.dev/errors/"+b;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)y+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+b+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal"),u=Symbol.for("react.recoverable"),f=Symbol.for("react.optimistic_key");function m(b,y,w){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:x===f?f:""+x,children:b,containerInfo:y,implementation:w}}var p=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(b,y){if(b==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,pn.browser=function(b){return{$$typeof:u,_reason:b}},pn.createPortal=function(b,y){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(i(299));return m(b,y,null,w)},pn.flushSync=function(b){var y=p.T,w=a.p;try{if(p.T=null,a.p=2,b)return b()}finally{p.T=y,a.p=w,a.d.f()}},pn.preconnect=function(b,y){typeof b=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,a.d.C(b,y))},pn.prefetchDNS=function(b){typeof b=="string"&&a.d.D(b)},pn.preinit=function(b,y){if(typeof b=="string"&&y&&typeof y.as=="string"){var w=y.as,x=g(w,y.crossOrigin),S=typeof y.integrity=="string"?y.integrity:void 0,T=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;w==="style"?a.d.S(b,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:T}):w==="script"&&a.d.X(b,{crossOrigin:x,integrity:S,fetchPriority:T,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},pn.preinitModule=function(b,y){if(typeof b=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var w=g(y.as,y.crossOrigin);a.d.M(b,{crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&a.d.M(b)},pn.preload=function(b,y){if(typeof b=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var w=y.as,x=g(w,y.crossOrigin);a.d.L(b,w,{crossOrigin:x,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},pn.preloadModule=function(b,y){if(typeof b=="string")if(y){var w=g(y.as,y.crossOrigin);a.d.m(b,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else a.d.m(b)},pn.requestFormReset=function(b){a.d.r(b)},pn.unstable_batchedUpdates=function(b,y){return b(y)},pn.useFormState=function(b,y,w){return p.H.useFormState(b,y,w)},pn.useFormStatus=function(){return p.H.useHostTransitionStatus()},pn.version="19.3.1",pn}var Xy;function bv(){if(Xy)return wd.exports;Xy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),wd.exports=wS(),wd.exports}var Zy;function SS(){if(Zy)return us;Zy=1;var t=xS(),i=pm(),r=bv();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){for(var n=e,l=n;l&&!l.alternate;)n=l,(n.flags&4098)!==0&&(e=n.return),l=n.return;for(;n.return;)n=n.return;return n.tag===3?e:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(u(e)!==e)throw Error(a(188))}function g(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(a(188));return n!==e?null:e}for(var l=e,s=n;;){var c=l.return;if(c===null)break;var d=c.alternate;if(d===null){if(s=c.return,s!==null){l=s;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===l)return p(c),e;if(d===s)return p(c),n;d=d.sibling}throw Error(a(188))}if(l.return!==s.return)l=c,s=d;else{for(var v=!1,k=c.child;k;){if(k===l){v=!0,l=c,s=d;break}if(k===s){v=!0,s=c,l=d;break}k=k.sibling}if(!v){for(k=d.child;k;){if(k===l){v=!0,l=d,s=c;break}if(k===s){v=!0,s=d,l=c;break}k=k.sibling}if(!v)throw Error(a(189))}}if(l.alternate!==s)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?e:n}function b(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=b(e),n!==null)return n;e=e.sibling}return null}function y(e,n,l,s,c,d){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&l(e,s,c,d)||(e.tag!==22||e.memoizedState===null)&&(n||e.tag!==5&&e.tag!==27)&&y(e.child,n,l,s,c,d))return!0;e=e.sibling}return!1}function w(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 n=!1;for(e=e.return;e!==null&&(e.tag===4&&(n=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return n}function S(e){var n=[null,null],l=w(e);return l===null||T(n,e,l.child,{foundSelf:!1}),n}function T(e,n,l,s){for(;l!==null;){if(l===n)s.foundSelf=!0;else if(l.tag===5||l.tag===27||l.tag===6){if(s.foundSelf)return e[1]=l,!0;e[0]=l}else if((l.tag!==22||l.memoizedState===null)&&T(e,n,l.child,s))return!0;l=l.sibling}return!1}function N(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var E=null,M=null;function H(e,n,l){return e===l?!0:e===n?(E=e,!0):!1}function te(e,n,l){return e===l?(M=e,!1):e===n?(M!==null&&(E=e),!0):!1}function ie(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,n,l){for(var s=0,c=e;c;c=l(c))s++;c=0;for(var d=n;d;d=l(d))c++;for(;0<s-c;)e=l(e),s--;for(;0<c-s;)n=l(n),c--;for(;s--;){if(e===n||n!==null&&e===n.alternate)return e;e=l(e),n=l(n)}return null}var Q=Object.assign,re=Symbol.for("react.element"),pe=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),je=Symbol.for("react.profiler"),qe=Symbol.for("react.consumer"),le=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),Ne=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),et=Symbol.for("react.activity"),ct=Symbol.for("react.legacy_hidden"),q=Symbol.for("react.memo_cache_sentinel"),R=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),de=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var Oe=Symbol.for("react.client.reference");function Ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case je:return"Profiler";case W:return"StrictMode";case ae:return"Suspense";case se:return"SuspenseList";case et:return"Activity";case R:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case z:return"Portal";case le:return e.displayName||"Context";case qe:return(e._context.displayName||"Context")+".Consumer";case G:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ne:return n=e.displayName||null,n!==null?n:Ce(e.type)||"Memo";case A:n=e._payload,e=e._init;try{return Ce(e(n))}catch{}}return null}var Se=Array.isArray,$=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ze={pending:!1,data:null,method:null,action:null},Ke=[],ke=-1;function $e(e){return{current:e}}function Fe(e){0>ke||(e.current=Ke[ke],Ke[ke]=null,ke--)}function Ue(e,n){ke++,Ke[ke]=e.current,e.current=n}var ze=$e(null),Ye=$e(null),gt=$e(null),fe=$e(null);function De(e,n){switch(Ue(gt,n),Ue(Ye,e),Ue(ze,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Kg(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Kg(n),e=$g(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Fe(ze),Ue(ze,e)}function yt(){Fe(ze),Fe(Ye),Fe(gt)}function bn(e){var n=e.memoizedState;n!==null&&(ea._currentValue=n.memoizedState,Ue(fe,e)),n=ze.current;var l=$g(n,e.type);n!==l&&(Ue(Ye,e),Ue(ze,l))}function Mt(e){Ye.current===e&&(Fe(ze),Fe(Ye)),fe.current===e&&(Fe(fe),ea._currentValue=Ze)}var X,oe;function be(e){if(X===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||"",oe=-1<l.stack.indexOf(`
|
|
3
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
-
`+X+e+oe}var we=!1;function Ge(e,n){if(!e||we)return"";we=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(he){var L=he}Reflect.construct(e,[],ee)}else{try{ee.call()}catch(he){L=he}ee=!1;try{var Y=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ee=!0,new e}finally{ee&&(Y!==void 0?Object.defineProperty(e.prototype,"props",Y):delete e.prototype.props)}}}else{try{throw Error()}catch(he){L=he}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(he){if(he&&L&&typeof he.stack=="string")return[he.stack,L.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],k=d[1];if(v&&k){var _=v.split(`
|
|
5
|
-
`),U=k.split(`
|
|
6
|
-
`);for(c=s=0;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;for(;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;if(s===_.length||c===U.length)for(s=_.length-1,c=U.length-1;1<=s&&0<=c&&_[s]!==U[c];)c--;for(;1<=s&&0<=c;s--,c--)if(_[s]!==U[c]){if(s!==1||c!==1)do if(s--,c--,0>c||_[s]!==U[c]){var F=`
|
|
7
|
-
`+_[s].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=s&&0<=c);break}}}finally{we=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?be(l):""}function ve(e,n){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be("Lazy");case 13:return e.child!==n&&n!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return Ge(e.type,!1);case 11:return Ge(e.type.render,!1);case 1:return Ge(e.type,!0);case 31:return be("Activity");case 30:return be("ViewTransition");default:return""}}function ht(e){try{var n="",l=null;do n+=ve(e,l),l=e,e=e.return;while(e);return n}catch(s){return`
|
|
8
|
-
Error generating stack: `+s.message+`
|
|
9
|
-
`+s.stack}}var Qt=Object.prototype.hasOwnProperty,tn=t.unstable_scheduleCallback,sn=t.unstable_cancelCallback,on=t.unstable_shouldYield,It=t.unstable_requestPaint,xt=t.unstable_now,Ot=t.unstable_getCurrentPriorityLevel,vn=t.unstable_ImmediatePriority,xn=t.unstable_UserBlockingPriority,hi=t.unstable_NormalPriority,Vt=t.unstable_LowPriority,K=t.unstable_IdlePriority,ue=t.log,ft=t.unstable_setDisableYieldValue,Xt=null,bt=null;function Lt(e){if(typeof ue=="function"&&ft(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Xt,e)}catch{}}var Bt=Math.clz32?Math.clz32:mr,dr=Math.log,Ol=Math.LN2;function mr(e){return e>>>=0,e===0?32:31-(dr(e)/Ol|0)|0}var hr=256,_i=262144,_l=4194304;function zi(e){var n=e&42;if(n!==0)return n;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 $i(e,n,l){var s=e.pendingLanes;if(s===0)return 0;var c=0,d=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var k=s&134217727;return k!==0?(s=k&~d,s!==0?c=zi(s):(v&=k,v!==0?c=zi(v):l||(l=k&~e,l!==0&&(c=zi(l))))):(k=s&~d,k!==0?c=zi(k):v!==0?c=zi(v):l||(l=s&~e,l!==0&&(c=zi(l)))),c===0?0:n!==0&&n!==c&&(n&d)===0&&(d=c&-c,l=n&-n,d>=l||d===32&&(l&4194048)!==0)?n:c}function Ri(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function ca(e,n){(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var s=31-Bt(l),c=1<<s;n|=e[s],l&=~c}return n}function fa(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 pr(){var e=_l;return _l<<=1,(_l&62914560)===0&&(_l=4194304),e}function gr(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function pi(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function yr(e,n,l,s,c,d){var v=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var k=e.entanglements,_=e.expirationTimes,U=e.hiddenUpdates;for(l=v&~l;0<l;){var F=31-Bt(l),ee=1<<F;k[F]=0,_[F]=-1;var L=U[F];if(L!==null)for(U[F]=null,F=0;F<L.length;F++){var Y=L[F];Y!==null&&(Y.lane&=-536870913)}l&=~ee}s!==0&&br(e,s,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(v&~n))}function br(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Bt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|l&261930}function da(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var s=31-Bt(l),c=1<<s;c&n|e[s]&n&&(e[s]|=n),l&=~c}}function zl(e,n){var l=n&-n;return l=(l&42)!==0?1:Rl(l),(l&(e.suspendedLanes|n))!==0?0:l}function Rl(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 ni(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function vr(){var e=me.p;return e!==0?e:(e=window.event,e===void 0?32:Ry(e.type))}function Ms(e,n){var l=me.p;try{return me.p=e,n()}finally{me.p=l}}var wn=Math.random().toString(36).slice(2),Wt="__reactFiber$"+wn,nn="__reactProps$"+wn,ii="__reactContainer$"+wn,Ds="__reactEvents$"+wn,Xu="__reactListeners$"+wn,Zu="__reactHandles$"+wn,qi="__reactResources$"+wn,ql="__reactMarker$"+wn,Ml="__reactLoad$"+wn;function Dl(e){delete e[Wt],delete e[nn],delete e[Xu],delete e[Zu]}function Ln(e){var n;if(n=e[Wt])return n;for(var l=e.parentNode;l;){if(n=l[ii]||l[Wt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=my(e);e!==null;){if(l=e[Wt])return l;e=my(e)}return n}e=l,l=e.parentNode}return null}function Yt(e){if(e=e[Wt]||e[ii]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Mi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function Di(e){var n=e[qi];return n||(n=e[qi]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Gt(e){e[ql]=!0}function ma(e){e[Ml]=void 0}var Ls=new Set,Ku={};function gi(e,n){En(e,n),En(e+"Capture",n)}function En(e,n){for(Ku[e]=n,e=0;e<n.length;e++)Ls.add(n[e])}var ha=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]*$"),Bs={},li={};function pa(e){return Qt.call(li,e)?!0:Qt.call(Bs,e)?!1:ha.test(e)?li[e]=!0:(Bs[e]=!0,!1)}var Ve=!1;function ga(){var e=Ve;return Ve=!1,e}function Ji(e,n,l){if(pa(n))if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,l)}}function Pi(e,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,l)}}function Bn(e,n,l,s){if(s===null)e.removeAttribute(l);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(n,l,s)}}function Sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Us(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Hs(e,n,l){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,d=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(v){l=""+v,d.call(this,v)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function ya(e){if(!e._valueTracker){var n=Us(e)?"checked":"value";e._valueTracker=Hs(e,n,""+e[n])}}function Is(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return e&&(s=Us(e)?e.checked?"true":"false":e.value),e=s,e!==l?(n.setValue(e),!0):!1}var $u=/[\n"\\]/g;function An(e){return e.replace($u,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ba(e,n,l,s,c,d,v,k){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),n!=null?v==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Sn(n)):e.value!==""+Sn(n)&&(e.value=""+Sn(n)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),n!=null?v==="number"&&e.value==n?xr(e,Sn(e.value)):xr(e,Sn(n)):l!=null?xr(e,Sn(l)):s!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+Sn(k):e.removeAttribute("name")}function va(e,n,l,s,c,d,v,k){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),n!=null||l!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){ya(e);return}l=l!=null?""+Sn(l):"",n=n!=null?""+Sn(n):l,k||n===e.value||(e.value=n),e.defaultValue=n}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=k?e.checked:!!s,e.defaultChecked=!!s,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),ya(e)}function xr(e,n){e.defaultValue!==""+n&&(e.defaultValue=""+n)}function Wi(e,n,l,s){if(e=e.options,n){n={};for(var c=0;c<l.length;c++)n["$"+l[c]]=!0;for(l=0;l<e.length;l++)c=n.hasOwnProperty("$"+e[l].value),e[l].selected!==c&&(e[l].selected=c),c&&s&&(e[l].defaultSelected=!0)}else{for(l=""+Sn(l),n=null,c=0;c<e.length;c++){if(e[c].value===l){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}n!==null||e[c].disabled||(n=e[c])}n!==null&&(n.selected=!0)}}function xa(e,n,l){if(n!=null&&(n=""+Sn(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+Sn(l):""}function wa(e,n,l,s){if(n==null){if(s!=null){if(l!=null)throw Error(a(92));if(Se(s)){if(1<s.length)throw Error(a(93));s=s[0]}l=s}l==null&&(l=""),n=l}l=Sn(n),e.defaultValue=l,s=e.textContent,s===l&&s!==""&&s!==null&&(e.value=s),ya(e)}function el(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var Ju=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 tl(e,n,l){var s=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,l):typeof l!="number"||l===0||Ju.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function Pu(e,n,l){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,l!=null){for(var s in l)!l.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",Ve=!0);for(var c in n)s=n[c],n.hasOwnProperty(c)&&l[c]!==s&&(tl(e,c,s),Ve=!0)}else for(var d in n)n.hasOwnProperty(d)&&tl(e,d,n[d])}function wr(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 Wu=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"]]),Vs=/^[\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 j(e){return Vs.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function I(){}var J=null;function ge(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _e=null,Te=null;function it(e){var n=Yt(e);if(n&&(e=n.stateNode)){var l=e[nn]||null;e:switch(e=n.stateNode,n.type){case"input":if(ba(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+An(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==e&&s.form===e.form){var c=s[nn]||null;if(!c)throw Error(a(90));ba(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(n=0;n<l.length;n++)s=l[n],s.form===e.form&&Is(s)}break e;case"textarea":xa(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&Wi(e,!!l.multiple,n,!1)}}}var Et=!1;function dt(e,n,l){if(Et)return e(n,l);Et=!0;try{var s=e(n);return s}finally{if(Et=!1,(_e!==null||Te!==null)&&(Yo(),_e&&(n=_e,e=Te,Te=_e=null,it(n),e)))for(n=0;n<e.length;n++)it(e[n])}}function lt(e,n){var l=e.stateNode;if(l===null)return null;var s=l[nn]||null;if(s===null)return null;l=s[n];e:switch(n){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(l&&typeof l!="function")throw Error(a(231,n,typeof l));return l}var ot=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_t=!1;if(ot)try{var jt={};Object.defineProperty(jt,"passive",{get:function(){_t=!0}}),window.addEventListener("test",jt,jt),window.removeEventListener("test",jt,jt)}catch{_t=!1}var un=null,Ll=null,Ys=null;function Fm(){if(Ys)return Ys;var e,n=Ll,l=n.length,s,c="value"in un?un.value:un.textContent,d=c.length;for(e=0;e<l&&n[e]===c[e];e++);var v=l-e;for(s=1;s<=v&&n[l-s]===c[d-s];s++);return Ys=c.slice(e,1<s?1-s:void 0)}function Gs(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Fs(){return!0}function Qm(){return!1}function Tn(e){function n(l,s,c,d,v){this._reactName=l,this._targetInst=c,this.type=s,this.nativeEvent=d,this.target=v,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(l=e[k],this[k]=l?l(d):d[k]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Fs:Qm,this.isPropagationStopped=Qm,this}return Q(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Fs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Fs)},persist:function(){},isPersistent:Fs}),n}var nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qs=Tn(nl),Sa=Q({},nl,{view:0,detail:0}),I1=Tn(Sa),ec,tc,ka,Xs=Q({},Sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ic,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!==ka&&(ka&&e.type==="mousemove"?(ec=e.screenX-ka.screenX,tc=e.screenY-ka.screenY):tc=ec=0,ka=e),ec)},movementY:function(e){return"movementY"in e?e.movementY:tc}}),Xm=Tn(Xs),V1=Q({},Xs,{dataTransfer:0}),Y1=Tn(V1),G1=Q({},Sa,{relatedTarget:0}),nc=Tn(G1),F1=Q({},nl,{animationName:0,elapsedTime:0,pseudoElement:0}),Q1=Tn(F1),X1=Q({},nl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Z1=Tn(X1),K1=Q({},nl,{data:0}),Zm=Tn(K1),$1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J1={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"},P1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=P1[e])?!!n[e]:!1}function ic(){return W1}var e0=Q({},Sa,{key:function(e){if(e.key){var n=$1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Gs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ic,charCode:function(e){return e.type==="keypress"?Gs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),t0=Tn(e0),n0=Q({},Xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Km=Tn(n0),i0=Q({},nl,{submitter:0}),l0=Tn(i0),r0=Q({},Sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ic}),a0=Tn(r0),s0=Q({},nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),o0=Tn(s0),u0=Q({},Xs,{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}),c0=Tn(u0),f0=Q({},nl,{newState:0,oldState:0,source:0}),d0=Tn(f0),m0=[9,13,27,32],lc=ot&&"CompositionEvent"in window,Ea=null;ot&&"documentMode"in document&&(Ea=document.documentMode);var h0=ot&&"TextEvent"in window&&!Ea,$m=ot&&(!lc||Ea&&8<Ea&&11>=Ea),Jm=" ",Pm=!1;function Wm(e,n){switch(e){case"keyup":return m0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sr=!1;function p0(e,n){switch(e){case"compositionend":return eh(n);case"keypress":return n.which!==32?null:(Pm=!0,Jm);case"textInput":return e=n.data,e===Jm&&Pm?null:e;default:return null}}function g0(e,n){if(Sr)return e==="compositionend"||!lc&&Wm(e,n)?(e=Fm(),Ys=Ll=un=null,Sr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return $m&&n.locale!=="ko"?null:n.data;default:return null}}var y0={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 th(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!y0[e.type]:n==="textarea"}function nh(e,n,l,s){_e?Te?Te.push(s):Te=[s]:_e=s,n=Ko(n,"onChange"),0<n.length&&(l=new Qs("onChange","change",null,l,s),e.push({event:l,listeners:n}))}var Ta=null,ja=null;function b0(e){Yg(e,0)}function Zs(e){var n=Mi(e);if(Is(n))return e}function ih(e,n){if(e==="change")return n}var lh=!1;if(ot){var rc;if(ot){var ac="oninput"in document;if(!ac){var rh=document.createElement("div");rh.setAttribute("oninput","return;"),ac=typeof rh.oninput=="function"}rc=ac}else rc=!1;lh=rc&&(!document.documentMode||9<document.documentMode)}function ah(){Ta&&(Ta.detachEvent("onpropertychange",sh),ja=Ta=null)}function sh(e){if(e.propertyName==="value"&&Zs(ja)){var n=[];nh(n,ja,e,ge(e)),dt(b0,n)}}function v0(e,n,l){e==="focusin"?(ah(),Ta=n,ja=l,Ta.attachEvent("onpropertychange",sh)):e==="focusout"&&ah()}function x0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zs(ja)}function w0(e,n){if(e==="click")return Zs(n)}function S0(e,n){if(e==="input"||e==="change")return Zs(n)}function k0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Un=typeof Object.is=="function"?Object.is:k0;function Ca(e,n){if(Un(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var l=Object.keys(e),s=Object.keys(n);if(l.length!==s.length)return!1;for(s=0;s<l.length;s++){var c=l[s];if(!Qt.call(n,c)||!Un(e[c],n[c]))return!1}return!0}function sc(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 oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uh(e,n){var l=oh(e);e=0;for(var s;l;){if(l.nodeType===3){if(s=e+l.textContent.length,e<=n&&s>=n)return{node:l,offset:n-e};e=s}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=oh(l)}}function ch(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ch(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function fh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=sc(e.document);n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=sc(e.document)}return n}function oc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var E0=ot&&"documentMode"in document&&11>=document.documentMode,kr=null,uc=null,Na=null,cc=!1;function dh(e,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;cc||kr==null||kr!==sc(s)||(s=kr,"selectionStart"in s&&oc(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}),Na&&Ca(Na,s)||(Na=s,s=Ko(uc,"onSelect"),0<s.length&&(n=new Qs("onSelect","select",null,n,l),e.push({event:n,listeners:s}),n.target=kr)))}function Bl(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Er={animationend:Bl("Animation","AnimationEnd"),animationiteration:Bl("Animation","AnimationIteration"),animationstart:Bl("Animation","AnimationStart"),transitionrun:Bl("Transition","TransitionRun"),transitionstart:Bl("Transition","TransitionStart"),transitioncancel:Bl("Transition","TransitionCancel"),transitionend:Bl("Transition","TransitionEnd")},fc={},mh={};ot&&(mh=document.createElement("div").style,"AnimationEvent"in window||(delete Er.animationend.animation,delete Er.animationiteration.animation,delete Er.animationstart.animation),"TransitionEvent"in window||delete Er.transitionend.transition);function Ul(e){if(fc[e])return fc[e];if(!Er[e])return e;var n=Er[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in mh)return fc[e]=n[l];return e}var hh=Ul("animationend"),ph=Ul("animationiteration"),gh=Ul("animationstart"),T0=Ul("transitionrun"),j0=Ul("transitionstart"),C0=Ul("transitioncancel"),yh=Ul("transitionend"),bh=new Map,dc="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(" ");dc.push("scrollEnd");function ri(e,n){bh.set(e,n),gi(n,[e])}var N0=0;function Li(e,n){if(e.name!=null&&e.name!=="auto")return e.name;if(n.autoName!==null)return n.autoName;e=ui.identifierPrefix;var l=N0++;return e="_"+e+"t_"+l.toString(32)+"_",n.autoName=e}function vh(e){if(e==null||typeof e=="string")return e;var n=null,l=Gr;if(l!==null)for(var s=0;s<l.length;s++){var c=e[l[s]];if(c!=null){if(c==="none")return"none";n=n==null?c:n+(" "+c)}}return n??e.default}function Bi(e,n){return e=vh(e),n=vh(n),n==null?e==="auto"?null:e:n==="auto"?null:n}var Ks=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Xn=[],Tr=0,mc=0;function $s(){for(var e=Tr,n=mc=Tr=0;n<e;){var l=Xn[n];Xn[n++]=null;var s=Xn[n];Xn[n++]=null;var c=Xn[n];Xn[n++]=null;var d=Xn[n];if(Xn[n++]=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&&xh(l,c,d)}}function Js(e,n,l,s){Xn[Tr++]=e,Xn[Tr++]=n,Xn[Tr++]=l,Xn[Tr++]=s,mc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function hc(e,n,l,s){return Js(e,n,l,s),Ps(e)}function Hl(e,n){return Js(e,null,null,n),Ps(e)}function xh(e,n,l){e.lanes|=l;var s=e.alternate;s!==null&&(s.lanes|=l);for(var c=!1,d=e.return;d!==null;)d.childLanes|=l,s=d.alternate,s!==null&&(s.childLanes|=l),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&&n!==null&&(c=31-Bt(l),e=d.hiddenUpdates,s=e[c],s===null?e[c]=[n]:s.push(n),n.lane=l|536870912),d):null}function Ps(e){if(50<$a)throw $a=0,Vo=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var jr={};function A0(e,n,l,s){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,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 On(e,n,l,s){return new A0(e,n,l,s)}function pc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ui(e,n){var l=e.alternate;return l===null?(l=On(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&1206910976,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function wh(e,n){e.flags&=1206910978;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,n=l.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Ws(e,n,l,s,c,d){var v=0;if(s=e,typeof s=="function")pc(s)&&(v=1);else if(typeof s=="string")v=iS(e,l,ze.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case et:return e=On(31,l,n,c),e.elementType=et,e.lanes=d,e;case Z:return Il(l.children,c,d,n);case W:v=8,c|=24;break;case je:return e=On(12,l,n,c|2),e.elementType=je,e.lanes=d,e;case ae:return e=On(13,l,n,c),e.elementType=ae,e.lanes=d,e;case se:return e=On(19,l,n,c),e.elementType=se,e.lanes=d,e;case ct:case R:return e=c|32,e=On(30,l,n,e),e.elementType=R,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 le:v=10;break e;case qe:v=9;break e;case G:v=11;break e;case Ne:v=14;break e;case A:v=16,s=null;break e}v=29,l=Error(a(130,e===null?"null":typeof e,"")),s=null}return n=On(v,l,n,c),n.elementType=e,n.type=s,n.lanes=d,n}function Il(e,n,l,s){return e=On(7,e,s,n),e.lanes=l,e}function gc(e,n,l){return e=On(6,e,null,n),e.lanes=l,e}function Sh(e){var n=On(18,null,null,0);return n.stateNode=e,n}function yc(e,n,l){return n=On(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var kh=new WeakMap;function Zn(e,n){if(typeof e=="object"&&e!==null){var l=kh.get(e);return l!==void 0?l:(n={value:e,source:n,stack:ht(n)},kh.set(e,n),n)}return{value:e,source:n,stack:ht(n)}}var Cr=[],Nr=0,eo=null,Aa=0,Kn=[],$n=0,il=null,yi=1,bi="";function Hi(e,n){Cr[Nr++]=Aa,Cr[Nr++]=eo,eo=e,Aa=n}function Eh(e,n,l){Kn[$n++]=yi,Kn[$n++]=bi,Kn[$n++]=il,il=e;var s=yi;e=bi;var c=32-Bt(s)-1;s&=~(1<<c),l+=1;var d=32-Bt(n)+c;if(30<d){var v=c-c%5;d=(s&(1<<v)-1).toString(32),s>>=v,c-=v,yi=1<<32-Bt(n)+c|l<<c|s,bi=d+e}else yi=1<<d|l<<c|s,bi=e}function to(e){e.return!==null&&(Hi(e,1),Eh(e,1,0))}function bc(e){for(;e===eo;)eo=Cr[--Nr],Cr[Nr]=null,Aa=Cr[--Nr],Cr[Nr]=null;for(;e===il;)il=Kn[--$n],Kn[$n]=null,bi=Kn[--$n],Kn[$n]=null,yi=Kn[--$n],Kn[$n]=null}function Th(e,n){Kn[$n++]=yi,Kn[$n++]=bi,Kn[$n++]=il,yi=n.id,bi=n.overflow,il=e}var ln=null,zt=null,Qe=!1,ll=null,Jn=!1,vc=Error(a(519));function rl(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Oa(Zn(n,e)),vc}function jh(e){var n=e.stateNode,l=e.type,s=e.memoizedProps;switch(n[Wt]=e,n[nn]=s,l){case"dialog":Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":case"embed":Pe("load",n);break;case"video":case"audio":for(l=0;l<Pa.length;l++)Pe(Pa[l],n);break;case"source":Pe("error",n);break;case"img":case"image":case"link":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"input":Pe("invalid",n),va(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Pe("invalid",n);break;case"textarea":Pe("invalid",n),wa(n,s.value,s.defaultValue,s.children)}l=s.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||s.suppressHydrationWarning===!0||Xg(n.textContent,l)?(s.popover!=null&&(Pe("beforetoggle",n),Pe("toggle",n)),s.onScroll!=null&&Pe("scroll",n),s.onScrollEnd!=null&&Pe("scrollend",n),s.onClick!=null&&(n.onclick=I),n=!0):n=!1,n||rl(e,!0)}function no(e){for(ln=e.return;ln;)switch(ln.tag){case 5:case 31:case 13:Jn=!1;return;case 27:case 3:Jn=!0;return;default:ln=ln.return}}function Ar(e){if(e!==ln)return!1;if(!Qe)return no(e),Qe=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||$f(e.type,e.memoizedProps)),l=!l),l&&zt&&rl(e),no(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));zt=dy(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));zt=dy(e)}else n===27?(n=zt,wl(e.type)?(e=rd,rd=null,zt=e):zt=n):zt=ln?Wn(e.stateNode.nextSibling):null;return!0}function Vl(){zt=ln=null,Qe=!1}function xc(){var e=ll;return e!==null&&(Rn===null?Rn=e:Rn.push.apply(Rn,e),ll=null),e}function Oa(e){ll===null?ll=[e]:ll.push(e)}var wc=$e(null),Yl=null,Ii=null;function al(e,n,l){Ue(wc,n._currentValue),n._currentValue=l}function Vi(e){e._currentValue=wc.current,Fe(wc)}function io(e,n,l){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===l)break;e=e.return}}function Sc(e,n,l,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 k=d;d=c;for(var _=0;_<n.length;_++)if(k.context===n[_]){d.lanes|=l,k=d.alternate,k!==null&&(k.lanes|=l),io(d.return,l,e),s||(v=null);break e}d=k.next}}else if(c.tag===18){if(v=c.return,v===null)throw Error(a(341));v.lanes|=l,d=v.alternate,d!==null&&(d.lanes|=l),io(v,l,e),v=null}else c.tag===13&&c.memoizedState!==null&&c.memoizedState.dehydrated===null?(c.lanes|=l,v=c.alternate,v!==null&&(v.lanes|=l),io(c.return,l,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 Gl(e,n,l,s){e=null;for(var c=n,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(a(387));if(v=v.memoizedProps,v!==null){var k=c.type;Un(c.pendingProps.value,v.value)||(e!==null?e.push(k):e=[k])}}else if(c===fe.current){if(v=c.alternate,v===null)throw Error(a(387));v.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ea):e=[ea])}c=c.return}return e!==null&&Sc(n,e,l,s),n.flags|=262144,e!==null}function lo(e){for(e=e.firstContext;e!==null;){if(!Un(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fl(e){Yl=e,Ii=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function cn(e){return Ch(Yl,e)}function ro(e,n){return Yl===null&&Fl(e),Ch(e,n)}function Ch(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Ii===null){if(e===null)throw Error(a(308));Ii=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Ii=Ii.next=n;return l}var O0=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(l,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(l){return l()})}},_0=t.unstable_scheduleCallback,z0=t.unstable_NormalPriority,Zt={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kc(){return{controller:new O0,data:new Map,refCount:0}}function _a(e){e.refCount--,e.refCount===0&&_0(z0,function(){e.controller.abort()})}function Nh(e,n){if((e.pendingLanes&4194048)!==0){var l=e.transitionTypes;for(l===null&&(l=e.transitionTypes=[]),e=0;e<n.length;e++){var s=n[e];l.indexOf(s)===-1&&l.push(s)}}}var za=null;function R0(e){var n=e.transitionTypes;return e.transitionTypes=null,n}var Ra=null,Ec=0,Ql=0,Or=null;function q0(e,n){if(Ra===null){var l=Ra=[];Ec=0,Ql=If(),Or={status:"pending",value:void 0,then:function(s){l.push(s)}}}return Ec++,n.then(Ah,Ah),n}function Ah(){if(--Ec===0&&(za=null,Ra!==null)){Or!==null&&(Or.status="fulfilled");var e=Ra;Ra=null,Ql=0,Or=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function M0(e,n){var l=[],s={status:"pending",value:null,reason:null,then:function(c){l.push(c)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var c=0;c<l.length;c++)(0,l[c])(n)},function(c){for(s.status="rejected",s.reason=c,c=0;c<l.length;c++)(0,l[c])(void 0)}),s}var Oh=$.S;$.S=function(e,n){if(Sg=xt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&q0(e,n),za!==null)for(var l=Zr;l!==null;)Nh(l,za),l=l.next;if(l=e.types,l!==null){for(var s=Zr;s!==null;)Nh(s,l),s=s.next;if(Ql!==0){s=za,s===null&&(s=za=[]);for(var c=0;c<l.length;c++){var d=l[c];s.indexOf(d)===-1&&s.push(d)}}}Oh!==null&&Oh(e,n)};var Xl=$e(null);function Tc(){var e=Xl.current;return e!==null?e:Ct.pooledCache}function ao(e,n){n===null?Ue(Xl,Xl.current):Ue(Xl,n.pool)}function _h(){var e=Tc();return e===null?null:{parent:Zt._currentValue,pool:e}}var _r=Error(a(460)),jc=Error(a(474)),so=Error(a(542)),oo={then:function(){}};function zh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Rh(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then(I,I),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Mh(e),e===void 0&&!("reason"in n)?Error(a(600)):e;default:if(typeof n.status=="string")n.then(I,I);else{if(e=Ct,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var c=n;c.status="fulfilled",c.value=s}},function(s){if(n.status==="pending"){var c=n;c.status="rejected",c.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Mh(e),e}throw Kl=n,_r}}function Zl(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Kl=l,_r):l}}var Kl=null;function qh(){if(Kl===null)throw Error(a(459));var e=Kl;return Kl=null,e}function Mh(e){if(e===_r||e===so)throw Error(a(483))}var zr=null,qa=0;function uo(e){var n=qa;return qa+=1,zr===null&&(zr=[]),Rh(zr,e,n)}function sl(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function co(e,n){throw n.$$typeof===re?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Dh(e){function n(B,D){if(e){var V=B.deletions;V===null?(B.deletions=[D],B.flags|=16):V.push(D)}}function l(B,D){if(!e)return null;for(;D!==null;)n(B,D),D=D.sibling;return null}function s(B){for(var D=new Map;B!==null;)B.key===null?D.set(B.index,B):D.set(B.key,B),B=B.sibling;return D}function c(B,D){return B=Ui(B,D),B.index=0,B.sibling=null,B}function d(B,D,V){return B.index=V,e?(V=B.alternate,V!==null?(V=V.index,V<D?(B.flags|=2,D):V):(B.flags|=134217730,D)):(B.flags|=1048576,D)}function v(B){return e&&B.alternate===null&&(B.flags|=134217730),B}function k(B,D,V,P){return D===null||D.tag!==6?(D=gc(V,B.mode,P),D.return=B,D):(D=c(D,V),D.return=B,D)}function _(B,D,V,P){var xe=V.type;return xe===Z?(B=F(B,D,V.props.children,P,V.key),sl(B,V),B):D!==null&&(D.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===A&&Zl(xe)===D.type)?(D=c(D,V.props),sl(D,V),D.return=B,D):(D=Ws(V.type,V.key,V.props,null,B.mode,P),sl(D,V),D.return=B,D)}function U(B,D,V,P){return D===null||D.tag!==4||D.stateNode.containerInfo!==V.containerInfo||D.stateNode.implementation!==V.implementation?(D=yc(V,B.mode,P),D.return=B,D):(D=c(D,V.children||[]),D.return=B,D)}function F(B,D,V,P,xe){return D===null||D.tag!==7?(D=Il(V,B.mode,P,xe),D.return=B,D):(D=c(D,V),D.return=B,D)}function ee(B,D,V){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=gc(""+D,B.mode,V),D.return=B,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case pe:return V=Ws(D.type,D.key,D.props,null,B.mode,V),sl(V,D),V.return=B,V;case z:return D=yc(D,B.mode,V),D.return=B,D;case A:return D=Zl(D),ee(B,D,V)}if(Se(D)||ye(D))return D=Il(D,B.mode,V,null),D.return=B,D;if(typeof D.then=="function")return ee(B,uo(D),V);if(D.$$typeof===le)return ee(B,ro(B,D),V);co(B,D)}return null}function L(B,D,V,P){var xe=D!==null?D.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return xe!==null?null:k(B,D,""+V,P);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case pe:return V.key===xe?_(B,D,V,P):null;case z:return V.key===xe?U(B,D,V,P):null;case A:return V=Zl(V),L(B,D,V,P)}if(Se(V)||ye(V))return xe!==null?null:F(B,D,V,P,null);if(typeof V.then=="function")return L(B,D,uo(V),P);if(V.$$typeof===le)return L(B,D,ro(B,V),P);co(B,V)}return null}function Y(B,D,V,P,xe){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return B=B.get(V)||null,k(D,B,""+P,xe);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case pe:return B=B.get(P.key===null?V:P.key)||null,_(D,B,P,xe);case z:return B=B.get(P.key===null?V:P.key)||null,U(D,B,P,xe);case A:return P=Zl(P),Y(B,D,V,P,xe)}if(Se(P)||ye(P))return B=B.get(V)||null,F(D,B,P,xe,null);if(typeof P.then=="function")return Y(B,D,V,uo(P),xe);if(P.$$typeof===le)return Y(B,D,V,ro(D,P),xe);co(D,P)}return null}function he(B,D,V,P){for(var xe=null,nt=null,Ae=D,Me=D=0,Jt=null;Ae!==null&&Me<V.length;Me++){Ae.index>Me?(Jt=Ae,Ae=null):Jt=Ae.sibling;var ut=L(B,Ae,V[Me],P);if(ut===null){Ae===null&&(Ae=Jt);break}e&&Ae&&ut.alternate===null&&n(B,Ae),D=d(ut,D,Me),nt===null?xe=ut:nt.sibling=ut,nt=ut,Ae=Jt}if(Me===V.length)return l(B,Ae),Qe&&Hi(B,Me),xe;if(Ae===null){for(;Me<V.length;Me++)Ae=ee(B,V[Me],P),Ae!==null&&(D=d(Ae,D,Me),nt===null?xe=Ae:nt.sibling=Ae,nt=Ae);return Qe&&Hi(B,Me),xe}for(Ae=s(Ae);Me<V.length;Me++)Jt=Y(Ae,B,Me,V[Me],P),Jt!==null&&(e&&(ut=Jt.alternate,ut!==null&&Ae.delete(ut.key===null?Me:ut.key)),D=d(Jt,D,Me),nt===null?xe=Jt:nt.sibling=Jt,nt=Jt);return e&&Ae.forEach(function(jl){return n(B,jl)}),Qe&&Hi(B,Me),xe}function Ee(B,D,V,P){if(V==null)throw Error(a(151));for(var xe=null,nt=null,Ae=D,Me=D=0,Jt=null,ut=V.next();Ae!==null&&!ut.done;Me++,ut=V.next()){Ae.index>Me?(Jt=Ae,Ae=null):Jt=Ae.sibling;var jl=L(B,Ae,ut.value,P);if(jl===null){Ae===null&&(Ae=Jt);break}e&&Ae&&jl.alternate===null&&n(B,Ae),D=d(jl,D,Me),nt===null?xe=jl:nt.sibling=jl,nt=jl,Ae=Jt}if(ut.done)return l(B,Ae),Qe&&Hi(B,Me),xe;if(Ae===null){for(;!ut.done;Me++,ut=V.next())ut=ee(B,ut.value,P),ut!==null&&(D=d(ut,D,Me),nt===null?xe=ut:nt.sibling=ut,nt=ut);return Qe&&Hi(B,Me),xe}for(Ae=s(Ae);!ut.done;Me++,ut=V.next())ut=Y(Ae,B,Me,ut.value,P),ut!==null&&(e&&(Jt=ut.alternate,Jt!==null&&Ae.delete(Jt.key===null?Me:Jt.key)),D=d(ut,D,Me),nt===null?xe=ut:nt.sibling=ut,nt=ut);return e&&Ae.forEach(function(pS){return n(B,pS)}),Qe&&Hi(B,Me),xe}function Ie(B,D,V,P){if(typeof V=="object"&&V!==null&&V.type===Z&&V.key===null&&V.props.ref===void 0&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case pe:e:{for(var xe=V.key;D!==null;){if(D.key===xe){if(xe=V.type,xe===Z){if(D.tag===7){l(B,D.sibling),P=c(D,V.props.children),sl(P,V),P.return=B,B=P;break e}}else if(D.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===A&&Zl(xe)===D.type){l(B,D.sibling),P=c(D,V.props),sl(P,V),P.return=B,B=P;break e}l(B,D);break}else n(B,D);D=D.sibling}V.type===Z?(P=Il(V.props.children,B.mode,P,V.key),sl(P,V),P.return=B,B=P):(P=Ws(V.type,V.key,V.props,null,B.mode,P),sl(P,V),P.return=B,B=P)}return v(B);case z:e:{for(xe=V.key;D!==null;){if(D.key===xe)if(D.tag===4&&D.stateNode.containerInfo===V.containerInfo&&D.stateNode.implementation===V.implementation){l(B,D.sibling),P=c(D,V.children||[]),P.return=B,B=P;break e}else{l(B,D);break}else n(B,D);D=D.sibling}P=yc(V,B.mode,P),P.return=B,B=P}return v(B);case A:return V=Zl(V),Ie(B,D,V,P)}if(Se(V))return he(B,D,V,P);if(ye(V)){if(xe=ye(V),typeof xe!="function")throw Error(a(150));return V=xe.call(V),Ee(B,D,V,P)}if(typeof V.then=="function")return Ie(B,D,uo(V),P);if(V.$$typeof===le)return Ie(B,D,ro(B,V),P);co(B,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,D!==null&&D.tag===6?(l(B,D.sibling),P=c(D,V),P.return=B,B=P):(l(B,D),P=gc(V,B.mode,P),P.return=B,B=P),v(B)):l(B,D)}return function(B,D,V,P){try{qa=0;var xe=Ie(B,D,V,P);return zr=null,xe}catch(Ae){if(Ae===_r||Ae===so)throw Ae;var nt=On(29,Ae,null,B.mode);return nt.lanes=P,nt.return=B,nt}}}var $l=Dh(!0),Lh=Dh(!1),ol=!1;function Cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nc(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ul(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function cl(e,n,l){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(pt&2)!==0){var c=s.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),s.pending=n,n=Ps(e),xh(e,null,l),n}return Js(e,s,n,l),Ps(e)}function Ma(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,da(e,l)}}function Ac(e,n){var l=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,l===s)){var c=null,d=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};d===null?c=d=v:d=d.next=v,l=l.next}while(l!==null);d===null?c=d=n:d=d.next=n}else c=d=n;l={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}var Oc=!1;function Da(){if(Oc){var e=Or;if(e!==null)throw e}}function La(e,n,l,s){Oc=!1;var c=e.updateQueue;ol=!1;var d=c.firstBaseUpdate,v=c.lastBaseUpdate,k=c.shared.pending;if(k!==null){c.shared.pending=null;var _=k,U=_.next;_.next=null,v===null?d=U:v.next=U,v=_;var F=e.alternate;F!==null&&(F=F.updateQueue,k=F.lastBaseUpdate,k!==v&&(k===null?F.firstBaseUpdate=U:k.next=U,F.lastBaseUpdate=_))}if(d!==null){var ee=c.baseState;v=0,F=U=_=null,k=d;do{var L=k.lane&-536870913,Y=L!==k.lane;if(Y?(tt&L)===L:(s&L)===L){L!==0&&L===Ql&&(Oc=!0),F!==null&&(F=F.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var he=e,Ee=k;L=n;var Ie=l;switch(Ee.tag){case 1:if(he=Ee.payload,typeof he=="function"){ee=he.call(Ie,ee,L);break e}ee=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Ee.payload,L=typeof he=="function"?he.call(Ie,ee,L):he,L==null)break e;ee=Q({},ee,L);break e;case 2:ol=!0}}L=k.callback,L!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=c.callbacks,Y===null?c.callbacks=[L]:Y.push(L))}else Y={lane:L,tag:k.tag,payload:k.payload,callback:k.callback,next:null},F===null?(U=F=Y,_=ee):F=F.next=Y,v|=L;if(k=k.next,k===null){if(k=c.shared.pending,k===null)break;Y=k,k=Y.next,Y.next=null,c.lastBaseUpdate=Y,c.shared.pending=null}}while(!0);F===null&&(_=ee),c.baseState=_,c.firstBaseUpdate=U,c.lastBaseUpdate=F,d===null&&(c.shared.lanes=0),yl|=v,e.lanes=v,e.memoizedState=ee}}function Bh(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function Uh(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Bh(l[e],n)}var fl=$e(null),fo=$e(0);function Hh(e,n){e=Xi,Ue(fo,e),Ue(fl,n),Xi=e|n.baseLanes}function _c(){Ue(fo,Xi),Ue(fl,fl.current)}function zc(){Xi=fo.current,Fe(fl),Fe(fo)}var fn=$e(null),kn=null;function dl(e){var n=e.alternate;Ue(dn,dn.current&1),Ue(fn,e),kn===null&&(n===null||fl.current!==null||n.memoizedState!==null)&&(kn=e)}function Rc(e){Ue(dn,dn.current),Ue(fn,e),kn===null&&(kn=e)}function Ih(e){e.tag===22?(Ue(dn,dn.current),Ue(fn,e),kn===null&&(kn=e)):ml()}function ml(){Ue(dn,dn.current),Ue(fn,fn.current)}function Hn(e){Fe(fn),kn===e&&(kn=null),Fe(dn)}var dn=$e(0);function Ba(e,n){Ue(fn,fn.current),Ue(dn,n)}function qc(e){Fe(dn),Fe(fn),kn===e&&(kn=null)}function mo(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||id(l)||ld(l)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!=="independent"){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Yi=0,He=null,Tt=null,Kt=null,ho=!1,Rr=!1,Jl=!1,po=0,Ua=0,qr=null,D0=0;function Ut(){throw Error(a(321))}function Mc(e,n){if(n===null)return!1;for(var l=0;l<n.length&&l<e.length;l++)if(!Un(e[l],n[l]))return!1;return!0}function Dc(e,n,l,s,c,d){return Yi=d,He=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,$.H=e===null||e.memoizedState===null?Ep:Tp,Jl=!1,d=l(s,c),Jl=!1,Rr&&(d=Yh(n,l,s,c)),Vh(e),d}function Vh(e){$.H=So;var n=Tt!==null&&Tt.next!==null;if(Yi=0,Kt=Tt=He=null,ho=!1,Ua=0,qr=null,n)throw Error(a(300));e===null||$t||(e=e.dependencies,e!==null&&lo(e)&&($t=!0))}function Yh(e,n,l,s){He=e;var c=0;do{if(Rr&&(qr=null),Ua=0,Rr=!1,25<=c)throw Error(a(301));if(c+=1,Kt=Tt=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}$.H=G0,d=n(l,s)}while(Rr);return d}function L0(){var e=$.H,n=e.useState()[0];return n=typeof n.then=="function"?Ha(n):n,e=e.useState()[0],(Tt!==null?Tt.memoizedState:null)!==e&&(He.flags|=1024),n}function Lc(){var e=po!==0;return po=0,e}function Bc(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function Uc(e){if(ho){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}ho=!1}Yi=0,Kt=Tt=He=null,Rr=!1,Ua=po=0,qr=null}function jn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?He.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Ft(){if(Tt===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var n=Kt===null?He.memoizedState:Kt.next;if(n!==null)Kt=n,Tt=e;else{if(e===null)throw He.alternate===null?Error(a(467)):Error(a(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Kt===null?He.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function go(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ha(e){var n=Ua;return Ua+=1,qr===null&&(qr=[]),e=Rh(qr,e,n),n=He,(Kt===null?n.memoizedState:Kt.next)===null&&(n=n.alternate,$.H=n===null||n.memoizedState===null?Ep:Tp),e}function yo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ha(e);if(e.$$typeof===ne)return;if(e.$$typeof===le)return cn(e)}throw Error(a(438,String(e)))}function Hc(e){var n=null,l=He.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var s=He.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(c){return c.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=go(),He.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(e),s=0;s<e;s++)l[s]=q;return n.index++,l}function Gi(e,n){return typeof n=="function"?n(e):n}function bo(e){var n=Ft();return Ic(n,Tt,e)}function Ic(e,n,l){var s=e.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=l;var c=e.baseQueue,d=s.pending;if(d!==null){if(c!==null){var v=c.next;c.next=d.next,d.next=v}n.baseQueue=c=d,s.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{n=c.next;var k=v=null,_=null,U=n,F=!1;do{var ee=U.lane&-536870913;if(ee!==U.lane?(tt&ee)===ee:(Yi&ee)===ee){var L=U.revertLane;if(L===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),ee===Ql&&(F=!0);else if((Yi&L)===L){U=U.next,L===Ql&&(F=!0);continue}else ee={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},_===null?(k=_=ee,v=d):_=_.next=ee,He.lanes|=L,yl|=L;ee=U.action,Jl&&l(d,ee),d=U.hasEagerState?U.eagerState:l(d,ee)}else L={lane:ee,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},_===null?(k=_=L,v=d):_=_.next=L,He.lanes|=ee,yl|=ee;U=U.next}while(U!==null&&U!==n);if(_===null?v=d:_.next=k,!Un(d,e.memoizedState)&&($t=!0,F&&(l=Or,l!==null)))throw l;e.memoizedState=d,e.baseState=v,e.baseQueue=_,s.lastRenderedState=d}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Vc(e){var n=Ft(),l=n.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=e;var s=l.dispatch,c=l.pending,d=n.memoizedState;if(c!==null){l.pending=null;var v=c=c.next;do d=e(d,v.action),v=v.next;while(v!==c);Un(d,n.memoizedState)||($t=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),l.lastRenderedState=d}return[d,s]}function Gh(e,n,l){var s=He,c=Ft(),d=Qe;if(d){if(l===void 0)throw Error(a(407));l=l()}else l=n();var v=!Un((Tt||c).memoizedState,l);if(v&&(c.memoizedState=l,$t=!0),c=c.queue,Fc(Xh.bind(null,s,c,e),[e]),e=c.getSnapshot!==n||v||Kt!==null&&(Kt.memoizedState.tag&1)!==0,Mr(e?9:8,{destroy:void 0},Qh.bind(null,s,c,l,n),null),e){if(s.flags|=2048,Ct===null)throw Error(a(349));d||(Yi&127)!==0||Fh(s,n,l)}return l}function Fh(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=He.updateQueue,n===null?(n=go(),He.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function Qh(e,n,l,s){n.value=l,n.getSnapshot=s,Zh(n)&&Kh(e)}function Xh(e,n,l){return l(function(){Zh(n)&&Kh(e)})}function Zh(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!Un(e,l)}catch{return!0}}function Kh(e){var n=Hl(e,2);n!==null&&qn(n,e,2)}function Yc(e){var n=jn();if(typeof e=="function"){var l=e;if(e=l(),Jl){Lt(!0);try{l()}finally{Lt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gi,lastRenderedState:e},n}function $h(e,n,l,s){return e.baseState=l,Ic(e,Tt,typeof s=="function"?s:Gi)}function B0(e,n,l,s,c){if(wo(e))throw Error(a(485));if(e=n.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)}};$.T!==null?l(!0):d.isTransition=!1,s(d),l=n.pending,l===null?(d.next=n.pending=d,Jh(n,d)):(d.next=l.next,n.pending=l.next=d)}}function Jh(e,n){var l=n.action,s=n.payload,c=e.state;if(n.isTransition){var d=$.T,v={};v.types=d!==null?d.types:null,$.T=v;try{var k=l(c,s),_=$.S;_!==null&&_(v,k),Ph(e,n,k)}catch(U){Gc(e,n,U)}finally{d!==null&&v.types!==null&&(d.types=v.types),$.T=d}}else try{d=l(c,s),Ph(e,n,d)}catch(U){Gc(e,n,U)}}function Ph(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(s){Wh(e,n,s)},function(s){return Gc(e,n,s)}):Wh(e,n,l)}function Wh(e,n,l){n.status="fulfilled",n.value=l,ep(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,Jh(e,l)))}function Gc(e,n,l){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=l,ep(n),n=n.next;while(n!==s)}e.action=null}function ep(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function tp(e,n){return n}function np(e,n){if(Qe){var l=Ct.formState;if(l!==null){e:{var s=He;if(Qe){if(zt){t:{for(var c=zt,d=Jn;c.nodeType!==8;){if(!d){c=null;break t}if(c=Wn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){zt=Wn(c.nextSibling),s=c.data==="F!";break e}}rl(s)}s=!1}s&&(n=l[0])}}return l=jn(),l.memoizedState=l.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tp,lastRenderedState:n},l.queue=s,l=wp.bind(null,He,s),s.dispatch=l,s=Yc(!1),d=$c.bind(null,He,!1,s.queue),s=jn(),c={state:n,dispatch:null,action:e,pending:null},s.queue=c,l=B0.bind(null,He,c,d,l),c.dispatch=l,s.memoizedState=e,[n,l,!1]}function ip(e){var n=Ft();return lp(n,Tt,e)}function lp(e,n,l){if(n=Ic(e,n,tp)[0],e=bo(Gi)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Ha(n)}catch(v){throw v===_r?so:v}else s=n;n=Ft();var c=n.queue,d=c.dispatch;return l!==n.memoizedState&&(He.flags|=2048,Mr(9,{destroy:void 0},U0.bind(null,c,l),null)),[s,d,e]}function U0(e,n){e.action=n}function rp(e){var n=Ft(),l=Tt;if(l!==null)return lp(n,l,e);Ft(),n=n.memoizedState,l=Ft();var s=l.queue.dispatch;return l.memoizedState=e,[n,s,!1]}function Mr(e,n,l,s){return e={tag:e,create:l,deps:s,inst:n,next:null},n=He.updateQueue,n===null&&(n=go(),He.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=e.next=e:(s=l.next,l.next=e,e.next=s,n.lastEffect=e),e}function ap(){return Ft().memoizedState}function vo(e,n,l,s){var c=jn();He.flags|=e,c.memoizedState=Mr(1|n,{destroy:void 0},l,s===void 0?null:s)}function xo(e,n,l,s){var c=Ft();s=s===void 0?null:s;var d=c.memoizedState.inst;Tt!==null&&s!==null&&Mc(s,Tt.memoizedState.deps)?c.memoizedState=Mr(n,d,l,s):(He.flags|=e,c.memoizedState=Mr(1|n,d,l,s))}function sp(e,n){vo(8390656,8,e,n)}function Fc(e,n){xo(2048,8,e,n)}function H0(e){He.flags|=4;var n=He.updateQueue;if(n===null)n=go(),He.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function op(e){var n=Ft().memoizedState;return H0({ref:n,nextImpl:e}),function(){if((pt&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function up(e,n){return xo(4,2,e,n)}function cp(e,n){return xo(4,4,e,n)}function fp(e,n){if(typeof n=="function"){e=e();var l=n(e);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function dp(e,n,l){l=l!=null?l.concat([e]):null,xo(4,4,fp.bind(null,n,e),l)}function Qc(){}function mp(e,n){var l=Ft();n=n===void 0?null:n;var s=l.memoizedState;return n!==null&&Mc(n,s[1])?s[0]:(l.memoizedState=[e,n],e)}function hp(e,n){var l=Ft();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&Mc(n,s[1]))return s[0];if(s=e(),Jl){Lt(!0);try{e()}finally{Lt(!1)}}return l.memoizedState=[s,n],s}function Xc(e,n,l){return l===void 0||(Yi&1073741824)!==0&&(tt&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Eg(),He.lanes|=e,yl|=e,l)}function pp(e,n,l,s){return Un(l,n)?l:fl.current!==null?(e=Xc(e,l,s),Un(e,n)||($t=!0),e):(Yi&106)===0||(Yi&1073741824)!==0&&(tt&261930)===0?($t=!0,e.memoizedState=l):(e=Eg(),He.lanes|=e,yl|=e,n)}function gp(e,n,l,s,c){var d=me.p;me.p=d!==0&&8>d?d:8;var v=$.T,k={};k.types=v!==null?v.types:null,$.T=k,$c(e,!1,n,l);try{var _=c(),U=$.S;if(U!==null&&U(k,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var F=M0(_,s);Ia(e,n,F,Gn(e))}else Ia(e,n,s,Gn(e))}catch(ee){Ia(e,n,{then:function(){},status:"rejected",reason:ee},Gn())}finally{me.p=d,v!==null&&k.types!==null&&(v.types=k.types),$.T=v}}function I0(){}function Zc(e,n,l,s){if(e.tag!==5)throw Error(a(476));var c=yp(e).queue;gp(e,c,n,Ze,l===null?I0:function(){return bp(e),l(s)})}function yp(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:Ze,baseState:Ze,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gi,lastRenderedState:Ze},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gi,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function bp(e){var n=yp(e);n.next===null&&(n=e.alternate.memoizedState),Ia(e,n.next.queue,{},Gn())}function Kc(){return cn(ea)}function vp(){return Ft().memoizedState}function xp(){return Ft().memoizedState}function V0(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=Gn();e=ul(l);var s=cl(n,e,l);s!==null&&(qn(s,n,l),Ma(s,n,l)),n={cache:kc()},e.payload=n;return}n=n.return}}function Y0(e,n,l){var s=Gn();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},wo(e)?Sp(n,l):(l=hc(e,n,l,s),l!==null&&(qn(l,e,s),kp(l,n,s)))}function wp(e,n,l){var s=Gn();Ia(e,n,l,s)}function Ia(e,n,l,s){var c={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(wo(e))Sp(n,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var v=n.lastRenderedState,k=d(v,l);if(c.hasEagerState=!0,c.eagerState=k,Un(k,v))return Js(e,n,c,0),Ct===null&&$s(),!1}catch{}if(l=hc(e,n,c,s),l!==null)return qn(l,e,s),kp(l,n,s),!0}return!1}function $c(e,n,l,s){if(s={lane:2,revertLane:If(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},wo(e)){if(n)throw Error(a(479))}else n=hc(e,l,s,2),n!==null&&qn(n,e,2)}function wo(e){var n=e.alternate;return e===He||n!==null&&n===He}function Sp(e,n){Rr=ho=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function kp(e,n,l){if((l&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,da(e,l)}}var So={readContext:cn,use:yo,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut,useEffectEvent:Ut},Ep={readContext:cn,use:yo,useCallback:function(e,n){return jn().memoizedState=[e,n===void 0?null:n],e},useContext:cn,useEffect:sp,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,vo(4194308,4,fp.bind(null,n,e),l)},useLayoutEffect:function(e,n){return vo(4194308,4,e,n)},useInsertionEffect:function(e,n){vo(4,2,e,n)},useMemo:function(e,n){var l=jn();n=n===void 0?null:n;var s=e();if(Jl){Lt(!0);try{e()}finally{Lt(!1)}}return l.memoizedState=[s,n],s},useReducer:function(e,n,l){var s=jn();if(l!==void 0){var c=l(n);if(Jl){Lt(!0);try{l(n)}finally{Lt(!1)}}}else c=n;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=Y0.bind(null,He,e),[s.memoizedState,e]},useRef:function(e){var n=jn();return e={current:e},n.memoizedState=e},useState:function(e){e=Yc(e);var n=e.queue,l=wp.bind(null,He,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:Qc,useDeferredValue:function(e,n){var l=jn();return Xc(l,e,n)},useTransition:function(){var e=Yc(!1);return e=gp.bind(null,He,e.queue,!0,!1),jn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var s=He,c=jn();if(Qe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=n(),Ct===null)throw Error(a(349));(tt&127)!==0||Fh(s,n,l)}c.memoizedState=l;var d={value:l,getSnapshot:n};return c.queue=d,sp(Xh.bind(null,s,d,e),[e]),s.flags|=2048,Mr(9,{destroy:void 0},Qh.bind(null,s,d,l,n),null),l},useId:function(){var e=jn(),n=Ct.identifierPrefix;if(Qe){var l=bi,s=yi;l=(s&~(1<<32-Bt(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=po++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=D0++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Kc,useFormState:np,useActionState:np,useOptimistic:function(e){var n=jn();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=$c.bind(null,He,!0,l),l.dispatch=n,[e,n]},useMemoCache:Hc,useCacheRefresh:function(){return jn().memoizedState=V0.bind(null,He)},useEffectEvent:function(e){var n=jn(),l={impl:e};return n.memoizedState=l,function(){if((pt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Tp={readContext:cn,use:yo,useCallback:mp,useContext:cn,useEffect:Fc,useImperativeHandle:dp,useInsertionEffect:up,useLayoutEffect:cp,useMemo:hp,useReducer:bo,useRef:ap,useState:function(){return bo(Gi)},useDebugValue:Qc,useDeferredValue:function(e,n){var l=Ft();return pp(l,Tt.memoizedState,e,n)},useTransition:function(){var e=bo(Gi)[0],n=Ft().memoizedState;return[typeof e=="boolean"?e:Ha(e),n]},useSyncExternalStore:Gh,useId:vp,useHostTransitionStatus:Kc,useFormState:ip,useActionState:ip,useOptimistic:function(e,n){var l=Ft();return $h(l,Tt,e,n)},useMemoCache:Hc,useCacheRefresh:xp,useEffectEvent:op},G0={readContext:cn,use:yo,useCallback:mp,useContext:cn,useEffect:Fc,useImperativeHandle:dp,useInsertionEffect:up,useLayoutEffect:cp,useMemo:hp,useReducer:Vc,useRef:ap,useState:function(){return Vc(Gi)},useDebugValue:Qc,useDeferredValue:function(e,n){var l=Ft();return Tt===null?Xc(l,e,n):pp(l,Tt.memoizedState,e,n)},useTransition:function(){var e=Vc(Gi)[0],n=Ft().memoizedState;return[typeof e=="boolean"?e:Ha(e),n]},useSyncExternalStore:Gh,useId:vp,useHostTransitionStatus:Kc,useFormState:rp,useActionState:rp,useOptimistic:function(e,n){var l=Ft();return Tt!==null?$h(l,Tt,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Hc,useCacheRefresh:xp,useEffectEvent:op};function Jc(e,n,l,s){n=e.memoizedState,l=l(s,n),l=l==null?n:Q({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Pc={enqueueSetState:function(e,n,l){e=e._reactInternals;var s=Gn(),c=ul(s);c.payload=n,l!=null&&(c.callback=l),n=cl(e,c,s),n!==null&&(qn(n,e,s),Ma(n,e,s))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var s=Gn(),c=ul(s);c.tag=1,c.payload=n,l!=null&&(c.callback=l),n=cl(e,c,s),n!==null&&(qn(n,e,s),Ma(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=Gn(),s=ul(l);s.tag=2,n!=null&&(s.callback=n),n=cl(e,s,l),n!==null&&(qn(n,e,l),Ma(n,e,l))}};function jp(e,n,l,s,c,d,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,v):n.prototype&&n.prototype.isPureReactComponent?!Ca(l,s)||!Ca(c,d):!0}function Cp(e,n,l,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,s),n.state!==e&&Pc.enqueueReplaceState(n,n.state,null)}function Pl(e,n){var l=n;if("ref"in n){l={};for(var s in n)s!=="ref"&&(l[s]=n[s])}if(e=e.defaultProps){l===n&&(l=Q({},l));for(var c in e)l[c]===void 0&&(l[c]=e[c])}return l}function Np(e){Ks(e)}function Ap(e){console.error(e)}function Op(e){Ks(e)}function ko(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function _p(e,n,l){try{var s=e.onCaughtError;s(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Wc(e,n,l){return l=ul(l),l.tag=3,l.payload={element:null},l.callback=function(){ko(e,n)},l}function zp(e){return e=ul(e),e.tag=3,e}function Rp(e,n,l,s){var c=l.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;e.payload=function(){return c(d)},e.callback=function(){_p(n,l,s)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){_p(n,l,s),typeof c!="function"&&(bl===null?bl=new Set([this]):bl.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function F0(e,n,l,s,c){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&Gl(n,l,c,!0),l=fn.current,l!==null){switch(l.tag){case 31:case 13:case 19:return kn===null?Go():l.alternate===null&&Ht===0&&(Ht=3),l.flags&=-257,l.flags|=65536,l.lanes=c,s===oo?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([s]):n.add(s),Bf(e,s,c)),!1;case 22:return l.flags|=65536,s===oo?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([s]):l.add(s)),Bf(e,s,c)),!1}throw Error(a(435,l.tag))}return Bf(e,s,c),Go(),!1}if(Qe)return n=fn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=c,s!==vc&&(e=Error(a(422),{cause:s}),Oa(Zn(e,l)))):(s!==vc&&(n=Error(a(423),{cause:s}),Oa(Zn(n,l))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=Zn(s,l),c=Wc(e.stateNode,s,c),Ac(e,c),Ht!==4&&(Ht=2)),!1;var d=Error(a(520),{cause:s});if(d=Zn(d,l),Ka===null?Ka=[d]:Ka.push(d),Ht!==4&&(Ht=2),n===null)return!0;s=Zn(s,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=c&-c,l.lanes|=e,e=Wc(l.stateNode,s,e),Ac(l,e),!1;case 1:if(n=l.type,d=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(bl===null||!bl.has(d))))return l.flags|=65536,c&=-c,l.lanes|=c,c=zp(c),Rp(c,e,l,s),Ac(l,c),!1;break;case 22:if(l.memoizedState!==null)return l.flags|=65536,!1}l=l.return}while(l!==null);return!1}var ef=Error(a(461)),$t=!1;function en(e,n,l,s){n.child=e===null?Lh(n,null,l,s):$l(n,e.child,l,s)}function qp(e,n,l,s,c){l=l.render;var d=n.ref;if("ref"in s){var v={};for(var k in s)k!=="ref"&&(v[k]=s[k])}else v=s;return Fl(n),s=Dc(e,n,l,v,d,c),k=Lc(),e!==null&&!$t?(Bc(e,n,c),Fi(e,n,c)):(Qe&&k&&to(n),n.flags|=1,en(e,n,s,c),n.child)}function Mp(e,n,l,s,c){if(e===null){var d=l.type;return typeof d=="function"&&!pc(d)&&d.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=d,Dp(e,n,d,s,c)):(e=Ws(l.type,null,s,n,n.mode,c),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!uf(e,c)){var v=d.memoizedProps;if(l=l.compare,l=l!==null?l:Ca,l(v,s)&&e.ref===n.ref)return Fi(e,n,c)}return n.flags|=1,e=Ui(d,s),e.ref=n.ref,e.return=n,n.child=e}function Dp(e,n,l,s,c){if(e!==null){var d=e.memoizedProps;if(Ca(d,s)&&e.ref===n.ref)if($t=!1,n.pendingProps=s=d,uf(e,c))(e.flags&131072)!==0&&($t=!0);else return n.lanes=e.lanes,Fi(e,n,c)}return tf(e,n,l,s,c)}function Lp(e,n,l,s){var c=s.children,d=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(d=d!==null?d.baseLanes|l:l,e!==null){for(s=n.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,n.child=null;return Bp(e,n,d,l,s)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&ao(n,d!==null?d.cachePool:null),d!==null?Hh(n,d):_c(),Ih(n);else return s=n.lanes=536870912,Bp(e,n,d!==null?d.baseLanes|l:l,l,s)}else d!==null?(ao(n,d.cachePool),Hh(n,d),ml(),n.memoizedState=null):(e!==null&&ao(n,null),_c(),ml());return en(e,n,c,l),n.child}function Va(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Bp(e,n,l,s,c){var d=Tc();return d=d===null?null:{parent:Zt._currentValue,pool:d},n.memoizedState={baseLanes:l,cachePool:d},e!==null&&ao(n,null),_c(),Ih(n),e!==null&&Gl(e,n,s,!0),n.childLanes=c,null}function Eo(e,n){return n=To({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Up(e,n,l){return $l(n,e.child,null,l),e=Eo(n,n.pendingProps),e.flags|=2,Hn(n),n.memoizedState=null,e}function Q0(e,n,l){var s=n.pendingProps,c=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Qe){if(s.mode==="hidden")return e=Eo(n,s),n.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Va(null,e);if(Rc(n),(e=zt)?(e=fy(e,Jn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:il!==null?{id:yi,overflow:bi}:null,retryLane:536870912,hydrationErrors:null},l=Sh(e),l.return=n,n.child=l,ln=n,zt=null)):e=null,e===null)throw rl(n);return n.lanes=536870912,null}return Eo(n,s)}var d=e.memoizedState;if(d!==null){var v=d.dehydrated;if(Rc(n),c)if(n.flags&256)n.flags&=-257,n=Up(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if($t||Gl(e,n,l,!1),c=(l&e.childLanes)!==0,$t||c){if(fl.current===null){if(s=Ct,s!==null&&(v=zl(s,l),v!==0&&v!==d.retryLane))throw d.retryLane=v,Hl(e,v),qn(s,e,v),ef;Go()}n=Up(e,n,l)}else e=d.treeContext,zt=Wn(v.nextSibling),ln=n,Qe=!0,ll=null,Jn=!1,e!==null&&Th(n,e),n=Eo(n,s),n.flags|=134221824;return n}return e=Ui(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Dr(e,n){var l=n.ref;if(l===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(e===null||e.ref!==l)&&(n.flags|=4194816)}}function tf(e,n,l,s,c){return Fl(n),l=Dc(e,n,l,s,void 0,c),s=Lc(),e!==null&&!$t?(Bc(e,n,c),Fi(e,n,c)):(Qe&&s&&to(n),n.flags|=1,en(e,n,l,c),n.child)}function Hp(e,n,l,s,c,d){return Fl(n),n.updateQueue=null,l=Yh(n,s,l,c),Vh(e),s=Lc(),e!==null&&!$t?(Bc(e,n,d),Fi(e,n,d)):(Qe&&s&&to(n),n.flags|=1,en(e,n,l,d),n.child)}function Ip(e,n,l,s,c){if(Fl(n),n.stateNode===null){var d=jr,v=l.contextType;typeof v=="object"&&v!==null&&(d=cn(v)),d=new l(s,d),n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Pc,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=s,d.state=n.memoizedState,d.refs={},Cc(n),v=l.contextType,d.context=typeof v=="object"&&v!==null?cn(v):jr,d.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Jc(n,l,v,s),d.state=n.memoizedState),typeof l.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&&Pc.enqueueReplaceState(d,d.state,null),La(n,s,d,c),Da(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){d=n.stateNode;var k=n.memoizedProps,_=Pl(l,k);d.props=_;var U=d.context,F=l.contextType;v=jr,typeof F=="object"&&F!==null&&(v=cn(F));var ee=l.getDerivedStateFromProps;F=typeof ee=="function"||typeof d.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,F||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(k||U!==v)&&Cp(n,d,s,v),ol=!1;var L=n.memoizedState;d.state=L,La(n,s,d,c),Da(),U=n.memoizedState,k||L!==U||ol?(typeof ee=="function"&&(Jc(n,l,ee,s),U=n.memoizedState),(_=ol||jp(n,l,_,s,L,U,v))?(F||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"&&(n.flags|=4194308)):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=U),d.props=s,d.state=U,d.context=v,s=_):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{d=n.stateNode,Nc(e,n),v=n.memoizedProps,F=Pl(l,v),d.props=F,ee=n.pendingProps,L=d.context,U=l.contextType,_=jr,typeof U=="object"&&U!==null&&(_=cn(U)),k=l.getDerivedStateFromProps,(U=typeof k=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v!==ee||L!==_)&&Cp(n,d,s,_),ol=!1,L=n.memoizedState,d.state=L,La(n,s,d,c),Da();var Y=n.memoizedState;v!==ee||L!==Y||ol||e!==null&&e.dependencies!==null&&lo(e.dependencies)?(typeof k=="function"&&(Jc(n,l,k,s),Y=n.memoizedState),(F=ol||jp(n,l,F,s,L,Y,_)||e!==null&&e.dependencies!==null&&lo(e.dependencies))?(U||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,Y,_),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,Y,_)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||v===e.memoizedProps&&L===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&L===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=Y),d.props=s,d.state=Y,d.context=_,s=F):(typeof d.componentDidUpdate!="function"||v===e.memoizedProps&&L===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&L===e.memoizedState||(n.flags|=1024),s=!1)}return d=s,Dr(e,n),s=(n.flags&128)!==0,d||s?(d=n.stateNode,l=s&&typeof l.getDerivedStateFromError!="function"?null:d.render(),n.flags|=1,e!==null&&s?(n.child=$l(n,e.child,null,c),n.child=$l(n,null,l,c)):en(e,n,l,c),n.memoizedState=d.state,e=n.child):e=Fi(e,n,c),e}function Vp(e,n,l,s){return Vl(),n.flags|=256,en(e,n,l,s),n.child}var nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lf(e){return{baseLanes:e,cachePool:_h()}}function rf(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Yn),e}function Yp(e,n,l){var s=n.pendingProps,c=!1,d=(n.flags&128)!==0,v;if((v=d)||(v=e!==null&&e.memoizedState===null?!1:(dn.current&2)!==0),v&&(c=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,e===null){if(Qe){if(c?dl(n):ml(),(e=zt)?(e=fy(e,Jn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:il!==null?{id:yi,overflow:bi}:null,retryLane:536870912,hydrationErrors:null},l=Sh(e),l.return=n,n.child=l,ln=n,zt=null)):e=null,e===null)throw rl(n);return ld(e)?n.lanes=32:n.lanes=536870912,null}return d=s.children,s=s.fallback,c?(ml(),c=n.mode,d=To({mode:"hidden",children:d},c),s=Il(s,c,l,null),d.return=n,s.return=n,d.sibling=s,n.child=d,s=n.child,s.memoizedState=lf(l),s.childLanes=rf(e,v,l),n.memoizedState=nf,Va(null,s)):(dl(n),af(n,d))}var k=e.memoizedState;if(k!==null){var _=k.dehydrated;if(_!==null)return X0(e,n,d,v,s,_,k,l)}return c?(ml(),c=s.fallback,d=n.mode,k=e.child,_=k.sibling,s=Ui(k,{mode:"hidden",children:s.children}),s.subtreeFlags=k.subtreeFlags&1206910976,_!==null?c=Ui(_,c):(c=Il(c,d,l,null),c.flags|=2),c.return=n,s.return=n,s.sibling=c,n.child=s,Va(null,s),s=n.child,c=e.child.memoizedState,c===null?c=lf(l):(d=c.cachePool,d!==null?(k=Zt._currentValue,d=d.parent!==k?{parent:k,pool:k}:d):d=_h(),c={baseLanes:c.baseLanes|l,cachePool:d}),s.memoizedState=c,s.childLanes=rf(e,v,l),n.memoizedState=nf,Va(e.child,s)):(dl(n),l=e.child,e=l.sibling,l=Ui(l,{mode:"visible",children:s.children}),l.return=n,l.sibling=null,e!==null&&(v=n.deletions,v===null?(n.deletions=[e],n.flags|=16):v.push(e)),n.child=l,n.memoizedState=null,l)}function af(e,n){return n=To({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function To(e,n){return e=On(22,e,null,n),e.lanes=0,e}function jo(e,n,l){return $l(n,e.child,null,l),e=af(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function X0(e,n,l,s,c,d,v,k){if(l)return n.flags&256?(dl(n),n.flags&=-257,jo(e,n,k)):n.memoizedState!==null?(ml(),n.child=e.child,n.flags|=128,null):(ml(),d=c.fallback,v=n.mode,c=To({mode:"visible",children:c.children},v),d=Il(d,v,k,null),d.flags|=2,c.return=n,d.return=n,c.sibling=d,n.child=c,$l(n,e.child,null,k),c=n.child,c.memoizedState=lf(k),c.childLanes=rf(e,s,k),n.memoizedState=nf,Va(null,c));if(dl(n),ld(d)){if(s=d.nextSibling&&d.nextSibling.dataset,s)var _=s.dgst;return s=_,s!==""&&(c=Error(a(419)),c.stack="",c.digest=s,Oa({value:c,source:null,stack:null})),jo(e,n,k)}if($t||Gl(e,n,k,!1),s=(k&e.childLanes)!==0,$t||s){if(fl.current!==null)return jo(e,n,k);if(s=Ct,s!==null&&(c=zl(s,k),c!==0&&c!==v.retryLane))throw v.retryLane=c,Hl(e,c),qn(s,e,c),ef;return id(d)||Go(),jo(e,n,k)}return id(d)?(n.flags|=192,n.child=e.child,null):(e=v.treeContext,zt=Wn(d.nextSibling),ln=n,Qe=!0,ll=null,Jn=!1,e!==null&&Th(n,e),n=af(n,c.children),n.flags|=134221824,n)}function Gp(e,n,l){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),io(e.return,n,l)}function Fp(e){for(var n=null;e!==null;){var l=e.alternate;l!==null&&mo(l)===null&&(n=e),e=e.sibling}return n}function Co(e,n,l,s,c,d){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:l,tailMode:c,treeForkCount:d}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=s,v.tail=l,v.tailMode=c,v.treeForkCount=d)}function sf(e){var n=e.child;for(e.child=null;n!==null;){var l=n.sibling;n.sibling=e.child,e.child=n,n=l}}function of(e,n,l){var s=n.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var v=dn.current;if(n.flags&128)return Ba(n,v),null;var k=(v&2)!==0;if(k?(v=v&1|2,n.flags|=128):v&=1,Ba(n,v),c==="backwards"&&e!==null?(sf(e),en(e,n,s,l),sf(e)):en(e,n,s,l),s=Qe?Aa:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gp(e,l,n);else if(e.tag===19)Gp(e,l,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"backwards":l=Fp(n.child),l===null?(c=n.child,n.child=null):(c=l.sibling,l.sibling=null,sf(n)),Co(n,!0,c,null,d,s);break;case"unstable_legacy-backwards":for(l=null,c=n.child,n.child=null;c!==null;){if(e=c.alternate,e!==null&&mo(e)===null){n.child=c;break}e=c.sibling,c.sibling=l,l=c,c=e}Co(n,!0,l,null,d,s);break;case"together":Co(n,!1,null,null,void 0,s);break;case"independent":n.memoizedState=null;break;default:l=Fp(n.child),l===null?(c=n.child,n.child=null):(c=l.sibling,l.sibling=null),Co(n,!1,c,l,d,s)}return n.child}function Qp(e,n,l){var s=n.pendingProps;return al(n,n.type,s.value),en(e,n,s.children,l),n.child}function Fi(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),yl|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(Gl(e,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,l=Ui(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=Ui(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function uf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&lo(e)))}function Z0(e,n,l){switch(n.tag){case 3:De(n,n.stateNode.containerInfo),al(n,Zt,e.memoizedState.cache),Vl();break;case 27:case 5:bn(n);break;case 4:De(n,n.stateNode.containerInfo);break;case 10:al(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Rc(n),null;break;case 13:var s=n.memoizedState;if(s!==null){if(s.dehydrated!==null)return dl(n),n.flags|=128,null;s=Gl(e,n,l,!1);var c=n.child.childLanes;return s||(l&c)!==0?Yp(e,n,l):(dl(n),e=Fi(e,n,l),e!==null?e.sibling:null)}dl(n);break;case 19:if(n.flags&128)return of(e,n,l);if(c=(e.flags&128)!==0,s=(l&n.childLanes)!==0,s||(Gl(e,n,l,!1),s=(l&n.childLanes)!==0),c){if(s)return of(e,n,l);n.flags|=128}if(c=n.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Ba(n,dn.current),s)break;return null;case 22:return n.lanes=0,Lp(e,n,l,n.pendingProps);case 24:al(n,Zt,e.memoizedState.cache)}return Fi(e,n,l)}function Xp(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)$t=!0;else{if(!uf(e,l)&&(n.flags&128)===0)return $t=!1,Z0(e,n,l);$t=(e.flags&131072)!==0}else $t=!1,Qe&&(n.flags&1048576)!==0&&Eh(n,Aa,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Zl(n.elementType),n.type=e,typeof e=="function")pc(e)?(s=Pl(e,s),n.tag=1,n=Ip(null,n,e,s,l)):(n.tag=0,n=tf(null,n,e,s,l));else{if(e!=null){var c=e.$$typeof;if(c===G){n.tag=11,n=qp(null,n,e,s,l);break e}else if(c===Ne){n.tag=14,n=Mp(null,n,e,s,l);break e}else if(c===le){n.tag=10,n.type=e,n=Qp(null,n,l);break e}}throw n=Ce(e)||e,Error(a(306,n,""))}}return n;case 0:return tf(e,n,n.type,n.pendingProps,l);case 1:return s=n.type,c=Pl(s,n.pendingProps),Ip(e,n,s,c,l);case 3:e:{if(De(n,n.stateNode.containerInfo),e===null)throw Error(a(387));s=n.pendingProps;var d=n.memoizedState;c=d.element,Nc(e,n),La(n,s,null,l);var v=n.memoizedState;if(s=v.cache,al(n,Zt,s),s!==d.cache&&Sc(n,[Zt],l,!0),Da(),s=v.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=d,n.memoizedState=d,n.flags&256){n=Vp(e,n,s,l);break e}else if(s!==c){c=Zn(Error(a(424)),n),Oa(c),n=Vp(e,n,s,l);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,zt=Wn(e.firstChild),ln=n,Qe=!0,ll=null,Jn=!0,l=Lh(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|134221824,l=l.sibling;else{if(Vl(),s===c){n=Fi(e,n,l);break e}en(e,n,s,l)}n=n.child}return n;case 26:return Dr(e,n),e===null?(l=by(n.type,null,n.pendingProps,null))?n.memoizedState=l:Qe||(n.stateNode=Jg(n.type,n.pendingProps,gt.current,n)):n.memoizedState=by(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return bn(n),e===null&&Qe&&(s=n.stateNode=hy(n.type,n.pendingProps,gt.current),ln=n,Jn=!0,c=zt,wl(n.type)?(rd=c,zt=Wn(s.firstChild)):zt=c),en(e,n,n.pendingProps.children,l),Dr(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Qe&&((c=s=zt)&&(s=Vw(s,n.type,n.pendingProps,Jn),s!==null?(n.stateNode=s,ln=n,zt=Wn(s.firstChild),Jn=!1,c=!0):c=!1),c||rl(n)),bn(n),c=n.type,d=n.pendingProps,v=e!==null?e.memoizedProps:null,s=d.children,$f(c,d)?s=null:v!==null&&$f(c,v)&&(n.flags|=32),n.memoizedState!==null&&(c=Dc(e,n,L0,null,null,l),ea._currentValue=c),Dr(e,n),en(e,n,s,l),n.child;case 6:return e===null&&Qe&&((e=l=zt)&&(l=Yw(l,n.pendingProps,Jn),l!==null?(n.stateNode=l,ln=n,zt=null,e=!0):e=!1),e||rl(n)),null;case 13:return Yp(e,n,l);case 4:return De(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=$l(n,null,s,l):en(e,n,s,l),n.child;case 11:return qp(e,n,n.type,n.pendingProps,l);case 7:return s=n.pendingProps,Dr(e,n),en(e,n,s,l),n.child;case 8:return en(e,n,n.pendingProps.children,l),n.child;case 12:return en(e,n,n.pendingProps.children,l),n.child;case 10:return Qp(e,n,l);case 9:return c=n.type._context,s=n.pendingProps.children,Fl(n),c=cn(c),s=s(c),n.flags|=1,en(e,n,s,l),n.child;case 14:return Mp(e,n,n.type,n.pendingProps,l);case 15:return Dp(e,n,n.type,n.pendingProps,l);case 19:return of(e,n,l);case 31:return Q0(e,n,l);case 22:return Lp(e,n,l,n.pendingProps);case 24:return Fl(n),s=cn(Zt),e===null?(c=Tc(),c===null&&(c=Ct,d=kc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=l),c=d),n.memoizedState={parent:s,cache:c},Cc(n),al(n,Zt,c)):((e.lanes&l)!==0&&(Nc(e,n),La(n,null,null,l),Da()),c=e.memoizedState,d=n.memoizedState,c.parent!==s?(c={parent:s,cache:s},n.memoizedState=c,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=c),al(n,Zt,s)):(s=d.cache,al(n,Zt,s),s!==c.cache&&Sc(n,[Zt],l,!0))),en(e,n,n.pendingProps.children,l),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=n.pendingProps,s.name!=null&&s.name!=="auto"?n.flags|=e===null?18882560:18874368:Qe&&to(n),e!==null&&e.memoizedProps.name!==s.name?n.flags|=4194816:Dr(e,n),en(e,n,s.children,l),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Qi(e){e.flags|=4}function cf(e,n,l,s,c){var d;if((d=(e.mode&32)!==0)&&(d=l===null?Sy(n,s):Sy(n,s)&&(s.src!==l.src||s.srcSet!==l.srcSet)),d){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Ng())e.flags|=8192;else throw Kl=oo,jc}else e.flags&=-16777217}function Zp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ky(n))if(Ng())e.flags|=8192;else throw Kl=oo,jc}function No(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?pr():536870912,e.lanes|=n,Ir|=n)}function Ya(e,n){if(!Qe)switch(e.tailMode){case"visible":break;case"collapsed":for(var l=e.tail,s=null;l!==null;)l.alternate!==null&&(s=l),l=l.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(n=e.tail,l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?e.tail=null:l.sibling=null}}function Rt(e){var n=e.alternate!==null&&e.alternate.child===e.child,l=0,s=0;if(n)for(var c=e.child;c!==null;)l|=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;)l|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=l,n}function K0(e,n,l){var s=n.pendingProps;switch(bc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(n),null;case 1:return Rt(n),null;case 3:return l=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Vi(Zt),yt(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ar(n)?Qi(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,xc())),Rt(n),null;case 26:var c=n.type,d=n.memoizedState;return e===null?(Qi(n),d!==null?(Rt(n),Zp(n,d)):(Rt(n),cf(n,c,null,s,l))):d?d!==e.memoizedState?(Qi(n),Rt(n),Zp(n,d)):(Rt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Qi(n),Rt(n),cf(n,c,e,s,l)),null;case 27:if(Mt(n),l=gt.current,c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Qi(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return Rt(n),n.subtreeFlags&=-33554433,null}e=ze.current,Ar(n)?jh(n):(e=hy(c,s,l),n.stateNode=e,Qi(n))}return Rt(n),n.subtreeFlags&=-33554433,null;case 5:if(Mt(n),c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Qi(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return Rt(n),n.subtreeFlags&=-33554433,null}if(d=ze.current,Ar(n))jh(n);else{var v=es(gt.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[Wt]=n,d[nn]=s;e:for(v=n.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===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=d;e:switch(hn(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&&Qi(n)}}return Rt(n),n.subtreeFlags&=-33554433,cf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Qi(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=gt.current,Ar(n)){if(e=n.stateNode,l=n.memoizedProps,s=null,c=ln,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[Wt]=n,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||Xg(e.nodeValue,l)),e||rl(n,!0)}else e=es(e).createTextNode(s),e[Wt]=n,n.stateNode=e}return Rt(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(s=Ar(n),l!==null){if(e===null){if(!s)throw Error(a(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[Wt]=n}else Vl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Rt(n),e=!1}else l=xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return n.flags&256?(Hn(n),n):(Hn(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Rt(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ar(n),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(a(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));c[Wt]=n}else Vl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Rt(n),c=!1}else c=xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(Hn(n),n):(Hn(n),null)}return Hn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=s!==null,e=e!==null&&e.memoizedState!==null,l&&(s=n.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)),l!==e&&l&&(n.child.flags|=8192),No(n,n.updateQueue),Rt(n),null);case 4:return yt(),e===null&&Ff(n.stateNode.containerInfo),n.flags|=67108864,Rt(n),null;case 10:return Vi(n.type),Rt(n),null;case 19:if(qc(n),s=n.memoizedState,s===null)return Rt(n),null;if(c=(n.flags&128)!==0,d=s.rendering,d===null)if(c)Ya(s,!1);else{if(Ht!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=mo(e),d!==null){for(n.flags|=128,Ya(s,!1),e=d.updateQueue,n.updateQueue=e,No(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)wh(l,e),l=l.sibling;return Ba(n,dn.current&1|2),Qe&&Hi(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&xt()>Ho&&(n.flags|=128,c=!0,Ya(s,!1),n.lanes=4194304)}else{if(!c)if(e=mo(d),e!==null){if(n.flags|=128,c=!0,e=e.updateQueue,n.updateQueue=e,No(n,e),Ya(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!d.alternate&&!Qe)return Rt(n),null}else 2*xt()-s.renderingStartTime>Ho&&l!==536870912&&(n.flags|=128,c=!0,Ya(s,!1),n.lanes=4194304);s.isBackwards?(d.sibling=n.child,n.child=d):(e=s.last,e!==null?e.sibling=d:n.child=d,s.last=d)}if(s.tail!==null){e=s.tail;e:{for(l=e;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=xt(),e.sibling=null,d=dn.current,d=c?d&1|2:d&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!l||Qe?Ba(n,d):(l=d,Ue(fn,n),Ue(dn,l),kn===null&&(kn=n)),Qe&&Hi(n,s.treeForkCount),e}return Rt(n),null;case 22:case 23:return Hn(n),zc(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(l&536870912)!==0&&(n.flags&128)===0&&(Rt(n),n.subtreeFlags&6&&(n.flags|=8192)):Rt(n),l=n.updateQueue,l!==null&&No(n,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==l&&(n.flags|=2048),e!==null&&Fe(Xl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Vi(Zt),Rt(n),null;case 25:return null;case 30:return n.flags|=33554432,Rt(n),null}throw Error(a(156,n.tag))}function $0(e,n){switch(bc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Vi(Zt),yt(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Mt(n),null;case 31:if(n.memoizedState!==null){if(Hn(n),n.alternate===null)throw Error(a(340));Vl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Hn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Vl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return qc(n),e=n.flags,e&65536?(n.flags=e&-65537|128,e=n.memoizedState,e!==null&&(e.rendering=null,e.tail=null),n.flags|=4,n):null;case 4:return yt(),null;case 10:return Vi(n.type),null;case 22:case 23:return Hn(n),zc(),e!==null&&Fe(Xl),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Vi(Zt),null;case 25:return null;default:return null}}function Kp(e,n){switch(bc(n),n.tag){case 3:Vi(Zt),yt();break;case 26:case 27:case 5:Mt(n);break;case 4:yt();break;case 31:n.memoizedState!==null&&Hn(n);break;case 13:Hn(n);break;case 19:qc(n);break;case 10:Vi(n.type);break;case 22:case 23:Hn(n),zc(),e!==null&&Fe(Xl);break;case 24:Vi(Zt)}}function Ga(e,n){try{var l=n.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var c=s.next;l=c;do{if((l.tag&e)===e){s=void 0;var d=l.create,v=l.inst;s=d(),v.destroy=s}l=l.next}while(l!==c)}}catch(k){St(n,n.return,k)}}function hl(e,n,l){try{var s=n.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,k=v.destroy;if(k!==void 0){v.destroy=void 0,c=n;var _=l,U=k;try{U()}catch(F){St(c,_,F)}}}s=s.next}while(s!==d)}}catch(F){St(n,n.return,F)}}function $p(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{Uh(n,l)}catch(s){St(e,e.return,s)}}}function Jp(e,n,l){l.props=Pl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){St(e,n,s)}}function vi(e,n){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var c=e.stateNode,d=Li(e.memoizedProps,c);(c.ref===null||c.ref.name!==d)&&(c.ref=ly(d)),s=c.ref;break;case 7:if(e.stateNode===null){var v=new Fn(e);y(e.child,!1,Hw,v,void 0,void 0),e.stateNode=v}s=e.stateNode;break;default:s=e.stateNode}typeof l=="function"?e.refCleanup=l(s):l.current=s}}catch(k){St(e,n,k)}}function mn(e,n){var l=e.ref,s=e.refCleanup;if(l!==null)if(typeof s=="function")try{s()}catch(c){St(e,n,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(c){St(e,n,c)}else l.current=null}function Ao(e,n){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&n!==null)for(var l=0;l<n.length;l++)cy(e.stateNode,n[l])}function Pp(e){for(var n=e.return;n!==null&&(df(n)&&cy(e.stateNode,n.stateNode),!ff(n));)n=n.return}function Fa(e){for(var n=e.return;n!==null&&(df(n)&&Iw(e.stateNode,n.stateNode),!ff(n));)n=n.return}function ff(e){return e.tag===5||e.tag===3||e.tag===27}function df(e){return e&&e.tag===7&&e.stateNode!==null}function mf(e){var n=e.type,l=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&s.focus();break e;case"img":l.src?s.src=l.src:l.srcSet&&(s.srcset=l.srcSet)}}catch(c){St(e,e.return,c)}}function hf(e,n,l){try{var s=e.stateNode;Sw(s,e.type,l,n),s[nn]=n}catch(c){St(e,e.return,c)}}function Wp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wl(e.type)||e.tag===4}function pf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wp(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&&wl(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 gf(e,n,l,s){var c=e.tag;if(c===5||c===6)c=e.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(c,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(c),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=I)),Ao(e,s),Ve=!0;else if(c!==4&&(c===27&&(Ao(e,s),s=null,wl(e.type)&&(l=e.stateNode,n=null)),e=e.child,e!==null))for(gf(e,n,l,s),e=e.sibling;e!==null;)gf(e,n,l,s),e=e.sibling}function Oo(e,n,l,s){var c=e.tag;if(c===5||c===6)c=e.stateNode,n?l.insertBefore(c,n):l.appendChild(c),Ao(e,s),Ve=!0;else if(c!==4&&(c===27&&(Ao(e,s),s=null,wl(e.type)&&(l=e.stateNode)),e=e.child,e!==null))for(Oo(e,n,l,s),e=e.sibling;e!==null;)Oo(e,n,l,s),e=e.sibling}function eg(e){var n=e.stateNode,l=e.memoizedProps;try{for(var s=e.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);hn(n,s,l),n[Wt]=e,n[nn]=l}catch(d){St(e,e.return,d)}}var _o=!1,In=null;function tg(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(_o=!0)}var xi=null;function ng(){var e=xi;return xi=null,e}var _n=0;function Lr(e,n,l,s,c){return _n=0,ig(e.child,n,l,s,c)}function ig(e,n,l,s,c){for(var d=!1;e!==null;){if(e.tag===5){var v=e.stateNode;if(s!==null){var k=Wf(v);s.push(k),k.view&&(d=!0)}else d||Wf(v).view&&(d=!0);_o=!0,ny(v,_n===0?n:n+"_"+_n,l),_n++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||ig(e.child,n,l,s,c)&&(d=!0));e=e.sibling}return d}function wi(e,n){for(;e!==null;)e.tag===5?iy(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&n||wi(e.child,n)),e=e.sibling}function zo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(zo(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var n=e.memoizedProps;if(n.name==null||n.name==="auto")throw Error(a(544));var l=n.name;n=Bi(n.default,n.share),n!=="none"&&(Lr(e,l,n,null,!1)||wi(e.child,!1))}e=e.sibling}}function yf(e,n){if(e.tag===30){var l=e.stateNode,s=e.memoizedProps,c=Li(s,l),d=Bi(s.default,l.paired?s.share:s.enter);d!=="none"?Lr(e,c,d,null,!1)?(zo(e),l.paired||n||Fr(e,s.onEnter)):wi(e.child,!1):zo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)yf(e,n),e=e.sibling;else zo(e)}function bf(e){if(In!==null&&In.size!==0){var n=In;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 l=e.memoizedProps,s=l.name;if(s!=null&&s!=="auto"){var c=n.get(s);if(c!==void 0){var d=Bi(l.default,l.share);if(d!=="none"&&(Lr(e,s,d,null,!1)?(d=e.stateNode,c.paired=d,d.paired=c,Fr(e,l.onShare)):wi(e.child,!1)),n.delete(s),n.size===0)break}}}bf(e)}e=e.sibling}}}function vf(e){if(e.tag===30){var n=e.memoizedProps,l=Li(n,e.stateNode),s=In!==null?In.get(l):void 0,c=Bi(n.default,s!==void 0?n.share:n.exit);c!=="none"&&(Lr(e,l,c,null,!1)?s!==void 0?(c=e.stateNode,s.paired=c,c.paired=s,In.delete(l),Fr(e,n.onShare)):Fr(e,n.onExit):wi(e.child,!1)),In!==null&&bf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)vf(e),e=e.sibling;else In!==null&&bf(e)}function lg(e){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=Li(n,e.stateNode);n=Bi(n.default,n.update),e.flags&=-5,n!=="none"&&Lr(e,l,n,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&lg(e);e=e.sibling}}function xf(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 n=e.stateNode;n.paired!==null&&(n.paired=null,wi(e.child,!1))}xf(e)}e=e.sibling}}function Ro(e){if(e.tag===30)e.stateNode.paired=null,wi(e.child,!1),xf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ro(e),e=e.sibling;else xf(e)}function rg(e){for(e=e.child;e!==null;)e.tag===30?wi(e.child,!1):(e.subtreeFlags&33554432)!==0&&rg(e),e=e.sibling}function wf(e,n,l,s,c,d,v){for(var k=!1;n!==null;){if(n.tag===5){var _=n.stateNode;if(d!==null&&_n<d.length){var U=d[_n],F=Wf(_);(U.view||F.view)&&(k=!0);var ee;if(ee=(e.flags&4)===0)if(F.clip)ee=!0;else{ee=U.rect;var L=F.rect;ee=ee.y!==L.y||ee.x!==L.x||ee.height!==L.height||ee.width!==L.width}ee&&(e.flags|=4),F.abs?F=!U.abs:(U=U.rect,F=F.rect,F=U.height!==F.height||U.width!==F.width),F&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&ny(_,_n===0?l:l+"_"+_n,c),k&&(e.flags&4)!==0||(xi===null&&(xi=[]),xi.push(_,_n===0?s:s+"_"+_n,n.memoizedProps)),_n++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&v?e.flags|=n.flags&32:wf(e,n.child,l,s,c,d,v)&&(k=!0));n=n.sibling}return k}function ag(e,n){for(e=e.child;e!==null;){if(e.tag===30){var l=e.memoizedProps,s=e.stateNode,c=Li(l,s),d=Bi(l.default,l.update),v;v=e.memoizedState,e.memoizedState=null,s=e;var k=e.child;_n=0,c=wf(s,k,c,c,d,v,!1),(e.flags&4)!==0&&c&&Fr(e,l.onUpdate)}else(e.subtreeFlags&33554432)!==0&&ag(e);e=e.sibling}}var rn=!1,vt=!1,Si=!1,Sf=!1,sg=typeof WeakSet=="function"?WeakSet:Set,an=null,ki=!1,Qa=!1,qo=!1,kf=!1;function J0(e,n,l){if(e=e.containerInfo,Zf=ta,e=fh(e),oc(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 k=0,_=-1,U=-1,F=0,ee=0,L=e,Y=null;t:for(;;){for(var he;L!==s||d!==0&&L.nodeType!==3||(_=k+d),L!==v||c!==0&&L.nodeType!==3||(U=k+c),L.nodeType===3&&(k+=L.nodeValue.length),(he=L.firstChild)!==null;)Y=L,L=he;for(;;){if(L===e)break t;if(Y===s&&++F===d&&(_=k),Y===v&&++ee===c&&(U=k),(he=L.nextSibling)!==null)break;L=Y,Y=L.parentNode}L=he}s=_===-1||U===-1?null:{start:_,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(Kf={focusedElem:e,selectionRange:s},ta=!1,l=(l&335544064)===l,an=n,n=l?9270:1024;an!==null;){if(e=an,l&&(s=e.deletions,s!==null))for(d=0;d<s.length;d++)l&&vf(s[d]);if(e.alternate===null&&(e.flags&2)!==0)l&&tg(e),Mo(l);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&l&&vf(s),Mo(l);continue}else if(s!==null&&s.memoizedState!==null){l&&tg(e),Mo(l);continue}}s=e.child,(e.subtreeFlags&n)!==0&&s!==null?(s.return=e,an=s):(l&&lg(e),Mo(l))}}In=null}function Mo(e){for(;an!==null;){var n=an,l=e,s=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((c&1024)!==0&&s!==null){l=void 0,c=s.memoizedProps,s=s.memoizedState;var d=n.stateNode;try{var v=Pl(n.type,c);l=d.getSnapshotBeforeUpdate(v,s),d.__reactInternalSnapshotBeforeUpdate=l}catch(k){St(n,n.return,k)}}break;case 3:if((c&1024)!==0){if(s=n.stateNode.containerInfo,l=s.nodeType,l===9)nd(s);else if(l===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":nd(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:l&&s!==null&&(l=Li(s.memoizedProps,s.stateNode),c=n.memoizedProps,c=Bi(c.default,c.update),c!=="none"&&Lr(s,l,c,s.memoizedState=[],!0));break;default:if((c&1024)!==0)throw Error(a(163))}if(s=n.sibling,s!==null){s.return=n.return,an=s;break}an=n.return}}function og(e,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:Ei(e,l),s&4&&Ga(5,l);break;case 1:if(Ei(e,l),s&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(v){St(l,l.return,v)}else{var c=Pl(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(c,n,e.__reactInternalSnapshotBeforeUpdate)}catch(v){St(l,l.return,v)}}s&64&&$p(l),s&512&&vi(l,l.return);break;case 3:if(Ei(e,l),s&64&&(e=l.updateQueue,e!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{Uh(e,n)}catch(v){St(l,l.return,v)}}break;case 27:n===null&&s&4&&eg(l);case 26:case 5:Ei(e,l),n===null&&s&4&&mf(l),s&512&&vi(l,l.return);break;case 12:Ei(e,l);break;case 31:Ei(e,l),s&4&&dg(e,l);break;case 13:Ei(e,l),s&4&&mg(e,l),s&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=uw.bind(null,l),Gw(e,l))));break;case 22:if(s=l.memoizedState!==null||rn,!s){var d=n!==null&&n.memoizedState!==null||vt;n=rn,c=vt,rn=s,(vt=d)&&!c?(s=2,(l.subtreeFlags&8772)!==0&&(s|=1),oi(e,l,s)):Ei(e,l),rn=n,vt=c}break;case 30:Ei(e,l),s&512&&vi(l,l.return);break;case 7:s&512&&vi(l,l.return);default:Ei(e,l)}}function Ef(e,n){for(e=e.child;e!==null;)ug(e,n),e=e.sibling}function ug(e,n){switch(e.tag){case 5:case 26:try{var l=e.stateNode;if(n){var s=l.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(_){St(e,e.return,_)}Tf(e,n);break;case 6:try{e.stateNode.nodeValue=n?"":e.memoizedProps,Ve=!0}catch(_){St(e,e.return,_)}break;case 18:try{var k=e.stateNode;n?ty(k,!0):ty(e.stateNode,!1)}catch(_){St(e,e.return,_)}break;case 22:case 23:e.memoizedState===null&&Ef(e,n);break;default:Ef(e,n)}}function Tf(e,n){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var l=e,s=n;switch(l.tag){case 4:ug(l,s);break e;case 22:l.memoizedState===null&&Tf(l,s);break e;default:Tf(l,s)}}e=e.sibling}}function cg(e){var n=e.alternate;n!==null&&(e.alternate=null,cg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Dl(n)),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 qt=null,zn=!1;function ai(e,n,l){for(l=l.child;l!==null;)fg(e,n,l),l=l.sibling}function fg(e,n,l){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Xt,l)}catch{}switch(l.tag){case 26:vt||mn(l,n),ai(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&!vt&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:vt||mn(l,n),Fa(l);var s=qt,c=zn;wl(l.type)&&(qt=l.stateNode,zn=!1),ai(e,n,l),py(l.stateNode,l.type,l.memoizedProps),qt=s,zn=c;break;case 5:vt||mn(l,n),Fa(l);case 6:if(l.tag===6&&Fa(l),s=qt,c=zn,qt=null,ai(e,n,l),qt=s,zn=c,qt!==null)if(zn)try{(qt.nodeType===9?qt.body:qt.nodeName==="HTML"?qt.ownerDocument.body:qt).removeChild(l.stateNode),Ve=!0}catch(d){St(l,n,d)}else try{qt.removeChild(l.stateNode),Ve=!0}catch(d){St(l,n,d)}break;case 18:qt!==null&&(zn?(e=qt,ey(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),na(e)):ey(qt,l.stateNode));break;case 4:s=qt,c=zn,qt=l.stateNode.containerInfo,zn=!0,ai(e,n,l),qt=s,zn=c;break;case 0:case 11:case 14:case 15:hl(2,l,n),vt||hl(4,l,n),ai(e,n,l);break;case 1:vt||(mn(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&Jp(l,n,s)),ai(e,n,l);break;case 21:ai(e,n,l);break;case 22:vt=(s=vt)||l.memoizedState!==null,ai(e,n,l),vt=s;break;case 30:mn(l,n),ai(e,n,l);break;case 7:vt||mn(l,n),ai(e,n,l);break;default:ai(e,n,l)}}function dg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{na(e)}catch(l){St(n,n.return,l)}}}function mg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{na(e)}catch(l){St(n,n.return,l)}}function P0(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new sg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new sg),n;default:throw Error(a(435,e.tag))}}function Do(e,n){var l=P0(e);n.forEach(function(s){if(!l.has(s)){l.add(s);var c=cw.bind(null,e,s);s.then(c,c)}})}function Cn(e,n,l){var s=n.deletions;if(s!==null)for(var c=0;c<s.length;c++){var d=s[c],v=e,k=n,_=k;e:for(;_!==null;){switch(_.tag){case 27:if(wl(_.type)){qt=_.stateNode,zn=!1;break e}break;case 5:qt=_.stateNode,zn=!1;break e;case 3:case 4:qt=_.stateNode.containerInfo,zn=!0;break e}_=_.return}if(qt===null)throw Error(a(160));fg(v,k,d),qt=null,zn=!1,v=d.alternate,v!==null&&(v.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)hg(n,e,l),n=n.sibling}var si=null;function hg(e,n,l){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}Cn(n,e,l),Nn(e),c&4&&(hl(3,e,e.return),Ga(3,e),hl(5,e,e.return));break;case 1:Cn(n,e,l),Nn(e),c&512&&(vt||s===null||mn(s,s.return)),c&64&&rn&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:if(d=si,Cn(n,e,l),Nn(e),c&512&&(vt||s===null||mn(s,s.return)),c&4)if(c=s!==null?s.memoizedState:null,l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null)if(rn)e.stateNode=Jg(e.type,e.memoizedProps,n.containerInfo,e);else{e:{n=e.type,l=e.memoizedProps,c=d.ownerDocument||d;t:switch(n){case"title":s=c.getElementsByTagName("title")[0],(!s||s[ql]||s[Wt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=c.createElement(n),c.head.insertBefore(s,c.querySelector("head > title"))),hn(s,n,l),s[Wt]=e,Gt(s),n=s;break e;case"link":if(d=wy("link","href",c).get(n+(l.href||""))){for(v=0;v<d.length;v++)if(s=d[v],s.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&s.getAttribute("rel")===(l.rel==null?null:l.rel)&&s.getAttribute("title")===(l.title==null?null:l.title)&&s.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){d.splice(v,1);break t}}s=c.createElement(n),hn(s,n,l),c.head.appendChild(s);break;case"meta":if(d=wy("meta","content",c).get(n+(l.content||""))){for(v=0;v<d.length;v++)if(s=d[v],s.getAttribute("content")===(l.content==null?null:""+l.content)&&s.getAttribute("name")===(l.name==null?null:l.name)&&s.getAttribute("property")===(l.property==null?null:l.property)&&s.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&s.getAttribute("charset")===(l.charSet==null?null:l.charSet)){d.splice(v,1);break t}}s=c.createElement(n),hn(s,n,l),c.head.appendChild(s);break;default:throw Error(a(468,n))}s[Wt]=e,Gt(s),n=s}e.stateNode=n}else rn||ud(d,e.type,e.stateNode);else e.stateNode=xy(d,l,e.memoizedProps);else c!==l?(c===null?(n=s.stateNode,n===null||vt||n.parentNode.removeChild(n)):c.count--,l===null?rn||ud(d,e.type,e.stateNode):xy(d,l,e.memoizedProps)):l===null&&e.stateNode!==null&&hf(e,e.memoizedProps,s.memoizedProps);break;case 27:Cn(n,e,l),Nn(e),c&512&&(vt||s===null||mn(s,s.return)),s!==null&&c&4&&hf(e,e.memoizedProps,s.memoizedProps);break;case 5:if(d=Si,Si=!1,Cn(n,e,l),Si=d,Nn(e),c&512&&(vt||s===null||mn(s,s.return)),e.flags&32){n=e.stateNode;try{el(n,""),Ve=!0}catch(F){St(e,e.return,F)}}c&4&&e.stateNode!=null&&(n=e.memoizedProps,hf(e,n,s!==null?s.memoizedProps:n)),c&1024&&(Sf=!0);break;case 6:if(Cn(n,e,l),Nn(e),c&4){if(e.stateNode===null)throw Error(a(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n,Ve=!0}catch(F){St(e,e.return,F)}}break;case 3:if(Ve=!1,Jo=null,d=si,si=ts(n.containerInfo),Cn(n,e,l),si=d,Nn(e),c&4&&s!==null&&s.memoizedState.isDehydrated)try{na(n.containerInfo)}catch(F){St(e,e.return,F)}Sf&&(Sf=!1,pg(e)),Ve=!1;break;case 4:c=Si,Si=rn,s=ga(),d=si,si=ts(e.stateNode.containerInfo),Cn(n,e,l),Nn(e),si=d,Ve&&Qa&&(qo=!0),Ve=s,Si=c;break;case 12:Cn(n,e,l),Nn(e);break;case 31:Cn(n,e,l),Nn(e),c&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Do(e,n)));break;case 13:Cn(n,e,l),Nn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Uo=xt()),c&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Do(e,n)));break;case 22:d=e.memoizedState!==null,v=s!==null&&s.memoizedState!==null;var k=rn,_=vt,U=Si;rn=k||d,Si=U||d,vt=_||v,Cn(n,e,l),vt=_,Si=U,rn=k,Nn(e),c&8192&&(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,!d||s===null||v||rn||vt||(n=v||vt,l=rn,s=vt,rn=d||rn,vt=n,pl(e,2),rn=l,vt=s),!d&&Si||Ef(e,d)),c&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Do(e,l))));break;case 19:Cn(n,e,l),Nn(e),c&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Do(e,n)));break;case 30:c&512&&(vt||s===null||mn(s,s.return)),c=ga(),d=Qa,v=(l&335544064)===l,k=e.memoizedProps,Qa=v&&Bi(k.default,k.update)!=="none",Cn(n,e,l),Nn(e),v&&s!==null&&Ve&&(e.flags|=4),Qa=d,Ve=c;break;case 21:break;case 7:c&512&&(vt||s===null||mn(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:Cn(n,e,l),Nn(e)}}function Nn(e){var n=e.flags;if(n&2){try{for(var l,s=e.return;s!==null;){if(Wp(s)){l=s;break}s=s.return}s=null;for(var c=e.return;c!==null;){if(df(c)){var d=c.stateNode;s===null?s=[d]:s.push(d)}if(ff(c))break;c=c.return}var v=s;if(l==null)throw Error(a(160));switch(l.tag){case 27:var k=l.stateNode,_=pf(e);Oo(e,_,k,v);break;case 5:var U=l.stateNode;l.flags&32&&(el(U,""),l.flags&=-33);var F=pf(e);Oo(e,F,U,v);break;case 3:case 4:var ee=l.stateNode.containerInfo,L=pf(e);gf(e,L,ee,v);break;default:throw Error(a(161))}}catch(Y){St(e,e.return,Y)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function pg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;pg(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,ta=!0,n.reset(),ta=!1),e=e.sibling}}function Br(e,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)gg(n,e),n=n.sibling;else ag(n)}function gg(e,n){var l=e.alternate;if(l===null)yf(e,!1);else switch(e.tag){case 3:if(kf=ki=!1,ng(),Br(n,e),!ki&&!qo){if(e=xi,e!==null)for(var s=0;s<e.length;s+=3){l=e[s];var c=e[s+1];iy(l,e[s+2]),l=l.ownerDocument.documentElement,l!==null&&l.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+c+")"})}e=n.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"})),kf=!0}xi=null;break;case 5:Br(n,e);break;case 4:s=ki,ki=!1,Br(n,e),ki&&(qo=!0),ki=s;break;case 22:e.memoizedState===null&&(l.memoizedState!==null?yf(e,!1):Br(n,e));break;case 30:s=ki,c=ng(),ki=!1,Br(n,e),ki&&(e.flags|=4);var d=e.memoizedProps,v=e.stateNode;n=Li(d,v),v=Li(l.memoizedProps,v);var k=Bi(d.default,d.update);k==="none"?n=!1:(d=l.memoizedState,l.memoizedState=null,l=e.child,_n=0,n=wf(e,l,n,v,k,d,!0),_n!==(d===null?0:d.length)&&(e.flags|=32)),(e.flags&4)!==0&&n?(Fr(e,e.memoizedProps.onUpdate),xi=c):c!==null&&(c.push.apply(c,xi),xi=c),ki=(e.flags&32)!==0?!0:s;break;default:Br(n,e)}}function Ei(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)og(e,n.alternate,n),n=n.sibling}function pl(e,n){for(e=e.child;e!==null;){var l=e,s=n;switch(l.tag){case 0:case 11:case 14:case 15:hl(4,l,l.return),pl(l,s);break;case 1:mn(l,l.return);var c=l.stateNode;typeof c.componentWillUnmount=="function"&&Jp(l,l.return,c),pl(l,s);break;case 27:(s&2)!==0&&py(l.stateNode,l.type,l.memoizedProps);case 5:mn(l,l.return),l.tag!==5&&l.tag!==27||Fa(l),pl(l,s);break;case 6:Fa(l);break;case 26:mn(l,l.return),c=l.stateNode,l.memoizedState!==null||c===null||vt||c.parentNode.removeChild(c),pl(l,s);break;case 22:l.memoizedState===null&&pl(l,s);break;case 30:mn(l,l.return),pl(l,s);break;case 7:mn(l,l.return);default:pl(l,s)}e=e.sibling}}function oi(e,n,l){for(l=(n.subtreeFlags&8772)!==0?l:l&-2,n=n.child;n!==null;){var s=n.alternate,c=e,d=n,v=d.flags,k=(l&1)!==0;switch(d.tag){case 0:case 11:case 15:oi(c,d,l),Ga(4,d);break;case 1:if(oi(c,d,l),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(F){St(s,s.return,F)}if(s=d,c=s.updateQueue,c!==null){var _=s.stateNode;try{var U=c.shared.hiddenCallbacks;if(U!==null)for(c.shared.hiddenCallbacks=null,c=0;c<U.length;c++)Bh(U[c],_)}catch(F){St(s,s.return,F)}}k&&v&64&&$p(d),vi(d,d.return);break;case 27:(l&2)!==0&&eg(d);case 5:d.tag!==5&&d.tag!==27||Pp(d),oi(c,d,l),k&&s===null&&v&4&&mf(d),vi(d,d.return);break;case 6:Pp(d);break;case 26:_=d.stateNode,d.memoizedState!==null||_===null||rn||ud(ts(_.ownerDocument),d.type,_),oi(c,d,l),k&&s===null&&v&4&&mf(d),vi(d,d.return);break;case 12:oi(c,d,l);break;case 31:oi(c,d,l),k&&v&4&&dg(c,d);break;case 13:oi(c,d,l),k&&v&4&&mg(c,d);break;case 22:d.memoizedState===null&&oi(c,d,l),vi(d,d.return);break;case 30:oi(c,d,l),vi(d,d.return);break;case 7:vi(d,d.return);default:oi(c,d,l)}n=n.sibling}}function jf(e,n){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&_a(l))}function Cf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&_a(e))}function Pn(e,n,l,s){var c=(l&335544064)===l;if(n.subtreeFlags&(c?10262:10256))for(n=n.child;n!==null;)yg(e,n,l,s),n=n.sibling;else c&&rg(n)}function yg(e,n,l,s){var c=(l&335544064)===l;c&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&Ro(n);var d=n.flags;switch(n.tag){case 0:case 11:case 15:Pn(e,n,l,s),d&2048&&Ga(9,n);break;case 1:Pn(e,n,l,s);break;case 3:Pn(e,n,l,s),c&&kf&&(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,n.alternate!==null&&(d=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==d&&(n.refCount++,d!=null&&_a(d)));break;case 12:if(d&2048){Pn(e,n,l,s),d=n.stateNode;try{var v=n.memoizedProps,k=v.id,_=v.onPostCommit;typeof _=="function"&&_(k,n.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(U){St(n,n.return,U)}}else Pn(e,n,l,s);break;case 31:Pn(e,n,l,s);break;case 13:Pn(e,n,l,s);break;case 23:break;case 22:v=n.stateNode,k=n.alternate,n.memoizedState!==null?(c&&k!==null&&k.memoizedState===null&&Ro(k),v._visibility&2?Pn(e,n,l,s):Xa(e,n)):(c&&k!==null&&k.memoizedState!==null&&Ro(n),v._visibility&2?Pn(e,n,l,s):(v._visibility|=2,Ur(e,n,l,s,(n.subtreeFlags&10256)!==0||!1))),d&2048&&jf(k,n);break;case 24:Pn(e,n,l,s),d&2048&&Cf(n.alternate,n);break;case 30:c&&(d=n.alternate,d!==null&&(wi(d.child,!0),wi(n.child,!0))),Pn(e,n,l,s);break;default:Pn(e,n,l,s)}}function Ur(e,n,l,s,c){for(c=c&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,v=n,k=l,_=s,U=v.flags;switch(v.tag){case 0:case 11:case 15:Ur(d,v,k,_,c),Ga(8,v);break;case 23:break;case 22:var F=v.stateNode;v.memoizedState!==null?F._visibility&2?Ur(d,v,k,_,c):Xa(d,v):(F._visibility|=2,Ur(d,v,k,_,c)),c&&U&2048&&jf(v.alternate,v);break;case 24:Ur(d,v,k,_,c),c&&U&2048&&Cf(v.alternate,v);break;default:Ur(d,v,k,_,c)}n=n.sibling}}function Xa(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=e,s=n,c=s.flags;switch(s.tag){case 22:Xa(l,s),c&2048&&jf(s.alternate,s);break;case 24:Xa(l,s),c&2048&&Cf(s.alternate,s);break;default:Xa(l,s)}n=n.sibling}}var Wl=8192;function er(e,n,l){if(e.subtreeFlags&Wl)for(e=e.child;e!==null;)bg(e,n,l),e=e.sibling}function bg(e,n,l){switch(e.tag){case 26:er(e,n,l),e.flags&Wl&&(e.memoizedState!==null?lS(l,si,e.memoizedState,e.memoizedProps):(e=e.stateNode,(n&335544128)===n&&Ty(l,e)));break;case 5:er(e,n,l),e.flags&Wl&&(e=e.stateNode,(n&335544128)===n&&Ty(l,e));break;case 3:case 4:var s=si;si=ts(e.stateNode.containerInfo),er(e,n,l),si=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Wl,Wl=16777216,er(e,n,l),Wl=s):er(e,n,l));break;case 30:if((e.flags&Wl)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var c=e.stateNode;c.paired=null,In===null&&(In=new Map),In.set(s,c)}er(e,n,l);break;default:er(e,n,l)}}function vg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Za(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];an=s,wg(s,e)}vg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)xg(e),e=e.sibling}function xg(e){switch(e.tag){case 0:case 11:case 15:Za(e),e.flags&2048&&hl(9,e,e.return);break;case 3:Za(e);break;case 12:Za(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Lo(e)):Za(e);break;default:Za(e)}}function Lo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];an=s,wg(s,e)}vg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:hl(8,n,n.return),Lo(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Lo(n));break;default:Lo(n)}e=e.sibling}}function wg(e,n){for(;an!==null;){var l=an;switch(l.tag){case 0:case 11:case 15:hl(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var s=l.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:_a(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,an=s;else e:for(l=e;an!==null;){s=an;var c=s.sibling,d=s.return;if(cg(s),s===l){an=null;break e}if(c!==null){c.return=d,an=c;break e}an=d}}}var W0={getCacheForType:function(e){var n=cn(Zt),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return cn(Zt).controller.signal}},ew=typeof WeakMap=="function"?WeakMap:Map,pt=0,Ct=null,Je=null,tt=0,wt=0,Vn=null,gl=!1,Hr=!1,Nf=!1,Xi=0,Ht=0,yl=0,tr=0,Bo=0,Yn=0,Ir=0,Ka=null,Rn=null,Af=!1,Uo=0,Sg=0,Ho=1/0,Io=null,bl=null,Dt=0,ui=null,nr=null,Ti=0,Of=0,_f=null,kg=null,Vr=null,Yr=null,Gr=null,$a=0,Vo=null;function Gn(){return(pt&2)!==0&&tt!==0?tt&-tt:$.T!==null?If():vr()}function Eg(){if(Yn===0)if((tt&536870912)===0||Qe){var e=_i;_i<<=1,(_i&3932160)===0&&(_i=262144),Yn=e}else Yn=536870912;return e=fn.current,e!==null&&(e.flags|=32),Yn}function Fr(e,n){if(n!=null){var l=e.stateNode,s=l.ref;s===null&&(s=l.ref=ly(Li(e.memoizedProps,l))),Yr===null&&(Yr=[]),Yr.push(n.bind(null,s))}}function qn(e,n,l){(e===Ct&&(wt===2||wt===9)||e.cancelPendingCommit!==null)&&(Qr(e,0),vl(e,tt,Yn,!1)),pi(e,l),((pt&2)===0||e!==Ct)&&(e===Ct&&((pt&2)===0&&(tr|=l),Ht===4&&vl(e,tt,Yn,!1)),ji(e))}function Tg(e,n,l){if((pt&6)!==0)throw Error(a(327));var s=!l&&(n&127)===0&&(n&e.expiredLanes)===0||Ri(e,n),c=s?iw(e,n):Rf(e,n,!0),d=s;do{if(c===0){Hr&&!s&&vl(e,n,0,!1);break}else{if(l=e.current.alternate,d&&!tw(l)){c=Rf(e,n,!1),d=!1;continue}if(c===2){if(d=n,e.errorRecoveryDisabledLanes&d)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var k=e;c=Ka;var _=k.current.memoizedState.isDehydrated;if(_&&(Qr(k,v).flags|=256),v=Rf(k,v,!1),v!==2&&v!==6){if(Nf&&!_){k.errorRecoveryDisabledLanes|=d,tr|=d,c=4;break e}d=Rn,Rn=c,d!==null&&(Rn===null?Rn=d:Rn.push.apply(Rn,d))}c=v}if(d=!1,c!==2)continue}}if(c===1){Qr(e,0),vl(e,n,0,!0);break}e:{switch(s=e,d=c,d){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:vl(s,n,Yn,!gl);break e;case 2:Rn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(c=Uo+300-xt(),10<c)){if(vl(s,n,Yn,!gl),$i(s,0,!0)!==0)break e;Ti=n,s.timeoutHandle=Pf(jg.bind(null,s,l,Rn,Io,Af,n,Yn,tr,Ir,gl,d,"Throttled",-0,0),c);break e}jg(s,l,Rn,Io,Af,n,Yn,tr,Ir,gl,d,null,-0,0)}}break}while(!0);ji(e)}function jg(e,n,l,s,c,d,v,k,_,U,F,ee,L,Y){e.timeoutHandle=-1;var he=n.subtreeFlags,Ee=(d&335544064)===d;if(ee=null,(Ee||he&8192||(he&16785408)===16785408)&&(ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:I},In=null,bg(n,d,ee),Ee&&(he=ee,Ee=e.containerInfo,Ee=(Ee.nodeType===9?Ee:Ee.ownerDocument).__reactViewTransition,Ee!=null&&(he.count++,he.waitingForViewTransition=!0,he=ls.bind(he),Ee.finished.then(he,he))),he=(d&62914560)===d?Uo-xt():(d&4194048)===d?Sg-xt():0,he=rS(ee,he),he!==null)){Ti=d,e.cancelPendingCommit=he(qg.bind(null,e,n,d,l,s,c,v,k,_,U,F,ee,null,L,Y)),vl(e,d,v,!U);return}qg(e,n,d,l,s,c,v,k,_,U,F,ee)}function tw(e){for(var n=e;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var s=0;s<l.length;s++){var c=l[s],d=c.getSnapshot;c=c.value;try{if(!Un(d(),c))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function vl(e,n,l,s){n=ca(e,n),n&=~Bo,n&=~tr,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var c=n;0<c;){var d=31-Bt(c),v=1<<d;s[d]=-1,c&=~v}l!==0&&br(e,l,n)}function Yo(){return(pt&6)===0?(Ja(0),!1):!0}function zf(){if(Je!==null){if(wt===0)var e=Je.return;else e=Je,Ii=Yl=null,Uc(e),zr=null,qa=0,e=Je;for(;e!==null;)Kp(e.alternate,e),e=e.return;Je=null}}function Qr(e,n){var l=e.timeoutHandle;return l!==-1&&(e.timeoutHandle=-1,Tw(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Ti=0,zf(),Ct=e,Je=l=Ui(e.current,null),tt=n,wt=0,Vn=null,gl=!1,Hr=Ri(e,n),Nf=!1,Ir=Yn=Bo=tr=yl=Ht=0,Rn=Ka=null,Af=!1,Xi=ca(e,n),$s(),l}function Cg(e,n){He=null,$.H=So,n===_r||n===so?(n=qh(),wt=3):n===jc?(n=qh(),wt=4):wt=n===ef?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Vn=n,Je===null&&(Ht=1,ko(e,Zn(n,e.current)))}function Ng(){var e=fn.current;return e===null?!0:(tt&4194048)===tt?kn===null:(tt&62914560)===tt||(tt&536870912)!==0?e===kn:!1}function Ag(){var e=$.H;return $.H=So,e===null?So:e}function Og(){var e=$.A;return $.A=W0,e}function Go(){Ht=4,gl||(tt&4194048)!==tt&&fn.current!==null||(Hr=!0),(yl&134217727)===0&&(tr&134217727)===0||Ct===null||vl(Ct,tt,Yn,!1)}function Rf(e,n,l){var s=pt;pt|=2;var c=Ag(),d=Og();(Ct!==e||tt!==n)&&(Io=null,Qr(e,n)),n=!1;var v=Ht;e:do try{if(wt!==0&&Je!==null){var k=Je,_=Vn;switch(wt){case 8:zf(),v=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(n=!0);var U=wt;if(wt=0,Vn=null,Xr(e,k,_,U),l&&Hr){v=0;break e}break;default:U=wt,wt=0,Vn=null,Xr(e,k,_,U)}}nw(),v=Ht;break}catch(F){Cg(e,F)}while(!0);return n&&e.shellSuspendCounter++,Ii=Yl=null,pt=s,$.H=c,$.A=d,Je===null&&(Ct=null,tt=0,$s()),v}function nw(){for(;Je!==null;)_g(Je)}function iw(e,n){var l=pt;pt|=2;var s=Ag(),c=Og();Ct!==e||tt!==n?(Io=null,Ho=xt()+500,Qr(e,n)):Hr=Ri(e,n);e:do try{if(wt!==0&&Je!==null){n=Je;var d=Vn;t:switch(wt){case 1:wt=0,Vn=null,Xr(e,n,d,1);break;case 2:case 9:if(zh(d)){wt=0,Vn=null,zg(n);break}n=function(){wt!==2&&wt!==9||Ct!==e||(wt=7),ji(e)},d.then(n,n);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:zh(d)?(wt=0,Vn=null,zg(n)):(wt=0,Vn=null,Xr(e,n,d,7));break;case 5:var v=null;switch(Je.tag){case 26:v=Je.memoizedState;case 5:case 27:var k=Je;if(v?ky(v):k.stateNode.complete){wt=0,Vn=null;var _=k.sibling;if(_!==null)Je=_;else{var U=k.return;U!==null?(Je=U,Fo(U)):Je=null}break t}}wt=0,Vn=null,Xr(e,n,d,5);break;case 6:wt=0,Vn=null,Xr(e,n,d,6);break;case 8:zf(),Ht=6;break e;default:throw Error(a(462))}}lw();break}catch(F){Cg(e,F)}while(!0);return Ii=Yl=null,$.H=s,$.A=c,pt=l,Je!==null?0:(Ct=null,tt=0,$s(),Ht)}function lw(){for(;Je!==null&&!on();)_g(Je)}function _g(e){var n=Xp(e.alternate,e,Xi);e.memoizedProps=e.pendingProps,n===null?Fo(e):Je=n}function zg(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=Hp(l,n,n.pendingProps,n.type,void 0,tt);break;case 11:n=Hp(l,n,n.pendingProps,n.type.render,n.ref,tt);break;case 5:Uc(n);var s=n;s===ln&&(Qe?(no(s),s.tag===5&&s.stateNode!=null&&(zt=s.stateNode)):(no(s),Qe=!0));default:Kp(l,n),n=Je=wh(n,Xi),n=Xp(l,n,Xi)}e.memoizedProps=e.pendingProps,n===null?Fo(e):Je=n}function Xr(e,n,l,s){Ii=Yl=null,Uc(n),zr=null,qa=0;var c=n.return;try{if(F0(e,c,n,l,tt)){Ht=1,ko(e,Zn(l,e.current)),Je=null;return}}catch(d){if(c!==null)throw Je=c,d;Ht=1,ko(e,Zn(l,e.current)),Je=null;return}n.flags&32768?(Qe||s===1?e=!0:Hr||(tt&536870912)!==0?e=!1:(gl=e=!0,(s===2||s===9||s===3||s===6)&&(s=fn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Rg(n,e)):Fo(n)}function Fo(e){var n=e;do{if((n.flags&32768)!==0){Rg(n,gl);return}e=n.return;var l=K0(n.alternate,n,Xi);if(l!==null){Je=l;return}if(n=n.sibling,n!==null){Je=n;return}Je=n=e}while(n!==null);Ht===0&&(Ht=5)}function Rg(e,n){do{var l=$0(e.alternate,e);if(l!==null){l.flags&=32767,Je=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){Je=e;return}Je=e=l}while(e!==null);Ht=6,Je=null}function qg(e,n,l,s,c,d,v,k,_,U,F,ee){e.cancelPendingCommit=null;do Qo();while(Dt!==0);if((pt&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));e===Ct&&(Je=Ct=null,tt=0),nr=n,ui=e,Ti=l,_f=c,kg=s,rw(e,n,l,v,k,_,ee)}}function rw(e,n,l,s,c,d,v){var k=n.lanes|n.childLanes;if(Of=k,k|=mc,yr(e,l,k,s,c,d),Yr=null,(l&335544064)===l?(Gr=R0(e),s=10262):(Gr=null,s=10256),(n.subtreeFlags&s)!==0||(n.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,fw(hi,function(){return Lf(),null})):(e.callbackNode=null,e.callbackPriority=0),_o=!1,s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=$.T,$.T=null,c=me.p,me.p=2,d=pt,pt|=4;try{J0(e,n,l)}finally{pt=d,me.p=c,$.T=s}}Dt=1,_o?Vr=_w(v,e.containerInfo,Gr,qf,Mf,sw,Df,Lf,aw):(qf(),Mf(),Df())}function aw(e){if(Dt!==0){var n=ui.onRecoverableError;n(e,{componentStack:null})}}function sw(){Dt===3&&(Dt=0,gg(nr,ui),Dt=4)}function qf(){if(Dt===1){Dt=0;var e=ui,n=nr,l=Ti,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=$.T,$.T=null;var c=me.p;me.p=2;var d=pt;pt|=4;try{Qa=qo=!1,hg(n,e,l),l=Kf;var v=fh(e.containerInfo),k=l.focusedElem,_=l.selectionRange;if(v!==k&&k&&k.ownerDocument&&ch(k.ownerDocument.documentElement,k)){if(_!==null&&oc(k)){var U=_.start,F=_.end;if(F===void 0&&(F=U),"selectionStart"in k)k.selectionStart=U,k.selectionEnd=Math.min(F,k.value.length);else{var ee=k.ownerDocument||document,L=ee&&ee.defaultView||window;if(L.getSelection){var Y=L.getSelection(),he=k.textContent.length,Ee=Math.min(_.start,he),Ie=_.end===void 0?Ee:Math.min(_.end,he);!Y.extend&&Ee>Ie&&(v=Ie,Ie=Ee,Ee=v);var B=uh(k,Ee),D=uh(k,Ie);if(B&&D&&(Y.rangeCount!==1||Y.anchorNode!==B.node||Y.anchorOffset!==B.offset||Y.focusNode!==D.node||Y.focusOffset!==D.offset)){var V=ee.createRange();V.setStart(B.node,B.offset),Y.removeAllRanges(),Ee>Ie?(Y.addRange(V),Y.extend(D.node,D.offset)):(V.setEnd(D.node,D.offset),Y.addRange(V))}}}}for(ee=[],Y=k;Y=Y.parentNode;)Y.nodeType===1&&ee.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<ee.length;k++){var P=ee[k];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}ta=!!Zf,Kf=Zf=null}finally{pt=d,me.p=c,$.T=s}}e.current=n,Dt=2}}function Mf(){if(Dt===2){Dt=0;var e=ui,n=nr,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=$.T,$.T=null;var s=me.p;me.p=2;var c=pt;pt|=4;try{og(e,n.alternate,n)}finally{pt=c,me.p=s,$.T=l}}Dt=3}}function Df(){if(Dt===4||Dt===3){Dt=0;var e=Vr;Vr=null,It();var n=ui,l=nr,s=Ti,c=kg,d=(s&335544064)===s?10262:10256;if((l.subtreeFlags&d)!==0||(l.flags&d)!==0?Dt=5:(Dt=0,nr=ui=null,Mg(n,n.pendingLanes)),d=n.pendingLanes,d===0&&(bl=null),ni(s),l=l.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Xt,l,void 0,(l.current.flags&128)===128)}catch{}if(c!==null){l=$.T,d=me.p,me.p=2,$.T=null;try{for(var v=n.onRecoverableError,k=0;k<c.length;k++){var _=c[k];v(_.value,{componentStack:_.stack})}}finally{$.T=l,me.p=d}}if(c=Yr,v=Gr,Gr=null,c!==null&&(Yr=null,v===null&&(v=[]),e!==null))for(_=0;_<c.length;_++)l=(0,c[_])(v),l!==void 0&&e.finished.finally(l);(Ti&3)!==0&&Qo(),ji(n),d=n.pendingLanes,(s&261930)!==0&&(d&42)!==0?n===Vo?$a++:($a=0,Vo=n):($a=0,Vo=null),Ja(0)}}function Mg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,_a(n)))}function Qo(){return Vr!==null&&(Vr.skipTransition(),Vr=null),qf(),Mf(),Df(),Lf()}function Lf(){if(Dt!==5)return!1;var e=ui,n=Of;Of=0;var l=ni(Ti),s=$.T,c=me.p;try{me.p=32>l?32:l,$.T=null,l=_f,_f=null;var d=ui,v=Ti;if(Dt=0,nr=ui=null,Ti=0,(pt&6)!==0)throw Error(a(331));var k=pt;if(pt|=4,xg(d.current),yg(d,d.current,v,l),pt=k,Ja(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Xt,d)}catch{}return!0}finally{me.p=c,$.T=s,Mg(e,n)}}function Dg(e,n,l){n=Zn(l,n),n=Wc(e.stateNode,n,2),e=cl(e,n,2),e!==null&&(pi(e,2),ji(e))}function St(e,n,l){if(e.tag===3)Dg(e,e,l);else for(;n!==null;){if(n.tag===3){Dg(n,e,l);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(bl===null||!bl.has(s))){e=Zn(l,e),l=zp(2),s=cl(n,l,2),s!==null&&(Rp(l,s,n,e),pi(s,2),ji(s));break}}n=n.return}}function Bf(e,n,l){var s=e.pingCache;if(s===null){s=e.pingCache=new ew;var c=new Set;s.set(n,c)}else c=s.get(n),c===void 0&&(c=new Set,s.set(n,c));c.has(l)||(Nf=!0,c.add(l),e=ow.bind(null,e,n,l),n.then(e,e))}function ow(e,n,l){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ct===e&&(tt&l)===l&&((Ht===4||Ht===3&&(tt&62914560)===tt&&300>xt()-Uo)&&(pt&2)===0?Qr(e,0):Bo|=l,Ir===tt&&(Ir=0)),ji(e)}function Lg(e,n){n===0&&(n=pr()),e=Hl(e,n),e!==null&&(pi(e,n),ji(e))}function uw(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),Lg(e,l)}function cw(e,n){var l=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(l=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),Lg(e,l)}function fw(e,n){return tn(e,n)}var Zr=null,Kr=null,Uf=!1,Xo=!1,Hf=!1,xl=0;function ji(e){e!==Kr&&e.next===null&&(Kr===null?Zr=Kr=e:Kr=Kr.next=e),Xo=!0,Uf||(Uf=!0,mw())}function Ja(e,n){if(!Hf&&Xo){Hf=!0;do for(var l=!1,s=Zr;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var v=s.suspendedLanes,k=s.pingedLanes;d=(1<<31-Bt(42|e)+1)-1,d&=c&~(v&~k),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(l=!0,Ig(s,d))}else d=tt,d=$i(s,s===Ct?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||Ri(s,d)||(l=!0,Ig(s,d));s=s.next}while(l);Hf=!1}}function dw(){Bg()}function Bg(){Xo=Uf=!1;var e=0;xl!==0&&Ew()&&(e=xl);for(var n=xt(),l=null,s=Zr;s!==null;){var c=s.next,d=Ug(s,n);d===0?(s.next=null,l===null?Zr=c:l.next=c,c===null&&(Kr=l)):(l=s,(e!==0||(d&3)!==0)&&(Xo=!0)),s=c}Dt!==0&&Dt!==5||Ja(e),xl!==0&&(xl=0)}function Ug(e,n){for(var l=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var v=31-Bt(d),k=1<<v,_=c[v];_===-1?((k&l)===0||(k&s)!==0)&&(c[v]=fa(k,n)):_<=n&&(e.expiredLanes|=k),d&=~k}if(n=Ct,l=tt,l=$i(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,l===0||e===n&&(wt===2||wt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&sn(s),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Ri(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(s!==null&&sn(s),ni(l)){case 2:case 8:l=xn;break;case 32:l=hi;break;case 268435456:l=K;break;default:l=hi}return s=Hg.bind(null,e),l=tn(l,s),e.callbackPriority=n,e.callbackNode=l,n}return s!==null&&s!==null&&sn(s),e.callbackPriority=2,e.callbackNode=null,2}function Hg(e,n){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Qo()&&e.callbackNode!==l)return null;var s=tt;return s=$i(e,e===Ct?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Tg(e,s,n),Ug(e,xt()),e.callbackNode!=null&&e.callbackNode===l?Hg.bind(null,e):null)}function Ig(e,n){if(Qo())return null;Tg(e,n,!0)}function mw(){jw(function(){(pt&6)!==0?tn(vn,dw):Bg()})}function If(){if(xl===0){var e=Ql;e===0&&(e=hr,hr<<=1,(hr&261888)===0&&(hr=256)),xl=e}return xl}function Vg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:j(e)}function hw(e,n,l,s,c){if(n==="submit"&&l&&l.stateNode===c){var d=Vg((c[nn]||null).action),v=s.submitter;v&&(n=(n=v[nn]||null)?Vg(n.formAction):v.getAttribute("formAction"),n!==null&&(d=n,v=null));var k=new Qs("action","action",null,s,c);e.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(xl!==0){var _=new FormData(c,v);Zc(l,{pending:!0,data:_,method:c.method,action:d},null,_)}}else typeof d=="function"&&(k.preventDefault(),_=new FormData(c,v),Zc(l,{pending:!0,data:_,method:c.method,action:d},d,_))},currentTarget:c}]})}}for(var Vf=0;Vf<dc.length;Vf++){var Yf=dc[Vf],pw=Yf.toLowerCase(),gw=Yf[0].toUpperCase()+Yf.slice(1);ri(pw,"on"+gw)}ri(hh,"onAnimationEnd"),ri(ph,"onAnimationIteration"),ri(gh,"onAnimationStart"),ri("dblclick","onDoubleClick"),ri("focusin","onFocus"),ri("focusout","onBlur"),ri(T0,"onTransitionRun"),ri(j0,"onTransitionStart"),ri(C0,"onTransitionCancel"),ri(yh,"onTransitionEnd"),En("onMouseEnter",["mouseout","mouseover"]),En("onMouseLeave",["mouseout","mouseover"]),En("onPointerEnter",["pointerout","pointerover"]),En("onPointerLeave",["pointerout","pointerover"]),gi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gi("onBeforeInput",["compositionend","keypress","textInput","paste"]),gi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pa="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(" "),yw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pa));function Yg(e,n){n=(n&4)!==0;for(var l=0;l<e.length;l++){var s=e[l],c=s.event;s=s.listeners;e:{var d=void 0;if(n)for(var v=s.length-1;0<=v;v--){var k=s[v],_=k.instance,U=k.currentTarget;if(k=k.listener,_!==d&&c.isPropagationStopped())break e;d=k,c.currentTarget=U;try{d(c)}catch(F){Ks(F)}c.currentTarget=null,d=_}else for(v=0;v<s.length;v++){if(k=s[v],_=k.instance,U=k.currentTarget,k=k.listener,_!==d&&c.isPropagationStopped())break e;d=k,c.currentTarget=U;try{d(c)}catch(F){Ks(F)}c.currentTarget=null,d=_}}}}function Pe(e,n){var l=n[Ds];l===void 0&&(l=n[Ds]=new Set);var s=e+"__bubble";l.has(s)||(Gg(n,e,2,!1),l.add(s))}function Gf(e,n,l){var s=0;n&&(s|=4),Gg(l,e,s,n)}var Zo="_reactListening"+Math.random().toString(36).slice(2);function Ff(e){if(!e[Zo]){e[Zo]=!0,Ls.forEach(function(l){l!=="selectionchange"&&(yw.has(l)||Gf(l,!1,e),Gf(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Zo]||(n[Zo]=!0,Gf("selectionchange",!1,n))}}function Gg(e,n,l,s){switch(Ry(n)){case 2:var c=uS;break;case 8:c=cS;break;default:c=fd}l=c.bind(null,n,l,e),c=void 0,!_t||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(n,l,{capture:!0,passive:c}):e.addEventListener(n,l,!0):c!==void 0?e.addEventListener(n,l,{passive:c}):e.addEventListener(n,l,!1)}function Qf(e,n,l,s,c){var d=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var v=s.tag;if(v===3||v===4){var k=s.stateNode.containerInfo;if(k===c)break;if(v===4)for(v=s.return;v!==null;){var _=v.tag;if((_===3||_===4)&&v.stateNode.containerInfo===c)return;v=v.return}for(;k!==null;){if(v=Ln(k),v===null)return;if(_=v.tag,_===5||_===6||_===26||_===27){s=d=v;continue e}k=k.parentNode}}s=s.return}dt(function(){var U=d,F=ge(l),ee=[];e:{var L=bh.get(e);if(L!==void 0){var Y=Qs,he=e;switch(e){case"keypress":if(Gs(l)===0)break e;case"keydown":case"keyup":Y=t0;break;case"focusin":he="focus",Y=nc;break;case"focusout":he="blur",Y=nc;break;case"beforeblur":case"afterblur":Y=nc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Xm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Y1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=a0;break;case hh:case ph:case gh:Y=Q1;break;case yh:Y=o0;break;case"scroll":case"scrollend":Y=I1;break;case"wheel":Y=c0;break;case"copy":case"cut":case"paste":Y=Z1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Km;break;case"submit":Y=l0;break;case"toggle":case"beforetoggle":Y=d0}var Ee=(n&4)!==0,Ie=!Ee&&(e==="scroll"||e==="scrollend"),B=Ee?L!==null?L+"Capture":null:L;Ee=[];for(var D=U,V;D!==null;){var P=D;if(V=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||V===null||B===null||(P=lt(D,B),P!=null&&Ee.push(Wa(D,P,V))),Ie)break;D=D.return}0<Ee.length&&(L=new Y(L,he,null,l,F),ee.push({event:L,listeners:Ee}))}}if((n&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",Y&&l!==J&&(he=l.relatedTarget||l.fromElement)&&(Ln(he)||he[ii]))break e;(L||Y)&&(he=F.window===F?F:(Y=F.ownerDocument)?Y.defaultView||Y.parentWindow:window,L?(Y=l.relatedTarget||l.toElement,L=U,Y=Y?Ln(Y):null,Y!==null&&(Ie=u(Y),Ee=Y.tag,Y!==Ie||Ee!==5&&Ee!==27&&Ee!==6)&&(Y=null)):(L=null,Y=U),L!==Y&&(Ee=Xm,P="onMouseLeave",B="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=Km,P="onPointerLeave",B="onPointerEnter",D="pointer"),Ie=L==null?he:Mi(L),V=Y==null?he:Mi(Y),he=new Ee(P,D+"leave",L,l,F),he.target=Ie,he.relatedTarget=V,P=null,Ln(F)===U&&(Ee=new Ee(B,D+"enter",Y,l,F),Ee.target=V,Ee.relatedTarget=Ie,P=Ee),Ie=P,Ee=L&&Y?O(L,Y,bw):null,L!==null&&Fg(ee,he,L,Ee,!1),Y!==null&&Ie!==null&&Fg(ee,Ie,Y,Ee,!0)))}e:{if(L=U?Mi(U):window,Y=L.nodeName&&L.nodeName.toLowerCase(),Y==="select"||Y==="input"&&L.type==="file")var xe=ih;else if(th(L))if(lh)xe=S0;else{xe=x0;var nt=v0}else Y=L.nodeName,!Y||Y.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?U&&wr(U.elementType)&&(xe=ih):xe=w0;if(xe&&(xe=xe(e,U))){nh(ee,xe,l,F);break e}nt&&nt(e,L,U)}switch(nt=U?Mi(U):window,e){case"focusin":(th(nt)||nt.contentEditable==="true")&&(kr=nt,uc=U,Na=null);break;case"focusout":Na=uc=kr=null;break;case"mousedown":cc=!0;break;case"contextmenu":case"mouseup":case"dragend":cc=!1,dh(ee,l,F);break;case"selectionchange":if(E0)break;case"keydown":case"keyup":dh(ee,l,F)}var Ae;if(lc)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Sr?Wm(e,l)&&(Me="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Me="onCompositionStart");Me&&($m&&l.locale!=="ko"&&(Sr||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Sr&&(Ae=Fm()):(un=F,Ll="value"in un?un.value:un.textContent,Sr=!0)),nt=Ko(U,Me),0<nt.length&&(Me=new Zm(Me,e,null,l,F),ee.push({event:Me,listeners:nt}),Ae?Me.data=Ae:(Ae=eh(l),Ae!==null&&(Me.data=Ae)))),(Ae=h0?p0(e,l):g0(e,l))&&(Me=Ko(U,"onBeforeInput"),0<Me.length&&(nt=new Zm("onBeforeInput","beforeinput",null,l,F),ee.push({event:nt,listeners:Me}),nt.data=Ae)),hw(ee,e,U,l,F)}Yg(ee,n)})}function Wa(e,n,l){return{instance:e,listener:n,currentTarget:l}}function Ko(e,n){for(var l=n+"Capture",s=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=lt(e,l),c!=null&&s.unshift(Wa(e,c,d)),c=lt(e,n),c!=null&&s.push(Wa(e,c,d))),e.tag===3)return s;e=e.return}return[]}function bw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fg(e,n,l,s,c){for(var d=n._reactName,v=[];l!==null&&l!==s;){var k=l,_=k.alternate,U=k.stateNode;if(k=k.tag,_!==null&&_===s)break;k!==5&&k!==26&&k!==27||U===null||(_=U,c?(U=lt(l,d),U!=null&&v.unshift(Wa(l,U,_))):c||(U=lt(l,d),U!=null&&v.push(Wa(l,U,_)))),l=l.return}v.length!==0&&e.push({event:n,listeners:v})}var vw=/\r\n?/g,xw=/\u0000|\uFFFD/g;function Qg(e){return(typeof e=="string"?e:""+e).replace(vw,`
|
|
10
|
-
`).replace(xw,"")}function Xg(e,n){return n=Qg(n),Qg(e)===n}function kt(e,n,l,s,c,d){switch(l){case"children":if(typeof s=="string")n==="body"||n==="textarea"&&s===""||el(e,s);else if(typeof s=="number"||typeof s=="bigint")n!=="body"&&el(e,""+s);else return;break;case"className":Pi(e,"class",s);break;case"tabIndex":Pi(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Pi(e,l,s);break;case"style":Pu(e,s,d);return;case"data":if(n!=="object"){Pi(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||l!=="href")){e.removeAttribute(l);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=j(s),e.setAttribute(l,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(l,"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"&&(l==="formAction"?(n!=="input"&&kt(e,n,"name",c.name,c,null),kt(e,n,"formEncType",c.formEncType,c,null),kt(e,n,"formMethod",c.formMethod,c,null),kt(e,n,"formTarget",c.formTarget,c,null)):(kt(e,n,"encType",c.encType,c,null),kt(e,n,"method",c.method,c,null),kt(e,n,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=j(s),e.setAttribute(l,s);break;case"onClick":s!=null&&(e.onclick=I);return;case"onScroll":s!=null&&Pe("scroll",e);return;case"onScrollEnd":s!=null&&Pe("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(l=s.__html,l!=null){if(c.children!=null)throw Error(a(60));d?.__html!==l&&(e.innerHTML=l)}}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}l=j(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);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(l,s):e.removeAttribute(l);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(l,""):e.removeAttribute(l);break;case"capture":case"download":s===!0?e.setAttribute(l,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,s):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(l,s):e.removeAttribute(l);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(l):e.setAttribute(l,s);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),Ji(e,"popover",s);break;case"xlinkActuate":Bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Bn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Bn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Bn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Bn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ji(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")l=Wu.get(l)||l,Ji(e,l,s);else return}Ve=!0}function Xf(e,n,l,s,c,d){switch(l){case"style":Pu(e,s,d);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(l=s.__html,l!=null){if(c.children!=null)throw Error(a(60));d?.__html!==l&&(e.innerHTML=l)}}break;case"children":if(typeof s=="string")el(e,s);else if(typeof s=="number"||typeof s=="bigint")el(e,""+s);else return;break;case"onScroll":s!=null&&Pe("scroll",e);return;case"onScrollEnd":s!=null&&Pe("scrollend",e);return;case"onClick":s!=null&&(e.onclick=I);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Ku.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(c=l.endsWith("Capture"),d=l.slice(2,c?l.length-7:void 0),n=e[nn]||null,n=n!=null?n[l]:null,typeof n=="function"&&e.removeEventListener(d,n,c),typeof s=="function")){typeof n!="function"&&n!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(d,s,c);break e}Ve=!0,l in e?e[l]=s:s===!0?e.setAttribute(l,""):Ji(e,l,s)}return}Ve=!0}function hn(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var s=!1,c=!1,d;for(d in l)if(l.hasOwnProperty(d)){var v=l[d];if(v!=null)switch(d){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:kt(e,n,d,v,l,null)}}c&&kt(e,n,"srcSet",l.srcSet,l,null),s&&kt(e,n,"src",l.src,l,null);return;case"input":Pe("invalid",e);var k=d=v=c=null,_=null,U=null;for(s in l)if(l.hasOwnProperty(s)){var F=l[s];if(F!=null)switch(s){case"name":c=F;break;case"type":v=F;break;case"checked":_=F;break;case"defaultChecked":U=F;break;case"value":d=F;break;case"defaultValue":k=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,n));break;default:kt(e,n,s,F,l,null)}}va(e,d,k,_,U,v,c,!1);return;case"select":Pe("invalid",e),s=v=d=null;for(c in l)if(l.hasOwnProperty(c)&&(k=l[c],k!=null))switch(c){case"value":d=k;break;case"defaultValue":v=k;break;case"multiple":s=k;default:kt(e,n,c,k,l,null)}n=d,l=v,e.multiple=!!s,n!=null?Wi(e,!!s,n,!1):l!=null&&Wi(e,!!s,l,!0);return;case"textarea":Pe("invalid",e),d=c=s=null;for(v in l)if(l.hasOwnProperty(v)&&(k=l[v],k!=null))switch(v){case"value":s=k;break;case"defaultValue":c=k;break;case"children":d=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:kt(e,n,v,k,l,null)}wa(e,s,c,d);return;case"option":for(_ in l)l.hasOwnProperty(_)&&(s=l[_],s!=null)&&(_==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":kt(e,n,_,s,l,null));return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(s=0;s<Pa.length;s++)Pe(Pa[s],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("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 l)if(l.hasOwnProperty(U)&&(s=l[U],s!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:kt(e,n,U,s,l,null)}return;default:if(wr(n)){for(F in l)l.hasOwnProperty(F)&&(s=l[F],s!==void 0&&Xf(e,n,F,s,l,void 0));return}}for(k in l)l.hasOwnProperty(k)&&(s=l[k],s!=null&&kt(e,n,k,s,l,null))}var ww={};function Sw(e,n,l,s){switch(n){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,k=null,_=null,U=null,F=null;for(Y in l){var ee=l[Y];if(l.hasOwnProperty(Y)&&ee!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":_=ee;default:s.hasOwnProperty(Y)||kt(e,n,Y,null,s,ee)}}for(var L in s){var Y=s[L];if(ee=l[L],s.hasOwnProperty(L)&&(Y!=null||ee!=null))switch(L){case"type":Y!==ee&&(Ve=!0),d=Y;break;case"name":Y!==ee&&(Ve=!0),c=Y;break;case"checked":Y!==ee&&(Ve=!0),U=Y;break;case"defaultChecked":Y!==ee&&(Ve=!0),F=Y;break;case"value":Y!==ee&&(Ve=!0),v=Y;break;case"defaultValue":Y!==ee&&(Ve=!0),k=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,n));break;default:Y!==ee&&kt(e,n,L,Y,s,ee)}}ba(e,v,k,_,U,F,d,c);return;case"select":Y=v=k=L=null;for(d in l)if(_=l[d],l.hasOwnProperty(d)&&_!=null)switch(d){case"value":break;case"multiple":Y=_;default:s.hasOwnProperty(d)||kt(e,n,d,null,s,_)}for(c in s)if(d=s[c],_=l[c],s.hasOwnProperty(c)&&(d!=null||_!=null))switch(c){case"value":d!==_&&(Ve=!0),L=d;break;case"defaultValue":d!==_&&(Ve=!0),k=d;break;case"multiple":d!==_&&(Ve=!0),v=d;default:d!==_&&kt(e,n,c,d,s,_)}n=k,l=v,s=Y,L!=null?Wi(e,!!l,L,!1):!!s!=!!l&&(n!=null?Wi(e,!!l,n,!0):Wi(e,!!l,l?[]:"",!1));return;case"textarea":Y=L=null;for(k in l)if(c=l[k],l.hasOwnProperty(k)&&c!=null&&!s.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:kt(e,n,k,null,s,c)}for(v in s)if(c=s[v],d=l[v],s.hasOwnProperty(v)&&(c!=null||d!=null))switch(v){case"value":c!==d&&(Ve=!0),L=c;break;case"defaultValue":c!==d&&(Ve=!0),Y=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(a(91));break;default:c!==d&&kt(e,n,v,c,s,d)}xa(e,L,Y);return;case"option":for(var he in l)L=l[he],l.hasOwnProperty(he)&&L!=null&&!s.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:kt(e,n,he,null,s,L));for(_ in s)L=s[_],Y=l[_],s.hasOwnProperty(_)&&L!==Y&&(L!=null||Y!=null)&&(_==="selected"?(L!==Y&&(Ve=!0),e.selected=L&&typeof L!="function"&&typeof L!="symbol"):kt(e,n,_,L,s,Y));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 Ee in l)L=l[Ee],l.hasOwnProperty(Ee)&&L!=null&&!s.hasOwnProperty(Ee)&&kt(e,n,Ee,null,s,L);for(U in s)if(L=s[U],Y=l[U],s.hasOwnProperty(U)&&L!==Y&&(L!=null||Y!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(a(137,n));break;default:kt(e,n,U,L,s,Y)}return;default:if(wr(n)){for(var Ie in l)L=l[Ie],l.hasOwnProperty(Ie)&&L!==void 0&&!s.hasOwnProperty(Ie)&&Xf(e,n,Ie,void 0,s,L);for(F in s)L=s[F],Y=l[F],!s.hasOwnProperty(F)||L===Y||L===void 0&&Y===void 0||Xf(e,n,F,L,s,Y);return}}for(var B in l)L=l[B],l.hasOwnProperty(B)&&L!=null&&!s.hasOwnProperty(B)&&kt(e,n,B,null,s,L);for(ee in s)L=s[ee],Y=l[ee],!s.hasOwnProperty(ee)||L===Y||L==null&&Y==null||kt(e,n,ee,L,s,Y)}function Zg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kw(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,l=performance.getEntriesByType("resource"),s=0;s<l.length;s++){var c=l[s],d=c.transferSize,v=c.initiatorType,k=c.duration;if(d&&k&&Zg(v)){for(v=0,k=c.responseEnd,s+=1;s<l.length;s++){var _=l[s],U=_.startTime;if(U>k)break;var F=_.transferSize,ee=_.initiatorType;F&&Zg(ee)&&(_=_.responseEnd,v+=F*(_<k?1:(k-U)/(_-U)))}if(--s,n+=8*(d+v)/(c.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Zf=null,Kf=null;function es(e){return e.nodeType===9?e:e.ownerDocument}function Kg(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 $g(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Jg(e,n,l,s){return l=es(l).createElement(e),l[Wt]=s,l[nn]=n,hn(l,e,n),Gt(l),l}function $f(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Jf=null;function Ew(){var e=window.event;return e&&e.type==="popstate"?e===Jf?!1:(Jf=e,!0):(Jf=null,!1)}var Pf=typeof setTimeout=="function"?setTimeout:void 0,Tw=typeof clearTimeout=="function"?clearTimeout:void 0,Pg=typeof Promise=="function"?Promise:void 0,Wg=typeof requestAnimationFrame=="function"?requestAnimationFrame:Pf,jw=typeof queueMicrotask=="function"?queueMicrotask:typeof Pg<"u"?function(e){return Pg.resolve(null).then(e).catch(Cw)}:Pf;function Cw(e){setTimeout(function(){throw e})}function wl(e){return e==="head"}function ey(e,n){var l=n,s=0;do{var c=l.nextSibling;if(e.removeChild(l),c&&c.nodeType===8)if(l=c.data,l==="/$"||l==="/&"){if(s===0){e.removeChild(c),na(n);return}s--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")s++;else if(l==="html")ad(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,ad(l);for(var d=l.firstChild;d;){var v=d.nextSibling,k=d.nodeName;d[ql]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&d.rel.toLowerCase()==="stylesheet"||l.removeChild(d),d=v}}else l==="body"&&ad(e.ownerDocument.body);l=c}while(l);na(n)}function ty(e,n){var l=e;e=0;do{var s=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),s&&s.nodeType===8)if(l=s.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=s}while(l)}function ny(e,n,l){if(n=CSS.escape(n)!==n?"r-"+btoa(n).replace(/=/g,""):n,e.style.viewTransitionName=n,l!=null&&(e.style.viewTransitionClass=l),l=getComputedStyle(e),l.display==="inline"){if(n=e.getClientRects(),n.length===1)var s=1;else for(var c=s=0;c<n.length;c++){var d=n[c];0<d.width&&0<d.height&&s++}s===1&&(e=e.style,e.display=n.length===1?"inline-block":"block",e.marginTop="-"+l.paddingTop,e.marginBottom="-"+l.paddingBottom)}}function iy(e,n){e=e.style,n=n.style;var l=n!=null?n.hasOwnProperty("viewTransitionName")?n.viewTransitionName:n.hasOwnProperty("view-transition-name")?n["view-transition-name"]:null:null;e.viewTransitionName=l==null||typeof l=="boolean"?"":(""+l).trim(),l=n!=null?n.hasOwnProperty("viewTransitionClass")?n.viewTransitionClass:n.hasOwnProperty("view-transition-class")?n["view-transition-class"]:null:null,e.viewTransitionClass=l==null||typeof l=="boolean"?"":(""+l).trim(),e.display==="inline-block"&&(n==null?e.display=e.margin="":(l=n.display,e.display=l==null||typeof l=="boolean"?"":l,l=n.margin,l!=null?e.margin=l:(l=n.hasOwnProperty("marginTop")?n.marginTop:n["margin-top"],e.marginTop=l==null||typeof l=="boolean"?"":l,n=n.hasOwnProperty("marginBottom")?n.marginBottom:n["margin-bottom"],e.marginBottom=n==null||typeof n=="boolean"?"":n)))}function Nw(e,n,l){return l=l.ownerDocument.defaultView,{rect:e,abs:n.position==="absolute"||n.position==="fixed",clip:n.clipPath!=="none"||n.overflow!=="visible"||n.filter!=="none"||n.mask!=="none"||n.mask!=="none"||n.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=l.innerHeight&&e.left<=l.innerWidth}}function Wf(e){var n=e.getBoundingClientRect(),l=getComputedStyle(e);return Nw(n,l,e)}function Aw(e){return e.documentElement.clientHeight}function Ow(e){this.addEventListener("load",e),this.addEventListener("error",e)}function _w(e,n,l,s,c,d,v,k,_){var U=n.nodeType===9?n:n.ownerDocument;try{var F=U.startViewTransition({update:function(){var L=U.defaultView,Y=L.navigation&&L.navigation.transition,he=U.fonts.status;s();var Ee=[];if(he==="loaded"&&(Aw(U),U.fonts.status==="loading"&&Ee.push(U.fonts.ready)),he=Ee.length,e!==null)for(var Ie=e.suspenseyImages,B=0,D=0;D<Ie.length;D++){var V=Ie[D];if(!V.complete){var P=V.getBoundingClientRect();if(0<P.bottom&&0<P.right&&P.top<L.innerHeight&&P.left<L.innerWidth){if(B+=Ey(V),B>Po){Ee.length=he;break}V=new Promise(Ow.bind(V)),Ee.push(V)}}}if(0<Ee.length)return L=Promise.race([Promise.all(Ee),new Promise(function(xe){return setTimeout(xe,500)})]).then(c,c),(Y?Promise.allSettled([Y.finished,L]):L).then(d,d);if(c(),Y)return Y.finished.then(d,d);d()},types:l});U.__reactViewTransition=F;var ee=[];return F.ready.then(function(){for(var L=U.documentElement.getAnimations({subtree:!0}),Y=0;Y<L.length;Y++){var he=L[Y],Ee=he.effect,Ie=Ee.pseudoElement;if(Ie!=null&&Ie.startsWith("::view-transition")){ee.push(he),he=Ee.getKeyframes();for(var B=Ie=void 0,D=!0,V=0;V<he.length;V++){var P=he[V],xe=P.width;if(Ie===void 0)Ie=xe;else if(Ie!==xe){D=!1;break}if(xe=P.height,B===void 0)B=xe;else if(B!==xe){D=!1;break}delete P.width,delete P.height,P.transform==="none"&&delete P.transform}D&&Ie!==void 0&&B!==void 0&&(Ee.setKeyframes(he),D=getComputedStyle(Ee.target,Ee.pseudoElement),D.width!==Ie||D.height!==B)&&(D=he[0],D.width=Ie,D.height=B,D=he[he.length-1],D.width=Ie,D.height=B,Ee.setKeyframes(he))}}v()},function(L){U.__reactViewTransition===F&&(U.__reactViewTransition=null);try{typeof L=="object"&&L!==null&&L.name==="InvalidStateError"&&(L.message==="View transition was skipped because document visibility state is hidden."||L.message==="Skipping view transition because document visibility state has become hidden."||L.message==="Skipping view transition because viewport size changed."||L.message==="Transition was aborted because of invalid state")&&(L=null),L!==null&&_(L)}finally{s(),c(),v()}}),F.finished.finally(function(){for(var L=0;L<ee.length;L++)ee[L].cancel();U.__reactViewTransition===F&&(U.__reactViewTransition=null),k()}),F}catch{return s(),c(),v(),null}}function ir(e,n){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+n+")"}ir.prototype.animate=function(e,n){return n=typeof n=="number"?{duration:n}:Q({},n),n.pseudoElement=this._selector,this._scope.animate(e,n)},ir.prototype.getAnimations=function(){for(var e=this._scope,n=this._selector,l=e.getAnimations({subtree:!0}),s=[],c=0;c<l.length;c++){var d=l[c].effect;d!==null&&d.target===e&&d.pseudoElement===n&&s.push(l[c])}return s},ir.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ly(e){return{name:e,group:new ir("group",e),imagePair:new ir("image-pair",e),old:new ir("old",e),new:new ir("new",e)}}function Fn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fn.prototype.addEventListener=function(e,n,l){var s=null,c=null;if(!(l!=null&&typeof l!="boolean"&&(s=l.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var d=this._eventListeners;if(ay(d,e,n,l)===-1){var v=this,k=n;l!=null&&typeof l!="boolean"&&l.once===!0&&(k=function(_){v.removeEventListener(e,n,l),typeof n=="function"?n.call(this,_):n.handleEvent(_)}),s!==null&&(c=v.removeEventListener.bind(v,e,n,l),s.addEventListener("abort",c,{once:!0}),c=s.removeEventListener.bind(s,"abort",c)),s=$r(l),d.push({type:e,listener:n,optionsOrUseCapture:l,attachedListener:k,cleanup:c}),y(this._fragmentFiber.child,!1,zw,e,k,s)}this._eventListeners=d}};function zw(e,n,l,s){return N(e).addEventListener(n,l,s),!1}Fn.prototype.removeEventListener=function(e,n,l){var s=this._eventListeners;if(s!==null&&(n=ay(s,e,n,l),n!==-1)){var c=s[n];l=c.attachedListener;var d=c.cleanup;c=$r(c.optionsOrUseCapture),y(this._fragmentFiber.child,!1,Rw,e,l,c),s.splice(n,1),d!==null&&d()}};function Rw(e,n,l,s){return N(e).removeEventListener(n,l,s),!1}function $r(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function ry(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function ay(e,n,l,s){if(e.length===0)return-1;s=ry(s);for(var c=0;c<e.length;c++){var d=e[c];if(d.type===n&&d.listener===l&&ry(d.optionsOrUseCapture)===s)return c}return-1}Fn.prototype.dispatchEvent=function(e){var n=w(this._fragmentFiber);if(n===null)return!0;n=N(n);var l=this._eventListeners;if(l!==null&&0<l.length||!e.bubbles){var s=n.nodeType===9?n.createComment(""):document.createTextNode("");if(l)for(var c=0;c<l.length;c++){var d=l[c];s.addEventListener(d.type,d.attachedListener,$r(d.optionsOrUseCapture))}if(n.appendChild(s),e=s.dispatchEvent(e),l)for(c=0;c<l.length;c++)d=l[c],s.removeEventListener(d.type,d.attachedListener,$r(d.optionsOrUseCapture));return n.removeChild(s),e}return n.dispatchEvent(e)},Fn.prototype.focus=function(e){y(this._fragmentFiber.child,!0,sy,e,void 0,void 0)};function sy(e,n){return e.tag===6?!1:(e=N(e),Fw(e,n))}Fn.prototype.focusLast=function(e){var n=[];y(this._fragmentFiber.child,!0,ed,n,void 0,void 0);for(var l=n.length-1;0<=l&&!sy(n[l],e);l--);};function ed(e,n){return n.push(e),!1}Fn.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=N(e),e=es(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,qw,e,void 0,void 0))};function qw(e,n){return e.tag===6?!1:(e=N(e),e===n||e.contains(n)?(n.blur(),!0):!1)}Fn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,Mw,e,void 0,void 0)};function Mw(e,n){return e.tag===6||(e=N(e),n.observe(e)),!1}Fn.prototype.unobserveUsing=function(e){var n=this._observers;if(n!==null&&n.has(e)){n.delete(e),y(this._fragmentFiber.child,!1,Dw,e,void 0,void 0);for(var l=n=0;l<ci.length;l++){var s=ci[l];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):ci[n++]=s}ci.length=n}};function Dw(e,n){return e.tag===6||(e=N(e),n.unobserve(e)),!1}var ci=[],td=!1;function Lw(e,n,l){ci.push({fragmentInstance:e,observer:n,instance:l}),td||(td=!0,Qw(function(){td=!1;var s=ci;ci=[];for(var c=0;c<s.length;c++){var d=s[c];d.observer.unobserve(d.instance)}}))}Fn.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,Bw,e,void 0,void 0),e};function Bw(e,n){if(e.tag===6){e=e.stateNode;var l=e.ownerDocument.createRange();l.selectNodeContents(e),n.push.apply(n,l.getClientRects())}else e=N(e),n.push.apply(n,e.getClientRects());return!1}Fn.prototype.getRootNode=function(e){var n=w(this._fragmentFiber);return n===null?this:N(n).getRootNode(e)},Fn.prototype.compareDocumentPosition=function(e){var n=w(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var l=[];y(this._fragmentFiber.child,!1,ed,l,void 0,void 0);var s=N(n);if(l.length===0){if(l=s,x(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(l=n)}n=this._fragmentFiber;var c=s=l.compareDocumentPosition(e);return l===e?c=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(l=S(n)[1],l===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=N(l).compareDocumentPosition(e),c=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),c|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=N(l[0]),c=N(l[l.length-1]);var d=x(this._fragmentFiber)?n.parentElement:s;if(d==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=d.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,d=d.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY;var v=n.compareDocumentPosition(e),k=c.compareDocumentPosition(e),_=v&Node.DOCUMENT_POSITION_CONTAINED_BY||k&Node.DOCUMENT_POSITION_CONTAINED_BY;return k=s&&d&&v&Node.DOCUMENT_POSITION_FOLLOWING&&k&Node.DOCUMENT_POSITION_PRECEDING,n=s&&n===e||d&&c===e||_||k?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&n===e||!d&&c===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:v,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Uw(n,this._fragmentFiber,l[0],l[l.length-1],e)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Uw(e,n,l,s,c){var d=Ln(c);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(l=!!d)e:{for(;d!==null;){if(d.tag===7&&(d===n||d.alternate===n)){l=!0;break e}d=d.return}l=!1}return l}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(d===null)return d=c.ownerDocument,c===d||c===d.documentElement||c===d.body;e:{for(d=n,n=w(n);d!==null;){if(!(d.tag!==5&&d.tag!==3&&d.tag!==27||d!==n&&d.alternate!==n)){d=!0;break e}d=d.return}d=!1}return d}return e&Node.DOCUMENT_POSITION_PRECEDING?((n=!!d)&&!(n=d===l)&&(n=O(l,d,ie),n===null?n=!1:(y(n,!0,H,d,l),d=E,E=null,n=d!==null)),n):e&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!d)&&!(n=d===s)&&(n=O(s,d,ie),n===null?n=!1:(y(n,!0,te,d,s),d=E,M=E=null,n=d!==null)),n):!1}function oy(e,n){var l=e.ownerDocument.createRange();l.selectNodeContents(e),e=l.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,n?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(a(566));var n=[];y(this._fragmentFiber.child,!1,ed,n,void 0,void 0);var l=e!==!1;if(n.length===0){var s=S(this._fragmentFiber);if(s=l?s[1]||s[0]||w(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=N(s),oy(e,l);return}if(s=N(s),s.nodeType!==9){if(s.nodeType===11){l="host"in s?s.host:null,l!==null&&l.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=l?n.length-1:0;s!==(l?-1:n.length);){var c=n[s];c.tag===6?(c=N(c),oy(c,l)):N(c).scrollIntoView(e),s+=l?-1:1}};function Hw(e,n){return e=N(e),uy(e,n),!1}function uy(e,n){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(n)}function cy(e,n){var l=n._eventListeners;if(l!==null)for(var s=0;s<l.length;s++){var c=l[s];e.addEventListener(c.type,c.attachedListener,$r(c.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){for(var v=0,k=0;k<ci.length;k++){var _=ci[k];(_.fragmentInstance!==n||_.observer!==d||_.instance!==e)&&(ci[v++]=_)}ci.length=v,d.observe(e)}),uy(e,n))}function Iw(e,n){var l=n._eventListeners;if(l!==null)for(var s=0;s<l.length;s++){var c=l[s];e.removeEventListener(c.type,c.attachedListener,$r(c.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){typeof d.rootMargin=="string"?Lw(n,d,e):d.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(n))}function nd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":nd(l),Dl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Vw(e,n,l,s){for(;e.nodeType===1;){var c=l;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[ql])switch(n){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(n==="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=Wn(e.nextSibling),e===null)break}return null}function Yw(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Wn(e.nextSibling),e===null))return null;return e}function fy(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Wn(e.nextSibling),e===null))return null;return e}function id(e){return e.data==="$?"||e.data==="$~"}function ld(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Gw(e,n){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||l.readyState!=="loading")n();else{var s=function(){n(),l.removeEventListener("DOMContentLoaded",s)};l.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Wn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var rd=null;function dy(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return Wn(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function my(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return e;n--}else l!=="/$"&&l!=="/&"||n++}e=e.previousSibling}return null}function Fw(e,n){function l(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",l,!0),(e.focus||HTMLElement.prototype.focus).call(e,n)}finally{e.ownerDocument.removeEventListener("focus",l,!0)}return s}function Qw(e){Wg(function(){Wg(function(n){return e(n)})})}function hy(e,n,l){switch(n=es(l),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function py(e,n,l){for(var s in l){var c=l[s];l.hasOwnProperty(s)&&c!=null&&kt(e,n,s,null,ww,c)}l.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===I&&(e.onclick=null),Dl(e)}function ad(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Dl(e)}var ei=new Map,gy=new Set;function ts(e){if(typeof e.getRootNode=="function"){var n=e.getRootNode();if(n.nodeType===9||n.nodeType===11)return n}return e.nodeType===9?e:e.ownerDocument}var Zi=me.d;me.d={f:Xw,r:Zw,D:Kw,C:$w,L:Jw,m:Pw,X:eS,S:Ww,M:tS};function Xw(){var e=Zi.f(),n=Yo();return e||n}function Zw(e){var n=Yt(e);n!==null&&n.tag===5&&n.type==="form"?bp(n):Zi.r(e)}var Jr=typeof document>"u"?null:document;function yy(e,n,l){var s=Jr;if(s&&typeof n=="string"&&n){var c=An(n);c='link[rel="'+e+'"][href="'+c+'"]',typeof l=="string"&&(c+='[crossorigin="'+l+'"]'),gy.has(c)||(gy.add(c),e={rel:e,crossOrigin:l,href:n},s.querySelector(c)===null&&(n=s.createElement("link"),hn(n,"link",e),Gt(n),s.head.appendChild(n)))}}function Kw(e){Zi.D(e),yy("dns-prefetch",e,null)}function $w(e,n){Zi.C(e,n),yy("preconnect",e,n)}function Jw(e,n,l){Zi.L(e,n,l);var s=Jr;if(s&&e&&n){var c='link[rel="preload"][as="'+An(n)+'"]';n==="image"&&l&&l.imageSrcSet?(c+='[imagesrcset="'+An(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(c+='[imagesizes="'+An(l.imageSizes)+'"]')):c+='[href="'+An(e)+'"]';var d=c;switch(n){case"style":d=Pr(e);break;case"script":d=Wr(e)}if(!(ei.has(d)||(e=Q({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),ei.set(d,e),s.querySelector(c)!==null||n==="style"&&s.querySelector(ns(d))||n==="script"&&s.querySelector(is(d))))){var v=s.createElement("link");hn(v,"link",e),n==="style"&&(v[Ml]=!0,v.onload=v.onerror=function(){ma(v)}),Gt(v),s.head.appendChild(v)}}}function Pw(e,n){Zi.m(e,n);var l=Jr;if(l&&e){var s=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+An(s)+'"][href="'+An(e)+'"]',d=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Wr(e)}if(!ei.has(d)&&(e=Q({rel:"modulepreload",href:e},n),ei.set(d,e),l.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(is(d)))return}s=l.createElement("link"),hn(s,"link",e),Gt(s),l.head.appendChild(s)}}}function Ww(e,n,l){Zi.S(e,n,l);var s=Jr;if(s&&e){var c=Di(s).hoistableStyles,d=Pr(e);n=n||"default";var v=c.get(d);if(!v){var k={loading:0,preload:null};if(v=s.querySelector(ns(d)))k.loading=5;else{e=Q({rel:"stylesheet",href:e,"data-precedence":n},l),(l=ei.get(d))&&sd(e,l);var _=v=s.createElement("link");Gt(_),hn(_,"link",e),_._p=new Promise(function(U,F){_.onload=U,_.onerror=F}),_.addEventListener("load",function(){k.loading|=1}),_.addEventListener("error",function(){k.loading|=2}),k.loading|=4,$o(v,n,s)}v={type:"stylesheet",instance:v,count:1,state:k},c.set(d,v)}}}function eS(e,n){Zi.X(e,n);var l=Jr;if(l&&e){var s=Di(l).hoistableScripts,c=Wr(e),d=s.get(c);d||(d=l.querySelector(is(c)),d||(e=Q({src:e,async:!0},n),(n=ei.get(c))&&od(e,n),d=l.createElement("script"),Gt(d),hn(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function tS(e,n){Zi.M(e,n);var l=Jr;if(l&&e){var s=Di(l).hoistableScripts,c=Wr(e),d=s.get(c);d||(d=l.querySelector(is(c)),d||(e=Q({src:e,async:!0,type:"module"},n),(n=ei.get(c))&&od(e,n),d=l.createElement("script"),Gt(d),hn(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function by(e,n,l,s){var c=(c=gt.current)?ts(c):null;if(!c)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=Pr(l.href),n=Di(c).hoistableStyles,s=n.get(l),s||(s={type:"style",instance:null,count:0,state:null},n.set(l,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Pr(l.href);var d=Di(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(ns(e)))?d._p||(v.instance=d,v.state.loading=5):(d=ei.get(e),d||(d={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ei.set(e,d)),nS(c,e,d,v.state))),n&&s===null)throw Error(a(528,""));return v}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(l=Wr(l),n=Di(c).hoistableScripts,s=n.get(l),s||(s={type:"script",instance:null,count:0,state:null},n.set(l,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pr(e){return'href="'+An(e)+'"'}function ns(e){return'link[rel="stylesheet"]['+e+"]"}function vy(e){return Q({},e,{"data-precedence":e.precedence,precedence:null})}function nS(e,n,l,s){if(n=e.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[Ml]!==!0){s.loading=1;return}}else n=e.createElement("link"),n[Ml]=!0,n.onload=n.onerror=ma.bind(null,n),hn(n,"link",l),Gt(n),e.head.appendChild(n);s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2})}function Wr(e){return'[src="'+An(e)+'"]'}function is(e){return"script[async]"+e}function xy(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+An(l.href)+'"]');if(s)return n.instance=s,Gt(s),s;var c=Q({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Gt(s),hn(s,"style",c),$o(s,l.precedence,e),n.instance=s;case"stylesheet":c=Pr(l.href);var d=e.querySelector(ns(c));if(d)return n.state.loading|=4,n.instance=d,Gt(d),d;s=vy(l),(c=ei.get(c))&&sd(s,c),d=(e.ownerDocument||e).createElement("link"),Gt(d);var v=d;return v._p=new Promise(function(k,_){v.onload=k,v.onerror=_}),hn(d,"link",s),n.state.loading|=4,$o(d,l.precedence,e),n.instance=d;case"script":return d=Wr(l.src),(c=e.querySelector(is(d)))?(n.instance=c,Gt(c),c):(s=l,(c=ei.get(d))&&(s=Q({},l),od(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),Gt(c),hn(c,"link",s),e.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,$o(s,l.precedence,e));return n.instance}function $o(e,n,l){for(var s=l.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 k=s[v];if(k.dataset.precedence===n)d=k;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(e,n.firstChild))}function sd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function od(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Jo=null;function wy(e,n,l){if(Jo===null){var s=new Map,c=Jo=new Map;c.set(l,s)}else c=Jo,s=c.get(l),s||(s=new Map,c.set(l,s));if(s.has(e))return s;for(s.set(e,null),l=l.getElementsByTagName(e),c=0;c<l.length;c++){var d=l[c];if(!(d[ql]||d[Wt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var v=d.getAttribute(n)||"";v=e+v;var k=s.get(v);k?k.push(d):s.set(v,[d])}}return s}function ud(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function iS(e,n,l){if(l===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Sy(e,n){return e==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function ky(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ey(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Ty(e,n){typeof n.decode=="function"&&(e.imgCount++,n.complete||(e.imgBytes+=Ey(n),e.suspenseyImages.push(n)),e=aS.bind(e),n.decode().then(e,e))}function lS(e,n,l,s){if(l.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var c=Pr(s.href),d=n.querySelector(ns(c));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=ls.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=d,Gt(d);return}d=n.ownerDocument||n,s=vy(s),(c=ei.get(c))&&sd(s,c),d=d.createElement("link"),Gt(d);var v=d;v._p=new Promise(function(k,_){v.onload=k,v.onerror=_}),hn(d,"link",s),l.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ls.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var Po=0;function rS(e,n){return e.stylesheets&&e.count===0&&eu(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var s=setTimeout(function(){if(e.stylesheets&&eu(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&Po===0&&(Po=62500*kw());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&eu(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Po?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function jy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)eu(e,e.stylesheets);else if(e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}}}function ls(){this.count--,jy(this)}function aS(){this.imgCount--,jy(this)}var Wo=null;function eu(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wo=new Map,n.forEach(sS,e),Wo=null,ls.call(e))}function sS(e,n){if(!(n.state.loading&4)){var l=Wo.get(e);if(l)var s=l.get(null);else{l=new Map,Wo.set(e,l);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")&&(l.set(v.dataset.precedence,v),s=v)}s&&l.set(null,s)}c=n.instance,v=c.getAttribute("data-precedence"),d=l.get(v)||s,d===s&&l.set(null,c),l.set(v,c),this.count++,s=ls.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)),n.state.loading|=4}}var ea={$$typeof:le,Provider:null,Consumer:null,_currentValue:Ze,_currentValue2:Ze,_threadCount:0};function oS(e,n,l,s,c,d,v,k,_){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=gr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gr(0),this.hiddenUpdates=gr(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.transitionTypes=null,this.incompleteTransitions=new Map}function Cy(e,n,l,s,c,d,v,k,_,U,F,ee){return e=new oS(e,n,l,v,_,U,F,ee,k),n=1,d===!0&&(n|=24),d=On(3,null,null,n),e.current=d,d.stateNode=e,n=kc(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:s,isDehydrated:l,cache:n},Cc(d),e}function Ny(e){return e?(e=jr,e):jr}function Ay(e,n,l,s,c,d){c=Ny(c),s.context===null?s.context=c:s.pendingContext=c,s=ul(n),s.payload={element:l},d=d===void 0?null:d,d!==null&&(s.callback=d),l=cl(e,s,n),l!==null&&(qn(l,e,n),Ma(l,e,n))}function Oy(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function cd(e,n){Oy(e,n),(e=e.alternate)&&Oy(e,n)}function _y(e){if(e.tag===13||e.tag===31){var n=Hl(e,67108864);n!==null&&qn(n,e,67108864),cd(e,67108864)}}function zy(e){if(e.tag===13||e.tag===31){var n=Gn();n=Rl(n);var l=Hl(e,n);l!==null&&qn(l,e,n),cd(e,n)}}var ta=!0;function uS(e,n,l,s){var c=$.T;$.T=null;var d=me.p;try{me.p=2,fd(e,n,l,s)}finally{me.p=d,$.T=c}}function cS(e,n,l,s){var c=$.T;$.T=null;var d=me.p;try{me.p=8,fd(e,n,l,s)}finally{me.p=d,$.T=c}}function fd(e,n,l,s){if(ta){var c=dd(s);if(c===null)Qf(e,n,s,tu,l),qy(e,s);else if(dS(c,e,n,l,s))s.stopPropagation();else if(qy(e,s),n&4&&-1<fS.indexOf(e)){for(;c!==null;){var d=Yt(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var v=zi(d.pendingLanes);if(v!==0){var k=d;for(k.pendingLanes|=2,k.entangledLanes|=2;v;){var _=1<<31-Bt(v);k.entanglements[1]|=_,v&=~_}ji(d),(pt&6)===0&&(Ho=xt()+500,Ja(0))}}break;case 31:case 13:k=Hl(d,2),k!==null&&qn(k,d,2),Yo(),cd(d,2)}if(d=dd(s),d===null&&Qf(e,n,s,tu,l),d===c)break;c=d}c!==null&&s.stopPropagation()}else Qf(e,n,s,null,l)}}function dd(e){return e=ge(e),md(e)}var tu=null;function md(e){if(tu=null,e=Ln(e),e!==null){var n=u(e);if(n===null)e=null;else{var l=n.tag;if(l===13){if(e=f(n),e!==null)return e;e=null}else if(l===31){if(e=m(n),e!==null)return e;e=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return tu=e,null}function Ry(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(Ot()){case vn:return 2;case xn:return 8;case hi:case Vt:return 32;case K:return 268435456;default:return 32}default:return 32}}var hd=!1,Sl=null,kl=null,El=null,rs=new Map,as=new Map,Tl=[],fS="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 qy(e,n){switch(e){case"focusin":case"focusout":Sl=null;break;case"dragenter":case"dragleave":kl=null;break;case"mouseover":case"mouseout":El=null;break;case"pointerover":case"pointerout":rs.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":as.delete(n.pointerId)}}function ss(e,n,l,s,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:n,domEventName:l,eventSystemFlags:s,nativeEvent:d,targetContainers:[c]},n!==null&&(n=Yt(n),n!==null&&_y(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,c!==null&&n.indexOf(c)===-1&&n.push(c),e)}function dS(e,n,l,s,c){switch(n){case"focusin":return Sl=ss(Sl,e,n,l,s,c),!0;case"dragenter":return kl=ss(kl,e,n,l,s,c),!0;case"mouseover":return El=ss(El,e,n,l,s,c),!0;case"pointerover":var d=c.pointerId;return rs.set(d,ss(rs.get(d)||null,e,n,l,s,c)),!0;case"gotpointercapture":return d=c.pointerId,as.set(d,ss(as.get(d)||null,e,n,l,s,c)),!0}return!1}function My(e){var n=Ln(e.target);if(n!==null){var l=u(n);if(l!==null){if(n=l.tag,n===13){if(n=f(l),n!==null){e.blockedOn=n,Ms(e.priority,function(){zy(l)});return}}else if(n===31){if(n=m(l),n!==null){e.blockedOn=n,Ms(e.priority,function(){zy(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nu(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=dd(e.nativeEvent);if(l===null){l=e.nativeEvent;var s=new l.constructor(l.type,l);J=s,l.target.dispatchEvent(s),J=null}else return n=Yt(l),n!==null&&_y(n),e.blockedOn=l,!1;n.shift()}return!0}function Dy(e,n,l){nu(e)&&l.delete(n)}function mS(){hd=!1,Sl!==null&&nu(Sl)&&(Sl=null),kl!==null&&nu(kl)&&(kl=null),El!==null&&nu(El)&&(El=null),rs.forEach(Dy),as.forEach(Dy)}function iu(e,n){e.blockedOn===n&&(e.blockedOn=null,hd||(hd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,mS)))}var lu=null;function Ly(e){lu!==e&&(lu=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){lu===e&&(lu=null);for(var n=0;n<e.length;n+=3){var l=e[n],s=e[n+1],c=e[n+2];if(typeof s!="function"){if(md(s||l)===null)continue;break}var d=Yt(l);d!==null&&(e.splice(n,3),n-=3,Zc(d,{pending:!0,data:c,method:l.method,action:s},s,c))}}))}function na(e){function n(_){return iu(_,e)}Sl!==null&&iu(Sl,e),kl!==null&&iu(kl,e),El!==null&&iu(El,e),rs.forEach(n),as.forEach(n);for(var l=0;l<Tl.length;l++){var s=Tl[l];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Tl.length&&(l=Tl[0],l.blockedOn===null);)My(l),l.blockedOn===null&&Tl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(s=0;s<l.length;s+=3){var c=l[s],d=l[s+1],v=c[nn]||null;if(typeof d=="function")v||Ly(l);else if(v){var k=null;if(d&&d.hasAttribute("formAction")){if(c=d,v=d[nn]||null)k=v.formAction;else if(md(c)!==null)continue}else k=v.action;typeof k=="function"?l[s+1]=k:(l.splice(s,3),s-=3),Ly(l)}}}function By(){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 n(){c!==null&&(c(),c=null),s||setTimeout(l,20)}function l(){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",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),c!==null&&(c(),c=null)}}}function pd(e){this._internalRoot=e}ru.prototype.render=pd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,s=Gn();Ay(l,s,e,n,null,null)},ru.prototype.unmount=pd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Ay(e.current,2,null,e,null,null),Yo(),n[ii]=null}};function ru(e){this._internalRoot=e}ru.prototype.unstable_scheduleHydration=function(e){if(e){var n=vr();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Tl.length&&n!==0&&n<Tl[l].priority;l++);Tl.splice(l,0,e),l===0&&My(e)}};var Uy=i.version;if(Uy!=="19.3.1")throw Error(a(527,Uy,"19.3.1"));me.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=g(n),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var hS={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!au.isDisabled&&au.supportsFiber)try{Xt=au.inject(hS),bt=au}catch{}}return us.createRoot=function(e,n){if(!o(e))throw Error(a(299));var l=!1,s="",c=Np,d=Ap,v=Op;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=Cy(e,1,!1,null,null,l,s,null,c,d,v,By),e[ii]=n.current,Ff(e),new pd(n)},us.hydrateRoot=function(e,n,l){if(!o(e))throw Error(a(299));var s=!1,c="",d=Np,v=Ap,k=Op,_=null;return l!=null&&(l.unstable_strictMode===!0&&(s=!0),l.identifierPrefix!==void 0&&(c=l.identifierPrefix),l.onUncaughtError!==void 0&&(d=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(k=l.onRecoverableError),l.formState!==void 0&&(_=l.formState)),n=Cy(e,1,!0,n,l??null,s,c,_,d,v,k,By),n.context=Ny(null),l=n.current,s=Gn(),s=Rl(s),c=ul(s),c.callback=null,cl(l,c,s),l=s,n.current.lanes=l,pi(n,l),ji(n),e[ii]=n.current,Ff(e),new ru(n)},us.version="19.3.1",us}var Ky;function kS(){if(Ky)return bd.exports;Ky=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),bd.exports=SS(),bd.exports}var ES=kS();async function rt(t,i){const r=await fetch("/dsh-bot/api"+t,{...i,headers:{accept:"application/json",...i?.headers??{}}}),a=await r.json().catch(()=>({}));return{status:r.status,body:a&&typeof a=="object"?a:{}}}async function Ni(t,i){const r=await fetch(t,{...i,headers:{accept:"application/json",...i?.headers??{}}}),a=await r.json().catch(()=>({}));return{status:r.status,body:a&&typeof a=="object"?a:{}}}function vv(t,i){return typeof t.message=="string"&&t.message!==""?t.message:i}const TS=/^(?:Name|名字)\s*[::]\s*(.+?)\s*$/i,jS=/^(?:Style|风格)\s*[::]\s*(.+?)\s*$/i,CS=/^(?:Task|任务)\s*[::]\s*(.+?)\s*$/i;function NS(t,i,r){const a=[];return t.trim()!==""&&a.push(`Name: ${t.trim()}`),i.trim()!==""&&a.push(`Style: ${i.trim()}`),r.trim()!==""&&a.push(`Task: ${r.trim()}`),a.join(`
|
|
11
|
-
|
|
12
|
-
`)}function AS(t){const i={name:"",style:"",task:""};for(const r of t.split(`
|
|
13
|
-
`)){const a=TS.exec(r),o=jS.exec(r),u=CS.exec(r);a&&i.name===""?i.name=a[1]??"":o&&i.style===""?i.style=o[1]??"":u&&i.task===""&&(i.task=u[1]??"")}return i}const OS={"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)"},_S={"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":"(空结果)"},xv={en:OS,zh:_S},zS={"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"},RS={"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":"来源"},wv={en:zS,zh:RS},qS={"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…","files.open":"Files","files.title":"Files","files.workspace":"Workspace","files.home":"Home","files.refresh":"Refresh","files.upload":"Upload","files.download":"Download","files.pathHint":"Copy the path","files.empty":"This directory is empty.","files.loading":"Reading this directory…","files.folder":"Folder","files.link":"Link","files.file":"File","files.name":"Name","files.type":"Type","files.size":"Size","files.modified":"Modified","files.drop":"Drop the file to upload it here","files.confirm":"Upload this file into the current directory?","files.overwrite":"Replace the existing file","files.cancel":"Cancel","files.tooLarge":"Files larger than 50 MB are not uploaded.","files.denied":"This location is not available.","files.missing":"This location could not be found.","files.binary":"This file has no preview. Download it instead.","files.exists":"A file with this name is already here.","files.failed":"The file request failed.","files.overlap":"This workspace overlaps the runtime directory.","files.uploading":"Uploading…","files.truncated":"Only the first 1 MB is shown.","files.previewMode":"Preview","files.sourceMode":"Source","files.copy":"Copy","files.copied":"Copied","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."},MS={"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":"正在读取文件…","files.open":"文件","files.title":"文件","files.workspace":"工作区","files.home":"主目录","files.refresh":"刷新","files.upload":"上传","files.download":"下载","files.pathHint":"复制路径","files.empty":"这个目录是空的。","files.loading":"正在读取这个目录…","files.folder":"文件夹","files.link":"链接","files.file":"文件","files.name":"名称","files.type":"类型","files.size":"大小","files.modified":"修改","files.drop":"松开即可上传到当前目录","files.confirm":"把这个文件上传到当前目录?","files.overwrite":"覆盖已有的同名文件","files.cancel":"取消","files.tooLarge":"超过 50 MB 的文件不会上传。","files.denied":"这个位置不可用。","files.missing":"找不到这个位置。","files.binary":"这个文件不能预览,可以下载。","files.exists":"这里已经有同名文件。","files.failed":"文件请求失败。","files.overlap":"工作区与运行时目录重叠。","files.uploading":"正在上传…","files.truncated":"只显示了前 1 MB。","files.previewMode":"预览","files.sourceMode":"源码","files.copy":"复制","files.copied":"已复制","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":"无法读取会话是否仍在运行"},Sv={en:qS,zh:MS},DS={"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."},LS={"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":"没有送出。"},kv={en:DS,zh:LS},BS={"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.menu":"Session actions","session.delete":"Delete permanently","session.deleteRunning":"This session is still running. Wait until it finishes, then delete it.","session.deleteAttached":"This session is still open in the runtime. Leave it, then delete it.","session.deleteFailed":"Could not delete this session.","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"},US={"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.menu":"会话操作","session.delete":"彻底删除","session.deleteRunning":"这个会话还在进行,等它结束后再删除。","session.deleteAttached":"这个会话还开在运行时里。先离开它,再彻底删除。","session.deleteFailed":"没能彻底删除这个会话。","session.listUnavailable":"会话列表不可用","session.unnamed":"新会话","session.blankName":"空白会话","local.mark":"本","local.here":"本机","local.down":"主运行时不可达"},Ev={en:BS,zh:US},HS={"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"},IS={"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":"已记录决定"},Tv={en:HS,zh:IS},VS={"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."},YS={"approval.title":"工具许可","approval.allowOnce":"允许一次","approval.reject":"拒绝","approval.waiting":"等待你的回答","approval.allowed":"已允许一次","approval.rejected":"已拒绝","approval.cancelled":"这个请求已被取消。","approval.failed":"这个请求未能完成。","approval.submitFailed":"决定未能提交。"},jv={en:VS,zh:YS},GS={"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"},FS={"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":"自动审阅"},Cv={en:GS,zh:FS},QS={"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"},XS={"auth.title":"授权","auth.open":"凭据","auth.empty":"当前没有可进行的授权流程。","auth.start":"开始","auth.writeVault":"写入保险库","auth.cancel":"取消","auth.secretMask":"••••••••","auth.unavailable":"此主机未提供官方授权。","auth.failed":"授权未能完成。","auth.close":"关闭"},Nv={en:QS,zh:XS},ZS={"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"},KS={"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":"关闭"},Av={en:ZS,zh:KS},$S={"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"},JS={"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} 毫秒"},Ov={en:$S,zh:JS},_v={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":"重试图片"}},PS={"memory.open":"Memory","memory.title":"Memory","memory.close":"Close","memory.search":"Search memory","memory.scope":"Scope","memory.scope.all":"All scopes","memory.scope.user":"User","memory.scope.session":"Session","memory.scope.work":"Work ticket","memory.scope.skill":"Skill","memory.lifecycle":"Lifecycle","memory.lifecycle.all":"Any lifecycle","memory.lifecycle.active":"Active","memory.lifecycle.corrected":"Corrected","memory.lifecycle.forgotten":"Forgotten","memory.lifecycle.candidate":"Candidate","memory.kind":"Type","memory.type.all":"All types","memory.type.persona":"Persona","memory.type.profile":"User profile","memory.type.fact":"Fact","memory.type.episodic":"Episode","memory.type.procedural":"Procedure","memory.type.state":"Working state","memory.type.skill":"Skill","memory.empty":"Nothing matches these filters.","memory.loading":"Reading memory…","memory.failed":"Memory could not be read.","memory.denied":"Sign in to read memory.","memory.refresh":"Refresh","memory.more":"More","memory.capped":"Only the most recent entries are shown.","memory.readonly":"This view is read-only. Corrections and forgetting still go through the existing tools.","memory.frame":"Context frame","memory.frame.none":"No frozen context frame yet.","memory.frame.unselected":"Do not compare","memory.frame.option":"Revision {revision}","memory.frame.hint":"A frame is a frozen view revision. The snapshot does not store a turn number.","memory.frame.note":"This frame has no context manifest, so the citation form is unknown.","memory.cite.unknown":"Unknown","memory.cite.full":"Full text","memory.cite.summary":"Summary","memory.cite.index":"Index","memory.cite.recall":"Tool recall","memory.cite.absent":"Not cited","memory.cite.reason.no_manifest":"The snapshot only has a hash and a presence bit, so full text, summary, and index cannot be told apart.","memory.cite.reason.no_frame":"Choose a context frame before reading citation.","memory.source":"Source","memory.source.user":"User statement","memory.source.model":"Model write","memory.source.system":"System migration","memory.source.tool":"Tool import","memory.source.unknown":"Unknown","memory.source.unrecorded":"Not recorded","memory.source.created":"Created {time}","memory.source.updated":"Updated {time}","memory.chain":"Corrections","memory.changes":"Changes","memory.tombstone":"Forgotten. The text stays hidden.","memory.version":"Version {version}","memory.profile.empty":"No attributes were recorded.","memory.episode.participants":"Participants: not recorded","memory.procedure.empty":"No steps were recorded.","memory.state.goal":"Goal","memory.state.blockers":"Blocked","memory.state.next":"Next","memory.state.empty":"No goal is recorded.","memory.skill.loadUnknown":"Full text load: unknown","memory.skill.binding":"Skill file · {scope}","memory.skill.public":"Public","memory.skill.private":"Private","memory.skill.disabled":"Disabled","memory.skill.enabled":"Enabled","memory.body.hidden":"The text stays hidden.","memory.body.mismatch":"The stored text does not match its hash, so it stays hidden.","memory.body.absent":"No text is stored.","memory.detail.close":"Close detail","memory.missing":"Not recorded","memory.priority":"Priority {priority}","memory.note":"Note","memory.back":"Back to the list","memory.tool.foundations_remember":"Remember","memory.tool.foundations_correct":"Correct","memory.tool.foundations_forget":"Forget","memory.tool.foundations_state_update":"Update working state"},WS={"memory.open":"记忆","memory.title":"记忆","memory.close":"关闭","memory.search":"搜索记忆","memory.scope":"作用域","memory.scope.all":"全部作用域","memory.scope.user":"用户级","memory.scope.session":"会话级","memory.scope.work":"工作票级","memory.scope.skill":"技能级","memory.lifecycle":"生命周期","memory.lifecycle.all":"全部状态","memory.lifecycle.active":"活跃","memory.lifecycle.corrected":"已更正","memory.lifecycle.forgotten":"已遗忘","memory.lifecycle.candidate":"待确认","memory.kind":"类型","memory.type.all":"全部类型","memory.type.persona":"人格","memory.type.profile":"用户画像","memory.type.fact":"稳定事实","memory.type.episodic":"情景记忆","memory.type.procedural":"过程记忆","memory.type.state":"工作状态","memory.type.skill":"技能","memory.empty":"没有符合这些筛选的记忆。","memory.loading":"正在读取记忆…","memory.failed":"记忆没有读出来。","memory.denied":"需要登录后才能查看记忆。","memory.refresh":"刷新","memory.more":"更多","memory.capped":"只显示最近的一部分。","memory.readonly":"这里只读。更正和遗忘仍走原来的工具。","memory.frame":"上下文帧","memory.frame.none":"还没有冻结过的上下文帧。","memory.frame.unselected":"不对照","memory.frame.option":"修订 {revision}","memory.frame.hint":"对照的是冻结时的视图修订。快照里没有轮次号。","memory.frame.note":"这一帧没有上下文清单,所以引用形式是未知。","memory.cite.unknown":"未知","memory.cite.full":"全文","memory.cite.summary":"摘要","memory.cite.index":"索引","memory.cite.recall":"工具召回","memory.cite.absent":"未引用","memory.cite.reason.no_manifest":"旧快照只有哈希和存在位,分不清全文、摘要还是索引。","memory.cite.reason.no_frame":"先选择一个上下文帧,才能判断引用。","memory.source":"来源","memory.source.user":"用户陈述","memory.source.model":"模型写入","memory.source.system":"系统迁移","memory.source.tool":"工具导入","memory.source.unknown":"未知","memory.source.unrecorded":"历史未记录","memory.source.created":"创建于 {time}","memory.source.updated":"更新于 {time}","memory.chain":"更正链","memory.changes":"变更","memory.tombstone":"已遗忘。正文不显示。","memory.version":"版本 {version}","memory.profile.empty":"没有记录到的属性。","memory.episode.participants":"参与者:历史未记录","memory.procedure.empty":"没有记录到的步骤。","memory.state.goal":"当前目标","memory.state.blockers":"阻塞","memory.state.next":"下一步","memory.state.empty":"没有记录到的目标。","memory.skill.loadUnknown":"全文是否已 load:未知","memory.skill.binding":"技能文件 · {scope}","memory.skill.public":"公开","memory.skill.private":"私有","memory.skill.disabled":"已停用","memory.skill.enabled":"已启用","memory.body.hidden":"正文不显示。","memory.body.mismatch":"正文和哈希对不上,所以不显示。","memory.body.absent":"没有正文。","memory.detail.close":"关闭详情","memory.missing":"未记录","memory.priority":"优先级 {priority}","memory.note":"附注","memory.back":"返回列表","memory.tool.foundations_remember":"记住","memory.tool.foundations_correct":"更正","memory.tool.foundations_forget":"遗忘","memory.tool.foundations_state_update":"更新工作状态"},zv={en:PS,zh:WS},ek={...Ev.en,...Sv.en,...kv.en,...wv.en,...Ov.en,...xv.en,...Tv.en,...jv.en,...Cv.en,...Nv.en,...Av.en,..._v.en,...zv.en},tk={...Ev.zh,...Sv.zh,...kv.zh,...wv.zh,...Ov.zh,...xv.zh,...Tv.zh,...jv.zh,...Cv.zh,...Nv.zh,...Av.zh,..._v.zh,...zv.zh},$y={en:ek,zh:tk},Rv="dsh-bot.locale";function nk(){try{const t=localStorage.getItem(Rv);if(t==="en"||t==="zh")return t}catch{}return"en"}function ik(t){try{localStorage.setItem(Rv,t)}catch{}typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")}function qv(t,i,r){const a=$y[t][i]??$y.en[i];return r?a.replace(/\{(\w+)\}/g,(o,u)=>r[u]??""):a}function Ai(t,i){return qv("en",t,i)}const lk={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 rk(t,i,r=Ai){const a=lk[t];return a?r(a):i}const Mv=C.createContext({locale:"en",setLocale:()=>{},t:Ai});function ak({children:t}){const[i,r]=C.useState(()=>nk()),a=C.useCallback(f=>{ik(f),r(f)},[]),o=C.useCallback((f,m)=>qv(i,f,m),[i]),u=C.useMemo(()=>({locale:i,setLocale:a,t:o}),[i,a,o]);return h.jsx(Mv.Provider,{value:u,children:t})}function We(){return C.useContext(Mv)}const sk={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"},ok=new Set(["delivered","cancelled"]),uk=new Set(["accepted","enqueued","started","needs_user","waiting_budget"]);function Dv(t,i=Ai){const r=sk[t];return r?i(r):t}function Lv(t){return t.replace(/^\uFEFF/,"").trimStart().startsWith("[foundations:ticket]")}function gm(t){const i=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
14
|
-
`).trimStart();if(!i.startsWith("[foundations:briefing]"))return null;const r=i.slice(22).replace(/^\n/,""),a=r.indexOf(`
|
|
15
|
-
---
|
|
16
|
-
`);if(a<0)return null;const o=[],u={};for(const g of r.slice(0,a).split(`
|
|
17
|
-
`)){const b=/^(briefing_revision|budget_wall_ms|budget_max_tokens|material_sha256):\s*(.*)$/.exec(g);b?.[1]?u[b[1]]=(b[2]??"").trim():g.trim()!==""&&o.push(g.trim())}const f=Number(u.briefing_revision),m=Number(u.budget_wall_ms),p=Number(u.budget_max_tokens);return{revision:Number.isFinite(f)&&f>0?f:1,wallMs:Number.isFinite(m)&&m>0?m:null,maxTokens:Number.isFinite(p)&&p>0?p:null,material:u.material_sha256??"",notes:o,body:r.slice(a+5).trim(),cancel:o.some(g=>g.startsWith("This is a cancellation note")||g.startsWith("这是取消说明"))}}function ar(t){return t.startsWith("worker-")&&t.length>7}function ck(t){return ar(t)?t.slice(7):""}function fk(t){const i=t.signals;if(!i||typeof i!="object"||Array.isArray(i))return{};const r={};for(const[a,o]of Object.entries(i))r[a]=Array.isArray(o)?o.filter(u=>typeof u=="string"):[];return r}function dk(t){const i=t.cards;if(!i||typeof i!="object"||Array.isArray(i))return{};const r={};for(const[a,o]of Object.entries(i))r[a]=hk({cards:o});return r}function mk(t){const i=t.work&&typeof t.work=="object"&&!Array.isArray(t.work)?t.work:t;return!("signals"in i)&&!("cards"in i)?null:{signals:fk(i),cards:dk(i)}}function hk(t){return Array.isArray(t.cards)?t.cards.flatMap(i=>{if(!i||typeof i!="object")return[];const r=i,a=typeof r.summary=="string"?r.summary:"",o=pk(r,a);return o?[o]:[]}):[]}function pk(t,i="",r=Ai){const a=t.ticket;if(!a||typeof a!="object")return null;const o=a;if(typeof o.id!="string"||typeof o.status!="string")return null;const u=Array.isArray(t.attempts)?t.attempts:[],f=typeof o.active_attempt_id=="string"?o.active_attempt_id:"",m=u.find(w=>w&&typeof w=="object"&&w.id===f),p=Array.isArray(t.events)?t.events.flatMap(Ek):[],g=typeof o.child_session_id=="string"?o.child_session_id:"";let b=o.waiting_budget===!0;if(typeof o.budget_json=="string")try{b||=JSON.parse(o.budget_json).quota?.waiting===!0}catch{}const y=i.trim()||r("work.ticket");return{id:o.id,status:b&&["started","enqueued"].includes(o.status)?"waiting_budget":o.status,revision:typeof o.briefing_revision=="number"?o.briefing_revision:1,summary:y,childSessionId:g.startsWith("worker-")?g:null,startedAt:typeof m?.started_at=="string"?m.started_at:null,events:p}}function Bv(t){const i=t.filter(a=>!ok.has(a.status)),r=t.find(a=>a.status==="delivered");return r?[...i,r]:i}function Uv(t){return t.some(i=>uk.has(i.status))}function Jy(t,i,r=!1){return r?!1:t&&!Uv(i)}const gk=new Set(["accepted","enqueued","started"]);function yk(t,i=!1){if(i)return"run";let r=!1,a=!1;for(const o of t)o.status==="delivered"||o.status==="cancelled"||(o.status==="needs_user"||o.status==="waiting_budget"?r=!0:gk.has(o.status)&&(a=!0));return r?"wait":a?"run":null}function Sd(t,i=Date.now(),r=Ai){const a=t.filter(f=>f.status==="started");if(a.length>1)return r("work.preview.startedMany",{count:String(a.length)});const o=Vv(t);if(!o||o.status==="ready")return"";const u=Dv(o.status,r);if(o.status==="started"){const f=Iv(o.startedAt,i);return f?`${u} · ${f}`:u}return u}function bk(t,i=Ai){if(t.filter(o=>o.status==="started").length>1)return i("work.placeholder.many");const a=Vv(t);return a?a.status==="started"?i("work.placeholder.started"):a.status==="waiting_budget"?i("work.fact.waitingBudget"):a.status==="needs_user"?i("work.placeholder.needsUser"):a.status==="ready"?i("work.placeholder.ready"):a.status==="failed"?i("work.placeholder.failed"):null:null}function vk(t,i,r=Ai){const a=[r("work.fact.revision",{revision:String(t.revision)})];if(t.status==="accepted"&&a.push(r("work.fact.accepted")),t.status==="enqueued"&&a.push(r("work.fact.enqueued")),t.status==="started"){const u=Iv(t.startedAt,i);u&&a.push(r("work.fact.elapsed",{time:u})),a.push(r("work.fact.wall"))}t.status==="waiting_budget"&&a.push(r("work.fact.waitingBudget")),t.status==="needs_user"&&a.push(r("work.fact.needsUser")),t.status==="ready"&&a.push(r("work.fact.ready")),t.status==="delivered"&&a.push(r("work.fact.delivered")),t.status==="failed"&&a.push(r("work.fact.failed")),t.revision>1&&(t.status==="enqueued"||t.status==="accepted")&&(a.push(r("work.fact.sameWorker")),a.push(r("work.fact.restart")));const o=kk(t);return o&&a.push(o),a}function xk(t){const i=t.events.filter(r=>r.kind==="question"&&r.text.trim()!=="");if(t.status==="needs_user")return{text:i.filter(a=>a.revision===t.revision&&a.applyStatus!=="stale").at(-1)?.text??"",stale:!1};if(t.revision>1&&(t.status==="enqueued"||t.status==="accepted"||t.status==="started")){const r=[...i].reverse().find(a=>a.applyStatus==="stale");if(r)return{text:r.text,stale:!0}}return null}function Hv(t){if(t.name!=="foundations_dispatch"||t.result.trim()==="")return null;const i=ym(t.result);return i?i.ok===!1?null:typeof i.ticketId=="string"&&i.ticketId!==""?i.ticketId:null:/"ticketId"\s*:\s*"([^"]+)"/.exec(t.result)?.[1]??null}function wk(t){if(t.name!=="foundations_dispatch"||t.result.trim()==="")return!1;const i=ym(t.result);return i?i.ok===!1&&i.code==="BUDGET":t.result.includes('"BUDGET"')||/concurrency limit/i.test(t.result)}function Sk(t,i=Ai){const r=ym(t);return r&&typeof r.message=="string"&&r.message!==""?r.message:i("work.budgetFallback")}function Iv(t,i){if(!t)return"";const r=Date.parse(t);if(!Number.isFinite(r))return"";const a=Math.max(0,Math.floor((i-r)/1e3)),o=Math.floor(a/60),u=a%60;return`${o}:${String(u).padStart(2,"0")}`}function Vv(t){const i=Bv(t),r=["waiting_budget","needs_user","started","enqueued","accepted","ready","failed"];for(const a of r){const o=i.find(u=>u.status===a);if(o)return o}return i[0]??null}function kk(t){return t.events.filter(r=>r.kind==="progress"&&r.applyStatus==="applied"&&r.revision===t.revision&&r.text.trim()!=="").at(-1)?.text??""}function Ek(t){if(!t||typeof t!="object")return[];const i=t;return typeof i.event_id!="string"||typeof i.kind!="string"?[]:[{eventId:i.event_id,kind:i.kind,applyStatus:typeof i.apply_status=="string"?i.apply_status:"",revision:typeof i.briefing_revision=="number"?i.briefing_revision:0,text:typeof i.text=="string"?i.text:""}]}function ym(t){try{const i=JSON.parse(t);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}const Tk="modulepreload",jk=function(t){return"/dsh-bot/"+t},Py={},Ck=function(i,r,a){let o=Promise.resolve();if(r&&r.length>0){let p=function(g){return Promise.all(g.map(b=>Promise.resolve(b).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=f?.nonce||f?.getAttribute("nonce");o=p(r.map(g=>{if(g=jk(g),g in Py)return;Py[g]=!0;const b=g.endsWith(".css"),y=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${y}`))return;const w=document.createElement("link");if(w.rel=b?"stylesheet":Tk,b||(w.as="script"),w.crossOrigin="",w.href=g,m&&w.setAttribute("nonce",m),document.head.appendChild(w),b)return new Promise((x,S)=>{w.addEventListener("load",x),w.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return o.then(f=>{for(const m of f||[])m.status==="rejected"&&u(m.reason);return i().catch(u)})};var Ru=bv();const Yv=1120,hs=268,kd=220,Wy=400,Gv=320,Fv=960,Ss=640;function sa(t){return Number.isFinite(t)?Math.min(Fv,Math.max(Gv,Math.round(t))):Ss}function Qv(t){return Math.max(0,(t-Math.min(Yv,t))/2)}function pu(t){const i=Qv(t);return{drawer:0,reserve:0,sidebar:hs,inset:i,insetRight:i,overlap:!1}}function eb(t,i){const r=Math.min(Fv,Math.max(Gv,i)),a=Math.min(Yv,t),o=Qv(t),u=kd+Wy;if(r<=o)return{drawer:r,reserve:0,sidebar:hs,inset:o,insetRight:o,overlap:!1};const f=Math.max(0,o-(r-o)),m=t-f-r;if(m<u)return{drawer:r,reserve:Math.max(0,t-u),sidebar:kd,inset:0,insetRight:0,overlap:!0};const p=Math.max(0,a-m),g=Math.max(0,a-hs-Wy),b=Math.max(0,hs-kd),y=g+b,w=y===0?0:Math.min(g,p*g/y),x=Math.min(b,Math.max(0,p-w));return{drawer:r,reserve:r,sidebar:hs-x,inset:f,insetRight:0,overlap:!1}}let la=null;function gu(t){const i=document.documentElement;i.style.setProperty("--files-inset",`${t.inset}px`),i.style.setProperty("--files-inset-right",`${t.insetRight}px`),i.style.setProperty("--files-reserve",`${t.reserve}px`),i.style.setProperty("--files-sidebar",`${t.sidebar}px`)}function tb(t){if(la!==t)return;la=null,document.documentElement.classList.remove("files-push","files-closing","files-resizing"),gu(pu(0))}function Xv(t){const{present:i,narrow:r,motion:a,width:o,resizing:u,viewport:f}=t,m=C.useRef(Symbol("drawer")),p=C.useRef(!1),g=C.useRef(i),b=C.useRef(a);g.current=i,b.current=a,C.useLayoutEffect(()=>{const y=document.documentElement,w=m.current;if(!i||r){p.current=!1,tb(w);return}if(a==="out"&&la!==null&&la!==w){p.current=!1;return}la=w;const x=a==="out"?pu(f):eb(f,o);if(y.classList.add("files-push"),y.classList.toggle("files-closing",a==="out"),y.classList.toggle("files-resizing",u),!p.current&&a!=="out"){p.current=!0,y.classList.add("files-resizing"),gu(pu(f));let S=!1;const T=requestAnimationFrame(()=>{if(S=!0,la!==w||(y.classList.remove("files-resizing"),!g.current))return;const N=b.current==="out"?pu(window.innerWidth):eb(window.innerWidth,o);gu(N)});return()=>{cancelAnimationFrame(T),S||(p.current=!1)}}p.current=!0,gu(x)},[i,r,a,o,u,f]),C.useEffect(()=>()=>{p.current=!1,tb(m.current)},[])}function $O(t){const i=t.split(".").pop()?.toLowerCase()??"";return{js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",htm:"html",css:"css",scss:"scss",md:"markdown",markdown:"markdown",py:"python",rs:"rust",go:"go",sh:"shell",bash:"shell",zsh:"shell",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",svg:"xml",sql:"sql",java:"java",c:"c",h:"c",cc:"cpp",cpp:"cpp",rb:"ruby",ini:"ini",env:"ini",gitignore:"ini",lock:"ini"}[i]??"plaintext"}function Nk(t){const i=t.split(".").pop()?.toLowerCase()??"";return i==="md"||i==="markdown"}function Ak(t,i){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Ok=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_k=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zk={};function nb(t,i){return(zk.jsx?_k:Ok).test(t)}const Rk=/[ \t\n\f\r]/g;function qk(t){return typeof t=="object"?t.type==="text"?ib(t.value):!1:ib(t)}function ib(t){return t.replace(Rk,"")===""}class As{constructor(i,r,a){this.normal=r,this.property=i,a&&(this.space=a)}}As.prototype.normal={};As.prototype.property={};As.prototype.space=void 0;function Zv(t,i){const r={},a={};for(const o of t)Object.assign(r,o.property),Object.assign(a,o.normal);return new As(r,a,i)}function Xd(t){return t.toLowerCase()}class Dn{constructor(i,r){this.attribute=r,this.property=i}}Dn.prototype.attribute="";Dn.prototype.booleanish=!1;Dn.prototype.boolean=!1;Dn.prototype.commaOrSpaceSeparated=!1;Dn.prototype.commaSeparated=!1;Dn.prototype.defined=!1;Dn.prototype.mustUseProperty=!1;Dn.prototype.number=!1;Dn.prototype.overloadedBoolean=!1;Dn.prototype.property="";Dn.prototype.spaceSeparated=!1;Dn.prototype.space=void 0;let Mk=0;const Be=fr(),Pt=fr(),Zd=fr(),ce=fr(),Nt=fr(),ur=fr(),Qn=fr();function fr(){return 2**++Mk}const Kd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:Pt,commaOrSpaceSeparated:Qn,commaSeparated:ur,number:ce,overloadedBoolean:Zd,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),Ed=Object.keys(Kd);class bm extends Dn{constructor(i,r,a,o){let u=-1;if(super(i,r),lb(this,"space",o),typeof a=="number")for(;++u<Ed.length;){const f=Ed[u];lb(this,Ed[u],(a&Kd[f])===Kd[f])}}}bm.prototype.defined=!0;function lb(t,i,r){r&&(t[i]=r)}function oa(t){const i={},r={};for(const[a,o]of Object.entries(t.properties)){const u=new bm(a,t.transform(t.attributes||{},a),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),i[a]=u,r[Xd(a)]=a,r[Xd(u.attribute)]=a}return new As(i,r,t.space)}const Kv=oa({properties:{ariaActiveDescendant:null,ariaAtomic:Pt,ariaAutoComplete:null,ariaBusy:Pt,ariaChecked:Pt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:Nt,ariaCurrent:null,ariaDescribedBy:Nt,ariaDetails:null,ariaDisabled:Pt,ariaDropEffect:Nt,ariaErrorMessage:null,ariaExpanded:Pt,ariaFlowTo:Nt,ariaGrabbed:Pt,ariaHasPopup:null,ariaHidden:Pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nt,ariaLevel:ce,ariaLive:null,ariaModal:Pt,ariaMultiLine:Pt,ariaMultiSelectable:Pt,ariaOrientation:null,ariaOwns:Nt,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:Pt,ariaReadOnly:Pt,ariaRelevant:null,ariaRequired:Pt,ariaRoleDescription:Nt,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:Pt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(t,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function $v(t,i){return i in t?t[i]:i}function Jv(t,i){return $v(t,i.toLowerCase())}const Dk=oa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ur,acceptCharset:Nt,accessKey:Nt,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alpha:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:Nt,autoFocus:Be,autoPlay:Be,blocking:Nt,capture:null,charSet:null,checked:Be,cite:null,className:Nt,closedBy:null,colorSpace:null,cols:ce,colSpan:ce,command:null,commandFor:null,content:null,contentEditable:Pt,controls:Be,controlsList:Nt,coords:ce|ur,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:Zd,draggable:Pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:Nt,height:ce,hidden:Zd,high:ce,href:null,hrefLang:null,htmlFor:Nt,httpEquiv:Nt,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:Nt,itemRef:Nt,itemScope:Be,itemType:Nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,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:Be,optimum:ce,pattern:null,ping:Nt,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:Nt,required:Be,reversed:Be,rows:ce,rowSpan:ce,sandbox:Nt,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootCustomElementRegistry:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shadowRootSerializable:Be,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:Pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:Pt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nt,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:Pt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Be,disablePictureInPicture:Be,disableRemotePlayback:Be,exportParts:ur,part:Nt,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:Jv}),Lk=oa({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:Qn,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:Nt,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:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,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:ur,g2:ur,glyphName:ur,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:Qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,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:ce,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:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qn,rev:Qn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qn,requiredFeatures:Qn,requiredFonts:Qn,requiredFormats:Qn,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:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:Qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qn,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$v}),Pv=oa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,i){return"xlink:"+i.slice(5).toLowerCase()}}),Wv=oa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Jv}),ex=oa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,i){return"xml:"+i.slice(3).toLowerCase()}}),Bk={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"},Uk=/[A-Z]/g,rb=/-[a-z]/g,Hk=/^data[-\w.:]+$/i;function Ik(t,i){const r=Xd(i);let a=i,o=Dn;if(r in t.normal)return t.property[t.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Hk.test(i)){if(i.charAt(4)==="-"){const u=i.slice(5).replace(rb,Yk);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=i.slice(4);if(!rb.test(u)){let f=u.replace(Uk,Vk);f.charAt(0)!=="-"&&(f="-"+f),i="data"+f}}o=bm}return new o(a,i)}function Vk(t){return"-"+t.toLowerCase()}function Yk(t){return t.charAt(1).toUpperCase()}const Gk=Zv([Kv,Dk,Pv,Wv,ex],"html"),vm=Zv([Kv,Lk,Pv,Wv,ex],"svg");function Fk(t){return t.join(" ").trim()}var ab=/\/\*(?:[^*]|\*(?!\/))*\*\//g,Qk=/\n/g,Xk=/^\s*/,Zk=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Kk=/^:\s*/,$k=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,Jk=/^[;\s]*/,Pk=`
|
|
18
|
-
`,sb="/",ob="*",cs="",Wk="comment",eE="declaration";function tE(t,i){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];i=i||{};var r=1,a=1;function o(S){var T=S.match(Qk);T&&(r+=T.length);var N=S.lastIndexOf(Pk);a=~N?S.length-N:a+S.length}function u(){var S={line:r,column:a};return function(T){return T.position=new f(S),g(),T}}function f(S){this.start=S,this.end={line:r,column:a},this.source=i.source}f.prototype.content=t;function m(S){var T=new Error(i.source+":"+r+":"+a+": "+S);if(T.reason=S,T.filename=i.source,T.line=r,T.column=a,T.source=t,!i.silent)throw T}function p(S){var T=S.exec(t);if(T){var N=T[0];return o(N),t=t.slice(N.length),T}}function g(){p(Xk)}function b(S){for(var T;T=y();)S.push(T);return S}function y(){var S=u();if(!(sb!=t.charAt(0)||ob!=t.charAt(1))){for(var T=2;cs!=t.charAt(T)&&(ob!=t.charAt(T)||sb!=t.charAt(T+1));)++T;if(T+=2,cs===t.charAt(T-1))return m("End of comment missing");var N=t.slice(2,T-2);return a+=2,o(N),t=t.slice(T),a+=2,S({type:Wk,comment:N})}}function w(){var S=u(),T=p(Zk);if(T){if(y(),!p(Kk))return m("property missing ':'");var N=p($k),E=S({type:eE,property:T[0].replace(ab,cs).trim(),value:N?N[0].replace(ab,cs).trim():cs});return p(Jk),E}}function x(){var S=[];b(S);for(var T;T=w();)S.push(T),b(S);return S}return g(),x()}function nE(t,i){let r=null;if(!t||typeof t!="string")return r;const a=tE(t),o=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:m}=u;o?i(f,m,u):m&&(r=r??{},r[f]=m)}),r}const tx=nx("end"),xm=nx("start");function nx(t){return i;function i(r){const a=r&&r.position&&r.position[t]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function iE(t){const i=xm(t),r=tx(t);if(i&&r)return{start:i,end:r}}function gs(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?ub(t.position):"start"in t||"end"in t?ub(t):"line"in t||"column"in t?$d(t):""}function $d(t){return cb(t&&t.line)+":"+cb(t&&t.column)}function ub(t){return $d(t&&t.start)+"-"+$d(t&&t.end)}function cb(t){return t&&typeof t=="number"?t:1}class qu extends Error{constructor(i,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let o="",u={},f=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof i=="string"?o=i:!u.cause&&i&&(f=!0,o=i.message,u.cause=i),!u.ruleId&&!u.source&&typeof a=="string"){const p=a.indexOf(":");p===-1?u.ruleId=a:(u.source=a.slice(0,p),u.ruleId=a.slice(p+1))}if(!u.place&&u.ancestors){const p=u.ancestors[u.ancestors.length-1];p&&(u.place=p.position)}const m=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=m?m.line:void 0,this.name=gs(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=f&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(qu.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 wm={}.hasOwnProperty,lE=new Map,rE=/[A-Z]/g,aE=/-([a-z])/g,sE=new Set(["table","tbody","thead","tfoot","tr"]),oE=new Set(["td","th"]),ix="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function uE(t,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=i.filePath||void 0;let a;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=yE(r,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=gE(r,i.jsx,i.jsxs)}const o={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:a,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?vm:Gk,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},u=lx(o,t,void 0);return u&&typeof u!="string"?u:o.create(t,o.Fragment,{children:u||void 0},void 0)}function lx(t,i,r){if(i.type==="element")return cE(t,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return fE(t,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return mE(t,i,r);if(i.type==="mdxjsEsm")return dE(t,i);if(i.type==="root")return hE(t,i,r);if(i.type==="text")return pE(t,i)}function cE(t,i,r){const a=t.schema;let o=a;i.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=vm,t.schema=o),t.ancestors.push(i);const u=ax(t,i.tagName,!1),f=bE(t,i);let m=km(t,i);return sE.has(i.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!qk(p):!0})),rx(t,f,u,i),Sm(f,m),t.ancestors.pop(),t.schema=a,t.create(i,u,f,r)}function fE(t,i){if(i.data&&i.data.estree&&t.evaluater){const a=i.data.estree.body[0];return a.type,t.evaluater.evaluateExpression(a.expression)}ks(t,i.position)}function dE(t,i){if(i.data&&i.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(i.data.estree);ks(t,i.position)}function mE(t,i,r){const a=t.schema;let o=a;i.name==="svg"&&a.space==="html"&&(o=vm,t.schema=o),t.ancestors.push(i);const u=i.name===null?t.Fragment:ax(t,i.name,!0),f=vE(t,i),m=km(t,i);return rx(t,f,u,i),Sm(f,m),t.ancestors.pop(),t.schema=a,t.create(i,u,f,r)}function hE(t,i,r){const a={};return Sm(a,km(t,i)),t.create(i,t.Fragment,a,r)}function pE(t,i){return i.value}function rx(t,i,r,a){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(i.node=a)}function Sm(t,i){if(i.length>0){const r=i.length>1?i:i[0];r&&(t.children=r)}}function gE(t,i,r){return a;function a(o,u,f,m){const g=Array.isArray(f.children)?r:i;return m?g(u,f,m):g(u,f)}}function yE(t,i){return r;function r(a,o,u,f){const m=Array.isArray(u.children),p=xm(a);return i(o,u,f,m,{columnNumber:p?p.column-1:void 0,fileName:t,lineNumber:p?p.line:void 0},void 0)}}function bE(t,i){const r={};let a,o;for(o in i.properties)if(o!=="children"&&wm.call(i.properties,o)){const u=xE(t,o,i.properties[o]);if(u){const[f,m]=u;t.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&oE.has(i.tagName)?a=m:r[f]=m}}if(a){const u=r.style||(r.style={});u[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function vE(t,i){const r={};for(const a of i.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&t.evaluater){const u=a.data.estree.body[0];u.type;const f=u.expression;f.type;const m=f.properties[0];m.type,Object.assign(r,t.evaluater.evaluateExpression(m.argument))}else ks(t,i.position);else{const{name:o}=a;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&t.evaluater){const m=a.value.data.estree.body[0];m.type,u=t.evaluater.evaluateExpression(m.expression)}else ks(t,i.position);else u=a.value===null?!0:a.value;r[o]=u}return r}function km(t,i){const r=[];let a=-1;const o=t.passKeys?new Map:lE;for(;++a<i.children.length;){const u=i.children[a];let f;if(t.passKeys){const p=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(p){const g=o.get(p)||0;f=p+"-"+g,o.set(p,g+1)}}const m=lx(t,u,f);m!==void 0&&r.push(m)}return r}function xE(t,i,r){if(r==null||typeof r=="number"&&Number.isNaN(r))return;const a=Ik(t.schema,i);return Array.isArray(r)&&(r=a.commaSeparated?Ak(r):Fk(r)),a.property==="style"?["style",typeof r=="object"?t.stylePropertyNameCase==="dom"?r:SE(r):wE(t,String(r))]:[t.elementAttributeNameCase==="react"&&a.space?Bk[a.property]||a.property:a.attribute,r]}function wE(t,i){const r={};try{nE(i,function(a,o){if(a&&o){let u=a;u.slice(0,2)!=="--"&&(u=u.toLowerCase(),t.stylePropertyNameCase==="dom"&&(u.slice(0,4)==="-ms-"&&(u=u.slice(1)),u=u.replace(aE,TE))),r[u]=o}})}catch(a){if(t.ignoreInvalidStyle)return{};const o=a,u=new qu("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=t.filePath||void 0,u.url=ix+"#cannot-parse-style-attribute",u}return r}function ax(t,i,r){let a;if(!r)a={type:"Literal",value:i};else if(i.includes(".")){const o=i.split(".");let u=-1,f;for(;++u<o.length;){const m=nb(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};f=f?{type:"MemberExpression",object:f,property:m,computed:!!(u&&m.type==="Literal"),optional:!1}:m}a=f}else a=nb(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(a.type==="Literal"){const o=a.value;return wm.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(a);ks(t)}function ks(t,i){const r=new qu("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=ix+"#cannot-handle-mdx-estrees-without-createevaluater",r}function SE(t){const i={};let r;for(r in t)wm.call(t,r)&&(i[kE(r)]=t[r]);return i}function kE(t){if(t.slice(0,2)==="--")return t;let i=t.replace(rE,EE);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function EE(t){return"-"+t.toLowerCase()}function TE(t,i){return i.toUpperCase()}const Td={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"]},jE={};function Mu(t,i){const r=jE,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return sx(t,a,o)}function sx(t,i,r){if(CE(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(i&&"alt"in t&&t.alt)return t.alt;if("children"in t)return fb(t.children,i,r)}return Array.isArray(t)?fb(t,i,r):""}function fb(t,i,r){const a=[];let o=-1;for(;++o<t.length;)a[o]=sx(t[o],i,r);return a.join("")}function CE(t){return!!(t&&typeof t=="object")}const db=document.createElement("i");function Em(t){const i="&"+t+";";db.innerHTML=i;const r=db.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===i?!1:r}function di(t,i,r,a){const o=t.length;let u=0,f;if(i<0?i=-i>o?0:o+i:i=i>o?o:i,r=r>0?r:0,a.length<1e4)f=Array.from(a),f.unshift(i,r),t.splice(...f);else for(r&&t.splice(i,r);u<a.length;)f=a.slice(u,u+1e4),f.unshift(i,0),t.splice(...f),u+=1e4,i+=1e4}function ti(t,i){return t.length>0?(di(t,t.length,0,i),t):i}const mb={}.hasOwnProperty;function ox(t){const i={};let r=-1;for(;++r<t.length;)NE(i,t[r]);return i}function NE(t,i){let r;for(r in i){const o=(mb.call(t,r)?t[r]:void 0)||(t[r]={}),u=i[r];let f;if(u)for(f in u){mb.call(o,f)||(o[f]=[]);const m=u[f];AE(o[f],Array.isArray(m)?m:m?[m]:[])}}}function AE(t,i){let r=-1;const a=[];for(;++r<i.length;)(i[r].add==="after"?t:a).push(i[r]);di(t,0,0,a)}function ux(t,i){const r=Number.parseInt(t,i);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function mi(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const gn=Al(/[A-Za-z]/),yn=Al(/[\dA-Za-z]/),OE=Al(/[#-'*+\--9=?A-Z^-~]/);function xu(t){return t!==null&&(t<32||t===127)}const Jd=Al(/\d/),_E=Al(/[\dA-Fa-f]/),cx=Al(/[!-/:-@[-`{-~]/);function Re(t){return t!==null&&t<-2}function At(t){return t!==null&&(t<0||t===32)}function Xe(t){return t===-2||t===-1||t===32}const Os=Al(new RegExp("\\p{P}|\\p{S}","u")),cr=Al(/\s/);function Al(t){return i;function i(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function ua(t){const i=[];let r=-1,a=0,o=0;for(;++r<t.length;){const u=t.charCodeAt(r);let f="";if(u===37&&yn(t.charCodeAt(r+1))&&yn(t.charCodeAt(r+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(f=String.fromCharCode(u));else if(u>55295&&u<57344){const m=t.charCodeAt(r+1);u<56320&&m>56319&&m<57344?(f=String.fromCharCode(u,m),o=1):f="�"}else f=String.fromCharCode(u);f&&(i.push(t.slice(a,r),encodeURIComponent(f)),a=r+o+1,f=""),o&&(r+=o,o=0)}return i.join("")+t.slice(a)}function mt(t,i,r,a){const o=a?a-1:1/0;let u=0;return f;function f(p){return Xe(p)?(t.enter(r),m(p)):i(p)}function m(p){return Xe(p)&&u++<o?(t.consume(p),m):(t.exit(r),i(p))}}function fx(t,i,r,a,o,u){let f=0;return m;function m(b){return Xe(b)?(t.enter(a),p(b)):g(b)}function p(b){return Xe(b)&&f<u?(t.consume(b),f++,p):(t.exit(a),g(b))}function g(b){return f>=o?i(b):r(b)}}const zE={tokenize:RE};function RE(t){const i=t.attempt(this.parser.constructs.contentInitial,a,o);let r;return i;function a(m){if(m===null){t.consume(m);return}return t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),mt(t,i,"linePrefix")}function o(m){return t.enter("paragraph"),u(m)}function u(m){const p=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=p),r=p,f(m)}function f(m){if(m===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(m);return}return Re(m)?(t.consume(m),t.exit("chunkText"),u):(t.consume(m),f)}}let wu=class{constructor(){this.index=new Map,this.map=[]}add(i,r,a){hb(this,i,r,a,!1)}addBefore(i,r,a){hb(this,i,r,a,!0)}consume(i){if(this.map.sort(function(u,f){return u[0]-f[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];a.push(i.slice()),i.length=0;let o=a.pop();for(;o;){for(const u of o)i.push(u);o=a.pop()}this.map.length=0,this.index.clear()}};function hb(t,i,r,a,o){if(r===0&&a.length===0)return;const u=t.index.get(i);if(u){u[1]+=r,o?(a.push(...u[2]),u[2]=a):u[2].push(...a);return}const f=[i,r,a];t.map.push(f),t.index.set(i,f)}const qE={tokenize:ME},pb={tokenize:DE};function ME(t){const i=this,r=[];let a=0,o,u,f;return m;function m(H){if(a<r.length){const te=r[a];return i.containerState=te[1],t.attempt(te[0].continuation,p,g)(H)}return g(H)}function p(H){if(a++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,o&&M();const te=i.events.length;let ie=te,O;for(;ie--;)if(i.events[ie][0]==="exit"&&i.events[ie][1].type==="chunkFlow"){O=i.events[ie][1].end;break}E(a);let Q=te;for(;Q<i.events.length;)i.events[Q][1].end={...O},Q++;const re=new wu;return re.add(ie+1,0,i.events.slice(te)),re.add(te,Q-te,[]),re.consume(i.events),g(H)}return m(H)}function g(H){if(a===r.length){if(!o)return w(H);if(o.currentConstruct&&o.currentConstruct.concrete)return S(H);i.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return i.containerState={},t.check(pb,b,y)(H)}function b(H){return o&&M(),E(a),w(H)}function y(H){return i.parser.lazy[i.now().line]=a!==r.length,f=i.now().offset,S(H)}function w(H){return i.containerState={},t.attempt(pb,x,S)(H)}function x(H){return a++,r.push([i.currentConstruct,i.containerState]),w(H)}function S(H){if(H===null){o&&M(),E(0),t.consume(H);return}return o=o||i.parser.flow(i.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),T(H)}function T(H){if(H===null){N(t.exit("chunkFlow"),!0),E(0),t.consume(H);return}return Re(H)?(t.consume(H),N(t.exit("chunkFlow")),a=0,i.interrupt=void 0,m):(t.consume(H),T)}function N(H,te){const ie=i.sliceStream(H);if(te&&ie.push(null),H.previous=u,u&&(u.next=H),u=H,o.defineSkip(H.start),o.write(ie),i.parser.lazy[H.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<f&&(!o.events[O][1].end||o.events[O][1].end.offset>f))return;const Q=i.events.length;let re=Q,pe,z;for(;re--;)if(i.events[re][0]==="exit"&&i.events[re][1].type==="chunkFlow"){if(pe){z=i.events[re][1].end;break}pe=!0}for(E(a),O=Q;O<i.events.length;)i.events[O][1].end={...z},O++;const Z=new wu;Z.add(re+1,0,i.events.slice(Q)),Z.add(Q,O-Q,[]),Z.consume(i.events)}}function E(H){let te=r.length;for(;te-- >H;){const ie=r[te];i.containerState=ie[1],ie[0].exit.call(i,t)}r.length=H}function M(){o.write([null]),u=void 0,o=void 0,i.containerState._closeFlow=void 0}}function DE(t,i,r){return mt(t,t.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Nl(t){if(t===null||At(t)||cr(t))return 1;if(Os(t))return 2}function Du(t,i,r){const a=[];let o=-1;for(;++o<t.length;){const u=t[o].resolveAll;u&&!a.includes(u)&&(i=u(i,r),a.push(u))}return i}const Pd={name:"attention",resolveAll:LE,tokenize:BE};function LE(t,i){let r=-1,a;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){let o=r;for(;o--;)if(t[o][0]==="exit"&&t[o][1].type==="attentionSequence"&&t[o][1]._open&&i.sliceSerialize(t[o][1]).charCodeAt(0)===i.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[o][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[o][1].end.offset-t[o][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;const u=t[o][1].end.offset-t[o][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1,f={...t[o][1].end},m={...t[r][1].start};gb(f,-u),gb(m,u);const p={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...t[o][1].end}},g={type:u>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:m},b={type:u>1?"strongText":"emphasisText",start:{...t[o][1].end},end:{...t[r][1].start}},y={type:u>1?"strong":"emphasis",start:{...p.start},end:{...g.end}};t[o][1].end={...p.start},t[r][1].start={...g.end},a=[],t[o][1].end.offset-t[o][1].start.offset&&(a=ti(a,[["enter",t[o][1],i],["exit",t[o][1],i]])),a=ti(a,[["enter",y,i],["enter",p,i],["exit",p,i],["enter",b,i]]),a=ti(a,Du(i.parser.constructs.insideSpan.null,t.slice(o+1,r),i)),a=ti(a,[["exit",b,i],["enter",g,i],["exit",g,i],["exit",y,i]]);let w=0;t[r][1].end.offset-t[r][1].start.offset&&(w=2,a=ti(a,[["enter",t[r][1],i],["exit",t[r][1],i]])),di(t,o-1,r-o+3,a),r=o+a.length-w-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function BE(t,i){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,o=Nl(a);let u;return f;function f(p){return u=p,t.enter("attentionSequence"),m(p)}function m(p){if(p===u)return t.consume(p),m;const g=t.exit("attentionSequence"),b=Nl(p),y=!b||b===2&&o||r.includes(p)&&p!==42&&p!==95,w=!o||o===2&&b||r.includes(a)&&a!==42&&a!==95;return g._open=!!(u===42?y:y&&(o||!w)),g._close=!!(u===42?w:w&&(b||!y)),i(p)}}function gb(t,i){t.column+=i,t.offset+=i,t._bufferIndex+=i}const UE={name:"autolink",tokenize:HE};function HE(t,i,r){let a=0;return o;function o(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),u}function u(x){return gn(x)?(t.consume(x),f):x===64?r(x):g(x)}function f(x){return x===43||x===45||x===46||yn(x)?(a=1,m(x)):g(x)}function m(x){return x===58?(t.consume(x),a=0,p):(x===43||x===45||x===46||yn(x))&&a++<32?(t.consume(x),m):(a=0,g(x))}function p(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),i):x===null||x===32||x===60||xu(x)?r(x):(t.consume(x),p)}function g(x){return x===64?(t.consume(x),b):OE(x)?(t.consume(x),g):r(x)}function b(x){return yn(x)?y(x):r(x)}function y(x){return x===46?(t.consume(x),a=0,b):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),i):w(x)}function w(x){if((x===45||yn(x))&&a++<63){const S=x===45?w:y;return t.consume(x),S}return r(x)}}const _s={partial:!0,tokenize:IE};function IE(t,i,r){return a;function a(u){return Xe(u)?mt(t,o,"linePrefix")(u):o(u)}function o(u){return u===null||Re(u)?i(u):r(u)}}const dx={continuation:{tokenize:YE},exit:GE,name:"blockQuote",tokenize:VE};function VE(t,i,r){const a=this;return o;function o(f){if(f===62){const m=a.containerState;return m.open||(t.enter("blockQuote",{_container:!0}),m.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(f),t.exit("blockQuoteMarker"),u}return r(f)}function u(f){return Xe(f)?(t.enter("blockQuotePrefixWhitespace"),t.consume(f),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),i):(t.exit("blockQuotePrefix"),i(f))}}function YE(t,i,r){const a=this;return o;function o(f){return Xe(f)?mt(t,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):u(f)}function u(f){return t.attempt(dx,i,r)(f)}}function GE(t){t.exit("blockQuote")}const mx={name:"characterEscape",tokenize:FE};function FE(t,i,r){return a;function a(u){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(u),t.exit("escapeMarker"),o}function o(u){return cx(u)?(t.enter("characterEscapeValue"),t.consume(u),t.exit("characterEscapeValue"),t.exit("characterEscape"),i):r(u)}}const hx={name:"characterReference",tokenize:QE};function QE(t,i,r){const a=this;let o=0,u,f;return m;function m(y){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(y),t.exit("characterReferenceMarker"),p}function p(y){return y===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(y),t.exit("characterReferenceMarkerNumeric"),g):(t.enter("characterReferenceValue"),u=31,f=yn,b(y))}function g(y){return y===88||y===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(y),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),u=6,f=_E,b):(t.enter("characterReferenceValue"),u=7,f=Jd,b(y))}function b(y){if(y===59&&o){const w=t.exit("characterReferenceValue");return f===yn&&!Em(a.sliceSerialize(w))?r(y):(t.enter("characterReferenceMarker"),t.consume(y),t.exit("characterReferenceMarker"),t.exit("characterReference"),i)}return f(y)&&o++<u?(t.consume(y),b):r(y)}}const Wd={partial:!0,tokenize:XE};function XE(t,i,r){const a=this;return o;function o(f){return f===null?r(f):(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),u)}function u(f){return a.parser.lazy[a.now().line]?r(f):i(f)}}const yb={concrete:!0,name:"codeFenced",tokenize:ZE};function ZE(t,i,r){const a=this,o={partial:!0,tokenize:ie};let u=0,f=0,m;return p;function p(O){return g(O)}function g(O){const Q=a.events[a.events.length-1];return u=Q&&Q[1].type==="linePrefix"?Q[2].sliceSerialize(Q[1],!0).length:0,m=O,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),b(O)}function b(O){return O===m?(f++,t.consume(O),b):f<3?r(O):(t.exit("codeFencedFenceSequence"),Xe(O)?mt(t,y,"whitespace")(O):y(O))}function y(O){return O===null||Re(O)?(t.exit("codeFencedFence"),a.interrupt?i(O):t.check(Wd,T,te)(O)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),w(O))}function w(O){return O===null||Re(O)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),y(O)):Xe(O)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),mt(t,x,"whitespace")(O)):O===96&&O===m?r(O):(t.consume(O),w)}function x(O){return O===null||Re(O)?y(O):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),S(O))}function S(O){return O===null||Re(O)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),y(O)):O===96&&O===m?r(O):(t.consume(O),S)}function T(O){return t.attempt(o,te,N)(O)}function N(O){return t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),E}function E(O){return u>0&&Xe(O)?mt(t,M,"linePrefix",u+1)(O):M(O)}function M(O){return O===null||Re(O)?t.check(Wd,T,te)(O):(t.enter("codeFlowValue"),H(O))}function H(O){return O===null||Re(O)?(t.exit("codeFlowValue"),M(O)):(t.consume(O),H)}function te(O){return t.exit("codeFenced"),i(O)}function ie(O,Q,re){let pe=0;return z;function z(le){return O.enter("lineEnding"),O.consume(le),O.exit("lineEnding"),Z}function Z(le){return O.enter("codeFencedFence"),Xe(le)?mt(O,W,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(le):W(le)}function W(le){return le===m?(O.enter("codeFencedFenceSequence"),je(le)):re(le)}function je(le){return le===m?(pe++,O.consume(le),je):pe>=f?(O.exit("codeFencedFenceSequence"),Xe(le)?mt(O,qe,"whitespace")(le):qe(le)):re(le)}function qe(le){return le===null||Re(le)?(O.exit("codeFencedFence"),Q(le)):re(le)}}}const jd={name:"codeIndented",tokenize:$E},KE={partial:!0,tokenize:JE};function $E(t,i,r){return a;function a(m){return t.enter("codeIndented"),fx(t,o,r,"linePrefix",4,4)(m)}function o(m){return m===null?f(m):Re(m)?t.attempt(KE,o,f)(m):(t.enter("codeFlowValue"),u(m))}function u(m){return m===null||Re(m)?(t.exit("codeFlowValue"),o(m)):(t.consume(m),u)}function f(m){return t.exit("codeIndented"),i(m)}}function JE(t,i,r){const a=this;return o;function o(f){return a.parser.lazy[a.now().line]?r(f):Re(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),o):fx(t,i,u,"linePrefix",4,4)(f)}function u(f){return Re(f)?o(f):r(f)}}const PE={name:"codeText",previous:eT,resolve:WE,tokenize:tT};function WE(t){let i=t.length-4,r=3,a,o;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[i][1].type==="lineEnding"||t[i][1].type==="space")){for(a=r;++a<i;)if(t[a][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[i][1].type="codeTextPadding",r+=2,i-=2;break}}for(a=r-1,i++;++a<=i;)o===void 0?a!==i&&t[a][1].type!=="lineEnding"&&(o=a):(a===i||t[a][1].type==="lineEnding")&&(t[o][1].type="codeTextData",a!==o+2&&(t[o][1].end=t[a-1][1].end,t.splice(o+2,a-o-2),i-=a-o-2,a=o+2),o=void 0);return t}function eT(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tT(t,i,r){let a=0,o,u;return f;function f(y){return t.enter("codeText"),t.enter("codeTextSequence"),m(y)}function m(y){return y===96?(t.consume(y),a++,m):(t.exit("codeTextSequence"),p(y))}function p(y){return y===null?r(y):y===32?(t.enter("space"),t.consume(y),t.exit("space"),p):y===96?(u=t.enter("codeTextSequence"),o=0,b(y)):Re(y)?(t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),p):(t.enter("codeTextData"),g(y))}function g(y){return y===null||y===32||y===96||Re(y)?(t.exit("codeTextData"),p(y)):(t.consume(y),g)}function b(y){return y===96?(t.consume(y),o++,b):o===a?(t.exit("codeTextSequence"),t.exit("codeText"),i(y)):(u.type="codeTextData",g(y))}}class nT{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(i,a):i>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(i,r,a){const o=r||0;this.setCursor(Math.trunc(i));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&fs(this.left,a),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),fs(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),fs(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const r=this.left.splice(i,Number.POSITIVE_INFINITY);fs(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);fs(this.left,r.reverse())}}}function fs(t,i){let r=0;if(i.length<1e4)t.push(...i);else for(;r<i.length;)t.push(...i.slice(r,r+1e4)),r+=1e4}function px(t){const i={};let r=-1,a,o,u,f,m,p,g;const b=new nT(t);for(;++r<b.length;){for(;r in i;)r=i[r];if(a=b.get(r),r&&a[1].type==="chunkFlow"&&b.get(r-1)[1].type==="listItemPrefix"&&(p=a[1]._tokenizer.events,u=0,u<p.length&&p[u][1].type==="lineEndingBlank"&&(u+=2),u<p.length&&p[u][1].type==="content"))for(;++u<p.length&&p[u][1].type!=="content";)p[u][1].type==="chunkText"&&(p[u][1]._isInFirstContentOfListItem=!0,u++);if(a[0]==="enter")a[1].contentType&&(Object.assign(i,iT(b,r)),r=i[r],g=!0);else if(a[1]._container){for(u=r,o=void 0;u--;)if(f=b.get(u),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(o&&(b.get(o)[1].type="lineEndingBlank"),f[1].type="lineEnding",o=u);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;o&&(a[1].end={...b.get(o)[1].start},m=b.slice(o,r),m.unshift(a),b.splice(o,r-o+1,m))}}return di(t,0,Number.POSITIVE_INFINITY,b.slice(0)),!g}function iT(t,i){const r=t.get(i)[1],a=t.get(i)[2];let o=i-1;const u=[];let f=r._tokenizer;f||(f=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const m=f.events,p=[],g={};let b,y,w=-1,x=r,S=0,T=0;const N=[T];for(;x;){for(;t.get(++o)[1]!==x;);u.push(o),x._tokenizer||(b=a.sliceStream(x),x.next||b.push(null),y&&f.defineSkip(x.start),x._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(b),x._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),y=x,x=x.next}for(x=r;++w<m.length;)m[w][0]==="exit"&&m[w-1][0]==="enter"&&m[w][1].type===m[w-1][1].type&&m[w][1].start.line!==m[w][1].end.line&&(T=w+1,N.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):N.pop(),w=N.length;w--;){const E=m.slice(N[w],N[w+1]),M=u.pop();p.push([M,M+E.length-1]),t.splice(M,2,E)}for(p.reverse(),w=-1;++w<p.length;)g[S+p[w][0]]=S+p[w][1],S+=p[w][1]-p[w][0]-1;return g}const lT={resolve:aT,tokenize:sT},rT={partial:!0,tokenize:oT};function aT(t){return px(t),t}function sT(t,i){let r;return a;function a(m){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),o(m)}function o(m){return m===null?u(m):Re(m)?t.check(rT,f,u)(m):(t.consume(m),o)}function u(m){return t.exit("chunkContent"),t.exit("content"),i(m)}function f(m){return t.consume(m),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function oT(t,i,r){const a=this;return o;function o(f){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),mt(t,u,"linePrefix")}function u(f){if(f===null||Re(f))return r(f);const m=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?i(f):t.interrupt(a.parser.constructs.flow,r,i)(f)}}function gx(t,i,r,a,o,u,f,m,p){const g=p||Number.POSITIVE_INFINITY;let b=0;return y;function y(E){return E===60?(t.enter(a),t.enter(o),t.enter(u),t.consume(E),t.exit(u),w):E===null||E===32||E===41||xu(E)?r(E):(t.enter(a),t.enter(f),t.enter(m),t.enter("chunkString",{contentType:"string"}),T(E))}function w(E){return E===62?(t.enter(u),t.consume(E),t.exit(u),t.exit(o),t.exit(a),i):(t.enter(m),t.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===62?(t.exit("chunkString"),t.exit(m),w(E)):E===null||E===60||Re(E)?r(E):(t.consume(E),E===92?S:x)}function S(E){return E===60||E===62||E===92?(t.consume(E),x):x(E)}function T(E){return!b&&(E===null||E===41||At(E))?(t.exit("chunkString"),t.exit(m),t.exit(f),t.exit(a),i(E)):b<g&&E===40?(t.consume(E),b++,T):E===41?(t.consume(E),b--,T):E===null||E===32||E===40||xu(E)?r(E):(t.consume(E),E===92?N:T)}function N(E){return E===40||E===41||E===92?(t.consume(E),T):T(E)}}function yx(t,i,r,a,o,u){const f=this;let m=0,p;return g;function g(x){return t.enter(a),t.enter(o),t.consume(x),t.exit(o),t.enter(u),b}function b(x){return m>999||x===null||x===91||x===93&&!p||x===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?r(x):x===93?(t.exit(u),t.enter(o),t.consume(x),t.exit(o),t.exit(a),i):Re(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),b):(t.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||Re(x)||m++>999?(t.exit("chunkString"),b(x)):(t.consume(x),p||(p=!Xe(x)),x===92?w:y)}function w(x){return x===91||x===92||x===93?(t.consume(x),m++,y):y(x)}}function bx(t,i,r,a,o,u){let f;return m;function m(w){return w===34||w===39||w===40?(t.enter(a),t.enter(o),t.consume(w),t.exit(o),f=w===40?41:w,p):r(w)}function p(w){return w===f?(t.enter(o),t.consume(w),t.exit(o),t.exit(a),i):(t.enter(u),g(w))}function g(w){return w===f?(t.exit(u),p(f)):w===null?r(w):Re(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),mt(t,g,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),b(w))}function b(w){return w===f||w===null||Re(w)?(t.exit("chunkString"),g(w)):(t.consume(w),w===92?y:b)}function y(w){return w===f||w===92?(t.consume(w),b):b(w)}}function ys(t,i){let r;return a;function a(o){return Re(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r=!0,a):Xe(o)?mt(t,a,r?"linePrefix":"lineSuffix")(o):i(o)}}const uT={name:"definition",tokenize:fT},cT={partial:!0,tokenize:dT};function fT(t,i,r){const a=this;let o;return u;function u(x){return t.enter("definition"),f(x)}function f(x){return yx.call(a,t,m,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function m(x){return o=mi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),p):r(x)}function p(x){return At(x)?ys(t,g)(x):g(x)}function g(x){return gx(t,b,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function b(x){return t.attempt(cT,y,y)(x)}function y(x){return Xe(x)?mt(t,w,"whitespace")(x):w(x)}function w(x){return x===null||Re(x)?(t.exit("definition"),a.parser.defined.push(o),i(x)):r(x)}}function dT(t,i,r){return a;function a(m){return At(m)?ys(t,o)(m):r(m)}function o(m){return bx(t,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function u(m){return Xe(m)?mt(t,f,"whitespace")(m):f(m)}function f(m){return m===null||Re(m)?i(m):r(m)}}const mT={name:"hardBreakEscape",tokenize:hT};function hT(t,i,r){return a;function a(u){return t.enter("hardBreakEscape"),t.consume(u),o}function o(u){return Re(u)?(t.exit("hardBreakEscape"),i(u)):r(u)}}const pT={name:"headingAtx",resolve:gT,tokenize:yT};function gT(t,i){let r=t.length-2,a=3;if(t[a][1].type==="whitespace"&&(a+=2),r-2>a&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&t[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a){const o={type:"atxHeadingText",start:t[a][1].start,end:t[r][1].end},u={type:"chunkText",start:t[a][1].start,end:t[r][1].end,contentType:"text"};di(t,a,r-a+1,[["enter",o,i],["enter",u,i],["exit",u,i],["exit",o,i]])}return t}function yT(t,i,r){let a=0;return o;function o(b){return t.enter("atxHeading"),u(b)}function u(b){return t.enter("atxHeadingSequence"),f(b)}function f(b){return b===35&&a++<6?(t.consume(b),f):b===null||At(b)?(t.exit("atxHeadingSequence"),m(b)):r(b)}function m(b){return b===35?(t.enter("atxHeadingSequence"),p(b)):b===null||Re(b)?(t.exit("atxHeading"),i(b)):Xe(b)?mt(t,m,"whitespace")(b):(t.enter("atxHeadingText"),g(b))}function p(b){return b===35?(t.consume(b),p):(t.exit("atxHeadingSequence"),m(b))}function g(b){return b===null||b===35||At(b)?(t.exit("atxHeadingText"),m(b)):(t.consume(b),g)}}const vx=["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"],em=["pre","script","style","textarea"],bT={concrete:!0,name:"htmlFlow",resolveTo:xT,tokenize:wT},vT={partial:!0,tokenize:ST};function xT(t){let i=t.length;for(;i--&&!(t[i][0]==="enter"&&t[i][1].type==="htmlFlow"););return i>1&&t[i-2][1].type==="linePrefix"&&(t[i][1].start=t[i-2][1].start,t[i+1][1].start=t[i-2][1].start,t.splice(i-2,2)),t}function wT(t,i,r){const a=this;let o,u,f,m,p;return g;function g(q){return b(q)}function b(q){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(q),y}function y(q){return q===33?(t.consume(q),w):q===47?(t.consume(q),u=!0,T):q===63?(t.consume(q),o=3,a.interrupt?i:A):gn(q)?(t.consume(q),f=String.fromCharCode(q),N):r(q)}function w(q){return q===45?(t.consume(q),o=2,x):q===91?(t.consume(q),o=5,m=0,S):gn(q)?(t.consume(q),o=4,a.interrupt?i:A):r(q)}function x(q){return q===45?(t.consume(q),a.interrupt?i:A):r(q)}function S(q){const R="CDATA[";return q===R.charCodeAt(m++)?(t.consume(q),m===R.length?a.interrupt?i:W:S):r(q)}function T(q){return gn(q)?(t.consume(q),f=String.fromCharCode(q),N):r(q)}function N(q){if(q===null||q===47||q===62||At(q)){const R=q===47,ne=f.toLowerCase();return!R&&!u&&em.includes(ne)?(o=1,a.interrupt?i(q):W(q)):vx.includes(f.toLowerCase())?(o=6,R?(t.consume(q),E):a.interrupt?i(q):W(q)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(q):u?M(q):H(q))}return q===45||yn(q)?(t.consume(q),f+=String.fromCharCode(q),N):r(q)}function E(q){return q===62?(t.consume(q),a.interrupt?i:W):r(q)}function M(q){return Xe(q)?(t.consume(q),M):z(q)}function H(q){return q===47?(t.consume(q),z):q===58||q===95||gn(q)?(t.consume(q),te):Xe(q)?(t.consume(q),H):z(q)}function te(q){return q===45||q===46||q===58||q===95||yn(q)?(t.consume(q),te):ie(q)}function ie(q){return q===61?(t.consume(q),O):Xe(q)?(t.consume(q),ie):H(q)}function O(q){return q===null||q===60||q===61||q===62||q===96?r(q):q===34||q===39?(t.consume(q),p=q,Q):Xe(q)?(t.consume(q),O):re(q)}function Q(q){return q===p?(t.consume(q),p=null,pe):q===null||Re(q)?r(q):(t.consume(q),Q)}function re(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||At(q)?ie(q):(t.consume(q),re)}function pe(q){return q===47||q===62||Xe(q)?H(q):r(q)}function z(q){return q===62?(t.consume(q),Z):r(q)}function Z(q){return q===null||Re(q)?W(q):Xe(q)?(t.consume(q),Z):r(q)}function W(q){return q===45&&o===2?(t.consume(q),G):q===60&&o===1?(t.consume(q),ae):q===62&&o===4?(t.consume(q),et):q===63&&o===3?(t.consume(q),A):q===93&&o===5?(t.consume(q),Ne):Re(q)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(vT,ct,je)(q)):q===null||Re(q)?(t.exit("htmlFlowData"),je(q)):(t.consume(q),W)}function je(q){return t.check(Wd,qe,ct)(q)}function qe(q){return t.enter("lineEnding"),t.consume(q),t.exit("lineEnding"),le}function le(q){return q===null||Re(q)?je(q):(t.enter("htmlFlowData"),W(q))}function G(q){return q===45?(t.consume(q),A):W(q)}function ae(q){return q===47?(t.consume(q),f="",se):W(q)}function se(q){if(q===62){const R=f.toLowerCase();return em.includes(R)?(t.consume(q),et):W(q)}return gn(q)&&f.length<8?(t.consume(q),f+=String.fromCharCode(q),se):W(q)}function Ne(q){return q===93?(t.consume(q),A):W(q)}function A(q){return q===62?(t.consume(q),et):q===45&&o===2?(t.consume(q),A):W(q)}function et(q){return q===null||Re(q)?(t.exit("htmlFlowData"),ct(q)):(t.consume(q),et)}function ct(q){return t.exit("htmlFlow"),i(q)}}function ST(t,i,r){return a;function a(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(_s,i,r)}}const kT={name:"htmlText",tokenize:ET};function ET(t,i,r){const a=this;let o,u,f;return m;function m(A){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(A),p}function p(A){return A===33?(t.consume(A),g):A===47?(t.consume(A),ie):A===63?(t.consume(A),H):gn(A)?(t.consume(A),re):r(A)}function g(A){return A===45?(t.consume(A),b):A===91?(t.consume(A),u=0,S):gn(A)?(t.consume(A),M):r(A)}function b(A){return A===45?(t.consume(A),x):r(A)}function y(A){return A===null?r(A):A===45?(t.consume(A),w):Re(A)?(f=y,ae(A)):(t.consume(A),y)}function w(A){return A===45?(t.consume(A),x):y(A)}function x(A){return A===62?G(A):A===45?w(A):y(A)}function S(A){const et="CDATA[";return A===et.charCodeAt(u++)?(t.consume(A),u===et.length?T:S):r(A)}function T(A){return A===null?r(A):A===93?(t.consume(A),N):Re(A)?(f=T,ae(A)):(t.consume(A),T)}function N(A){return A===93?(t.consume(A),E):T(A)}function E(A){return A===62?G(A):A===93?(t.consume(A),E):T(A)}function M(A){return A===null||A===62?G(A):Re(A)?(f=M,ae(A)):(t.consume(A),M)}function H(A){return A===null?r(A):A===63?(t.consume(A),te):Re(A)?(f=H,ae(A)):(t.consume(A),H)}function te(A){return A===62?G(A):H(A)}function ie(A){return gn(A)?(t.consume(A),O):r(A)}function O(A){return A===45||yn(A)?(t.consume(A),O):Q(A)}function Q(A){return Re(A)?(f=Q,ae(A)):Xe(A)?(t.consume(A),Q):G(A)}function re(A){return A===45||yn(A)?(t.consume(A),re):A===47||A===62||At(A)?pe(A):r(A)}function pe(A){return A===47?(t.consume(A),G):A===58||A===95||gn(A)?(t.consume(A),z):Re(A)?(f=pe,ae(A)):Xe(A)?(t.consume(A),pe):G(A)}function z(A){return A===45||A===46||A===58||A===95||yn(A)?(t.consume(A),z):Z(A)}function Z(A){return A===61?(t.consume(A),W):Re(A)?(f=Z,ae(A)):Xe(A)?(t.consume(A),Z):pe(A)}function W(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(t.consume(A),o=A,je):Re(A)?(f=W,ae(A)):Xe(A)?(t.consume(A),W):(t.consume(A),qe)}function je(A){return A===o?(t.consume(A),o=void 0,le):A===null?r(A):Re(A)?(f=je,ae(A)):(t.consume(A),je)}function qe(A){return A===null||A===34||A===39||A===60||A===61||A===96?r(A):A===47||A===62||At(A)?pe(A):(t.consume(A),qe)}function le(A){return A===47||A===62||At(A)?pe(A):r(A)}function G(A){return A===62?(t.consume(A),t.exit("htmlTextData"),t.exit("htmlText"),i):r(A)}function ae(A){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),se}function se(A){return Xe(A)?mt(t,Ne,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Ne(A)}function Ne(A){return t.enter("htmlTextData"),f(A)}}const Tm={name:"labelEnd",resolveAll:NT,resolveTo:AT,tokenize:OT},TT={tokenize:_T},jT={tokenize:zT},CT={tokenize:RT};function NT(t){let i=-1;const r=[];for(;++i<t.length;){const a=t[i][1];if(r.push(t[i]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",i+=o}}return t.length!==r.length&&di(t,0,t.length,r),t}function AT(t,i){let r=t.length,a=0,o,u,f;for(;r--;){const b=t[r][1];if(o){if(b.type==="link"||b.type==="labelLink"&&b._inactive)break;t[r][0]==="enter"&&b.type==="labelLink"&&(b._inactive=!0)}else if(u){if(t[r][0]==="enter"&&(b.type==="labelImage"||b.type==="labelLink")&&!b._balanced&&(o=r,b.type!=="labelLink")){a=2;break}}else b.type==="labelEnd"&&(u=r)}const m={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},p={type:"label",start:{...t[o][1].start},end:{...t[u][1].end}},g={type:"labelText",start:{...t[o+a+2][1].end},end:{...t[u-2][1].start}};return f=[["enter",m,i],["enter",p,i]],f=ti(f,t.slice(o+1,o+a+3)),f=ti(f,[["enter",g,i]]),f=ti(f,Du(i.parser.constructs.insideSpan.null,t.slice(o+a+4,u-3),i)),f=ti(f,[["exit",g,i],t[u-2],t[u-1],["exit",p,i]]),f=ti(f,t.slice(u+1)),f=ti(f,[["exit",m,i]]),di(t,o,t.length,f),t}function OT(t,i,r){const a=this,o=a._labelStarts;let u,f;if(o){for(;o.length>0&&o[o.length-1]._balanced;)o.pop();u=o[o.length-1]}return m;function m(w){return u?u._inactive?y(w):(f=a.parser.defined.includes(mi(a.sliceSerialize({start:u.end,end:a.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(w),t.exit("labelMarker"),t.exit("labelEnd"),p):r(w)}function p(w){return w===40?t.attempt(TT,b,f?b:y)(w):w===91?t.attempt(jT,b,f?g:y)(w):f?b(w):y(w)}function g(w){return t.attempt(CT,b,y)(w)}function b(w){return o.pop(),i(w)}function y(w){return u._balanced=!0,r(w)}}function _T(t,i,r){return a;function a(y){return t.enter("resource"),t.enter("resourceMarker"),t.consume(y),t.exit("resourceMarker"),o}function o(y){return At(y)?ys(t,u)(y):u(y)}function u(y){return y===41?b(y):gx(t,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function f(y){return At(y)?ys(t,p)(y):b(y)}function m(y){return r(y)}function p(y){return y===34||y===39||y===40?bx(t,g,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):b(y)}function g(y){return At(y)?ys(t,b)(y):b(y)}function b(y){return y===41?(t.enter("resourceMarker"),t.consume(y),t.exit("resourceMarker"),t.exit("resource"),i):r(y)}}function zT(t,i,r){const a=this;return o;function o(m){return yx.call(a,t,u,f,"reference","referenceMarker","referenceString")(m)}function u(m){return a.parser.defined.includes(mi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?i(m):r(m)}function f(m){return r(m)}}function RT(t,i,r){return a;function a(u){return t.enter("reference"),t.enter("referenceMarker"),t.consume(u),t.exit("referenceMarker"),o}function o(u){return u===93?(t.enter("referenceMarker"),t.consume(u),t.exit("referenceMarker"),t.exit("reference"),i):r(u)}}const qT={name:"labelStartImage",resolveAll:Tm.resolveAll,tokenize:MT};function MT(t,i,r){const a=this;let o;return u;function u(p){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(p),t.exit("labelImageMarker"),f}function f(p){return p===91?(t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),o=t.exit("labelImage"),m):r(p)}function m(p){return p===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(p):(a._labelStarts=a._labelStarts||[],a._labelStarts.push(o),i(p))}}const DT={name:"labelStartLink",resolveAll:Tm.resolveAll,tokenize:LT};function LT(t,i,r){const a=this;let o;return u;function u(m){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(m),t.exit("labelMarker"),o=t.exit("labelLink"),f}function f(m){return m===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(m):(a._labelStarts=a._labelStarts||[],a._labelStarts.push(o),i(m))}}const Cd={name:"lineEnding",tokenize:BT};function BT(t,i){return r;function r(a){return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),mt(t,i,"linePrefix")}}const yu={name:"thematicBreak",tokenize:UT};function UT(t,i,r){let a=0,o;return u;function u(g){return t.enter("thematicBreak"),f(g)}function f(g){return o=g,m(g)}function m(g){return g===o?(t.enter("thematicBreakSequence"),p(g)):a>=3&&(g===null||Re(g))?(t.exit("thematicBreak"),i(g)):r(g)}function p(g){return g===o?(t.consume(g),a++,p):(t.exit("thematicBreakSequence"),Xe(g)?mt(t,m,"whitespace")(g):m(g))}}const Mn={continuation:{tokenize:YT},exit:FT,name:"list",tokenize:VT},HT={partial:!0,tokenize:QT},IT={partial:!0,tokenize:GT};function VT(t,i,r){const a=this,o=a.events[a.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,f=0;return m;function m(x){const S=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:Jd(x)){if(a.containerState.type||(a.containerState.type=S,t.enter(S,{_container:!0})),S==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(yu,r,g)(x):g(x);if(!a.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),p(x)}return r(x)}function p(x){return Jd(x)&&++f<10?(t.consume(x),p):(!a.interrupt||f<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),g(x)):r(x)}function g(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,t.check(_s,a.interrupt?r:b,t.attempt(HT,w,y))}function b(x){return a.containerState.initialBlankLine=!0,u++,w(x)}function y(x){return Xe(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),w):r(x)}function w(x){return a.containerState.size=u+a.sliceSerialize(t.exit("listItemPrefix"),!0).length,i(x)}}function YT(t,i,r){const a=this;return a.containerState._closeFlow=void 0,t.check(_s,o,u);function o(m){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,mt(t,i,"listItemIndent",a.containerState.size+1)(m)}function u(m){return a.containerState.furtherBlankLines||!Xe(m)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,f(m)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,t.attempt(IT,i,f)(m))}function f(m){return a.containerState._closeFlow=!0,a.interrupt=void 0,mt(t,t.attempt(Mn,i,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function GT(t,i,r){const a=this;return mt(t,o,"listItemIndent",a.containerState.size+1);function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===a.containerState.size?i(u):r(u)}}function FT(t){t.exit(this.containerState.type)}function QT(t,i,r){const a=this;return mt(t,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const f=a.events[a.events.length-1];return!Xe(u)&&f&&f[1].type==="listItemPrefixWhitespace"?i(u):r(u)}}const bb={name:"setextUnderline",resolveTo:XT,tokenize:ZT};function XT(t,i){const r=new wu;let a=t.length,o,u,f;for(;a--;)if(t[a][0]==="enter"){if(t[a][1].type==="content"){o=a;break}t[a][1].type==="paragraph"&&(u=a)}else t[a][1].type==="content"&&r.add(a,1,[]),!f&&t[a][1].type==="definition"&&(f=a);const m={type:"setextHeading",start:{...t[o][1].start},end:{...t[t.length-1][1].end}};return t[u][1].type="setextHeadingText",f?(r.add(u,0,[["enter",m,i]]),r.add(f+1,0,[["exit",t[o][1],i]]),t[o][1].end={...t[f][1].end}):t[o][1]=m,r.add(t.length,0,[["exit",m,i]]),r.consume(t),t}function ZT(t,i,r){const a=this;let o;return u;function u(g){let b=a.events.length,y;for(;b--;)if(a.events[b][1].type!=="lineEnding"&&a.events[b][1].type!=="linePrefix"&&a.events[b][1].type!=="content"){y=a.events[b][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(t.enter("setextHeadingLine"),o=g,f(g)):r(g)}function f(g){return t.enter("setextHeadingLineSequence"),m(g)}function m(g){return g===o?(t.consume(g),m):(t.exit("setextHeadingLineSequence"),Xe(g)?mt(t,p,"lineSuffix")(g):p(g))}function p(g){return g===null||Re(g)?(t.exit("setextHeadingLine"),i(g)):r(g)}}const KT={tokenize:$T};function $T(t){const i=this,r=t.attempt(_s,a,t.attempt(this.parser.constructs.flowInitial,o,mt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(lT,o)),"linePrefix")));return r;function a(u){if(u===null){t.consume(u);return}return t.enter("lineEndingBlank"),t.consume(u),t.exit("lineEndingBlank"),i.currentConstruct=void 0,r}function o(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),i.currentConstruct=void 0,r}}const JT={resolveAll:wx()},PT=xx("string"),WT=xx("text");function xx(t){return{resolveAll:wx(t==="text"?ej:void 0),tokenize:i};function i(r){const a=this,o=this.parser.constructs[t],u=r.attempt(o,f,m);return f;function f(b){return g(b)?u(b):m(b)}function m(b){if(b===null){r.consume(b);return}return r.enter("data"),r.consume(b),p}function p(b){return g(b)?(r.exit("data"),u(b)):(r.consume(b),p)}function g(b){if(b===null)return!0;const y=o[b];let w=-1;if(y)for(;++w<y.length;){const x=y[w];if(!x.previous||x.previous.call(a,a.previous))return!0}return!1}}}function wx(t){return i;function i(r,a){let o=-1,u;for(;++o<=r.length;)u===void 0?r[o]&&r[o][1].type==="data"&&(u=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==u+2&&(r[u][1].end=r[o-1][1].end,r.splice(u+2,o-u-2),o=u+2),u=void 0);return t?t(r,a):r}}function ej(t,i){const r=new wu;let a=0;for(;++a<=t.length;)if((a===t.length||t[a][1].type==="lineEnding")&&t[a-1][1].type==="data"){const o=t[a-1][1],u=i.sliceStream(o);let f=u.length,m=-1,p=0,g;for(;f--;){const b=u[f];if(typeof b=="string"){for(m=b.length;b.charCodeAt(m-1)===32;)p++,m--;if(m)break;m=-1}else if(b===-2)g=!0,p++;else if(b!==-1){f++;break}}if(i._contentTypeTextTrailing&&a===t.length&&(p=0),p){const b={type:a===t.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:f?m:o.start._bufferIndex+m,_index:o.start._index+f,line:o.end.line,column:o.end.column-p,offset:o.end.offset-p},end:{...o.end}};o.end={...b.start},o.start.offset===o.end.offset?Object.assign(o,b):r.add(a,0,[["enter",b,i],["exit",b,i]])}a++}return r.consume(t),t}const tj={42:Mn,43:Mn,45:Mn,48:Mn,49:Mn,50:Mn,51:Mn,52:Mn,53:Mn,54:Mn,55:Mn,56:Mn,57:Mn,62:dx},nj={91:uT},ij={[-2]:jd,[-1]:jd,32:jd},lj={35:pT,42:yu,45:[bb,yu],60:bT,61:bb,95:yu,96:yb,126:yb},rj={38:hx,92:mx},aj={[-5]:Cd,[-4]:Cd,[-3]:Cd,33:qT,38:hx,42:Pd,60:[UE,kT],91:DT,92:[mT,mx],93:Tm,95:Pd,96:PE},sj={null:[Pd,JT]},oj={null:[42,95]},uj={null:[]},cj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:oj,contentInitial:nj,disable:uj,document:tj,flow:lj,flowInitial:ij,insideSpan:sj,string:rj,text:aj},Symbol.toStringTag,{value:"Module"}));function fj(t,i,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},u=[];let f=[],m=[];const p={attempt:Q(ie),check:Q(O),consume:M,enter:H,exit:te,interrupt:Q(O,{interrupt:!0})},g={code:null,containerState:{},defineSkip:T,events:[],now:S,parser:t,previous:null,sliceSerialize:w,sliceStream:x,write:y};let b=i.tokenize.call(g,p);return i.resolveAll&&u.push(i),g;function y(Z){return f=ti(f,Z),N(),f[f.length-1]!==null?[]:(re(i,0),g.events=Du(u,g.events,g),g.events)}function w(Z,W){return mj(x(Z),W)}function x(Z){return dj(f,Z)}function S(){const{_bufferIndex:Z,_index:W,line:je,column:qe,offset:le}=a;return{_bufferIndex:Z,_index:W,line:je,column:qe,offset:le}}function T(Z){o[Z.line]=Z.column,z()}function N(){for(;a._index<f.length;){const Z=f[a._index];if(typeof Z=="string"){const W=a._index;for(a._bufferIndex<0&&(a._bufferIndex=0);a._index===W&&a._bufferIndex<Z.length;)E(Z.charCodeAt(a._bufferIndex))}else E(Z)}}function E(Z){b=b(Z)}function M(Z){Re(Z)?(a.line++,a.column=1,a.offset+=Z===-3?2:1,z()):Z!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===f[a._index].length&&(a._bufferIndex=-1,a._index++)),g.previous=Z}function H(Z,W){const je=W||{};return je.type=Z,je.start=S(),g.events.push(["enter",je,g]),m.push(je),je}function te(Z){const W=m.pop();return W.end=S(),g.events.push(["exit",W,g]),W}function ie(Z,W){re(Z,W.from)}function O(Z,W){W.restore()}function Q(Z,W){return je;function je(qe,le,G){let ae,se,Ne,A;return Array.isArray(qe)?ct(qe):"tokenize"in qe?ct([qe]):et(qe);function et(de){return ye;function ye(Oe){const Ce=Oe!==null&&de[Oe],Se=Oe!==null&&de.null,$=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return ct($)(Oe)}}function ct(de){return ae=de,se=0,de.length===0?G:q(de[se])}function q(de){return ye;function ye(Oe){return A=pe(),Ne=de,de.partial||(g.currentConstruct=de),de.name&&g.parser.constructs.disable.null.includes(de.name)?ne():de.tokenize.call(W?Object.assign(Object.create(g),W):g,p,R,ne)(Oe)}}function R(de){return Z(Ne,A),le}function ne(de){return A.restore(),++se<ae.length?q(ae[se]):G}}}function re(Z,W){Z.resolveAll&&!u.includes(Z)&&u.push(Z),Z.resolve&&di(g.events,W,g.events.length-W,Z.resolve(g.events.slice(W),g)),Z.resolveTo&&(g.events=Z.resolveTo(g.events,g))}function pe(){const Z=S(),W=g.previous,je=g.currentConstruct,qe=g.events.length,le=Array.from(m);return{from:qe,restore:G};function G(){a=Z,g.previous=W,g.currentConstruct=je,g.events.length=qe,m=le,z()}}function z(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function dj(t,i){const r=i.start._index,a=i.start._bufferIndex,o=i.end._index,u=i.end._bufferIndex;let f;if(r===o)f=[t[r].slice(a,u)];else{if(f=t.slice(r,o),a>-1){const m=f[0];typeof m=="string"?f[0]=m.slice(a):f.shift()}u>0&&f.push(t[o].slice(0,u))}return f}function mj(t,i){let r=-1;const a=[];let o;for(;++r<t.length;){const u=t[r];let f;if(typeof u=="string")f=u;else switch(u){case-5:{f="\r";break}case-4:{f=`
|
|
19
|
-
`;break}case-3:{f=`\r
|
|
20
|
-
`;break}case-2:{f=i?" ":" ";break}case-1:{if(!i&&o)continue;f=" ";break}default:f=String.fromCharCode(u)}o=u===-2,a.push(f)}return a.join("")}function hj(t){const a={constructs:ox([cj,...(t||{}).extensions||[]]),content:o(zE),defined:[],document:o(qE),flow:o(KT),lazy:{},string:o(PT),text:o(WT)};return a;function o(u){return f;function f(m){return fj(a,u,m)}}}function pj(t){for(;!px(t););return t}const vb=/[\0\t\n\r]/g;function gj(){let t=1,i="",r=!0,a;return o;function o(u,f,m){u=i+(typeof u=="string"?u.toString():new TextDecoder(f||void 0).decode(u));const p=[];let g=0;for(i="",r&&(u.charCodeAt(0)===65279&&g++,r=void 0);g<u.length;){vb.lastIndex=g;const b=vb.exec(u),y=b&&b.index!==void 0?b.index:u.length,w=u.charCodeAt(y);if(!b){i=u.slice(g);break}if(w===10&&g===y&&a)p.push(-3),a=void 0;else switch(a&&(p.push(-5),a=void 0),g<y&&(p.push(u.slice(g,y)),t+=y-g),w){case 0:{p.push(65533),t++;break}case 9:{const x=Math.ceil(t/4)*4;for(p.push(-2);t++<x;)p.push(-1);break}case 10:{p.push(-4),t=1;break}default:a=!0,t=1}g=y+1}return m&&(a&&p.push(-5),i&&p.push(i),p.push(null)),p}}const yj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bj(t){return t.replace(yj,vj)}function vj(t,i,r){if(i)return i;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return ux(r.slice(u?2:1),u?16:10)}return Em(r)||t}const Sx={}.hasOwnProperty;function xj(t,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),wj(r)(pj(hj(r).document().write(gj()(t,i,!0))))}function wj(t){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:f(Ye),autolinkProtocol:z,autolinkEmail:z,atxHeading:f($e),blockQuote:f($),characterEscape:z,characterReference:z,codeFenced:f(me),codeFencedFenceInfo:m,codeFencedFenceMeta:m,codeIndented:f(me,m),codeText:f(Ze,m),codeTextData:z,data:z,codeFlowValue:z,definition:f(Ke),definitionDestinationString:m,definitionLabelString:m,definitionTitleString:m,emphasis:f(ke),hardBreakEscape:f(Fe),hardBreakTrailing:f(Fe),htmlFlow:f(Ue,m),htmlFlowData:z,htmlText:f(Ue,m),htmlTextData:z,image:f(ze),label:m,link:f(Ye),listItem:f(fe),listItemValue:x,listOrdered:f(gt,w),listUnordered:f(gt),paragraph:f(De),reference:R,referenceString:m,resourceDestinationString:m,resourceTitleString:m,setextHeading:f($e),strong:f(yt),thematicBreak:f(Mt)},exit:{atxHeading:g(),atxHeadingSequence:O,autolink:g(),autolinkEmail:Se,autolinkProtocol:Ce,blockQuote:g(),characterEscapeValue:Z,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:ye,characterReference:Oe,codeFenced:g(E),codeFencedFence:N,codeFencedFenceInfo:S,codeFencedFenceMeta:T,codeFlowValue:Z,codeIndented:g(M),codeText:g(G),codeTextData:Z,data:Z,definition:g(),definitionDestinationString:ie,definitionLabelString:H,definitionTitleString:te,emphasis:g(),hardBreakEscape:g(je),hardBreakTrailing:g(je),htmlFlow:g(qe),htmlFlowData:Z,htmlText:g(le),htmlTextData:Z,image:g(se),label:A,labelText:Ne,lineEnding:W,link:g(ae),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:ne,resourceDestinationString:et,resourceTitleString:ct,resource:q,setextHeading:g(pe),setextHeadingLineSequence:re,setextHeadingText:Q,strong:g(),thematicBreak:g()}};kx(i,(t||{}).mdastExtensions||[]);const r={};return a;function a(X){let oe={type:"root",children:[],position:void 0};const be={stack:[oe],tokenStack:[],config:i,enter:p,exit:b,buffer:m,resume:y,data:r},we=[],Ge=[];let ve=-1;for(;++ve<X.length;)if(Ge.push(X[ve]),X[ve][1].type==="listOrdered"||X[ve][1].type==="listUnordered")if(X[ve][0]==="enter")we.push(Ge.length-1);else{const ht=we.pop();u(Ge,ht)}for(X=Ge,ve=-1;++ve<X.length;){const ht=i[X[ve][0]];X[ve][0]==="enter"&&i.beforeEnter.length>0&&o(i.beforeEnter,{...be,sliceSerialize:X[ve][2].sliceSerialize},X[ve][1]),Sx.call(ht,X[ve][1].type)&&ht[X[ve][1].type].call({...be,sliceSerialize:X[ve][2].sliceSerialize},X[ve][1]),X[ve][0]==="exit"&&i.afterExit.length>0&&o(i.afterExit,{...be,sliceSerialize:X[ve][2].sliceSerialize},X[ve][1])}if(be.tokenStack.length>0){const ht=be.tokenStack[be.tokenStack.length-1];(ht[1]||xb).call(be,void 0,ht[0])}for(oe.position={start:Cl(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:Cl(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},ve=-1;++ve<i.transforms.length;)oe=i.transforms[ve](oe)||oe;return oe}function o(X,oe,be){let we=-1;for(;++we<X.length;)X[we].call(oe,be)}function u(X,oe){const be=X.length-1;let we=oe-1,Ge=-1,ve=!1,ht,Qt,tn,sn;const on=[];for(;++we<=be;){const Ot=X[we];switch(Ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ot[0]==="enter"?Ge++:Ge--,sn=void 0;break}case"lineEndingBlank":{Ot[0]==="enter"&&(ht&&!sn&&!Ge&&!tn&&(tn=we),sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sn=void 0}if(!Ge&&Ot[0]==="enter"&&Ot[1].type==="listItemPrefix"||Ge===-1&&Ot[0]==="exit"&&(Ot[1].type==="listUnordered"||Ot[1].type==="listOrdered")){if(ht){let vn=we;for(Qt=void 0;vn--;){const xn=X[vn];if(xn[1].type==="lineEnding"||xn[1].type==="lineEndingBlank"){if(xn[0]==="exit")continue;Qt&&(X[Qt][1].type="lineEndingBlank",ve=!0),xn[1].type="lineEnding",Qt=vn}else if(!(xn[1].type==="linePrefix"||xn[1].type==="blockQuotePrefix"||xn[1].type==="blockQuotePrefixWhitespace"||xn[1].type==="blockQuoteMarker"||xn[1].type==="listItemIndent"))break}tn&&(!Qt||tn<Qt)&&(ht._spread=!0),ht.end=Object.assign({},Qt?X[Qt][1].start:Ot[1].end),on.push({at:Qt||we,event:["exit",ht,Ot[2]]})}if(Ot[1].type==="listItemPrefix"){const vn={type:"listItem",_spread:!1,start:Object.assign({},Ot[1].start),end:void 0};ht=vn,on.push({at:we,event:["enter",vn,Ot[2]]}),tn=void 0,sn=!0}}}const It=X.splice(oe);let xt=0;for(we=-1;++we<It.length;){for(;xt<on.length&&on[xt].at===oe+we;)X.push(on[xt++].event);X.push(It[we])}X[oe][1]._spread=ve}function f(X,oe){return be;function be(we){p.call(this,X(we),we),oe&&oe.call(this,we)}}function m(){this.stack.push({type:"fragment",children:[]})}function p(X,oe,be){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([oe,be||void 0]),X.position={start:Cl(oe.start),end:void 0}}function g(X){return oe;function oe(be){X&&X.call(this,be),b.call(this,be)}}function b(X,oe){const be=this.stack.pop(),we=this.tokenStack.pop();if(!we)throw new Error("Cannot close `"+X.type+"` ("+gs({start:X.start,end:X.end})+"): it’s not open");we[0].type!==X.type&&(oe?oe.call(this,X,we[0]):(we[1]||xb).call(this,X,we[0])),be.position.end=Cl(X.end)}function y(){return Mu(this.stack.pop())}function w(){this.data.expectingFirstListItemValue=!0}function x(X){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function S(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=X}function T(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=X}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X.replace(/(\r?\n|\r)$/g,"")}function H(X){const oe=this.resume(),be=this.stack[this.stack.length-1];be.label=oe,be.identifier=mi(this.sliceSerialize(X)).toLowerCase()}function te(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.title=X}function ie(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.url=X}function O(X){const oe=this.stack[this.stack.length-1];if(!oe.depth){const be=this.sliceSerialize(X).length;oe.depth=be}}function Q(){this.data.setextHeadingSlurpLineEnding=!0}function re(X){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function pe(){this.data.setextHeadingSlurpLineEnding=void 0}function z(X){const be=this.stack[this.stack.length-1].children;let we=be[be.length-1];(!we||we.type!=="text")&&(we=bn(),we.position={start:Cl(X.start),end:void 0},be.push(we)),this.stack.push(we)}function Z(X){const oe=this.stack.pop();oe.value+=this.sliceSerialize(X),oe.position.end=Cl(X.end)}function W(X){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const be=oe.children[oe.children.length-1];be.position.end=Cl(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(oe.type)&&(z.call(this,X),Z.call(this,X))}function je(){this.data.atHardBreak=!0}function qe(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X}function le(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X}function G(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.value=X}function ae(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=oe,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function se(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=oe,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function Ne(X){const oe=this.sliceSerialize(X),be=this.stack[this.stack.length-2];be.label=bj(oe),be.identifier=mi(oe).toLowerCase()}function A(){const X=this.stack[this.stack.length-1],oe=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){const we=X.children;be.children=we}else be.alt=oe}function et(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.url=X}function ct(){const X=this.resume(),oe=this.stack[this.stack.length-1];oe.title=X}function q(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function ne(X){const oe=this.resume(),be=this.stack[this.stack.length-1];be.label=oe,be.identifier=mi(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function de(X){this.data.characterReferenceType=X.type}function ye(X){const oe=this.sliceSerialize(X),be=this.data.characterReferenceType;let we;be?(we=ux(oe,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=Em(oe);const Ge=this.stack[this.stack.length-1];Ge.value+=we}function Oe(X){const oe=this.stack.pop();oe.position.end=Cl(X.end)}function Ce(X){Z.call(this,X);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(X)}function Se(X){Z.call(this,X);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(X)}function $(){return{type:"blockquote",children:[],position:void 0}}function me(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Ze(){return{type:"inlineCode",value:"",position:void 0}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function ke(){return{type:"emphasis",children:[],position:void 0}}function $e(){return{type:"heading",depth:0,children:[],position:void 0}}function Fe(){return{type:"break",position:void 0}}function Ue(){return{type:"html",value:"",position:void 0}}function ze(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Ye(){return{type:"link",title:null,url:"",children:[],position:void 0}}function gt(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[],position:void 0}}function fe(X){return{type:"listItem",spread:X._spread,checked:null,children:[],position:void 0}}function De(){return{type:"paragraph",children:[],position:void 0}}function yt(){return{type:"strong",children:[],position:void 0}}function bn(){return{type:"text",value:"",position:void 0}}function Mt(){return{type:"thematicBreak",position:void 0}}}function Cl(t){return{line:t.line,column:t.column,offset:t.offset}}function kx(t,i){let r=-1;for(;++r<i.length;){const a=i[r];Array.isArray(a)?kx(t,a):Sj(t,a)}}function Sj(t,i){let r;for(r in i)if(Sx.call(i,r))switch(r){case"canContainEols":{const a=i[r];a&&t[r].push(...a);break}case"transforms":{const a=i[r];a&&t[r].push(...a);break}case"afterExit":case"beforeEnter":{const a=i[r];a&&t[r].push(a);break}case"enter":case"exit":{const a=i[r];a&&Object.assign(t[r],a);break}}}function xb(t,i){throw t?new Error("Cannot close `"+t.type+"` ("+gs({start:t.start,end:t.end})+"): a different token (`"+i.type+"`, "+gs({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+gs({start:i.start,end:i.end})+") is still open")}function kj(t){const i=this;i.parser=r;function r(a){return xj(a,{...i.data("settings"),...t,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function Ej(t,i){const r={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(i),!0)};return t.patch(i,r),t.applyData(i,r)}function Tj(t,i){const r={type:"element",tagName:"br",properties:{},children:[]};return t.patch(i,r),[t.applyData(i,r),{type:"text",value:`
|
|
21
|
-
`}]}function jj(t,i){const r=i.value?i.value+`
|
|
22
|
-
`:"",a={},o=i.lang?i.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return i.meta&&(u.data={meta:i.meta}),t.patch(i,u),u=t.applyData(i,u),u={type:"element",tagName:"pre",properties:{},children:[u]},t.patch(i,u),u}function Cj(t,i){const r={type:"element",tagName:"del",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function Nj(t,i){const r={type:"element",tagName:"em",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function Aj(t,i){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",a=String(i.identifier).toUpperCase(),o=ua(a.toLowerCase()),u=t.footnoteOrder.indexOf(a);let f,m=t.footnoteCounts.get(a);m===void 0?(m=0,t.footnoteOrder.push(a),f=t.footnoteOrder.length):f=u+1,m+=1,t.footnoteCounts.set(a,m);const p={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};t.patch(i,p);const g={type:"element",tagName:"sup",properties:{},children:[p]};return t.patch(i,g),t.applyData(i,g)}function Oj(t,i){const r={type:"element",tagName:"h"+i.depth,properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function _j(t,i){if(t.options.allowDangerousHtml){const r={type:"raw",value:i.value};return t.patch(i,r),t.applyData(i,r)}}function Ex(t,i){const r=i.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+a}];const o=t.all(i),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const f=o[o.length-1];return f&&f.type==="text"?f.value+=a:o.push({type:"text",value:a}),o}function zj(t,i){const r=String(i.identifier).toUpperCase(),a=t.definitionById.get(r);if(!a)return Ex(t,i);const o={src:ua(a.url||""),alt:i.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"img",properties:o,children:[]};return t.patch(i,u),t.applyData(i,u)}function Rj(t,i){const r={src:ua(i.url)};i.alt!==null&&i.alt!==void 0&&(r.alt=i.alt),i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"img",properties:r,children:[]};return t.patch(i,a),t.applyData(i,a)}function qj(t,i){const r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};t.patch(i,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return t.patch(i,a),t.applyData(i,a)}function Mj(t,i){const r=String(i.identifier).toUpperCase(),a=t.definitionById.get(r);if(!a)return Ex(t,i);const o={href:ua(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"a",properties:o,children:t.all(i)};return t.patch(i,u),t.applyData(i,u)}function Dj(t,i){const r={href:ua(i.url)};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"a",properties:r,children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function Lj(t,i,r){const a=t.all(i),o=r?Bj(r):Tx(i),u={},f=[];if(typeof i.checked=="boolean"){const b=a[0];let y;b&&b.type==="element"&&b.tagName==="p"?y=b:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let m=-1;for(;++m<a.length;){const b=a[m];(o||m!==0||b.type!=="element"||b.tagName!=="p")&&f.push({type:"text",value:`
|
|
23
|
-
`}),b.type==="element"&&b.tagName==="p"&&!o?f.push(...b.children):f.push(b)}const p=a[a.length-1];p&&(o||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
|
|
24
|
-
`});const g={type:"element",tagName:"li",properties:u,children:f};return t.patch(i,g),t.applyData(i,g)}function Bj(t){let i=!1;if(t.type==="list"){i=t.spread||!1;const r=t.children;let a=-1;for(;!i&&++a<r.length;)i=Tx(r[a])}return i}function Tx(t){const i=t.spread;return i??t.children.length>1}function Uj(t,i){const r={},a=t.all(i);let o=-1;for(typeof i.start=="number"&&i.start!==1&&(r.start=i.start);++o<a.length;){const f=a[o];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const u={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:t.wrap(a,!0)};return t.patch(i,u),t.applyData(i,u)}function Hj(t,i){const r={type:"element",tagName:"p",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function Ij(t,i){const r={type:"root",children:t.wrap(t.all(i))};return t.patch(i,r),t.applyData(i,r)}function Vj(t,i){const r={type:"element",tagName:"strong",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function Yj(t,i){const r=t.all(i),a=r.shift(),o=[];if(a){const f={type:"element",tagName:"thead",properties:{},children:t.wrap([a],!0)};t.patch(i.children[0],f),o.push(f)}if(r.length>0){const f={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},m=xm(i.children[1]),p=tx(i.children[i.children.length-1]);m&&p&&(f.position={start:m,end:p}),o.push(f)}const u={type:"element",tagName:"table",properties:{},children:t.wrap(o,!0)};return t.patch(i,u),t.applyData(i,u)}function Gj(t,i,r){const a=r?r.children:void 0,u=(a?a.indexOf(i):1)===0?"th":"td",f=r&&r.type==="table"?r.align:void 0,m=f?f.length:i.children.length;let p=-1;const g=[];for(;++p<m;){const y=i.children[p],w={},x=f?f[p]:void 0;x&&(w.align=x);let S={type:"element",tagName:u,properties:w,children:[]};y&&(S.children=t.all(y),t.patch(y,S),S=t.applyData(y,S)),g.push(S)}const b={type:"element",tagName:"tr",properties:{},children:t.wrap(g,!0)};return t.patch(i,b),t.applyData(i,b)}function Fj(t,i){const r={type:"element",tagName:"td",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}const wb=9,Sb=32;function Qj(t){const i=String(t),r=/\r?\n|\r/g;let a=r.exec(i),o=0;const u=[];for(;a;)u.push(kb(i.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=r.exec(i);return u.push(kb(i.slice(o),o>0,!1)),u.join("")}function kb(t,i,r){let a=0,o=t.length;if(i){let u=t.codePointAt(a);for(;u===wb||u===Sb;)a++,u=t.codePointAt(a)}if(r){let u=t.codePointAt(o-1);for(;u===wb||u===Sb;)o--,u=t.codePointAt(o-1)}return o>a?t.slice(a,o):""}function Xj(t,i){const r={type:"text",value:Qj(String(i.value))};return t.patch(i,r),t.applyData(i,r)}function Zj(t,i){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(i,r),t.applyData(i,r)}const Kj={blockquote:Ej,break:Tj,code:jj,delete:Cj,emphasis:Nj,footnoteReference:Aj,heading:Oj,html:_j,imageReference:zj,image:Rj,inlineCode:qj,linkReference:Mj,link:Dj,listItem:Lj,list:Uj,paragraph:Hj,root:Ij,strong:Vj,table:Yj,tableCell:Fj,tableRow:Gj,text:Xj,thematicBreak:Zj,toml:su,yaml:su,definition:su,footnoteDefinition:su};function su(){}const jx=-1,Lu=0,bs=1,Su=2,jm=3,Cm=4,Nm=5,Am=6,Cx=7,Nx=8,{defineProperty:$j}=Object,Ax=typeof self=="object"?self:globalThis,Eb=(t,i)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new Ax[t](i)},Jj=(t,i)=>{const r=(o,u)=>(t.set(u,o),o),a=o=>{if(t.has(o))return t.get(o);const[u,f]=i[o];switch(u){case Lu:case jx:return r(f,o);case bs:{const m=r([],o);for(const p of f)m.push(a(p));return m}case Su:{const m=r({},o);for(const[p,g]of f){const b=a(p),y=a(g);b==="__proto__"?$j(m,b,{value:y,configurable:!0,enumerable:!0,writable:!0}):m[b]=y}return m}case jm:return r(new Date(f),o);case Cm:{const{source:m,flags:p}=f;return r(new RegExp(m,p),o)}case Nm:{const m=r(new Map,o);for(const[p,g]of f)m.set(a(p),a(g));return m}case Am:{const m=r(new Set,o);for(const p of f)m.add(a(p));return m}case Cx:{const{name:m,message:p}=f;return r(typeof Ax[m]=="function"?Eb(m,p):new Error(p),o)}case Nx:return r(BigInt(f),o);case"BigInt":return r(Object(BigInt(f)),o);case"ArrayBuffer":return r(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return r(new DataView(m),f)}case"-0":return-0}return r(Eb(u,f),o)};return a},Tb=t=>Jj(new Map,t)(0),sr="",{toString:Pj}={},{keys:Wj,is:eC}=Object,ds=t=>{const i=typeof t;if(i!=="object"||!t)return[Lu,i];const r=Pj.call(t).slice(8,-1);switch(r){case"Array":return[bs,sr];case"Object":return[Su,sr];case"Date":return[jm,sr];case"RegExp":return[Cm,sr];case"Map":return[Nm,sr];case"Set":return[Am,sr];case"DataView":return[bs,r]}return r.includes("Array")?[bs,r]:t instanceof Error?[Cx,t.name||"Error"]:[Su,r]},ou=([t,i])=>t===Lu&&(i==="function"||i==="symbol"),tC=(t,i,r,a)=>{const o=(f,m)=>{const p=a.push(f)-1;return r.set(m,p),p},u=f=>{if(r.has(f))return r.get(f);let[m,p]=ds(f);switch(m){case Lu:{let b=f;switch(p){case"bigint":m=Nx,b=f.toString();break;case"number":if(!f&&eC(f,-0))return a.push(["-0"])-1;break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+p);b=null;break;case"undefined":return o([jx],f)}return o([m,b],f)}case bs:{if(p){let w=f;return p==="DataView"?w=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(w=new Uint8Array(f)),o([p,[...w]],f)}const b=[],y=o([m,b],f);for(const w of f)b.push(u(w));return y}case Su:{if(p)switch(p){case"BigInt":return o([p,f.toString()],f);case"Boolean":case"Number":case"String":return o([p,f.valueOf()],f)}if(i&&"toJSON"in f)return u(f.toJSON());const b=[],y=o([m,b],f);for(const w of Wj(f))(t||!ou(ds(f[w])))&&b.push([u(w),u(f[w])]);return y}case jm:return o([m,isNaN(f.getTime())?sr:f.toISOString()],f);case Cm:{const{source:b,flags:y}=f;return o([m,{source:b,flags:y}],f)}case Nm:{const b=[],y=o([m,b],f);for(const[w,x]of f)(t||!(ou(ds(w))||ou(ds(x))))&&b.push([u(w),u(x)]);return y}case Am:{const b=[],y=o([m,b],f);for(const w of f)(t||!ou(ds(w)))&&b.push(u(w));return y}}const{message:g}=f;return o([m,{name:p,message:g}],f)};return u},jb=(t,{json:i,lossy:r}={})=>{const a=[];return tC(!(i||r),!!i,new Map,a)(t),a},ku=typeof structuredClone=="function"?(t,i)=>i&&("json"in i||"lossy"in i)?Tb(jb(t,i)):structuredClone(t):(t,i)=>Tb(jb(t,i));function nC(t,i){const r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function iC(t,i){return"Back to reference "+(t+1)+(i>1?"-"+i:"")}function lC(t){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||nC,a=t.options.footnoteBackLabel||iC,o=t.options.footnoteLabel||"Footnotes",u=t.options.footnoteLabelTagName||"h2",f=t.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p<t.footnoteOrder.length;){const g=t.footnoteById.get(t.footnoteOrder[p]);if(!g)continue;const b=t.all(g),y=String(g.identifier).toUpperCase(),w=ua(y.toLowerCase());let x=0;const S=[],T=t.footnoteCounts.get(y);for(;T!==void 0&&++x<=T;){S.length>0&&S.push({type:"text",value:" "});let M=typeof r=="string"?r:r(p,x);typeof M=="string"&&(M={type:"text",value:M}),S.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+w+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(p,x),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const N=b[b.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const M=N.children[N.children.length-1];M&&M.type==="text"?M.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...S)}else b.push(...S);const E={type:"element",tagName:"li",properties:{id:i+"fn-"+w},children:t.wrap(b,!0)};t.patch(g,E),m.push(E)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...ku(f),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
25
|
-
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(m,!0)},{type:"text",value:`
|
|
26
|
-
`}]}}const Bu=(function(t){if(t==null)return oC;if(typeof t=="function")return Uu(t);if(typeof t=="object")return Array.isArray(t)?rC(t):aC(t);if(typeof t=="string")return sC(t);throw new Error("Expected function, string, or object as test")});function rC(t){const i=[];let r=-1;for(;++r<t.length;)i[r]=Bu(t[r]);return Uu(a);function a(...o){let u=-1;for(;++u<i.length;)if(i[u].apply(this,o))return!0;return!1}}function aC(t){const i=t;return Uu(r);function r(a){const o=a;let u;for(u in t)if(o[u]!==i[u])return!1;return!0}}function sC(t){return Uu(i);function i(r){return r&&r.type===t}}function Uu(t){return i;function i(r,a,o){return!!(uC(r)&&t.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function oC(){return!0}function uC(t){return t!==null&&typeof t=="object"&&"type"in t}const Ox=[],cC=!0,vs=!1,tm="skip";function nm(t,i,r,a){if(!t||typeof t!="object")throw new Error("Unexpected value `"+t+"` for `tree`, expected node");let o=!0,u,f,m,p;if(typeof r=="function"||r&&typeof r=="object"?(u=i,f=r,a&&(o=!1)):(f=i,r&&(o=!1)),typeof f=="function")m=f;else if(f&&typeof f=="object"){if(!(f.enter===null||f.enter===void 0))if(typeof f.enter=="function")m=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=Bu(u),b=o?1:-1;y(t,void 0,[])();function y(w,x,S){const T=w&&typeof w=="object"?w:{};if(typeof T.type=="string"){const E=typeof T.tagName=="string"?T.tagName:typeof T.name=="string"?T.name:void 0;Object.defineProperty(N,"name",{value:"node ("+(w.type+(E?"<"+E+">":""))+")"})}return N;function N(){const E=!u||g(w,x,S[S.length-1]||void 0);let M=Ox;if(m&&E&&(M=Cb(m(w,S,x)),M[0]===vs))return M;if("children"in w&&w.children){const H=w;if(H.children&&M[0]!==tm){let te=(o?-1:H.children.length)+b;const ie=[...S,H];for(;te>-1&&te<H.children.length;){const O=H.children[te],Q=y(O,te,ie)();if(Q[0]===vs)return Q;te=typeof Q[1]=="number"?Q[1]:te+b}}}if(p&&E){const H=Cb(p(w,S,x));if(H[0]===tm)throw new Error("Unexpected value `"+H[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(H[0]===vs||typeof H[1]=="number")return H}return M}}}function Cb(t){return Array.isArray(t)?t:typeof t=="number"?[cC,t]:t==null?Ox:[t]}function Hu(t,i,r,a){let o,u,f;u=i,f=r,typeof u=="function"?nm(t,o,im(u),f):nm(t,o,fC(u),f)}function fC(t){return!t||typeof t!="object"?t:{enter:typeof t.enter=="function"?im(t.enter):t.enter,exit:typeof t.exit=="function"?im(t.exit):t.exit}}function im(t){return i;function i(r,a,o){return t(r,o,a[a.length-1])}}const lm={}.hasOwnProperty,dC={};function mC(t,i){const r=i||dC,a=new Map,o=new Map,u=new Map,f={...Kj,...r.handlers},m={all:g,applyData:pC,definitionById:a,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:f,one:p,options:r,patch:hC,wrap:yC};return Hu(t,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const y=b.type==="definition"?a:o,w=String(b.identifier).toUpperCase();y.has(w)||y.set(w,b)}}),m;function p(b,y){const w=b.type,x=m.handlers[w];if(lm.call(m.handlers,w)&&x)return x(m,b,y);if(m.options.passThrough&&m.options.passThrough.includes(w)){if("children"in b){const{children:T,...N}=b,E=ku(N);return E.children=m.all(b),E}return ku(b)}return(m.options.unknownHandler||gC)(m,b,y)}function g(b){const y=[];if("children"in b){const w=b.children;let x=-1;for(;++x<w.length;){const S=m.one(w[x],b);if(S){if(x&&w[x-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Nb(S.value)),!Array.isArray(S)&&S.type==="element")){const T=S.children[0];T&&T.type==="text"&&(T.value=Nb(T.value))}Array.isArray(S)?y.push(...S):y.push(S)}}}return y}}function hC(t,i){t.position&&(i.position=iE(t))}function pC(t,i){let r=i;if(t&&t.data){const a=t.data.hName,o=t.data.hChildren,u=t.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const f="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:f}}r.type==="element"&&u&&Object.assign(r.properties,ku(u)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function gC(t,i){const r=i.data||{},a="value"in i&&!(lm.call(r,"hProperties")||lm.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function yC(t,i){const r=[];let a=-1;for(i&&r.push({type:"text",value:`
|
|
27
|
-
`});++a<t.length;)a&&r.push({type:"text",value:`
|
|
28
|
-
`}),r.push(t[a]);return i&&t.length>0&&r.push({type:"text",value:`
|
|
29
|
-
`}),r}function Nb(t){let i=0,r=t.charCodeAt(i);for(;r===9||r===32;)i++,r=t.charCodeAt(i);return t.slice(i)}function Ab(t,i){const r=mC(t,i),a=r.one(t,void 0),o=lC(r),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
|
|
30
|
-
`},o),u}function bC(t,i){return t&&"run"in t?async function(r,a){const o=Ab(r,{file:a,...i});await t.run(o,a)}:function(r,a){return Ab(r,{file:a,...t||i})}}function Ob(t){if(t)throw t}var Nd,_b;function vC(){if(_b)return Nd;_b=1;var t=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(g){return typeof Array.isArray=="function"?Array.isArray(g):i.call(g)==="[object Array]"},u=function(g){if(!g||i.call(g)!=="[object Object]")return!1;var b=t.call(g,"constructor"),y=g.constructor&&g.constructor.prototype&&t.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!b&&!y)return!1;var w;for(w in g);return typeof w>"u"||t.call(g,w)},f=function(g,b){r&&b.name==="__proto__"?r(g,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):g[b.name]=b.newValue},m=function(g,b){if(b==="__proto__")if(t.call(g,b)){if(a)return a(g,b).value}else return;return g[b]};return Nd=function p(){var g,b,y,w,x,S,T=arguments[0],N=1,E=arguments.length,M=!1;for(typeof T=="boolean"&&(M=T,T=arguments[1]||{},N=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});N<E;++N)if(g=arguments[N],g!=null)for(b in g)y=m(T,b),w=m(g,b),T!==w&&(M&&w&&(u(w)||(x=o(w)))?(x?(x=!1,S=y&&o(y)?y:[]):S=y&&u(y)?y:{},f(T,{name:b,newValue:p(M,S,w)})):typeof w<"u"&&f(T,{name:b,newValue:w}));return T},Nd}var xC=vC();const Ad=yv(xC);function rm(t){if(typeof t!="object"||t===null)return!1;const i=Object.getPrototypeOf(t);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function wC(){const t=[],i={run:r,use:a};return i;function r(...o){let u=-1;const f=o.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);m(null,...o);function m(p,...g){const b=t[++u];let y=-1;if(p){f(p);return}for(;++y<o.length;)(g[y]===null||g[y]===void 0)&&(g[y]=o[y]);o=g,b?SC(b,m)(...g):f(null,...g)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return t.push(o),i}}function SC(t,i){let r;return a;function a(...f){const m=t.length>f.length;let p;m&&f.push(o);try{p=t.apply(this,f)}catch(g){const b=g;if(m&&r)throw b;return o(b)}m||(p&&p.then&&typeof p.then=="function"?p.then(u,o):p instanceof Error?o(p):u(p))}function o(f,...m){r||(r=!0,i(f,...m))}function u(f){o(null,f)}}const Ci={basename:kC,dirname:EC,extname:TC,join:jC,sep:"/"};function kC(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');zs(t);let r=0,a=-1,o=t.length,u;if(i===void 0||i.length===0||i.length>t.length){for(;o--;)if(t.codePointAt(o)===47){if(u){r=o+1;break}}else a<0&&(u=!0,a=o+1);return a<0?"":t.slice(r,a)}if(i===t)return"";let f=-1,m=i.length-1;for(;o--;)if(t.codePointAt(o)===47){if(u){r=o+1;break}}else f<0&&(u=!0,f=o+1),m>-1&&(t.codePointAt(o)===i.codePointAt(m--)?m<0&&(a=o):(m=-1,a=f));return r===a?a=f:a<0&&(a=t.length),t.slice(r,a)}function EC(t){if(zs(t),t.length===0)return".";let i=-1,r=t.length,a;for(;--r;)if(t.codePointAt(r)===47){if(a){i=r;break}}else a||(a=!0);return i<0?t.codePointAt(0)===47?"/":".":i===1&&t.codePointAt(0)===47?"//":t.slice(0,i)}function TC(t){zs(t);let i=t.length,r=-1,a=0,o=-1,u=0,f;for(;i--;){const m=t.codePointAt(i);if(m===47){if(f){a=i+1;break}continue}r<0&&(f=!0,r=i+1),m===46?o<0?o=i:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||r<0||u===0||u===1&&o===r-1&&o===a+1?"":t.slice(o,r)}function jC(...t){let i=-1,r;for(;++i<t.length;)zs(t[i]),t[i]&&(r=r===void 0?t[i]:r+"/"+t[i]);return r===void 0?".":CC(r)}function CC(t){zs(t);const i=t.codePointAt(0)===47;let r=NC(t,!i);return r.length===0&&!i&&(r="."),r.length>0&&t.codePointAt(t.length-1)===47&&(r+="/"),i?"/"+r:r}function NC(t,i){let r="",a=0,o=-1,u=0,f=-1,m,p;for(;++f<=t.length;){if(f<t.length)m=t.codePointAt(f);else{if(m===47)break;m=47}if(m===47){if(!(o===f-1||u===1))if(o!==f-1&&u===2){if(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(p=r.lastIndexOf("/"),p!==r.length-1){p<0?(r="",a=0):(r=r.slice(0,p),a=r.length-1-r.lastIndexOf("/")),o=f,u=0;continue}}else if(r.length>0){r="",a=0,o=f,u=0;continue}}i&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+t.slice(o+1,f):r=t.slice(o+1,f),a=f-o-1;o=f,u=0}else m===46&&u>-1?u++:u=-1}return r}function zs(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const AC={cwd:OC};function OC(){return"/"}function am(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function _C(t){if(typeof t=="string")t=new URL(t);else if(!am(t)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(t.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return zC(t)}function zC(t){if(t.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const i=t.pathname;let r=-1;for(;++r<i.length;)if(i.codePointAt(r)===37&&i.codePointAt(r+1)===50){const a=i.codePointAt(r+2);if(a===70||a===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(i)}const Od=["history","path","basename","stem","extname","dirname"];class _x{constructor(i){let r;i?am(i)?r={path:i}:typeof i=="string"||RC(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":AC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Od.length;){const u=Od[a];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let o;for(o in r)Od.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Ci.basename(this.path):void 0}set basename(i){zd(i,"basename"),_d(i,"basename"),this.path=Ci.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ci.dirname(this.path):void 0}set dirname(i){zb(this.basename,"dirname"),this.path=Ci.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ci.extname(this.path):void 0}set extname(i){if(_d(i,"extname"),zb(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ci.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){am(i)&&(i=_C(i)),zd(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ci.basename(this.path,this.extname):void 0}set stem(i){zd(i,"stem"),_d(i,"stem"),this.path=Ci.join(this.dirname||"",i+(this.extname||""))}fail(i,r,a){const o=this.message(i,r,a);throw o.fatal=!0,o}info(i,r,a){const o=this.message(i,r,a);return o.fatal=void 0,o}message(i,r,a){const o=new qu(i,r,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function _d(t,i){if(t&&t.includes(Ci.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ci.sep+"`")}function zd(t,i){if(!t)throw new Error("`"+i+"` cannot be empty")}function zb(t,i){if(!t)throw new Error("Setting `"+i+"` requires `path` to be set too")}function RC(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const qC=(function(t){const a=this.constructor.prototype,o=a[t],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),MC={}.hasOwnProperty;class Om extends qC{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=wC()}copy(){const i=new Om;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];i.use(...a)}return i.data(Ad(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(Md("data",this.frozen),this.namespace[i]=r,this):MC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Md("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=r.call(i,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const r=uu(i),a=this.parser||this.Parser;return Rd("parse",a),a(String(r),r)}process(i,r){const a=this;return this.freeze(),Rd("process",this.parser||this.Parser),qd("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,f){const m=uu(i),p=a.parse(m);a.run(p,m,function(b,y,w){if(b||!y||!w)return g(b);const x=y,S=a.stringify(x,w);BC(S)?w.value=S:w.result=S,g(b,w)});function g(b,y){b||!y?f(b):u?u(y):r(void 0,y)}}}processSync(i){let r=!1,a;return this.freeze(),Rd("processSync",this.parser||this.Parser),qd("processSync",this.compiler||this.Compiler),this.process(i,o),qb("processSync","process",r),a;function o(u,f){r=!0,Ob(u),a=f}}run(i,r,a){Rb(i),this.freeze();const o=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?u(void 0,a):new Promise(u);function u(f,m){const p=uu(r);o.run(i,p,g);function g(b,y,w){const x=y||i;b?m(b):f?f(x):a(void 0,x,w)}}}runSync(i,r){let a=!1,o;return this.run(i,r,u),qb("runSync","run",a),o;function u(f,m){Ob(f),o=m,a=!0}}stringify(i,r){this.freeze();const a=uu(r),o=this.compiler||this.Compiler;return qd("stringify",o),Rb(i),o(i,a)}use(i,...r){const a=this.attachers,o=this.namespace;if(Md("use",this.frozen),i!=null)if(typeof i=="function")p(i,r);else if(typeof i=="object")Array.isArray(i)?m(i):f(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function u(g){if(typeof g=="function")p(g,[]);else if(typeof g=="object")if(Array.isArray(g)){const[b,...y]=g;p(b,y)}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");m(g.plugins),g.settings&&(o.settings=Ad(!0,o.settings,g.settings))}function m(g){let b=-1;if(g!=null)if(Array.isArray(g))for(;++b<g.length;){const y=g[b];u(y)}else throw new TypeError("Expected a list of plugins, not `"+g+"`")}function p(g,b){let y=-1,w=-1;for(;++y<a.length;)if(a[y][0]===g){w=y;break}if(w===-1)a.push([g,...b]);else if(b.length>0){let[x,...S]=b;const T=a[w][1];rm(T)&&rm(x)&&(x=Ad(!0,T,x)),a[w]=[g,x,...S]}}}}const DC=new Om().freeze();function Rd(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function qd(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Md(t,i){if(i)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Rb(t){if(!rm(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function qb(t,i,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+i+"` instead")}function uu(t){return LC(t)?t:new _x(t)}function LC(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function BC(t){return typeof t=="string"||UC(t)}function UC(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const HC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Mb=[],Db={allowDangerousHtml:!0},IC=/^(https?|ircs?|mailto|xmpp)$/i,VC=[{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 YC(t){const i=GC(t),r=FC(t);return QC(i.runSync(i.parse(r),r),t)}function GC(t){const i=t.rehypePlugins||Mb,r=t.remarkPlugins||Mb,a=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Db}:Db;return DC().use(kj).use(r).use(bC,a).use(i)}function FC(t){const i=t.children||"",r=new _x;return typeof i=="string"&&(r.value=i),r}function QC(t,i){const r=i.allowedElements,a=i.allowElement,o=i.components,u=i.disallowedElements,f=i.skipHtml,m=i.unwrapDisallowed,p=i.urlTransform||XC;for(const b of VC)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+HC+b.id,void 0);return Hu(t,g),uE(t,{Fragment:h.Fragment,components:o,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function g(b,y,w){if(b.type==="raw"&&w&&typeof y=="number")return f?w.children.splice(y,1):w.children[y]={type:"text",value:b.value},y;if(b.type==="element"){let x;for(x in Td)if(Object.hasOwn(Td,x)&&Object.hasOwn(b.properties,x)){const S=b.properties[x],T=Td[x];(T===null||T.includes(b.tagName))&&(b.properties[x]=p(String(S||""),x,b))}}if(b.type==="element"){let x=r?!r.includes(b.tagName):u?u.includes(b.tagName):!1;if(!x&&a&&typeof y=="number"&&(x=!a(b,y,w)),x&&w&&typeof y=="number")return m&&b.children?w.children.splice(y,1,...b.children):w.children.splice(y,1),y}}}function XC(t){const i=t.indexOf(":"),r=t.indexOf("?"),a=t.indexOf("#"),o=t.indexOf("/");return i===-1||o!==-1&&i>o||r!==-1&&i>r||a!==-1&&i>a||IC.test(t.slice(0,i))?t:""}function Lb(t,i){const r=String(t);if(typeof i!="string")throw new TypeError("Expected character");let a=0,o=r.indexOf(i);for(;o!==-1;)a++,o=r.indexOf(i,o+i.length);return a}function ZC(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function KC(t,i,r){const o=Bu((r||{}).ignore||[]),u=$C(i);let f=-1;for(;++f<u.length;)nm(t,m);function m(g,b,y){if(g.type==="text"&&typeof y=="number")return p(g,b,y);if(o(g,y,b[b.length-1]))return tm}function p(g,b,y){const w=b[b.length-1],x=u[f][0],S=u[f][1];let T=0,N=!1,E=[];x.lastIndex=0;let M=x.exec(g.value);for(;M;){const te=M.index,ie={index:M.index,input:M.input,stack:[...b,g]};let O=S(...M,ie);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1)x.lastIndex=te+1;else{if(T!==te&&H({type:"text",value:g.value.slice(T,te)}),Array.isArray(O))for(const Q of O)H(Q);else O&&H(O);T=te+M[0].length,N=!0}if(!x.global)break;M=x.exec(g.value)}return N?(T<g.value.length&&H({type:"text",value:g.value.slice(T)}),w.children.splice(y,1,...E)):E=[g],y+E.length;function H(te){const ie=E[E.length-1];ie&&ie.type==="text"&&te.type==="text"?ie.value+=te.value:E.push(te)}}}function $C(t){if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const i=[],r=!t[0]||Array.isArray(t[0])?t:[t];let a=-1;for(;++a<r.length;){const o=r[a];i.push([JC(o[0]),PC(o[1])])}return i}function JC(t){return typeof t=="string"?new RegExp(ZC(t),"g"):t}function PC(t){return typeof t=="function"?t:function(){return t}}const Dd="phrasing",Ld=["autolink","link","image","label"];function WC(){return{transforms:[aN],enter:{literalAutolink:tN,literalAutolinkEmail:Bd,literalAutolinkHttp:Bd,literalAutolinkWww:Bd},exit:{literalAutolink:rN,literalAutolinkEmail:lN,literalAutolinkHttp:nN,literalAutolinkWww:iN}}}function eN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Dd,notInConstruct:Ld},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Dd,notInConstruct:Ld},{character:":",before:"[ps]",after:"\\/",inConstruct:Dd,notInConstruct:Ld}]}}function tN(t){this.enter({type:"link",title:null,url:"",children:[],position:void 0},t)}function Bd(t){this.config.enter.autolinkProtocol.call(this,t)}function nN(t){this.config.exit.autolinkProtocol.call(this,t)}function iN(t){this.config.exit.data.call(this,t);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(t)}function lN(t){this.config.exit.autolinkEmail.call(this,t)}function rN(t){this.exit(t)}function aN(t){KC(t,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),sN],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),cN],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),uN],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),oN]],{ignore:["link","linkReference"]})}function sN(t,i,r,a,o){if(!mN(o))return!1;let u="";if(/^w/i.test(i)&&(r=i+r,i="",u="http://"),Os(r.charCodeAt(0))||!fN(r))return!1;const f=dN(r+a),m={type:"link",title:null,url:u+i+f[0],children:[{type:"text",value:i+f[0],position:void 0}],position:void 0};return f[1]?[m,{type:"text",value:f[1],position:void 0}]:m}function oN(t,i,r){return/[\d\-_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r,position:void 0}],position:void 0}}function uN(t,i,r){if(/[\d\-_]$/.test(r))return!1;const a="mailto:"+i+"@"+r;return{type:"link",title:null,url:a,children:[{type:"text",value:a,position:void 0}],position:void 0}}function cN(t,i,r,a,o){if(/[\d\-_]$/.test(r)||a&&(!/[A-Za-z]$/.test(a)||o.input.charAt(o.index+t.length)==="@"))return!1;const u="xmpp:"+i+"@"+r+(a||"");return{type:"link",title:null,url:u,children:[{type:"text",value:u,position:void 0}],position:void 0}}function fN(t){const i=t.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[\dA-Za-z]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[\dA-Za-z]/.test(i[i.length-2])))}function dN(t){let i=t.length;for(;i>0;){const f=t.charCodeAt(i-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)i--;else break}if(i===t.length)return[t,void 0];let r=t.slice(i);t=t.slice(0,i);let a=r.indexOf(")");const o=Lb(t,"(");let u=Lb(t,")");for(;a!==-1&&o>u;)t+=r.slice(0,a+1),r=r.slice(a+1),a=r.indexOf(")"),u++;return[t,r]}function mN(t){const i=t.input.charCodeAt(t.index-1);return t.index===0||cr(i)||Os(i)}zx.peek=SN;function hN(){this.buffer()}function pN(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function gN(){this.buffer()}function yN(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function bN(t){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=mi(this.sliceSerialize(t)).toLowerCase(),r.label=i}function vN(t){this.exit(t)}function xN(t){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=mi(this.sliceSerialize(t)).toLowerCase(),r.label=i}function wN(t){this.exit(t)}function SN(){return"["}function zx(t,i,r,a){const o=r.createTracker(a);let u=o.move("[^");const f=r.enter("footnoteReference"),m=r.enter("reference");return u+=o.move(r.safe(r.associationId(t),{after:"]",before:u})),m(),f(),u+=o.move("]"),u}function kN(){return{enter:{gfmFootnoteCallString:hN,gfmFootnoteCall:pN,gfmFootnoteDefinitionLabelString:gN,gfmFootnoteDefinition:yN},exit:{gfmFootnoteCallString:bN,gfmFootnoteCall:vN,gfmFootnoteDefinitionLabelString:xN,gfmFootnoteDefinition:wN}}}function EN(t){let i=!1;return t&&t.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:r,footnoteReference:zx},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(a,o,u,f){const m=u.createTracker(f);let p=m.move("[^");const g=u.enter("footnoteDefinition"),b=u.enter("label");return p+=m.move(u.safe(u.associationId(a),{before:p,after:"]"})),b(),p+=m.move("]:"),a.children&&a.children.length>0&&(m.shift(4),p+=m.move((i?`
|
|
31
|
-
`:" ")+u.indentLines(u.containerFlow(a,m.current()),i?Rx:TN))),g(),p}}function TN(t,i,r){return i===0?t:Rx(t,i,r)}function Rx(t,i,r){return(r?"":" ")+t}const jN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];_m.attention=_N;_m.peek=zN;function CN(){return{canContainEols:["delete"],enter:{strikethrough:AN},exit:{strikethrough:ON}}}function NN(){return{handlers:{delete:_m},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:jN}]}}function AN(t){this.enter({type:"delete",children:[],position:void 0},t)}function ON(t){this.exit(t)}function _m(t,i,r,a){const o=r.createTracker(a),u=r.stack.includes("strikethrough")?"~":"~~",f=r.enter("strikethrough");let m=o.move(u);return m+=r.containerPhrasing(t,{...o.current(),before:m,after:"~"}),m+=o.move(u),f(),m}function _N(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function zN(){return"~"}function RN(t){return t.length}function qN(t,i){const r=i||{},a=(r.align||[]).concat(),o=r.stringLength||RN,u=[],f=[],m=[],p=[];let g=0,b=-1;for(;++b<t.length;){const T=[],N=[];let E=-1;for(t[b].length>g&&(g=t[b].length);++E<t[b].length;){const M=MN(t[b][E]);if(r.alignDelimiters!==!1){const H=o(M);N[E]=H,(p[E]===void 0||H>p[E])&&(p[E]=H)}T.push(M)}f[b]=T,m[b]=N}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<g;)u[y]=Bb(a[y]);else{const T=Bb(a);for(;++y<g;)u[y]=T}y=-1;const w=[],x=[];for(;++y<g;){const T=u[y];let N="",E="";T===99?(N=":",E=":"):T===108?N=":":T===114&&(E=":");let M=r.alignDelimiters===!1?1:Math.max(1,p[y]-N.length-E.length);const H=N+"-".repeat(M)+E;r.alignDelimiters!==!1&&(M=N.length+M+E.length,M>p[y]&&(p[y]=M),x[y]=M),w[y]=H}f.splice(1,0,w),m.splice(1,0,x),b=-1;const S=[];for(;++b<f.length;){const T=f[b],N=m[b],E=r.fillRows===!1?Math.max(1,f[b===1?0:b].length):g;y=-1;const M=[];for(;++y<E;){const H=T[y]||"";let te="",ie="";if(r.alignDelimiters!==!1){const O=p[y]-(N[y]||0),Q=u[y];if(Q===114)te=" ".repeat(O);else if(Q===99){const re=O/2;O%2?(te=" ".repeat(re+.5),ie=" ".repeat(re-.5)):(te=" ".repeat(re),ie=te)}else ie=" ".repeat(O)}r.delimiterStart!==!1&&!y&&M.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&H==="")&&(r.delimiterStart!==!1||y)&&M.push(" "),r.alignDelimiters!==!1&&M.push(te),M.push(H),r.alignDelimiters!==!1&&M.push(ie),r.padding!==!1&&M.push(" "),(r.delimiterEnd!==!1||y!==E-1)&&M.push("|")}S.push(r.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return S.join(`
|
|
32
|
-
`)}function MN(t){return t==null?"":String(t)}function Bb(t){const i=typeof t=="string"?t.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}const DN=Bu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function LN(t,i,r,a){const o=r.enter("blockquote"),u=r.createTracker(a);u.move("> "),u.shift(2);const f=r.indentLines(r.containerFlow(t,u.current()),BN);return o(),f}function BN(t,i,r){return">"+(r?"":" ")+t}function UN(t,i){return Ub(t,i.inConstruct,!0)&&!Ub(t,i.notInConstruct,!1)}function Ub(t,i,r){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return r;let a=-1;for(;++a<i.length;)if(t.includes(i[a]))return!0;return!1}function Hb(t,i,r,a){let o=-1;for(;++o<r.unsafe.length;){const u=r.unsafe[o];if(u.character===`
|
|
33
|
-
`&&!u.before&&!u.after&&UN(r.stack,u))return/[\t ]/.test(a.before)?"":" "}return`\\
|
|
34
|
-
`}function HN(t,i){const r=String(t);let a=r.indexOf(i),o=a,u=0,f=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===o?++u>f&&(f=u):u=1,o=a+i.length,a=r.indexOf(i,o);return f}function IN(t,i){return!!(i.options.fences===!1&&t.value&&!t.lang&&/[^\n\r ]/.test(t.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(t.value))}function VN(t){const i=t.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function YN(t,i,r,a){const o=VN(r),u=t.value||"";if(IN(t,r)){const y=r.enter("codeIndented"),w=r.indentLines(u,GN);return y(),w}const f=r.createTracker(a),m=o.repeat(Math.max(HN(u,o)+1,3)),p=r.enter("codeFenced"),g=o==="`"?"GraveAccent":"Tilde";let b=f.move(m);if(t.lang){const y=r.enter(`codeFencedLang${g}`);b+=f.move(r.safe(t.lang,{before:b,after:" ",encode:["`"],...f.current()})),y()}if(t.lang&&t.meta){const y=r.enter(`codeFencedMeta${g}`);b+=f.move(" "),b+=f.move(r.safe(t.meta,{before:b,after:`
|
|
35
|
-
`,encode:["`"],...f.current()})),y()}return b+=f.move(`
|
|
36
|
-
`),u&&(b+=f.move(u+`
|
|
37
|
-
`)),b+=f.move(m),p(),b}function GN(t,i,r){return(r?"":" ")+t}function zm(t){const i=t.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function FN(t,i,r,a){const o=zm(r),u=o==='"'?"Quote":"Apostrophe",f=r.enter("definition");let m=r.enter("label");const p=r.createTracker(a);let g=p.move("[");return g+=p.move(r.safe(r.associationId(t),{before:g,after:"]",...p.current()})),g+=p.move("]: "),m(),!t.url||/[\0- \u007F]/.test(t.url)?(m=r.enter("destinationLiteral"),g+=p.move("<"),g+=p.move(r.safe(t.url,{before:g,after:">",...p.current()})),g+=p.move(">")):(m=r.enter("destinationRaw"),g+=p.move(r.safe(t.url,{before:g,after:t.title?" ":`
|
|
38
|
-
`,...p.current()}))),m(),t.title&&(m=r.enter(`title${u}`),g+=p.move(" "+o),g+=p.move(r.safe(t.title,{before:g,after:o,...p.current()})),g+=p.move(o),m()),f(),g}function QN(t){const i=t.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function Eu(t){const i=t.codePointAt(0);return i===void 0?"":String.fromCodePoint(i)}function aa(t){const i=t.codePointAt(t.length-2);return i!==void 0&&i>65535?t.slice(-2):t.slice(-1)}function qx(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Ib(t,i,r){const a=Nl(t),o=Nl(i);return a===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function XN(t){if(t.charCodeAt(0)!==60)return;const i=t.charCodeAt(1);if(i===33){const m=t.charCodeAt(2);return m===45?2:m===91?5:gn(m)?4:void 0}if(i===63)return 3;const r=i===47,a=r?2:1;let o=a,u=t.charCodeAt(o);if(!gn(u))return;for(;u===45||yn(u);)u=t.charCodeAt(++o);const f=t.slice(a,o).toLowerCase();return!r&&u!==47&&em.includes(f)?1:vx.includes(f)?6:7}const Mx=new Map([["*",!1],["_",!0]]);function ZN(t,i,r){const a=new Set;for(const u of t){const f=r.get(u);if(f&&u.attention&&i.some(m=>m.attention===u.attention))for(const m of f.tokens)a.add(m.attention)}const o=[];for(const u of t)u.attention&&a.delete(u.attention)&&o.push(u.attention);return o.reverse(),o}function Dx(t,i,r){const a=[],o=new Map,u=new Map;let f=0;for(;f<t.length;){if(!t[f].attention){f++;continue}const m=t[f].value.charAt(0),p=Mx.get(m);let g=f+1;for(;g<t.length&&t[g].attention&&t[g].value.charAt(0)===m;)g++;const b=f?t[f-1].value:i,y=Nl(b.charCodeAt(b.length-1)),w=Nl((g<t.length?t[g].value:r).charCodeAt(0)),x=!w||w===2&&!!y,S=!y||y===2&&!!w,T={tokens:t.slice(f,g),markers:[],start:0,end:0,open:p?x&&(!!y||!S):x,close:p?S&&(!!w||!x):S,split:p!==void 0};for(const N of T.tokens){o.set(N,[...T.tokens]),u.set(N,T);let E=N.value.length;for(;E--;)T.markers.push(N)}T.end=T.markers.length,a.push(T),f=g}for($N(a,o),f=-1;++f<t.length;){const m=o.get(t[f]);if(m)return{attention:ZN(t,m,u),index:f}}}function cu(t,i){const r=t[i?0:t.length-1];if(!r||r.attention)return;const a=i?Eu(r.value):aa(r.value),o=qx(a.codePointAt(0));if(i)r.value=o+r.value.slice(a.length);else{let u=r.value.slice(0,r.value.length-a.length),f=0;for(;u.charCodeAt(u.length-1-f)===92;)f++;f%2&&(u+="\\"),r.value=u+o}}function KN(t,i,r,a,o){for(const u of r.attention){const f=i.get(u)||u.sequences[0];for(const m of u.sequences){if(m===f)continue;const p=new Map(i);p.set(u,m);const g=Iu(t,p,a,o),b=Dx(g,a,o);if(!b||b.index>r.index)return{chosen:p,mistake:b,tokens:g}}}}function $N(t,i){const r=new Map;for(const a of t){const o=a.tokens[0].value.charAt(0);let u=r.get(o);u||(u=[],r.set(o,u));let f=a.close?u.length:0;for(;f--&&a.start<a.end;){const m=u[f],p=m.end-m.start,g=a.end-a.start;if(a.split?(m.close||a.open)&&g%3&&!((p+g)%3):p!==m.markers.length||p!==g)continue;const b=a.split?p>1&&g>1?2:1:g,y=m.markers.slice(m.end-b,m.end),w=a.markers.slice(a.start,a.start+b),x=y[0],S=w[0];if(x===y[b-1]&&x.value.length===b&&S===w[b-1]&&S.value.length===b&&x.attention===S.attention)i.delete(x),i.delete(S);else{const T=[...new Set([...y,...w])];for(const N of T){const E=i.get(N);E&&E.push(...T)}}m.end-=b,a.start+=b,m.start===m.end&&u.splice(f,1),f=u.length}a.open&&a.start<a.end&&u.push(a)}}function JN(t,i,r){if(i.length===0)throw new Error("Cannot serialize `"+t+"` as attention without markers, expected one or more markers");if(r.length===0)throw new Error("Cannot serialize `"+t+"` as attention without sizes, expected one or more sizes");for(const o of r)if(!Number.isSafeInteger(o)||o<1)throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as size, expected positive integer");const a=[];for(const o of i){if(o.length!==1)throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as marker, expected a single ascii character");if(!cx(o.charCodeAt(0)))throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as marker, expected ascii punctuation");for(const u of r)a.push(o.repeat(u))}return a}function PN(t,i,r){const a=i.indexStack,o=t.children||[],u=[];let f=-1,m=r.before;a.push(-1);let p=i.createTracker(r);for(;++f<o.length;){const g=o[f];let b;if(a[a.length-1]=f,f+1<o.length){let x=i.handle.handlers[o[f+1].type];x&&x.peek&&(x=x.peek),b=x?Eu(x(o[f+1],t,i,{before:"",after:"",...p.current()})):""}else b=r.after;const y=u[u.length-1];typeof y=="string"&&(m==="\r"||m===`
|
|
39
|
-
`)&&g.type==="html"&&XN(g.value)!==7&&(u[u.length-1]=y.replace(/(\r?\n|\r)$/," "),m=" ",p=i.createTracker(r),p.move(Vu(u,r.before,r.after)));const w=i.handle.handlers[g.type];if(w&&w.attention){const x=Rm(g,w.attention,i,p);if(!x)continue;u.push(x),m=aa(x.sequences[0])}else{const x=i.handle(g,t,i,{...p.current(),after:b,before:m});if(!x)continue;p.move(x),u.push(x),m=aa(x)}}return a.pop(),u}function Rm(t,i,r,a){const{construct:o,markers:u,sizes:f}=i(t,r),m=JN(t.type,u,f),p=m[0],g=r.enter(o),b=r.createTracker(a.current());b.move(p);const y=PN(t,r,{...b.current(),before:p,after:p});if(g(),y.length!==0)return a.move(p),a.move(Vu(y,p,p)),a.move(p),{children:y,sequences:m}}function Vb(t,i,r,a){let o=Iu(t,i,r,a),u=Dx(o,r,a);for(;u;){const f=KN(t,i,u,r,a);if(!f)return;i=f.chosen,o=f.tokens,u=f.mistake}return o}function Lx(t,i,r,a){let o=r,u=-1;for(;++u<t.length;){const f=t[u];if(typeof f=="string"){o="";continue}const m=u===t.length-1?a:"",p=f.sequences.find(function(g){const b=g.charAt(0);return b!==o.charAt(0)&&b!==m.charAt(0)||t.length===1&&Mx.has(b)&&g.length>r.length})||f.sequences[0];p!==f.sequences[0]&&i.set(f,p),Lx(f.children,i,p,p),o=p}}function Iu(t,i,r,a){const o=[];let u,f=aa(r),m=-1;for(;++m<t.length;){const p=t[m];if(typeof p=="string"){const H={value:p,attention:void 0};u&&u===Eu(p)&&cu([H],!0),u=void 0,o.push(H),H.value&&(f=aa(H.value));continue}const g=i.get(p)||p.sequences[0],b=g.charAt(0),y=t[m+1],w=f,x=Eu(y===void 0?a:typeof y=="string"?y:i.get(y)||y.sequences[0]),S=Iu(p.children,i,g,g),T=S[0].value,N=Ib(w.charCodeAt(w.length-1),T.charCodeAt(0),b);N.inside&&cu(S,!0);const E=aa(S[S.length-1].value),M=Ib(x.charCodeAt(0),E.charCodeAt(E.length-1),b);M.inside&&cu(S,!1),N.outside&&w!==`
|
|
40
|
-
`&&w!=="\r"&&cu(o,!1),M.outside&&(u=x),o.push({value:g,attention:p},...S,{value:g,attention:p}),f=g.charAt(g.length-1)}return o}function Vu(t,i,r){const a=new Map;Lx(t,a,i,r);const o=(a.size>0?Vb(t,a,i,r):void 0)||Vb(t,new Map,i,r)||Iu(t,new Map,i,r);let u="";for(const f of o)u+=f.value;return u}qm.attention=Bx;qm.peek=WN;function qm(t,i,r,a){const o=r.enter("phrasing"),u=Rm(t,Bx,r,r.createTracker(a)),f=u?Vu([u],a.before,a.after):"";return o(),f}function Bx(t,i){return{construct:"emphasis",markers:QN(i)==="*"?["*","_"]:["_","*"],sizes:[1]}}function WN(t,i,r){return r.options.emphasis||"*"}function eA(t,i){let r=!1;return Hu(t,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,vs}),!!((!t.depth||t.depth<3)&&Mu(t)&&(i.options.setext||r))}function tA(t,i,r,a){const o=Math.max(Math.min(6,t.depth||1),1),u=r.createTracker(a);if(eA(t,r)){const y=r.enter("headingSetext"),w=r.enter("phrasing"),x=r.containerPhrasing(t,{...u.current(),before:`
|
|
41
|
-
`,after:`
|
|
42
|
-
`});return w(),y(),x+`
|
|
43
|
-
`+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
44
|
-
`))+1))}const f="#".repeat(o),m=r.enter("headingAtx"),p=r.enter("phrasing");u.move(f+" ");let g=r.containerPhrasing(t,{before:"# ",after:`
|
|
45
|
-
`,...u.current()});const b=g.charCodeAt(0);return(b===9||b===32)&&(g=qx(b)+g.slice(1)),g=g?f+" "+g:f,r.options.closeAtx&&(g+=" "+f),p(),m(),g}Ux.peek=nA;function Ux(t){return t.value||""}function nA(){return"<"}Hx.peek=iA;function Hx(t,i,r,a){const o=zm(r),u=o==='"'?"Quote":"Apostrophe",f=r.enter("image");let m=r.enter("label");const p=r.createTracker(a);let g=p.move("![");return g+=p.move(r.safe(t.alt,{before:g,after:"]",...p.current()})),g+=p.move("]("),m(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(m=r.enter("destinationLiteral"),g+=p.move("<"),g+=p.move(r.safe(t.url,{before:g,after:">",...p.current()})),g+=p.move(">")):(m=r.enter("destinationRaw"),g+=p.move(r.safe(t.url,{before:g,after:t.title?" ":")",...p.current()}))),m(),t.title&&(m=r.enter(`title${u}`),g+=p.move(" "+o),g+=p.move(r.safe(t.title,{before:g,after:o,...p.current()})),g+=p.move(o),m()),g+=p.move(")"),f(),g}function iA(){return"!"}Ix.peek=lA;function Ix(t,i,r,a){const o=t.referenceType,u=r.enter("imageReference");let f=r.enter("label");const m=r.createTracker(a);let p=m.move("![");const g=r.safe(t.alt,{before:p,after:"]",...m.current()});p+=m.move(g+"]["),f();const b=r.stack;r.stack=b.filter(function(w){return w!=="phrasing"}),f=r.enter("reference");const y=r.safe(r.associationId(t),{before:p,after:"]",...m.current()});return f(),r.stack=b,u(),o==="full"||!g||g!==y?p+=m.move(y+"]"):o==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function lA(){return"!"}Vx.peek=rA;function Vx(t,i,r){let a=t.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(a);)o+="`";for(/[^\n\r ]/.test(a)&&(/^[\n\r ]/.test(a)&&/[\n\r ]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++u<r.unsafe.length;){const f=r.unsafe[u],m=r.compilePattern(f);if(!f.atBreak)continue;let p;for(;p=m.exec(a);){let g=p.index;a.charCodeAt(g)===10&&a.charCodeAt(g-1)===13&&g--,a=a.slice(0,g)+" "+a.slice(p.index+1)}}return o+a+o}function rA(){return"`"}function Yx(t,i){const r=Mu(t);return!!(!i.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][+\-.a-z]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Gx.peek=aA;function Gx(t,i,r,a){const o=zm(r),u=o==='"'?"Quote":"Apostrophe",f=r.createTracker(a);if(Yx(t,r)){const S=r.stack;r.stack=S.filter(function(E){return E!=="phrasing"});const T=r.enter("autolink");let N=f.move("<");return N+=f.move(r.containerPhrasing(t,{before:N,after:">",...f.current()})),N+=f.move(">"),T(),r.stack=S,N}const m=r.enter("link");let p=r.enter("label"),g=f.move("[");const b=r.containerPhrasing(t,{before:g,after:"](",...f.current()});g+=f.move(b),p(),g+=f.move("](");const y=/[\0- \u007F]/.test(t.url),w=a.before.charAt(a.before.length-1);let x=t.title||void 0;if(!x&&!y&&(w===`
|
|
46
|
-
`||w==="\r")){let S=0;for(;S<b.length&&b.charCodeAt(S)!==93;)S+=b.charCodeAt(S)===92?2:1;b.charCodeAt(S+1)===58&&(x="")}return!t.url&&typeof x=="string"||y?(p=r.enter("destinationLiteral"),g+=f.move("<"),g+=f.move(r.safe(t.url,{before:g,after:">",...f.current()})),g+=f.move(">")):(p=r.enter("destinationRaw"),g+=f.move(r.safe(t.url,{before:g,after:typeof x=="string"?" ":")",...f.current()}))),p(),typeof x=="string"&&(p=r.enter(`title${u}`),g+=f.move(" "+o),g+=f.move(r.safe(x,{before:g,after:o,...f.current()})),g+=f.move(o),p()),g+=f.move(")"),m(),g}function aA(t,i,r){return Yx(t,r)?"<":"["}Fx.peek=sA;function Fx(t,i,r,a){const o=t.referenceType,u=r.enter("linkReference");let f=r.enter("label");const m=r.createTracker(a);let p=m.move("[");const g=r.containerPhrasing(t,{before:p,after:"]",...m.current()});p+=m.move(g+"]["),f();const b=r.stack;r.stack=b.filter(function(w){return w!=="phrasing"}),f=r.enter("reference");const y=r.safe(r.associationId(t),{before:p,after:"]",...m.current()});return f(),r.stack=b,u(),o==="full"||!g||g!==y?p+=m.move(y+"]"):o==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function sA(){return"["}function Mm(t){const i=t.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function oA(t){const i=Mm(t),r=t.options.bulletOther;if(!r)return i==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+r+"`) to be different");return r}function uA(t){const i=t.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function Qx(t){const i=t.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function cA(t,i,r,a){const o=r.enter("list"),u=r.bulletCurrent;let f=t.ordered?uA(r):Mm(r);const m=t.ordered?f==="."?")":".":oA(r);let p=i&&r.bulletLastUsed?f===r.bulletLastUsed:!1;if(!t.ordered){const b=t.children?t.children[0]:void 0;if((f==="*"||f==="-")&&b&&(!b.children||!b.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(p=!0),Qx(r)===f&&b){let y=-1;for(;++y<t.children.length;){const w=t.children[y];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(f=m),r.bulletCurrent=f;const g=r.containerFlow(t,a);return r.bulletLastUsed=f,r.bulletCurrent=u,o(),g}function fA(t){const i=t.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function dA(t,i,r,a){const o=fA(r);let u=r.bulletCurrent||Mm(r);i&&i.type==="list"&&i.ordered&&(u=(typeof i.start=="number"&&i.start>-1?i.start:1)+(r.options.incrementListMarker===!1?0:i.children.indexOf(t))+u);let f=u.length+1;(o==="tab"||o==="mixed"&&(i&&i.type==="list"&&i.spread||t.spread))&&(f=Math.ceil(f/4)*4);const m=r.createTracker(a);m.move(u+" ".repeat(f-u.length)),m.shift(f);const p=r.enter("listItem"),g=r.indentLines(r.containerFlow(t,m.current()),b);return p(),g;function b(y,w,x){return w?(x?"":" ".repeat(f))+y:(x?u:u+" ".repeat(f-u.length))+y}}function mA(t,i,r,a){const o=r.enter("paragraph"),u=r.enter("phrasing"),f=r.containerPhrasing(t,a);return u(),o(),f}function hA(t,i,r,a){if(!t.children.some(function(m){return DN(m)}))return r.containerFlow(t,a);const u=r.enter("phrasing"),f=r.containerPhrasing(t,a);return u(),f}function pA(t){const i=t.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}Dm.attention=Xx;Dm.peek=gA;function Dm(t,i,r,a){const o=r.enter("phrasing"),u=Rm(t,Xx,r,r.createTracker(a)),f=u?Vu([u],a.before,a.after):"";return o(),f}function Xx(t,i){return{construct:"strong",markers:pA(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function gA(t,i,r){return r.options.strong||"*"}function yA(t,i,r,a){const o=i?i.children:[],u=r.indexStack[r.indexStack.length-1];return r.safe(t.value,{...a,afterNode:o[u+1],beforeNode:o[u-1]})}function bA(t){const i=t.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function vA(t,i,r){const a=(Qx(r)+(r.options.ruleSpaces?" ":"")).repeat(bA(r));return r.options.ruleSpaces?a.slice(0,-1):a}const sm={blockquote:LN,break:Hb,code:YN,definition:FN,emphasis:qm,hardBreak:Hb,heading:tA,html:Ux,image:Hx,imageReference:Ix,inlineCode:Vx,link:Gx,linkReference:Fx,list:cA,listItem:dA,paragraph:mA,root:hA,strong:Dm,text:yA,thematicBreak:vA};function xA(){return{enter:{table:wA,tableData:Yb,tableHeader:Yb,tableRow:kA},exit:{codeText:EA,table:SA,tableData:Ud,tableHeader:Ud,tableRow:Ud}}}function wA(t){const i=t._align;this.enter({type:"table",align:i.map(function(r){return r==="none"?null:r}),children:[],position:void 0},t),this.data.inTable=!0}function SA(t){this.exit(t),this.data.inTable=void 0}function kA(t){this.enter({type:"tableRow",children:[],position:void 0},t)}function Ud(t){this.exit(t)}function Yb(t){this.enter({type:"tableCell",children:[],position:void 0},t)}function EA(t){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,TA));const r=this.stack[this.stack.length-1];r.type,r.value=i,this.exit(t)}function TA(t,i){return i==="|"?i:t}function jA(t){const i=t||{},{tableCellPadding:r,tablePipeAlign:a,stringLength:o}=i,u=r?" ":"|";return{handlers:{inlineCode:w,table:f,tableCell:p,tableRow:m},join:[CA],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
47
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function f(x,S,T,N){const E=b(x,T,N),M=E[0];if(M){let H=x.align?x.align.length:0,te=-1;if(!H)for(;++te<E.length;)E[te].length>H&&(H=E[te].length);for(;M.length<H;)M.push("")}return g(E,x.align)}function m(x,S,T,N){const E=y(x,T,N),M=g([E]);return M.slice(0,M.indexOf(`
|
|
48
|
-
`))}function p(x,S,T,N){const E=T.enter("tableCell"),M=T.enter("phrasing"),H=T.containerPhrasing(x,{...N,before:u,after:u});return M(),E(),H}function g(x,S){return qN(x,{align:S,alignDelimiters:a,fillRows:!1,padding:r,stringLength:o})}function b(x,S,T){const{children:N}=x;let E=-1;const M=[],H=S.enter("table");for(;++E<N.length;)M[E]=y(N[E],S,T);return H(),M}function y(x,S,T){const{children:N}=x;let E=-1;const M=[],H=S.enter("tableRow");for(;++E<N.length;)M[E]=p(N[E],x,S,T);return H(),M}function w(x,S,T){const N=sm.inlineCode(x,S,T);if(!T.stack.includes("tableCell"))return N;const E=[];let M=0,H=N.indexOf("|");for(;H!==-1;){let te=H;for(;te>M&&N.charCodeAt(te-1)===92;)te--;E.push(N.slice(M,H)),(H-te)%2===0&&E.push("\\"),M=H,H=N.indexOf("|",H+1)}return E.push(N.slice(M)),E.join("")}}function CA(t,i,r,a){if(t.type==="table"&&r.type==="listItem"&&r.spread===!1&&(i.type==="definition"||i.type==="heading"&&NA(i,a)||i.type==="paragraph"||i.type==="table"))return 1}function NA(t,i){let r=!1;return Hu(t,function(a){if(a.type==="break"||"value"in a&&/\r?\n|\r/.test(a.value))return r=!0,vs}),!!((!t.depth||t.depth<3)&&Mu(t)&&(i.options.setext||r))}function AA(){return{exit:{taskListCheckValueChecked:Gb,taskListCheckValueUnchecked:Gb,paragraph:_A}}}function OA(){return{handlers:{paragraph:zA},join:[RA]}}function Gb(t){const i=this.stack[this.stack.length-2];i.type,i.checked=t.type==="taskListCheckValueChecked"}function _A(t){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const a=r.children[0];if(a&&a.type==="text"){const o=i.children;let u=-1,f;for(;++u<o.length;){const m=o[u];if(m.type==="paragraph"){f=m;break}}f===r&&(a.value=a.value.slice(1),a.value.length===0?r.children.shift():r.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,r.position.start={...a.position.start}))}}this.exit(t)}function zA(t,i,r,a){if(!i||i.type!=="listItem"||Zx(i)!==t)return sm.paragraph(t,i,r,a);const o="["+(i.checked?"x":" ")+"] ",u=r.createTracker(a);u.move(o);const f=sm.paragraph(t.children.length>0?t:{type:"paragraph",children:[{type:"text",value:" "}]},i,r,{...a,...u.current()});return o+f}function RA(t,i,r){if(!(t.type==="definition"&&r.type==="listItem"))return;const a=Zx(r);if(a&&r.children.indexOf(t)<r.children.indexOf(a))return 0}function Zx(t){if(typeof t.checked=="boolean")for(const i of t.children){if(i.type==="paragraph")return i;if(i.type!=="definition")return}}function qA(){return[WC(),kN(),CN(),xA(),AA()]}function MA(t){return{extensions:[eN(),EN(t),NN(),jA(t),OA()]}}const DA={tokenize:VA,partial:!0},Kx={tokenize:YA,partial:!0},$x={tokenize:GA,partial:!0},Jx={tokenize:FA,partial:!0},LA={tokenize:QA,partial:!0},Px={name:"wwwAutolink",tokenize:HA,previous:e1},Wx={name:"protocolAutolink",tokenize:IA,previous:t1},Ki={name:"emailAutolink",tokenize:UA,previous:n1},Oi={};function BA(){return{text:Oi}}let lr=48;for(;lr<123;)Oi[lr]=Ki,lr++,lr===58?lr=65:lr===91&&(lr=97);Oi[43]=Ki;Oi[45]=Ki;Oi[46]=Ki;Oi[95]=Ki;Oi[72]=[Ki,Wx];Oi[104]=[Ki,Wx];Oi[87]=[Ki,Px];Oi[119]=[Ki,Px];function UA(t,i,r){const a=this;let o,u;return f;function f(y){return!om(y)||!n1.call(a,a.previous)||Lm(a.events)?r(y):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),m(y))}function m(y){return om(y)?(t.consume(y),m):y===64?(t.consume(y),p):r(y)}function p(y){return y===46?t.check(LA,b,g)(y):y===45||y===95||yn(y)?(u=!0,t.consume(y),p):b(y)}function g(y){return t.consume(y),o=!0,p}function b(y){return u&&o&&gn(a.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),i(y)):r(y)}}function HA(t,i,r){const a=this;return o;function o(f){return f!==87&&f!==119||!e1.call(a,a.previous)||Lm(a.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(DA,t.attempt(Kx,t.attempt($x,u),r),r)(f))}function u(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),i(f)}}function IA(t,i,r){const a=this;let o="",u=!1;return f;function f(y){return(y===72||y===104)&&t1.call(a,a.previous)&&!Lm(a.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(y),t.consume(y),m):r(y)}function m(y){if(gn(y)&&o.length<5)return o+=String.fromCodePoint(y),t.consume(y),m;if(y===58){const w=o.toLowerCase();if(w==="http"||w==="https")return t.consume(y),p}return r(y)}function p(y){return y===47?(t.consume(y),u?g:(u=!0,p)):r(y)}function g(y){return y===null||xu(y)||At(y)||cr(y)||Os(y)?r(y):t.attempt(Kx,t.attempt($x,b),r)(y)}function b(y){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),i(y)}}function VA(t,i,r){let a=0;return o;function o(f){return(f===87||f===119)&&a<3?(a++,t.consume(f),o):f===46&&a===3?(t.consume(f),u):r(f)}function u(f){return f===null?r(f):i(f)}}function YA(t,i,r){let a,o,u;return f;function f(g){return g===46||g===95?t.check(Jx,p,m)(g):g===null||At(g)||cr(g)||g!==45&&Os(g)?p(g):(u=!0,t.consume(g),f)}function m(g){return g===95?a=!0:(o=a,a=void 0),t.consume(g),f}function p(g){return o||a||!u?r(g):i(g)}}function GA(t,i){let r=0,a=0;return o;function o(f){return f===40?(r++,t.consume(f),o):f===41&&a<r?u(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?t.check(Jx,i,u)(f):f===null||At(f)||cr(f)?i(f):(t.consume(f),o)}function u(f){return f===41&&a++,t.consume(f),o}}function FA(t,i,r){return a;function a(m){return m===33||m===34||m===39||m===41||m===42||m===44||m===46||m===58||m===59||m===63||m===95||m===126?(t.consume(m),a):m===38?(t.consume(m),u):m===93?(t.consume(m),o):m===60||m===null||At(m)||cr(m)?i(m):r(m)}function o(m){return m===null||m===40||m===91||At(m)||cr(m)?i(m):a(m)}function u(m){return gn(m)?f(m):r(m)}function f(m){return m===59?(t.consume(m),a):gn(m)?(t.consume(m),f):r(m)}}function QA(t,i,r){return a;function a(u){return t.consume(u),o}function o(u){return yn(u)?r(u):i(u)}}function e1(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||At(t)}function t1(t){return!gn(t)}function n1(t){return!(t===47||om(t))}function om(t){return t===43||t===45||t===46||t===95||yn(t)}function Lm(t){let i=t.length,r=!1;for(;i--;){const a=t[i][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){r=!0;break}if(a._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const XA={tokenize:t2,partial:!0};function ZA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:PA,continuation:{tokenize:WA},exit:e2}},text:{91:{name:"gfmFootnoteCall",tokenize:JA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:KA,resolveTo:$A}}}}function KA(t,i,r){const a=this;let o=a.events.length;const u=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let f;for(;o--;){const p=a.events[o][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 m;function m(p){if(!f||!f._balanced)return r(p);const g=mi(a.sliceSerialize({start:f.end,end:a.now()}));return g.codePointAt(0)!==94||!u.includes(g.slice(1))?r(p):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),i(p))}}function $A(t,i){let r=t.length;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},m=[t[r+1],t[r+2],["enter",a,i],t[r+3],t[r+4],["enter",o,i],["exit",o,i],["enter",u,i],["enter",f,i],["exit",f,i],["exit",u,i],t[t.length-2],t[t.length-1],["exit",a,i]];return t.splice(r,t.length-r+1,...m),t}function JA(t,i,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u=0,f;return m;function m(y){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(y),t.exit("gfmFootnoteCallLabelMarker"),p}function p(y){return y!==94?r(y):(t.enter("gfmFootnoteCallMarker"),t.consume(y),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",g)}function g(y){if(u>999||y===93&&!f||y===null||y===91||At(y))return r(y);if(y===93){t.exit("chunkString");const w=t.exit("gfmFootnoteCallString");return o.includes(mi(a.sliceSerialize(w)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(y),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),i):r(y)}return At(y)||(f=!0),u++,t.consume(y),y===92?b:g}function b(y){return y===91||y===92||y===93?(t.consume(y),u++,g):g(y)}}function PA(t,i,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u,f=0,m;return p;function p(S){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionLabelMarker"),g}function g(S){return S===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",b):r(S)}function b(S){if(f>999||S===93&&!m||S===null||S===91||At(S))return r(S);if(S===93){t.exit("chunkString");const T=t.exit("gfmFootnoteDefinitionLabelString");return u=mi(a.sliceSerialize(T)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),w}return At(S)||(m=!0),f++,t.consume(S),S===92?y:b}function y(S){return S===91||S===92||S===93?(t.consume(S),f++,b):b(S)}function w(S){return S===58?(t.enter("definitionMarker"),t.consume(S),t.exit("definitionMarker"),o.includes(u)||o.push(u),mt(t,x,"gfmFootnoteDefinitionWhitespace")):r(S)}function x(S){return i(S)}}function WA(t,i,r){return t.check(_s,i,t.attempt(XA,i,r))}function e2(t){t.exit("gfmFootnoteDefinition")}function t2(t,i,r){const a=this;return mt(t,o,"gfmFootnoteDefinitionIndent",5);function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?i(u):r(u)}}function n2(t){let r=(t||{}).singleTilde;const a={name:"strikethrough",tokenize:u,resolveAll:o};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function o(f,m){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 b={type:"strikethrough",start:Object.assign({},f[g][1].start),end:Object.assign({},f[p][1].end)},y={type:"strikethroughText",start:Object.assign({},f[g][1].end),end:Object.assign({},f[p][1].start)},w=[["enter",b,m],["enter",f[g][1],m],["exit",f[g][1],m],["enter",y,m]],x=m.parser.constructs.insideSpan.null;x&&di(w,w.length,0,Du(x,f.slice(g+1,p),m)),di(w,w.length,0,[["exit",y,m],["enter",f[p][1],m],["exit",f[p][1],m],["exit",b,m]]),di(f,g-1,p-g+3,w),p=g+w.length-2;break}}for(p=-1;++p<f.length;)f[p][1].type==="strikethroughSequenceTemporary"&&(f[p][1].type="data");return f}function u(f,m,p){const g=this.previous,b=this.events;let y=0;return w;function w(S){return g===126&&b[b.length-1][1].type!=="characterEscape"?p(S):(f.enter("strikethroughSequenceTemporary"),x(S))}function x(S){const T=Nl(g);if(S===126)return y>1?p(S):(f.consume(S),y++,x);if(y<2&&!r)return p(S);const N=f.exit("strikethroughSequenceTemporary"),E=Nl(S);return N._open=!E||E===2&&!!T,N._close=!T||T===2&&!!E,m(S)}}}class i2{constructor(){this.map=[],this.index=new Map}add(i,r,a){l2(this,i,r,a)}consume(i){if(this.map.sort(function(u,f){return u[0]-f[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];a.push(i.slice()),i.length=0;let o=a.pop();for(;o;){for(const u of o)i.push(u);o=a.pop()}this.map.length=0,this.index.clear()}}function l2(t,i,r,a){if(r===0&&a.length===0)return;const o=t.index.get(i);if(o){o[1]+=r,o[2].push(...a);return}const u=[i,r,a];t.map.push(u),t.index.set(i,u)}function r2(t,i){let r=!1;const a=[];for(;i<t.length;){const o=t[i];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&a.push(t[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(t[i-1][1].type==="tableDelimiterMarker"){const u=a.length-1;a[u]=a[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);i+=1}return a}function a2(){return{flow:{null:{name:"table",tokenize:s2,resolveAll:o2}}}}function s2(t,i,r){const a=this;let o=0,u=0,f;return m;function m(z){let Z=a.events.length-1;for(;Z>-1;){const{type:qe}=a.events[Z][1];if(qe==="lineEnding"||qe==="linePrefix")Z--;else break}const W=Z>-1?a.events[Z][1].type:null,je=W==="tableHead"||W==="tableRow"?O:p;return je===O&&a.parser.lazy[a.now().line]?r(z):je(z)}function p(z){return t.enter("tableHead"),t.enter("tableRow"),g(z)}function g(z){return z===124||(f=!0,u+=1),b(z)}function b(z){return z===null?r(z):Re(z)?u>1?(u=0,a.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(z),t.exit("lineEnding"),x):r(z):Xe(z)?mt(t,b,"whitespace")(z):(u+=1,f&&(f=!1,o+=1),z===124?(t.enter("tableCellDivider"),t.consume(z),t.exit("tableCellDivider"),f=!0,b):(t.enter("data"),y(z)))}function y(z){return z===null||z===124||At(z)?(t.exit("data"),b(z)):(t.consume(z),z===92?w:y)}function w(z){return z===92||z===124?(t.consume(z),y):y(z)}function x(z){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(z):(t.enter("tableDelimiterRow"),f=!1,Xe(z)?mt(t,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):S(z))}function S(z){return z===45||z===58?N(z):z===124?(f=!0,t.enter("tableCellDivider"),t.consume(z),t.exit("tableCellDivider"),T):ie(z)}function T(z){return Xe(z)?mt(t,N,"whitespace")(z):N(z)}function N(z){return z===58?(u+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(z),t.exit("tableDelimiterMarker"),E):z===45?(u+=1,E(z)):z===null||Re(z)?te(z):ie(z)}function E(z){return z===45?(t.enter("tableDelimiterFiller"),M(z)):ie(z)}function M(z){return z===45?(t.consume(z),M):z===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(z),t.exit("tableDelimiterMarker"),H):(t.exit("tableDelimiterFiller"),H(z))}function H(z){return Xe(z)?mt(t,te,"whitespace")(z):te(z)}function te(z){return z===124?S(z):z===null||Re(z)?!f||o!==u?ie(z):(t.exit("tableDelimiterRow"),t.exit("tableHead"),i(z)):ie(z)}function ie(z){return r(z)}function O(z){return t.enter("tableRow"),Q(z)}function Q(z){return z===124?(t.enter("tableCellDivider"),t.consume(z),t.exit("tableCellDivider"),Q):z===null||Re(z)?(t.exit("tableRow"),i(z)):Xe(z)?mt(t,Q,"whitespace")(z):(t.enter("data"),re(z))}function re(z){return z===null||z===124||At(z)?(t.exit("data"),Q(z)):(t.consume(z),z===92?pe:re)}function pe(z){return z===92||z===124?(t.consume(z),re):re(z)}}function o2(t,i){let r=-1,a=!0,o=0,u=[0,0,0,0],f=[0,0,0,0],m=!1,p=0,g,b,y;const w=new i2;for(;++r<t.length;){const x=t[r],S=x[1];x[0]==="enter"?S.type==="tableHead"?(m=!1,p!==0&&(Fb(w,i,p,g,b),b=void 0,p=0),g={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},w.add(r,0,[["enter",g,i]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,y=void 0,u=[0,0,0,0],f=[0,r+1,0,0],m&&(m=!1,b={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},w.add(r,0,[["enter",b,i]])),o=S.type==="tableDelimiterRow"?2:b?3:1):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,f[2]===0&&(u[1]!==0&&(f[0]=f[1],y=fu(w,i,u,o,void 0,y),u=[0,0,0,0]),f[2]=r)):S.type==="tableCellDivider"&&(a?a=!1:(u[1]!==0&&(f[0]=f[1],y=fu(w,i,u,o,void 0,y)),u=f,f=[u[1],r,0,0])):S.type==="tableHead"?(m=!0,p=r):S.type==="tableRow"||S.type==="tableDelimiterRow"?(p=r,u[1]!==0?(f[0]=f[1],y=fu(w,i,u,o,r,y)):f[1]!==0&&(y=fu(w,i,f,o,r,y)),o=0):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(f[3]=r)}for(p!==0&&Fb(w,i,p,g,b),w.consume(i.events),r=-1;++r<i.events.length;){const x=i.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=r2(i.events,r))}return t}function fu(t,i,r,a,o,u){const f=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",m="tableContent";r[0]!==0&&(u.end=Object.assign({},ia(i.events,r[0])),t.add(r[0],0,[["exit",u,i]]));const p=ia(i.events,r[1]);if(u={type:f,start:Object.assign({},p),end:Object.assign({},p)},t.add(r[1],0,[["enter",u,i]]),r[2]!==0){const g=ia(i.events,r[2]),b=ia(i.events,r[3]),y={type:m,start:Object.assign({},g),end:Object.assign({},b)};if(t.add(r[2],0,[["enter",y,i]]),a!==2){const w=i.events[r[2]],x=i.events[r[3]];if(w[1].end=Object.assign({},x[1].end),w[1].type="chunkText",w[1].contentType="text",r[3]>r[2]+1){const S=r[2]+1,T=r[3]-r[2]-1;t.add(S,T,[])}}t.add(r[3]+1,0,[["exit",y,i]])}return o!==void 0&&(u.end=Object.assign({},ia(i.events,o)),t.add(o,0,[["exit",u,i]]),u=void 0),u}function Fb(t,i,r,a,o){const u=[],f=ia(i.events,r);o&&(o.end=Object.assign({},f),u.push(["exit",o,i])),a.end=Object.assign({},f),u.push(["exit",a,i]),t.add(r+1,0,u)}function ia(t,i){const r=t[i],a=r[0]==="enter"?"start":"end";return r[1][a]}const u2={name:"tasklistCheck",tokenize:f2};function c2(){return{text:{91:u2}}}function f2(t,i,r){const a=this;return o;function o(p){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(p):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(p),t.exit("taskListCheckMarker"),u)}function u(p){return At(p)?(t.enter("taskListCheckValueUnchecked"),t.consume(p),t.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(t.enter("taskListCheckValueChecked"),t.consume(p),t.exit("taskListCheckValueChecked"),f):r(p)}function f(p){return p===93?(t.enter("taskListCheckMarker"),t.consume(p),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),m):r(p)}function m(p){return Re(p)?i(p):Xe(p)?t.check({tokenize:d2},i,r)(p):r(p)}}function d2(t,i,r){return mt(t,a,"whitespace");function a(o){return o===null?r(o):i(o)}}function m2(t){return ox([BA(),ZA(),n2(t),a2(),c2()])}const h2={};function p2(t){const i=this,r=t||h2,a=i.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),u=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),f=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(m2(r)),u.push(qA()),f.push(MA(r))}function i1(t=128){const i=new Set,r=new Set,a=()=>{for(const o of r)o()};return{has:o=>i.has(o),fail(o){i.has(o)||o.length>4096||(i.add(o),i.size>t&&i.delete(i.values().next().value),a())},retry(o){i.delete(o)&&a()},subscribe(o){return r.add(o),()=>{r.delete(o)}}}}const l1=C.createContext(null);function g2({children:t}){const[i]=C.useState(i1);return h.jsx(l1.Provider,{value:i,children:t})}function y2({src:t,alt:i="",title:r}){const{t:a}=We(),o=C.useContext(l1),[u]=C.useState(i1),f=o??u,m=C.useSyncExternalStore(f.subscribe,()=>f.has(t??""),()=>!1),[p,g]=C.useState(null),b=m||p===t,[y,w]=C.useState(!1),[x,S]=C.useState(!1),T=C.useRef(null),N=C.useRef(null),E=C.useRef(null),M=C.useRef(null),H=i||a("image.untitled");C.useEffect(()=>{if(!y||b)return;const O=document.activeElement instanceof HTMLElement?document.activeElement:null,Q=document.body.style.overflow;document.body.style.overflow="hidden",N.current?.focus();const re=z=>{if(z.key==="Escape"&&(z.preventDefault(),z.stopPropagation(),w(!1)),z.key!=="Tab")return;const Z=[...T.current?.querySelectorAll('button, [href], [tabindex="0"]')??[]],W=Z[0],je=Z.at(-1);z.shiftKey&&(document.activeElement===W||!T.current?.contains(document.activeElement))?(z.preventDefault(),je?.focus()):!z.shiftKey&&(document.activeElement===je||!T.current?.contains(document.activeElement))&&(z.preventDefault(),W?.focus())},pe=z=>{T.current?.contains(z.target)||N.current?.focus()};return document.addEventListener("keydown",re,!0),document.addEventListener("focusin",pe),()=>{document.removeEventListener("keydown",re,!0),document.removeEventListener("focusin",pe),document.body.style.overflow=Q,O?.isConnected?O.focus():E.current?.focus()}},[y,b]),C.useEffect(()=>{S(!1),w(!1)},[t]);function te(){S(O=>!O),M.current&&(M.current.scrollLeft=0,M.current.scrollTop=0)}function ie(){t&&(f.fail(t),g(t)),w(!1)}if(!t||b){const O=t?.split(/[?#]/)[0]?.split("/").at(-1);return h.jsxs("span",{className:"image-unavailable",role:"status",children:[h.jsx("strong",{children:i||O||a("image.untitled")}),h.jsx("span",{children:a("image.unavailable")}),t&&h.jsx("button",{ref:E,type:"button",onClick:()=>{w(!1),g(null),f.retry(t)},children:a("image.retry")})]})}return h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":a("image.open",{name:H}),"aria-haspopup":"dialog","aria-expanded":y,title:a("image.open",{name:H}),onClick:()=>{S(!1),w(!0)},children:[h.jsx("img",{className:"image-preview-thumbnail",src:t,alt:i,title:r,loading:"lazy",onError:ie}),h.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a("image.enlarge")})]}),y&&Ru.createPortal(h.jsx("div",{className:"image-lightbox",onClick:O=>{O.target===O.currentTarget&&w(!1)},children:h.jsxs("div",{ref:T,className:"image-lightbox-dialog",role:"dialog","aria-modal":"true","aria-label":H,children:[h.jsxs("header",{className:"image-lightbox-toolbar",children:[h.jsx("span",{className:"image-lightbox-name",title:H,children:H}),h.jsx("button",{type:"button",onClick:te,"aria-pressed":x,children:a(x?"image.fit":"image.original")}),h.jsx("button",{ref:N,type:"button",onClick:()=>w(!1),"aria-label":a("image.close"),children:a("image.close")})]}),h.jsx("div",{ref:M,className:x?"image-lightbox-stage original":"image-lightbox-stage",tabIndex:0,role:"region","aria-label":a(x?"image.scroll":"image.fit"),children:h.jsx("img",{src:t,alt:i,title:r,draggable:!1,onError:ie})})]})}),document.body)]})}function b2({text:t,language:i}){const[r,a]=C.useState(!1);return h.jsxs("div",{className:"code-block",children:[h.jsxs("div",{className:"code-banner",children:[h.jsx("span",{className:"code-lang",children:i||"Code block"}),h.jsx("button",{type:"button",className:"code-copy","aria-label":r?"Copied":"Copy",onClick:()=>{navigator.clipboard.writeText(t).then(()=>{a(!0),window.setTimeout(()=>a(!1),1e3)})},children:r?"Copied":"Copy"})]}),h.jsx("pre",{children:h.jsx("code",{children:t})})]})}function v2({children:t}){const i=C.Children.toArray(t)[0];if(C.isValidElement(i)){const r=i,a=String(r.props.children??"").replace(/\n$/,""),o=/language-([\w-]+)/.exec(r.props.className??"");return h.jsx(b2,{text:a,language:o?.[1]})}return h.jsx("pre",{children:t})}function x2(t){if(!t||/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("#")||t.startsWith("//")||t.startsWith("?"))return null;const i=t.indexOf("#"),r=i<0?t:t.slice(0,i);if(r.includes("?"))return null;let a;try{a=decodeURIComponent(r)}catch{return null}const o=/:(\d+)$/.exec(a);if(o&&(a=a.slice(0,-o[0].length)),!a||/[\u0000-\u001f\\]/.test(a)||a.split("/").includes(".."))return null;const u=o?Number(o[1]):void 0;return u!=null&&Number.isSafeInteger(u)&&u>0?{path:a,line:u}:{path:a}}const um=C.createContext({streaming:!1}),w2={pre:v2,img({src:t,alt:i,title:r}){const{resolveImage:a}=C.useContext(um),o=typeof t=="string"?a?.(t):void 0,u=typeof t=="string"&&t!==""&&!/^(?:[a-z][a-z0-9+.-]*:|\/|#|\?)/i.test(t);return h.jsx(y2,{src:o??(u?`/dsh-bot/${t.replace(/^\.\//,"")}`:t||void 0),alt:i,title:r})},code({className:t,children:i}){return h.jsx("code",{className:t,children:i})},table({children:t}){return h.jsx("div",{className:"table-scroll",children:h.jsx("table",{children:t})})},a({href:t,children:i,node:r}){const{streaming:a,onOpenFile:o}=C.useContext(um),{t:u}=We();if(r?.children.some(m=>m.type==="element"&&m.tagName==="img"))return h.jsxs("span",{className:"image-preview-linked",children:[i,h.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:u("image.openLink")})]});const f=a?null:x2(t);return f&&o?h.jsx("button",{type:"button",className:"file-mention",title:f.path,onClick:()=>o(f.path,f.line),children:i}):h.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:i})}};function S2(t,i){if(!i)return t;const r=t.match(/```/g);return r&&r.length%2===1?`${t}
|
|
49
|
-
\`\`\``:t}function Rs({text:t,streaming:i=!1,onOpenFile:r,resolveImage:a}){const o=C.useMemo(()=>({streaming:i,onOpenFile:r,resolveImage:a}),[i,r,a]);return h.jsx(um.Provider,{value:o,children:h.jsx("div",{className:i?"markdown streaming":"markdown",children:h.jsx(YC,{remarkPlugins:[p2],components:w2,children:S2(t,i)})})})}const k2=C.lazy(()=>Ck(()=>import("./SourceEditor-BEQaScgR.js").then(t=>t.S),__vite__mapDeps([0,1]))),E2=50*1024*1024,r1="dsh-bot.files-drawer-width";function T2(){try{const t=localStorage.getItem(r1);return t==null||t===""?Ss:sa(Number(t))}catch{return Ss}}function j2(t){try{localStorage.setItem(r1,String(t))}catch{}}function C2({open:t,sessionId:i,focus:r,onClose:a}){const{t:o}=We(),[u,f]=C.useState(null),[m,p]=C.useState("workspace"),[g,b]=C.useState(""),[y,w]=C.useState([]),[x,S]=C.useState("loading"),[T,N]=C.useState(""),[E,M]=C.useState(null),[H,te]=C.useState(0),[ie,O]=C.useState(T2),Q=C.useRef(ie),[re,pe]=C.useState(!1),[z,Z]=C.useState(()=>window.innerWidth),[W,je]=C.useState(()=>window.matchMedia("(max-width: 800px)").matches),[qe,le]=C.useState(t),[G,ae]=C.useState(t?"in":"out"),[se,Ne]=C.useState(),[A,et]=C.useState(""),[ct,q]=C.useState(!1),[R,ne]=C.useState(null),[de,ye]=C.useState(!1),[Oe,Ce]=C.useState(!1),[Se,$]=C.useState(null),[me,Ze]=C.useState(""),Ke=C.useRef(0),ke=C.useRef(null),$e=C.useRef(""),Fe=C.useRef(!0),Ue=C.useRef(0),ze=C.useRef(r),Ye=C.useRef(qe),gt=C.useRef(G);ze.current=r,Ye.current=qe,gt.current=G,C.useEffect(()=>()=>{Fe.current=!1,$e.current&&URL.revokeObjectURL($e.current)},[]),C.useEffect(()=>{if(t){le(!0),ae("in");return}if(Ye.current){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){le(!1);return}ae("out")}},[t]),C.useEffect(()=>{const K=window.matchMedia("(max-width: 800px)"),ue=()=>je(K.matches);return K.addEventListener("change",ue),()=>K.removeEventListener("change",ue)},[]),C.useEffect(()=>{const K=()=>Z(window.innerWidth);return window.addEventListener("resize",K),()=>window.removeEventListener("resize",K)},[]);const fe=sa(ie);Xv({present:qe,narrow:W,motion:G,width:fe,resizing:re,viewport:z}),C.useEffect(()=>{const K=ue=>{if(ue.key==="Escape"){if(R&&Se==null){ne(null);return}a()}};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[a,R,Se]),C.useEffect(()=>{if(!t)return;const K=new AbortController;return f(null),ze.current||(b(""),M(null),N("")),rt(`/files/roots?sessionId=${encodeURIComponent(i)}`,{signal:K.signal}).then(ue=>{if(K.signal.aborted)return;const ft=typeof ue.body.workspace=="string"?ue.body.workspace:null,Xt=typeof ue.body.home=="string"?ue.body.home:null,bt=typeof ue.body.workspaceReason=="string"?ue.body.workspaceReason:"";f({workspace:ft,workspaceReason:bt,home:Xt}),!ze.current&&(ft?(p("workspace"),b(ft)):Xt?(p("home"),b(Xt)):(S("error"),N(o(bt==="overlap"?"files.overlap":"files.missing"))))}).catch(()=>{K.signal.aborted||(S("error"),N(o("files.failed")))}),()=>K.abort()},[t,i,o]),C.useEffect(()=>{if(!t||!r||!u)return;const K=A2(u.workspace,r.path);if(!K){S("error"),N(u.workspaceReason==="overlap"?o("files.overlap"):o("files.missing"));return}const ue=++Ue.current,ft=new AbortController,Xt=K.split("/").filter(Boolean).at(-1)??K,bt=O2(K,u.workspace,u.home);return Ne(r.line),N(""),bt&&p(bt),rt(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(K)}`,{signal:ft.signal}).then(Lt=>{if(!(ue!==Ue.current||!Fe.current)){if(Lt.status===200&&Array.isArray(Lt.body.items)){Ne(void 0),et(""),M(null),S("loading"),(Lt.body.root==="workspace"||Lt.body.root==="home")&&p(Lt.body.root),b(typeof Lt.body.path=="string"?Lt.body.path:K);return}return et(K),b(_2(K)),X(K,Xt,0,ue)}}).catch(()=>{ue!==Ue.current||!Fe.current||ft.signal.aborted||M({kind:"error",path:K,name:Xt})}),()=>ft.abort()},[t,r,u,i,o]),C.useEffect(()=>{if(!g)return;const K=new AbortController;return S("loading"),N(""),rt(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(g)}`,{signal:K.signal}).then(ue=>{if(K.signal.aborted)return;if(ue.status!==200||!Array.isArray(ue.body.items)){w([]),S("error"),N(du(ue.body.error,o));return}const ft=typeof ue.body.path=="string"?ue.body.path:g;w(ue.body.items.filter(q2)),S("ready"),(ue.body.root==="workspace"||ue.body.root==="home")&&p(ue.body.root),ft!==g&&b(ft)}).catch(()=>{K.signal.aborted||(S("error"),N(o("files.failed")))}),()=>K.abort()},[g,i,H,o]);function De(K){$e.current&&URL.revokeObjectURL($e.current),$e.current=K}function yt(K){const ue=K==="workspace"?u?.workspace:u?.home;ue&&(p(K),M(null),ne(null),ue!==g&&(S("loading"),b(ue)))}async function bn(K){const ue=cm(g,K.name);if(K.kind==="file"){await X(ue,K.name,K.size);return}if(K.kind==="link"){const ft=await rt(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(ue)}`);if(!Fe.current)return;if(ft.status!==200){if(ft.body.error==="not_directory"){await X(ue,K.name,K.size);return}N(du(ft.body.error,o));return}M(null),S("loading"),b(typeof ft.body.path=="string"?ft.body.path:ue);return}M(null),S("loading"),b(ue)}async function Mt(K){const ue=await rt(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(K)}`);if(Fe.current){if(ue.status===200&&Array.isArray(ue.body.items)){M(null),S("loading"),(ue.body.root==="workspace"||ue.body.root==="home")&&p(ue.body.root),b(typeof ue.body.path=="string"?ue.body.path:K);return}if(ue.body.error==="not_directory"){const ft=K.split("/").filter(Boolean).at(-1)??K;await X(K,ft,0);return}N(du(ue.body.error,o))}}async function X(K,ue,ft,Xt=++Ue.current){const bt=()=>Fe.current&&Xt===Ue.current;M({kind:"loading",path:K,name:ue});const Lt=L2(ue);if(Lt){try{const dr=await fetch(Tu(i,K));if(!bt())return;if(!dr.ok){M({kind:"error",path:K,name:ue});return}const Ol=URL.createObjectURL(new Blob([await dr.arrayBuffer()],{type:Lt}));if(!bt()){URL.revokeObjectURL(Ol);return}De(Ol),M({kind:"image",path:K,name:ue,url:Ol})}catch{bt()&&M({kind:"error",path:K,name:ue})}return}const Bt=await rt(`/files/text?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(K)}`);if(bt()){if(Bt.status===415||Bt.body.error==="binary"){M({kind:"binary",path:K,name:ue,size:ft});return}if(Bt.status!==200||typeof Bt.body.text!="string"){M({kind:"error",path:K,name:ue});return}M({kind:"text",path:K,name:ue,text:Bt.body.text,eof:Bt.body.eof!==!1})}}function oe(K){if(Se==null){if(K.size>E2){N(o("files.tooLarge")),ne(null);return}N(""),ye(!1),Ce(!1),$(null),ne(K)}}async function be(){if(!(!R||!g||Se!=null)){$(0),N("");try{const K=await U2(i,g,R,de,$);if(!Fe.current)return;if(K.status===409){Ce(!0),N(o("files.exists")),$(null);return}if(K.status!==201||typeof K.body.path!="string"){N(du(K.body.error,o)),$(null);return}ne(null),$(null),te(ue=>ue+1)}catch{if(!Fe.current)return;N(o("files.failed")),$(null)}}}const we=C.useRef(null),Ge=C.useRef(0),[ve,ht]=C.useState(null),[Qt,tn]=C.useState(!1);C.useEffect(()=>{let K=null;if(E?E.kind!=="loading"&&(K={kind:"file",key:`file:${E.path}`,path:g,root:m,preview:E}):g&&x!=="loading"&&(K=x==="error"?{kind:"list",key:`dir:${g}`,path:g,root:m,items:[],error:T||o("files.failed")}:{kind:"list",key:`dir:${g}`,path:g,root:m,items:y,error:""}),!K){!g&&!E&&(we.current=null,ht(null)),tn(!1);return}const ue=we.current;if(ue?.key===K.key){if(ue.root===K.root&&ue.path===K.path&&(ue.kind==="file"&&K.kind==="file"?ue.preview===K.preview:ue.kind==="list"&&K.kind==="list"&&ue.items===K.items&&ue.error===K.error))return;we.current=K,ht(K);return}if(!ue||window.matchMedia("(prefers-reduced-motion: reduce)").matches){we.current=K,ht(K),tn(!1);return}const ft=++Ge.current;tn(!0);const Xt=window.setTimeout(()=>{Ge.current===ft&&(we.current=K,ht(K),tn(!1))},200);return()=>window.clearTimeout(Xt)},[E,y,x,g,m,T,o]),C.useEffect(()=>{const K=ve?.kind==="file"&&ve.preview.kind==="image",ue=E?.kind==="image"||E?.kind==="loading";K||ue||!$e.current||(URL.revokeObjectURL($e.current),$e.current="")},[ve,E]);const sn=ve?.root??m,on=ve?.path||g,It=sn==="workspace"?u?.workspace:u?.home,xt=It?R2(It,on):[],Ot=ve?.kind==="file"?{name:ve.preview.name,path:ve.preview.path}:null,vn=ve?.kind==="list"?ve.error:"";function xn(K){navigator.clipboard.writeText(K).then(()=>{Ze(K),window.setTimeout(()=>Ze(ue=>ue===K?"":ue),1e3)})}const hi=R!=null&&(Oe||y.some(K=>K.name===R.name)),Vt=Se!=null;return qe?Ru.createPortal(h.jsxs("div",{className:W?`files-drawer narrow files-drawer-${G}`:`files-drawer files-drawer-${G}${re?" resizing":""}`,style:W?void 0:{width:fe},role:"dialog","aria-label":o("files.title"),onAnimationEnd:K=>{K.target!==K.currentTarget||K.animationName!=="files-drawer-out"||gt.current==="out"&&le(!1)},onDragEnter:K=>{K.preventDefault(),Ke.current+=1,q(!0)},onDragOver:K=>K.preventDefault(),onDragLeave:()=>{Ke.current-=1,Ke.current<=0&&(Ke.current=0,q(!1))},onDrop:K=>{K.preventDefault(),Ke.current=0,q(!1);const ue=K.dataTransfer.files[0];ue&&oe(ue)},children:[W?null:h.jsx("div",{className:"files-resize",onPointerDown:K=>{K.preventDefault(),K.currentTarget.setPointerCapture(K.pointerId),pe(!0);const ue=Xt=>{const bt=sa(window.innerWidth-Xt.clientX);Q.current=bt,O(bt)},ft=()=>{pe(!1),j2(Q.current),window.removeEventListener("pointermove",ue),window.removeEventListener("pointerup",ft)};window.addEventListener("pointermove",ue),window.addEventListener("pointerup",ft)}}),h.jsxs("header",{className:"files-head",children:[h.jsx("button",{type:"button",className:"files-icon-btn","aria-label":o("file.close"),onClick:a,children:h.jsx(H2,{})}),h.jsxs("div",{className:"files-roots",role:"tablist",children:[h.jsx("button",{type:"button",role:"tab",className:"files-icon-btn","aria-selected":sn==="home","aria-label":o("files.home"),disabled:!u?.home,title:u?.home||void 0,onClick:()=>yt("home"),children:h.jsx(Y2,{})}),h.jsx("button",{type:"button",role:"tab",className:"files-icon-btn","aria-selected":sn==="workspace","aria-label":o("files.workspace"),disabled:!u?.workspace,title:u?.workspace??(u?.workspaceReason==="overlap"?o("files.overlap"):void 0),onClick:()=>yt("workspace"),children:h.jsx(V2,{})})]}),h.jsxs("nav",{className:"files-crumbs","aria-label":o("files.title"),children:[xt.length>0||Ot?h.jsx("span",{"aria-hidden":"true",children:"/"}):null,xt.map((K,ue)=>h.jsxs("span",{children:[ue>0?h.jsx("span",{"aria-hidden":"true",children:"/"}):null,h.jsx("button",{type:"button",title:K.path,onClick:()=>{K.path===g&&!E||(M(null),K.path!==g&&(S("loading"),b(K.path)))},children:K.name})]},K.path)),Ot?h.jsxs("span",{children:[xt.length>0?h.jsx("span",{"aria-hidden":"true",children:"/"}):null,h.jsx("span",{className:"files-crumb-current",title:Ot.path,children:Ot.name})]}):null,on?h.jsx("button",{type:"button",className:"files-icon-btn files-crumb-copy","aria-label":o("files.pathHint"),title:me===(Ot?.path||on)?o("files.copied"):o("files.pathHint"),onClick:()=>xn(Ot?.path||on),children:me===(Ot?.path||on)?h.jsx(o1,{}):h.jsx(s1,{})}):null]}),h.jsx("button",{type:"button",className:"files-icon-btn files-upload","aria-label":o("files.upload"),title:o("files.upload"),disabled:!g||Vt,onClick:()=>ke.current?.click(),children:h.jsx(Q2,{})}),h.jsx("input",{ref:ke,type:"file",hidden:!0,onChange:K=>{const ue=K.target.files?.[0];K.target.value="",ue&&oe(ue)}})]}),T&&T!==vn?h.jsx("p",{className:"files-notice",children:T}):null,ct?h.jsx("div",{className:"files-drop",children:o("files.drop")}):null,h.jsx("div",{className:"files-body",children:ve?h.jsx("div",{className:Qt?"files-stage out":"files-stage in",children:ve.kind==="file"?h.jsx(N2,{preview:ve.preview,sessionId:i,line:ve.preview.path===A?se:void 0,onOpenPath:K=>{Mt(K)}}):ve.error?h.jsx("p",{className:"files-status",children:ve.error}):ve.items.length===0?h.jsxs("div",{className:"files-empty",children:[h.jsx("span",{className:"files-empty-mark","aria-hidden":"true",children:h.jsx(I2,{})}),h.jsx("p",{children:o("files.empty")})]}):h.jsxs("div",{className:"files-table",role:"table",children:[h.jsxs("div",{className:"files-row files-columns",role:"row",children:[h.jsx("span",{role:"columnheader",children:o("files.name")}),h.jsx("span",{className:"files-col-type",role:"columnheader",children:o("files.type")}),h.jsx("span",{className:"files-col-size",role:"columnheader",children:o("files.size")}),h.jsx("span",{className:"files-col-time",role:"columnheader",children:o("files.modified")}),h.jsx("span",{})]}),ve.items.map(K=>h.jsxs("div",{className:"files-row",role:"row",children:[h.jsxs("button",{type:"button",className:"files-name",onClick:()=>{bn(K)},children:[h.jsx("span",{className:K.kind==="dir"?"files-mark dir":"files-mark",children:D2(K.kind)}),h.jsx("span",{children:K.name})]}),h.jsx("span",{className:"files-col-type",children:M2(K,o)}),h.jsx("span",{className:"files-col-size",children:K.kind==="file"?fm(K.size):"—"}),h.jsx("span",{className:"files-col-time",children:B2(K.mtime)}),h.jsx("span",{className:"files-row-actions",children:K.kind==="file"?h.jsxs("a",{className:"files-action",href:Tu(i,cm(g,K.name)),children:[h.jsx(u1,{}),o("files.download")]}):null})]},K.name))]})}):x==="loading"?h.jsx("p",{className:"files-status",children:o("files.loading")}):null}),R?h.jsxs("div",{className:"files-confirm",children:[h.jsx("p",{children:o("files.confirm")}),h.jsxs("p",{className:"files-confirm-name",children:[h.jsx("strong",{children:R.name}),h.jsx("span",{children:fm(R.size)})]}),h.jsx("p",{className:"files-confirm-dest",children:g}),Vt?h.jsxs("div",{className:"files-progress",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round((Se??0)*100),children:[h.jsx("div",{style:{width:`${Math.round((Se??0)*100)}%`}}),h.jsx("span",{children:o("files.uploading")})]}):null,hi?h.jsxs("label",{className:"files-check",children:[h.jsx("input",{type:"checkbox",checked:de,disabled:Vt,onChange:K=>ye(K.target.checked)}),o("files.overwrite")]}):null,h.jsxs("div",{className:"files-confirm-actions",children:[h.jsx("button",{type:"button",disabled:Vt,onClick:()=>ne(null),children:o("files.cancel")}),h.jsx("button",{type:"button",className:"primary",disabled:Vt||hi&&!de,onClick:()=>{be()},children:o("files.upload")})]})]}):null]}),document.body):null}function N2({preview:t,sessionId:i,line:r,onOpenPath:a}){const{t:o}=We(),u=t.kind==="text"&&Nk(t.name),[f,m]=C.useState(u&&r==null?"preview":"source"),[p,g]=C.useState(!1);if(C.useEffect(()=>{m(u&&r==null?"preview":"source"),g(!1)},[t.path,u,r]),t.kind==="loading")return h.jsx("p",{className:"files-status",children:o("file.loading")});if(t.kind==="error")return h.jsx("p",{className:"files-status",children:o("file.error")});const b=t.kind==="text"?t.text:"",y=t.kind==="text"?t.eof:!0,w=t.kind==="text"&&(!u||f==="source");return h.jsxs("div",{className:"files-preview",children:[h.jsx("div",{className:"files-preview-bar",children:h.jsxs("span",{children:[u?h.jsxs("span",{role:"group","aria-label":o("files.previewMode"),children:[h.jsxs("button",{type:"button",className:"files-action","aria-pressed":f==="preview",onClick:()=>m("preview"),children:[h.jsx(G2,{}),o("files.previewMode")]}),h.jsxs("button",{type:"button",className:"files-action","aria-pressed":f==="source",onClick:()=>m("source"),children:[h.jsx(F2,{}),o("files.sourceMode")]})]}):null,t.kind==="text"?h.jsxs("button",{type:"button",className:"files-action",onClick:()=>{navigator.clipboard.writeText(b).then(()=>{g(!0),window.setTimeout(()=>g(!1),1e3)})},children:[p?h.jsx(o1,{}):h.jsx(s1,{}),o(p?"files.copied":"files.copy")]}):null,h.jsxs("a",{className:"files-action",href:Tu(i,t.path),children:[h.jsx(u1,{}),o("files.download")]})]})}),t.kind==="image"?h.jsx("div",{className:"files-image",children:h.jsx("img",{src:t.url,alt:t.name})}):t.kind==="binary"?h.jsxs("p",{className:"files-status",children:[o("files.binary")," ",fm(t.size)]}):w?h.jsxs(h.Fragment,{children:[h.jsx(C.Suspense,{fallback:h.jsx("p",{className:"files-status",children:o("file.loading")}),children:h.jsx(k2,{text:b,name:t.name,line:r})}),y?null:h.jsx("p",{className:"file-modal-note",children:o("files.truncated")})]}):h.jsxs("div",{className:"files-markdown",children:[h.jsx(Rs,{text:b,onOpenFile:x=>{const S=x.startsWith("/")?x:a1(t.path,x);S&&a(S)},resolveImage:x=>z2(i,t.path,x)}),y?null:h.jsx("p",{className:"file-modal-note",children:o("files.truncated")})]})]})}function A2(t,i){const r=i.replace(/^\.\//,"");return r.startsWith("/")?r:t?cm(t,r):null}function O2(t,i,r){return i&&(t===i||t.startsWith(`${i}/`))?"workspace":r&&(t===r||t.startsWith(`${r}/`))?"home":null}function _2(t){const i=t.lastIndexOf("/");return i<=0?"/":t.slice(0,i)}function z2(t,i,r){if(/^[a-z][a-z0-9+.-]*:/i.test(r)||r.startsWith("//")||r.startsWith("#"))return;const a=r.startsWith("/")?r:a1(i,r);if(a)return`${Tu(t,a)}&inline=1`}function a1(t,i){const r=t.slice(0,t.lastIndexOf("/")),a=r===""?[]:r.split("/").filter(Boolean),o=r.startsWith("/")?[...a]:a;for(const u of i.split("/"))if(!(u===""||u===".")){if(u===".."){if(o.length===0)return null;o.pop();continue}o.push(u)}return o.length===0?null:`/${o.join("/")}`}function R2(t,i){if(!i.startsWith(t))return[];const r=(t==="/"?i.slice(1):i.slice(t.length).replace(/^\//,"")).split("/").filter(Boolean),a=[];let o=t;for(const u of r)o=o==="/"?`/${u}`:`${o}/${u}`,a.push({name:u,path:o});return a}function cm(t,i){return t==="/"?`/${i}`:`${t.replace(/\/$/,"")}/${i}`}function Tu(t,i){return`/dsh-bot/api/files/raw?sessionId=${encodeURIComponent(t)}&path=${encodeURIComponent(i)}`}function q2(t){if(!t||typeof t!="object")return!1;const i=t;return typeof i.name=="string"&&(i.kind==="dir"||i.kind==="file"||i.kind==="link")&&typeof i.size=="number"&&typeof i.mtime=="string"}function du(t,i){return i(t==="denied"?"files.denied":t==="missing"?"files.missing":t==="binary"?"files.binary":t==="exists"?"files.exists":t==="too_large"?"files.tooLarge":t==="overlap"?"files.overlap":"files.failed")}function M2(t,i){if(t.kind==="dir")return i("files.folder");if(t.kind==="link")return i("files.link");const r=t.name.includes(".")?t.name.split(".").pop()??"":"";return r?r.toUpperCase():i("files.file")}function D2(t){return t==="dir"?"▸":t==="link"?"↗":"·"}function L2(t){const i=t.split(".").pop()?.toLowerCase()??"";return i==="jpg"||i==="jpeg"?"image/jpeg":i==="png"?"image/png":i==="gif"?"image/gif":i==="webp"?"image/webp":null}function fm(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(t<10*1024?1:0)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function B2(t){const i=new Date(t);if(Number.isNaN(i.getTime()))return"";const r=String(i.getHours()).padStart(2,"0"),a=String(i.getMinutes()).padStart(2,"0");return`${i.getMonth()+1}/${i.getDate()} ${r}:${a}`}function U2(t,i,r,a,o){const u=`/dsh-bot/api/files?sessionId=${encodeURIComponent(t)}&dir=${encodeURIComponent(i)}&name=${encodeURIComponent(r.name)}&overwrite=${a?"1":"0"}`;return new Promise((f,m)=>{const p=new XMLHttpRequest;p.open("POST",u),p.setRequestHeader("content-type","application/octet-stream"),p.upload.onprogress=g=>{g.lengthComputable&&g.total>0&&o(g.loaded/g.total)},p.onload=()=>{let g={};try{const b=JSON.parse(p.responseText);b&&typeof b=="object"&&(g=b)}catch{g={}}f({status:p.status,body:g})},p.onerror=()=>m(new Error("failed")),p.send(r)})}function H2(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 I2(){return h.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:h.jsx("path",{d:"M3.2 7.4c0-.9.7-1.6 1.6-1.6h4.4l1.6 1.7h8.4c.9 0 1.6.7 1.6 1.6v8.5c0 .9-.7 1.6-1.6 1.6H4.8c-.9 0-1.6-.7-1.6-1.6V7.4z",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})})}function V2(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M1.8 5.1c0-.6.5-1.1 1.1-1.1h3.2l1.2 1.4h5.8c.6 0 1.1.5 1.1 1.1v5.9c0 .6-.5 1.1-1.1 1.1H2.9c-.6 0-1.1-.5-1.1-1.1V5.1z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function Y2(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M2.2 7.2 8 2.7l5.8 4.5V13H10V9.3H6V13H2.2V7.2z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function s1(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M6 4.2h6.2v8.2H6zM4.2 11.6H3.6V2.8h6.6V4",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function o1(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M3.4 8.2 6.4 11.2 12.6 4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function u1(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.6v6.2M5.2 6.4 8 9.2l2.8-2.8M3.2 12.6h9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function G2(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("path",{d:"M1.6 8s2.2-3.3 6.4-3.3S14.4 8 14.4 8s-2.2 3.3-6.4 3.3S1.6 8 1.6 8z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})]})}function F2(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M6 4.4 2.8 8 6 11.6M10 4.4 13.2 8 10 11.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Q2(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M8 2.6v6.1M5.2 5.3 8 2.6l2.8 2.7M3.2 9.1V12.4h9.6V9.1",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function X2({onClose:t,onCreated:i}){const[r,a]=C.useState(""),[o,u]=C.useState(""),[f,m]=C.useState(""),[p,g]=C.useState(!1),[b,y]=C.useState(""),{locale:w,setLocale:x,t:S}=We();function T(E){a(E)}async function N(){if(p)return;const E=r.trim();if(E===""){y(S("new.nameRequired"));return}g(!0),y("");const M=await rt("/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;y(Q?.message||String(M.body.error||S("new.createFailed"))),g(!1);return}const te=NS(E,o,f),ie=await Ni("/dsh-bot/api/sessions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:H,personaText:te,idempotencyKey:crypto.randomUUID()})}),O=ie.body.ok===!0?S("new.created",{name:E}):vv(ie.body,S("new.personaFailed"));i(H,O,E)}return h.jsx("div",{className:"setup-mask",role:"presentation",onMouseDown:t,children:h.jsxs("form",{className:"setup-card",role:"dialog","aria-labelledby":"new-session-title",onMouseDown:E=>E.stopPropagation(),onSubmit:E=>{E.preventDefault(),N()},children:[h.jsxs("div",{className:"setup-head",children:[h.jsx("h2",{id:"new-session-title",children:S("new.title")}),h.jsx("button",{type:"button",className:"setup-close","aria-label":S("new.close"),onClick:t,children:"×"})]}),h.jsx("p",{className:"setup-lead",children:S("new.lead")}),h.jsx("label",{htmlFor:"setup-name",children:S("new.name")}),h.jsx("input",{id:"setup-name",value:r,placeholder:S("new.namePlaceholder"),onChange:E=>T(E.target.value)}),h.jsx("label",{htmlFor:"setup-style",children:S("new.style")}),h.jsx("input",{id:"setup-style",value:o,placeholder:S("new.stylePlaceholder"),onChange:E=>u(E.target.value)}),h.jsx("label",{htmlFor:"setup-task",children:S("new.task")}),h.jsx("textarea",{id:"setup-task",rows:3,value:f,placeholder:S("new.taskPlaceholder"),onChange:E=>m(E.target.value)}),b?h.jsx("p",{className:"setup-error",children:b}):null,h.jsxs("div",{className:"setup-actions",children:[h.jsx("button",{type:"button",onClick:()=>x(w==="en"?"zh":"en"),children:S("lang.switch")}),h.jsx("button",{type:"button",onClick:t,children:S("new.cancel")}),h.jsx("button",{type:"submit",className:"primary",disabled:p||r.trim()==="",children:S(p?"new.creating":"new.create")})]})]})})}function Z2(t,i){const{t:r}=We(),[a,o]=C.useState("");return C.useEffect(()=>{if(t===""){o("");return}let u=!1;return(async()=>{const f=await Ni(`/dsh-bot/api/status?sessionId=${encodeURIComponent(t)}`),m=await Ni(`/dsh-bot/api/memory?sessionId=${encodeURIComponent(t)}`);if(u||f.body.ok!==!0)return;const p=f.body.binding;if((p&&typeof p=="object"?p.kind:f.body.kind)!=="bot"){o(r("basis.plain"));return}const b=typeof f.body.personaText=="string"?f.body.personaText.trim():"",y=AS(b),w=[y.name,y.style,y.task].filter(T=>T!=="").join(" · "),S=(Array.isArray(m.body.facts)?m.body.facts:[]).filter(T=>T&&typeof T=="object"&&T.status==="active").length;o(S>0?r("basis.facts",{head:w||"BOT",count:String(S)}):w||"BOT")})(),()=>{u=!0}},[t,i,r]),a}function Yu(t){const i=t.replace(/\r\n/g,`
|
|
50
|
-
`);if(!i.startsWith("[foundations:message]"))return null;const r=i.slice(21).replace(/^\n/,""),a=r.indexOf(`
|
|
51
|
-
---
|
|
52
|
-
`);if(a<0)return null;const o={},u=[];for(const f of r.slice(0,a).split(`
|
|
53
|
-
`)){const m=/^(id|from|correlation|causation|hop):\s*(.*)$/.exec(f);m?.[1]?o[m[1]]=(m[2]??"").trim():f.trim()!==""&&u.push(f.trim())}return o.from?{id:o.id??"",from:o.from,correlation:o.correlation??"",causation:o.causation??"",hop:o.hop??"",note:u.join(" "),body:r.slice(a+5).trim()}:null}function c1(t,i){return i!==""&&i!==t?i:t.startsWith("session-")&&t.length>18?`${t.slice(0,12)}…${t.slice(-4)}`:t}const K2=new Set(["foundations_send","foundations_reply"]);function f1(t){const i=[];for(const r of t){if(r.kind==="user"){const o=Yu(r.text);if(!o)continue;i.push({kind:"in",id:r.id,seq:r.seq,time:r.time,mail:o});continue}if(r.kind!=="tool"||!K2.has(r.name))continue;const a=W2(r);a&&i.push(a)}return i.sort((r,a)=>r.seq-a.seq||(r.kind===a.kind?0:r.kind==="in"?-1:1)),i}function $2(t){const i=f1(t);if(!i.some(o=>o.kind==="in"))return t.slice();const a=new Set(i.filter(o=>o.kind==="out").map(o=>o.id));return t.filter(o=>!a.has(o.id))}function J2(t,i){const r=t.filter(u=>u.kind==="in"),a=r.at(-1);if(!a)return null;const o=a.mail.body.replace(/\s+/g," ").trim();return{who:i(a.mail.from)||"BOT",preview:o.length>72?`${o.slice(0,71)}…`:o,count:r.length}}function P2(t,i){if(t.target)return t.target;if(!t.correlation)return"";for(let r=i.length-1;r>=0;r-=1){const a=i[r];if(!(!a||a.seq>t.seq)&&a.kind==="in"&&a.mail.correlation===t.correlation)return a.mail.from}return""}function W2(t){let i;try{const a=JSON.parse(t.args);if(!a||typeof a!="object"||Array.isArray(a))return null;i=a}catch{return null}const r=typeof i.text=="string"?i.text.trim():"";return r?{kind:"out",id:t.id,seq:t.seq,text:r,target:typeof i.targetSessionId=="string"?i.targetSessionId:"",correlation:typeof i.correlationId=="string"?i.correlationId:""}:null}function e3({mail:t,label:i,onOpenFile:r}){const{t:a}=We(),o=c1(t.from,i),u=/^\d+$/.test(t.hop)?t.hop:"",f=[t.id?`id ${t.id}`:"",`from ${t.from}`,t.correlation?`correlation ${t.correlation}`:"",t.causation?`causation ${t.causation}`:""].filter(Boolean).join(`
|
|
54
|
-
`);return h.jsxs("article",{className:"mail-card",children:[h.jsxs("header",{className:"mail-head",children:[h.jsx("span",{className:"bot-badge",children:"BOT"}),h.jsxs("span",{className:"mail-who",children:[h.jsx("strong",{children:o}),h.jsx("span",{children:a("inbox.received")})]}),u?h.jsx("span",{className:"mail-hop",children:a("inbox.hop",{hop:u})}):null]}),t.body?h.jsx("div",{className:"mail-body",children:h.jsx(Rs,{text:t.body,onOpenFile:r})}):null,h.jsx("p",{className:"mail-note",children:a("inbox.lead")}),f?h.jsxs("details",{className:"mail-details",children:[h.jsx("summary",{children:a("inbox.source")}),h.jsx("pre",{children:f})]}):null]})}function t3({who:t,preview:i,time:r,mark:a,onOpen:o}){const{t:u}=We(),f=i||u("inbox.received");return h.jsxs("div",{className:"inbox-line","data-turn":a,children:[h.jsxs("button",{type:"button",className:"inbox-entry",onClick:o,"aria-label":u("inbox.open",{who:t,line:f}),children:[h.jsx("span",{className:"inbox-icon",children:h.jsx(a3,{})}),h.jsxs("span",{className:"inbox-copy",children:[h.jsx("strong",{children:t}),h.jsx("span",{children:f})]})]}),r?h.jsx("time",{children:r}):null]})}function n3({items:t,botLabel:i,onOpenFile:r}){const{locale:a}=We();return h.jsxs("div",{className:"bot-chat",children:[h.jsx(l3,{}),t.length===0?h.jsx(r3,{}):null,t.map(o=>o.kind==="in"?h.jsxs("div",{className:"mail-row",children:[h.jsx(e3,{mail:o.mail,label:i(o.mail.from),onOpenFile:r}),ju(o.time,a)?h.jsx("time",{children:ju(o.time,a)}):null]},o.id):h.jsx(i3,{item:o,items:t,botLabel:i},o.id))]})}function i3({item:t,items:i,botLabel:r}){const{t:a,locale:o}=We(),u=P2(t,i),f=u?c1(u,r(u)):a("inbox.other");return h.jsxs("div",{className:"bot-out",children:[h.jsx("div",{className:"user-bubble",children:t.text}),h.jsx("span",{children:a("inbox.sentTo",{name:f})}),ju(t.time,o)?h.jsx("time",{children:ju(t.time,o)}):null]})}function l3(){const{t}=We();return h.jsx("p",{className:"bot-chat-lead",children:t("inbox.lead")})}function r3(){const{t}=We();return h.jsx("p",{className:"empty-thread",children:t("inbox.empty")})}function ju(t,i){if(!t)return"";const r=new Date(t);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString(i==="zh"?"zh-CN":"en",{hour:"2-digit",minute:"2-digit"})}function a3(){return h.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[h.jsx("path",{d:"M4 13.2 6.4 5.5h11.2L20 13.2",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),h.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 s3({root:t,marks:i,busyId:r}){const a=C.useRef(null),[o,u]=C.useState(i.at(-1)?.id??""),[f,m]=C.useState(null),[p,g]=C.useState({top:!1,bottom:!1}),b=i.map(x=>x.id).join("\0");C.useEffect(()=>{const x=t.current;if(!x||i.length<2)return;const S=()=>{const T=x.getBoundingClientRect().top,N=x.scrollHeight-x.scrollTop-x.clientHeight<48;let E=i[0]?.id??"";if(N)E=i.at(-1)?.id??E;else for(const M of i){const H=x.querySelector(`[data-turn="${CSS.escape(M.id)}"]`);H instanceof HTMLElement&&H.getBoundingClientRect().top-T<=36&&(E=M.id)}u(M=>M===E?M:E)};return S(),x.addEventListener("scroll",S,{passive:!0}),()=>x.removeEventListener("scroll",S)},[t,i,b]),C.useEffect(()=>{const x=a.current,S=x?.querySelector('[aria-current="true"]');if(!x||!S)return;const T=S.offsetTop-(x.clientHeight-S.offsetHeight)/2;x.scrollTop=Math.max(0,T);const N=x.scrollTop>1,E=x.scrollTop<x.scrollHeight-x.clientHeight-1;g(M=>M.top===N&&M.bottom===E?M:{top:N,bottom:E})},[o,b]);const{t:y}=We();if(i.length<2)return null;const w=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;return h.jsx("nav",{ref:a,className:["turn-rail",p.top?"fade-top":"",p.bottom?"fade-bottom":""].filter(Boolean).join(" "),"aria-label":y("turn.rail"),onMouseLeave:()=>m(null),children:i.map((x,S)=>{const T=x.id===o;return h.jsx("button",{type:"button",className:["turn-mark",T?"active":"",x.id===f?"preview":"",x.id===r?"busy":""].filter(Boolean).join(" "),"aria-current":T?"true":void 0,"aria-label":y("turn.jump",{index:String(S+1)}),onMouseEnter:()=>m(x.id),onFocus:()=>m(x.id),onBlur:()=>m(N=>N===x.id?null:N),onClick:()=>{t.current?.querySelector(`[data-turn="${CSS.escape(x.id)}"]`)?.scrollIntoView({block:"start",behavior:w?"auto":"smooth"})}},x.id)})})}function o3(t){let i=!1,r=t.visible!==!1,a=!1,o=!1,u=!1,f=0,m=0,p="",g=!1,b=()=>{},y=null;function w(N){const E=JSON.stringify(N);E!==p&&(p=E,g=t.active?.(N)===!0,t.apply(N))}function x(){if(b(),i||!r)return;const N=a?6e4:g?1500:Math.min(15e3,2e3*2**Math.min(m,3));b=t.schedule(()=>{S()},N)}async function S(){if(i||!r)return;if(o){u=!0;return}b(),o=!0;const N=f;y=new AbortController;const E=y,M=t.schedule(()=>E.abort(),1e4);try{const H=await t.fetch(y.signal);!i&&r&&N===f&&w(H),m=Math.min(m+1,3)}catch{m=Math.min(m+1,3)}finally{M(),o=!1,u?(u=!1,S()):x()}}const T={ingest(N){i||!r||(f++,a=!0,m=0,w(N),x())},disconnected(){a=!1,m=0,x()},setVisible(N){r!==N&&(r=N,N||(a=!1),f++,b(),y?.abort(),r&&(m=0,S()))},close(){i=!0,f++,b(),y?.abort()},refresh:S};return S(),T}function d1(t,i=Date.now){let r=null,a=0,o=null,u=0;const f={invalidate(){u++,r=null},get(){if(r&&i()-a<3e4)return Promise.resolve(r);if(o)return o;const m=u,p=t().then(g=>m!==u?(o=null,f.get()):(m===u&&(r=g,a=i()),g)).finally(()=>{o===p&&(o=null)});return o=p,p}};return f}const xs=new Set(["preparing","waiting","running","worker"]),m1=new Set([...xs,"background"]),u3=/(?:password|passwd|passphrase|secret|token|api[-_]?key|authorization|cookie|credential|private[-_]?key)/i;function st(t){if(/^\s*[\[{]/.test(t))try{const i=JSON.parse(t);if(i&&typeof i=="object")return JSON.stringify(Cu(i),null,2)}catch{}return t.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 Cu(t){return Array.isArray(t)?t.map(Cu):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([i,r])=>[i,u3.test(i)?"[REDACTED]":Cu(r)])):typeof t=="string"?st(t):t}function c3(t){try{return JSON.stringify(Cu(JSON.parse(t)),null,2)}catch{return st(t)}}function Es(t){try{const i=JSON.parse(t);return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}catch{return{}}}function Bm(t){return["bash","shell","pwsh","powershell"].includes(t.toLowerCase())}function Gu(t,i,r,a=""){if(/^TOOL_(NOT_STARTED|OUTCOME_UNKNOWN)$/.test(a))return"unknown";if(/ABORT|CANCEL/i.test(a))return"cancelled";if(r)return"failed";if(Bm(t)){if(/^\[stopped: .+\]$/m.test(i))return"cancelled";if(/^\[(?:timed out after .+|killed by signal: .+|sandbox: .+)\]$/m.test(i))return"failed";const o=/^\[exit code: (-?\d+)\]$/m.exec(i);if(o)return Number(o[1])!==0?"failed":"succeeded";if(/^started background job \S+/m.test(i)||/^\[still running after \d+ms; moved to background job .+\]$/m.test(i))return"background"}return"succeeded"}function Um(t){return t.status?t.status:t.resultReceived||t.result!==""?Gu(t.name,t.result,t.error):t.running?"waiting":"unknown"}const f3={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 Qb(t,i=Ai){return i(f3[t])}function ws(t,i,r=[]){const a=Es(t.args),o=Es(t.result),u=Bm(t.name),f=u&&typeof a.command=="string"?st(a.command):"",m=typeof a.description=="string"?st(a.description):"",p=t.meta&&typeof t.meta=="object"?t.meta:{},g=typeof p.cwd=="string"?p.cwd:typeof a.workdir=="string"?a.workdir:i,b=typeof p.cwd=="string"||!g||g.startsWith("/")||!i?g:i.replace(/\/$/,"")+"/"+g,y=b?st(b):"",w=typeof o.ticketId=="string"?o.ticketId:"",x=r.find(E=>E.id===w);let S=Um(t);x&&t.name==="foundations_dispatch"?S=x.status==="failed"?"failed":x.status==="cancelled"?"cancelled":x.status==="delivered"?"succeeded":"worker":t.name==="foundations_dispatch"&&S==="succeeded"&&w&&(S="worker");const T=t.name==="todo_write"&&Array.isArray(a.todos)?a.todos.flatMap(E=>{if(!E||typeof E!="object")return[];const M=E;return typeof M.content=="string"&&typeof M.status=="string"?[{content:st(M.content),status:M.status}]:[]}):[],N=u?/^\[exit code: (-?\d+)\]$/m.exec(t.result):null;return{status:S,command:f,description:m,cwd:y,cwdSource:typeof p.cwd=="string"?"recorded":typeof a.workdir=="string"?"requested":"session",todos:T,title:t.name==="todo_write"?"todo_write":st(t.name),args:c3(t.args),output:st(t.result),exitCode:N?Number(N[1]):null,ticket:x,ticketId:w,latestReport:x?.events.filter(E=>E.revision===x.revision&&E.applyStatus!=="stale").at(-1)?.text??"",jobId:u?/(?:^started background job |moved to background job )([^\s\]]+)/m.exec(t.result)?.[1]??"":""}}const d3="ask_user_question";function h1(t){return t.replace(/-/g,"_").toLowerCase()===d3}function m3(t,i=!1){const r=t.match(/^(.*?)\s*[\((]\s*(Recommended|推荐|建議)\s*[\))]\s*$/i);return{label:t,displayLabel:r?.[1]?.trim()?r[1].trim():t,recommended:i||!!r}}function Hd(t,i,r=""){return t?i.startsWith("zh")&&typeof t.zh=="string"&&t.zh!==""?t.zh:typeof t[i]=="string"&&t[i]!==""?t[i]:t.en||r:r}function h3(t){if(!t||typeof t!="object")return;const i=t;if(i.kind==="plan-review"&&typeof i.approve=="string"){const r={kind:"plan-review",approve:i.approve};return typeof i.callId=="string"&&i.callId!==""&&(r.callId=i.callId),r}if(i.kind==="approval"&&typeof i.approve=="string"&&typeof i.reject=="string"){const r={kind:"approval",approve:i.approve,reject:i.reject};if(typeof i.always=="string"&&i.always!==""&&(r.always=i.always),i.subject&&typeof i.subject=="object"){const a=i.subject;typeof a.name=="string"&&a.name!==""&&(r.subject={name:a.name},typeof a.icon=="string"&&a.icon!==""&&(r.subject.icon=a.icon))}if(i.display&&typeof i.display=="object"){const a=i.display,o=Id(a.question);if(o){r.display={question:o};const u=Id(a.detail);u&&(r.display.detail=u);const f=Id(a.approve);f&&(r.display.approve=f)}}return r}}function Id(t){if(!t||typeof t!="object"||typeof t.en!="string")return;const i={en:t.en};for(const[r,a]of Object.entries(t))typeof a=="string"&&(i[r]=a);return i}function p1(t){const i=t[0];if(!i||t.length!==1||i.multiSelect||i.intent?.kind!=="plan-review")return;const r=i.options.find(o=>o.label===i.intent?.approve);if(!r)return;const a=i.options.find(o=>o.label!==r.label);if(!(i.options.length>2))return{item:i,approve:r,decline:a,plan:i.detail}}function g1(t){const i=t[0];if(!i||t.length!==1||i.multiSelect||i.intent?.kind!=="approval")return;const r=i.intent,a=i.options.find(f=>f.label===r.approve),o=i.options.find(f=>f.label===r.reject);if(!a||!o)return;const u=r.always?i.options.find(f=>f.label===r.always):void 0;return{item:i,intent:r,approve:a,reject:o,always:u}}function or(t){return typeof t=="string"?t:""}function p3(t){return Array.isArray(t)?t.flatMap(i=>{if(!i||typeof i!="object")return[];const r=i;return typeof r.label!="string"?[]:[{label:r.label,description:or(r.description),recommended:r.recommended===!0}]}):[]}function g3(t){return Array.isArray(t)?t.flatMap((i,r)=>{if(!i||typeof i!="object")return[];const a=i,o=or(a.question);if(!o)return[];const u=or(a.id);return[{id:u===""?`question-${r+1}`:u,question:o,detail:or(a.detail),header:or(a.header),options:p3(a.options),multiSelect:a.multi_select===!0||a.multiSelect===!0,intent:h3(a.intent)}]}):[]}function y3(t){const i=new Map,r=Es(t),a=Array.isArray(r.answers)?r.answers:Array.isArray(r)?r:[];for(const o of a){if(!o||typeof o!="object")continue;const u=o,f=or(u.id);if(!f)continue;const m=Array.isArray(u.selected)?u.selected.flatMap(p=>typeof p=="string"?[p]:[]):[];i.set(f,{selected:m,custom:or(u.custom)})}return i}function b3(t){const i=t.errorCode??"";return/ASK_ABORTED|ABORT|CANCEL/i.test(i)||/aborted before the user answered/i.test(t.result)}function y1(t){if(!t)return!1;const i=Es(t);return!!(i&&i.pending===!0)}function v3(t){return y1(t.result)?!1:!!(t.resultReceived||t.result!==""||t.error||t.errorCode)}function x3(t){const i=t.timeout;if(!(typeof i!="number"||!Number.isFinite(i)||i<=0))return i>1e3?i:i*1e3}function qs(t){if(!h1(t.name))return null;const i=Es(t.args),r=g3(i.questions),a=y3(t.result),o=b3(t),u=y1(t.result),f=v3(t),m=f&&t.error&&!o,p=u?"continued":f?o?"aborted":m?"failed":"answered":"open",g=x3(i),b=u?"continued":p==="open"&&g?"counting":"none",y=r.map(S=>{const T=a.get(S.id),N=T?.selected??[],E=T?.custom??"";return{...S,selected:N,custom:E,skipped:p==="answered"&&N.length===0&&!E}}),w=y.find(S=>S.header)?.header||y[0]?.question||t.name,x=p1(y)?"plan-review":g1(y)?"approval":"question";return{callId:t.callId,state:p,wait:b,timeoutMs:g,title:w,questions:y,presentation:x}}function b1(t){return t==="open"||t==="continued"}const w3=new Set(["accepted","enqueued","started","needs_user","ready"]),S3=new Set(["delivered","failed","cancelled"]),k3={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"},E3={accepted:"activity.ticket.scheduling",enqueued:"activity.ticket.scheduling",started:"activity.status.worker",needs_user:"activity.ticket.needsUser",ready:"activity.ticket.ready"};function dm(t){const{segments:i,drafting:r,currentTurn:a,tickets:o=[],t:u=Ai}=t,f=[],m=[],p=new Set,g=w=>a==null||w===a,b=w=>u(k3[w]);for(const w of i){if(w.kind!=="tool")continue;const x=ws(w,void 0,o),S=qs(w);if(S&&b1(S.state)&&r&&g(w.turn)){f.push({text:u("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,N={text:`${b(x.status)}: ${T}`,moving:x.status!=="background"};if(x.status==="background"){r&&g(w.turn)&&m.push(N);continue}xs.has(x.status)&&(!r||!g(w.turn)||f.push(N))}t.pendingApprovals?.some(w=>w.state==="open")&&f.push({text:u("approval.waiting"),moving:!0});for(const w of o){if(p.has(w.id)||S3.has(w.status)||!w3.has(w.status))continue;p.add(w.id);const x=E3[w.status];x&&f.push({text:`${u(x)}: ${w.summary}`,moving:["accepted","enqueued","started"].includes(w.status)})}let y=f.find(w=>w.text===u("question.waiting"))??f.at(-1);if(f.length>1&&y&&(y={text:`${u("activity.pendingCount",{count:String(f.length)})} · ${y.text}`,moving:f.some(w=>w.moving)}),!y&&m.length&&(y=m.at(-1)),!y&&r){const w=i.filter(x=>g(x.turn));y=w.some(x=>x.kind==="think"&&x.running)?{text:u("activity.thinking"),moving:!0}:w.some(x=>x.kind==="assistant"&&x.streaming)?{text:u("bot.replying"),moving:!0}:{text:u("activity.waitingModel"),moving:!0}}if(!y)return null;if(t.connectionPhase&&t.connectionPhase!=="live"){const w=["restoring","connecting","syncing"].includes(t.connectionPhase);y={text:u("activity.staleSummary",{phase:u(w?"activity.syncing":"activity.connectionUnavailable"),text:y.text}),moving:!1}}return{...y,text:st(y.text).replace(/\s+/g," ").trim()}}function T3(t){const{t:i}=We(),r=dm({...t,t:i}),[a,o]=C.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return C.useEffect(()=>{const u=()=>o(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",u),u(),()=>document.removeEventListener("visibilitychange",u)},[]),r?h.jsxs("div",{className:"composer-activity",role:"status","aria-live":"polite","aria-atomic":"true","data-moving":r.moving&&a?"true":"false",children:[h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M3 4h10M3 8h10M3 12h6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})}),h.jsx("span",{className:"composer-activity-text",title:r.text,children:r.text})]}):null}const v1=["persona","profile","fact","episodic","procedural","state","skill"];function j3(t){return t==="full"?"full":t==="summary"||t==="truncated"?"summary":t==="index"?"index":t==="recall"||t==="tool"?"recall":t==="absent"||t==="none"||t==="uncited"?"absent":"unknown"}function x1(t){const i=t.chain?.map(a=>a.tombstone||a.lifecycle==="forgotten"?{...a,summary:"",tombstone:!0}:a);return t.tombstone||t.lifecycle==="forgotten"?{...t,tombstone:!0,title:t.type==="skill"?t.title:"",summary:"",body:null,bodyState:"hidden",attributes:[],steps:[],goal:"",blockers:[],next:"",...i?{chain:i}:{}}:i?{...t,chain:i}:t}function Xb(t){return Array.isArray(t.entities)?t.entities.flatMap(i=>{const r=w1(i);return r?[x1(r)]:[]}):[]}function C3(t){const i=w1(t.entity);return i?x1(i):null}function N3(t){if(!Array.isArray(t.frames))return[];const i=[];for(const r of t.frames){if(!r||typeof r!="object")continue;const a=r;typeof a.revision=="number"&&i.push({revision:a.revision,frozenAt:typeof a.frozenAt=="string"?a.frozenAt:"",presence:typeof a.presence=="string"?a.presence:"",hasManifest:a.hasManifest===!0})}return i}function A3(t){if(!Array.isArray(t.citations))return[];const i=[];for(const r of t.citations){if(!r||typeof r!="object")continue;const a=r;typeof a.id=="string"&&i.push({id:a.id,form:j3(a.form),reason:typeof a.reason=="string"?a.reason:"no_manifest"})}return i}function w1(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const i=t;return typeof i.id!="string"||!O3(i.type)?null:i}function O3(t){return typeof t=="string"&&v1.includes(t)}const S1="dsh-bot.memory-drawer-width",Hm={persona:"memory.type.persona",profile:"memory.type.profile",fact:"memory.type.fact",episodic:"memory.type.episodic",procedural:"memory.type.procedural",state:"memory.type.state",skill:"memory.type.skill"},_3={user:"memory.scope.user",session:"memory.scope.session",work:"memory.scope.work",skill:"memory.scope.skill"},k1={active:"memory.lifecycle.active",corrected:"memory.lifecycle.corrected",forgotten:"memory.lifecycle.forgotten",candidate:"memory.lifecycle.candidate"};function z3(){try{const t=localStorage.getItem(S1);return t==null||t===""?Ss:sa(Number(t))}catch{return Ss}}function R3(t){try{localStorage.setItem(S1,String(t))}catch{}}function q3({open:t,sessionId:i,onClose:r}){const{t:a}=We(),[o,u]=C.useState(""),[f,m]=C.useState(""),[p,g]=C.useState("all"),[b,y]=C.useState("all"),[w,x]=C.useState("all"),[S,T]=C.useState([]),[N,E]=C.useState(null),[M,H]=C.useState(!1),[te,ie]=C.useState([]),[O,Q]=C.useState("auto"),[re,pe]=C.useState([]),[z,Z]=C.useState(null),[W,je]=C.useState(null),[qe,le]=C.useState(!0),[G,ae]=C.useState(""),[se,Ne]=C.useState(0),[A,et]=C.useState(z3),ct=C.useRef(A),[q,R]=C.useState(!1),[ne,de]=C.useState(()=>window.innerWidth),[ye,Oe]=C.useState(()=>window.matchMedia("(max-width: 800px)").matches),[Ce,Se]=C.useState(t),[$,me]=C.useState(t?"in":"out"),Ze=C.useRef(Ce),Ke=C.useRef($);Ze.current=Ce,Ke.current=$;const ke=sa(A);Xv({present:Ce,narrow:ye,motion:$,width:ke,resizing:q,viewport:ne}),C.useEffect(()=>{if(t){Se(!0),me("in");return}if(Ze.current){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){Se(!1);return}me("out")}},[t]),C.useEffect(()=>{const fe=window.matchMedia("(max-width: 800px)"),De=()=>Oe(fe.matches);return fe.addEventListener("change",De),()=>fe.removeEventListener("change",De)},[]),C.useEffect(()=>{const fe=()=>de(window.innerWidth);return window.addEventListener("resize",fe),()=>window.removeEventListener("resize",fe)},[]),C.useEffect(()=>{u(""),m(""),Z(null),je(null),Q("auto"),T([]),ie([]),pe([]),E(null)},[i]),C.useEffect(()=>{const fe=setTimeout(()=>m(o.trim()),200);return()=>clearTimeout(fe)},[o]),C.useEffect(()=>{if(!t)return;let fe=!1;return le(!0),ae(""),Ni(Zb(i,{query:f,scope:p,lifecycle:b,type:w},null)).then(De=>{if(!fe){if(De.status!==200||De.body.ok===!1){T([]),E(null),ae(Kb(De.status,a)),le(!1);return}T(Xb(De.body)),E(typeof De.body.nextCursor=="string"?De.body.nextCursor:null),H(De.body.capped===!0),le(!1)}}),()=>{fe=!0}},[t,i,f,p,b,w,se,a]),C.useEffect(()=>{if(!t)return;let fe=!1;return Ni(`/dsh-bot/api/memory/frames?sessionId=${encodeURIComponent(i)}`).then(De=>{fe||De.body.ok===!1||ie(N3(De.body))}),()=>{fe=!0}},[t,i,se]);const $e=O==="none"?null:O==="auto"?te[0]?.revision??null:O,Fe=S.map(fe=>fe.id).join(",");C.useEffect(()=>{if(!t||$e==null||Fe===""){pe([]);return}let fe=!1;const De=new URLSearchParams({sessionId:i,revision:String($e),ids:Fe});return Ni(`/dsh-bot/api/memory/context?${De}`).then(yt=>{fe||yt.body.ok===!1||pe(A3(yt.body))}),()=>{fe=!0}},[t,i,$e,Fe]),C.useEffect(()=>{if(!t||z==null){je(null);return}let fe=!1;const De=new URLSearchParams({sessionId:i});return Ni(`/dsh-bot/api/memory/entities/${encodeURIComponent(z)}?${De}`).then(yt=>{fe||je(yt.body.ok===!1?null:C3(yt.body))}),()=>{fe=!0}},[t,i,z,se]),C.useEffect(()=>{if(!Ce)return;const fe=De=>{if(De.key==="Escape"){if(z!=null){Z(null);return}r()}};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[Ce,z,r]);async function Ue(){if(N==null)return;const fe=await Ni(Zb(i,{query:f,scope:p,lifecycle:b,type:w},N));if(fe.status!==200||fe.body.ok===!1){ae(Kb(fe.status,a));return}T(De=>[...De,...Xb(fe.body)]),E(typeof fe.body.nextCursor=="string"?fe.body.nextCursor:null)}const ze=S.find(fe=>fe.id===z)??null,Ye=W&&W.id===z?W:ze,gt=fe=>$e==null?null:re.find(De=>De.id===fe)??{id:fe,form:"unknown",reason:"no_manifest"};return Ce?Ru.createPortal(h.jsxs("div",{className:ye?`files-drawer narrow files-drawer-${$}`:`files-drawer files-drawer-${$}${q?" resizing":""}`,style:ye?void 0:{width:ke},role:"dialog","aria-label":a("memory.title"),onAnimationEnd:fe=>{fe.target!==fe.currentTarget||fe.animationName!=="files-drawer-out"||Ke.current==="out"&&Se(!1)},children:[ye?null:h.jsx("div",{className:"files-resize",onPointerDown:fe=>{fe.preventDefault(),fe.currentTarget.setPointerCapture(fe.pointerId),R(!0);const De=bn=>{const Mt=sa(window.innerWidth-bn.clientX);ct.current=Mt,et(Mt)},yt=()=>{R(!1),R3(ct.current),window.removeEventListener("pointermove",De),window.removeEventListener("pointerup",yt)};window.addEventListener("pointermove",De),window.addEventListener("pointerup",yt)}}),h.jsxs("header",{className:"files-head",children:[h.jsx("button",{type:"button",className:"files-icon-btn","aria-label":a("memory.close"),onClick:r,children:h.jsx(H3,{})}),h.jsxs("nav",{className:"files-crumbs","aria-label":a("memory.title"),children:[h.jsx("button",{type:"button",onClick:()=>Z(null),children:a("memory.title")}),Ye?h.jsxs("span",{children:[h.jsx("span",{"aria-hidden":"true",children:"/"}),h.jsx("span",{className:"files-crumb-current",children:E1(Ye,a("memory.missing"))})]}):null]}),h.jsx("button",{type:"button",className:"files-icon-btn files-upload","aria-label":a("memory.refresh"),onClick:()=>Ne(fe=>fe+1),children:h.jsx(I3,{})})]}),Ye?null:h.jsxs("div",{className:"memory-bar",children:[h.jsx("input",{className:"memory-search",value:o,placeholder:a("memory.search"),"aria-label":a("memory.search"),onChange:fe=>u(fe.target.value)}),h.jsxs("select",{"aria-label":a("memory.scope"),value:p,onChange:fe=>g(fe.target.value),children:[h.jsx("option",{value:"all",children:a("memory.scope.all")}),h.jsx("option",{value:"user",children:a("memory.scope.user")}),h.jsx("option",{value:"session",children:a("memory.scope.session")}),h.jsx("option",{value:"work",children:a("memory.scope.work")}),h.jsx("option",{value:"skill",children:a("memory.scope.skill")})]}),h.jsxs("select",{"aria-label":a("memory.lifecycle"),value:b,onChange:fe=>y(fe.target.value),children:[h.jsx("option",{value:"all",children:a("memory.lifecycle.all")}),h.jsx("option",{value:"active",children:a("memory.lifecycle.active")}),h.jsx("option",{value:"corrected",children:a("memory.lifecycle.corrected")}),h.jsx("option",{value:"forgotten",children:a("memory.lifecycle.forgotten")}),h.jsx("option",{value:"candidate",children:a("memory.lifecycle.candidate")})]}),h.jsxs("select",{"aria-label":a("memory.kind"),value:w,onChange:fe=>x(fe.target.value),children:[h.jsx("option",{value:"all",children:a("memory.type.all")}),v1.map(fe=>h.jsx("option",{value:fe,children:a(Hm[fe])},fe))]}),te.length===0?h.jsx("span",{className:"memory-note",children:a("memory.frame.none")}):h.jsxs("select",{id:"memory-frame","aria-label":a("memory.frame"),title:a("memory.frame.hint"),value:$e==null?"none":String($e),onChange:fe=>{const De=fe.target.value;Q(De==="none"?"none":Number(De))},children:[h.jsx("option",{value:"none",children:a("memory.frame.unselected")}),te.map(fe=>h.jsx("option",{value:fe.revision,children:a("memory.frame.option",{revision:String(fe.revision)})},fe.revision))]})]}),h.jsx("div",{className:"files-body",children:h.jsx("div",{className:"files-stage in",children:Ye?h.jsx(D3,{entity:Ye,citation:gt(Ye.id),sourceReady:W?.id===Ye.id,t:a,onClose:()=>Z(null),onSelect:Z}):G?h.jsx("p",{className:"files-status memory-error",children:G}):qe&&S.length===0?h.jsx("p",{className:"files-status",children:a("memory.loading")}):S.length===0?h.jsxs("div",{className:"files-empty",children:[h.jsx("span",{className:"files-empty-mark","aria-hidden":"true",children:h.jsx(V3,{})}),h.jsx("p",{children:a("memory.empty")})]}):h.jsxs(h.Fragment,{children:[$e!=null?h.jsx("p",{className:"memory-note",children:a("memory.frame.note")}):null,M?h.jsx("p",{className:"memory-note",children:a("memory.capped")}):null,h.jsxs("div",{className:"files-table",role:"table",children:[h.jsxs("div",{className:"files-row files-columns memory-row",role:"row",children:[h.jsx("span",{role:"columnheader",children:a("files.name")}),h.jsx("span",{className:"files-col-type",role:"columnheader",children:a("memory.kind")}),h.jsx("span",{className:"files-col-size",role:"columnheader",children:a("memory.lifecycle")}),h.jsx("span",{className:"files-col-time",role:"columnheader",children:a("files.modified")})]}),S.map(fe=>h.jsx(M3,{entity:fe,selected:fe.id===z,t:a,onSelect:Z},fe.id))]}),N?h.jsx("button",{type:"button",className:"memory-more",onClick:()=>{Ue()},children:a("memory.more")}):null,h.jsx("p",{className:"memory-readonly",children:a("memory.readonly")})]})})})]}),document.body):null}function M3({entity:t,selected:i,t:r,onSelect:a}){const o=t.tombstone?r("memory.tombstone"):E1(t,r("memory.missing"));return h.jsxs("div",{className:"files-row memory-row",role:"row",children:[h.jsxs("button",{type:"button",className:"files-name","aria-pressed":i,onClick:()=>a(t.id),children:[h.jsx(U3,{type:t.type}),h.jsx("span",{children:o})]}),h.jsx("span",{className:"files-col-type",children:r(Hm[t.type])}),h.jsx("span",{className:"files-col-size",children:r(k1[t.lifecycle])}),h.jsx("span",{className:"files-col-time",title:Q3(t.updatedAt),children:Ts(t.updatedAt,r("memory.missing"))})]})}function D3({entity:t,citation:i,sourceReady:r,t:a,onClose:o,onSelect:u}){const f=!t.tombstone&&t.bodyState==="visible"&&typeof t.body=="string"&&t.body.trim()!==t.summary.trim();return h.jsxs("div",{className:`files-preview memory-doc memory-doc-${t.type}`,children:[h.jsxs("div",{className:"files-preview-bar",children:[h.jsxs("span",{children:[a(Hm[t.type]),h.jsx("span",{"aria-hidden":"true",children:" · "}),a(_3[t.scope]),h.jsx("span",{"aria-hidden":"true",children:" · "}),a(k1[t.lifecycle])]}),h.jsxs("span",{children:[i?h.jsx("span",{className:`memory-cite memory-cite-${i.form}`,children:a(T1(i.form))}):null,h.jsx("button",{type:"button",onClick:o,children:a("memory.back")})]})]}),h.jsxs("div",{className:"files-markdown",children:[h.jsx(L3,{entity:t,citation:i,t:a}),t.type==="episodic"&&!t.tombstone?h.jsx("p",{className:"memory-participants",children:a("memory.episode.participants")}):null,f?h.jsx("pre",{className:"memory-body",children:t.body}):null,t.bodyState==="hidden"?h.jsx("p",{className:"memory-body-note",children:a("memory.body.hidden")}):null,t.bodyState==="mismatch"?h.jsx("p",{className:"memory-body-note",children:a("memory.body.mismatch")}):null,t.bodyState==="absent"?h.jsx("p",{className:"memory-body-note",children:a("memory.body.absent")}):null,t.note?h.jsxs("p",{className:"memory-note-line",children:[h.jsx("span",{children:a("memory.note")}),t.note]}):null,r?h.jsx(B3,{source:t.source,t:a}):null,i?h.jsx("p",{className:"memory-cite-reason",children:a(Y3(i.reason))}):null,t.chain&&t.chain.length>1?h.jsxs("section",{className:"memory-chain",children:[h.jsx("h5",{children:a("memory.chain")}),h.jsx("ul",{children:t.chain.map(m=>h.jsx("li",{children:h.jsx("button",{type:"button",disabled:m.id===t.id,onClick:()=>u(m.id),children:m.tombstone?a("memory.tombstone"):m.summary||m.id})},m.id))})]}):null,t.changes&&t.changes.length>0?h.jsxs("section",{className:"memory-changes",children:[h.jsx("h5",{children:a("memory.changes")}),h.jsx("ul",{children:t.changes.map(m=>h.jsxs("li",{children:[F3(m.tool,a)," · ",Ts(m.at,a("memory.missing"))]},m.id))})]}):null]})]})}function L3({entity:t,citation:i,t:r}){if(t.tombstone)return h.jsx("p",{className:"memory-tombstone",children:r("memory.tombstone")});if(t.type==="persona")return h.jsxs("div",{className:"memory-persona",children:[t.versionLabel?h.jsx("p",{className:"memory-version",children:r("memory.version",{version:t.versionLabel})}):null,t.title?h.jsx("p",{className:"memory-persona-title",children:t.title}):null,t.summary&&t.summary!==t.title?h.jsx("p",{className:"memory-excerpt",children:t.summary}):null]});if(t.type==="profile")return t.attributes&&t.attributes.length>0?h.jsx("dl",{className:"memory-attributes",children:t.attributes.map(o=>h.jsxs("div",{children:[h.jsx("dt",{children:o.name}),h.jsx("dd",{children:o.value})]},`${o.name}:${o.value}`))}):h.jsx("p",{className:"memory-profile-empty",children:t.summary||r("memory.profile.empty")});if(t.type==="fact")return h.jsxs("div",{className:"memory-fact",children:[h.jsx("p",{className:"memory-proposition",children:t.summary||r("memory.missing")}),t.priority!=null?h.jsx("p",{className:"memory-priority",children:r("memory.priority",{priority:String(t.priority)})}):null]});if(t.type==="episodic")return h.jsxs("div",{className:"memory-episode",children:[h.jsx("time",{dateTime:t.updatedAt??void 0,children:Ts(t.updatedAt,r("memory.missing"))}),t.title?h.jsx("p",{className:"memory-scene-title",children:t.title}):null,h.jsx("p",{className:"memory-scene",children:t.summary||r("memory.missing")})]});if(t.type==="procedural")return t.steps&&t.steps.length>0?h.jsx("ol",{className:"memory-steps",children:t.steps.map((o,u)=>h.jsx("li",{children:o},`${u}:${o}`))}):h.jsx("p",{className:"memory-procedure-empty",children:r("memory.procedure.empty")});if(t.type==="state")return h.jsxs("div",{className:"memory-state",children:[h.jsxs("p",{className:"memory-goal",children:[h.jsx("span",{children:r("memory.state.goal")}),t.goal||r("memory.missing")]}),h.jsxs("div",{className:"memory-blockers",children:[h.jsx("span",{children:r("memory.state.blockers")}),t.blockers&&t.blockers.length>0?h.jsx("ul",{children:t.blockers.map(o=>h.jsx("li",{children:o},o))}):h.jsx("p",{children:r("memory.missing")})]}),h.jsxs("p",{className:"memory-next",children:[h.jsx("span",{children:r("memory.state.next")}),t.next||r("memory.missing")]})]});const a=t.bindingScope==="private"?r("memory.skill.private"):r("memory.skill.public");return h.jsxs("div",{className:"memory-skill",children:[h.jsx("p",{className:"memory-skill-name",children:t.title}),t.summary?h.jsx("p",{className:"memory-skill-summary",children:t.summary}):null,h.jsx("p",{className:"memory-skill-load",children:r(i?T1(i.form):"memory.skill.loadUnknown")}),t.bindingScope?h.jsx("p",{className:"memory-skill-file",children:r("memory.skill.binding",{scope:a})}):null,t.enabled===!1?h.jsx("p",{className:"memory-skill-flag",children:r("memory.skill.disabled")}):null]})}function B3({source:t,t:i}){return t?.recorded?h.jsxs("section",{className:"memory-source",children:[h.jsx("h5",{children:i("memory.source")}),h.jsx("p",{children:i(G3(t.creator))}),t.createdAt?h.jsx("p",{children:i("memory.source.created",{time:Ts(t.createdAt,i("memory.missing"))})}):null,t.updatedAt?h.jsx("p",{children:i("memory.source.updated",{time:Ts(t.updatedAt,i("memory.missing"))})}):null]}):h.jsxs("section",{className:"memory-source",children:[h.jsx("h5",{children:i("memory.source")}),h.jsx("p",{children:i("memory.source.unrecorded")})]})}function U3({type:t}){return h.jsx("span",{className:"files-mark memory-mark","aria-hidden":"true",children:h.jsxs("svg",{viewBox:"0 0 16 16",children:[t==="persona"?h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"8",cy:"5.4",r:"2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),h.jsx("path",{d:"M3.6 13.2c.7-2.3 2.3-3.4 4.4-3.4s3.7 1.1 4.4 3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]}):null,t==="profile"?h.jsx("path",{d:"M4 3.6h8v8.8H4zM6.2 6.4h3.6M6.2 8.6h3.6M6.2 10.8h2.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round",strokeLinecap:"round"}):null,t==="fact"?h.jsx("path",{d:"M4 5.2h8M4 8h8M4 10.8h5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}):null,t==="episodic"?h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"8",cy:"8",r:"4.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),h.jsx("path",{d:"M8 5.6V8l2 1.3",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]}):null,t==="procedural"?h.jsx("path",{d:"M4.2 4.6h7.6M4.2 8h7.6M4.2 11.4h7.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}):null,t==="state"?h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"8",cy:"8",r:"4.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.3",fill:"currentColor"})]}):null,t==="skill"?h.jsx("path",{d:"M5.2 3.4v9.2M10.8 3.4v9.2M3.4 6h9.2M3.4 10h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}):null]})})}function H3(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 I3(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("path",{d:"M13.2 8a5.2 5.2 0 1 1-1.4-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),h.jsx("path",{d:"M13.4 2.6V5.2H10.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function V3(){return h.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[h.jsx("path",{d:"M5 6.5h14v11H5z",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),h.jsx("path",{d:"M8 10.5h8M8 13.5h5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function E1(t,i){if(t.tombstone)return i;if(t.type==="persona")return t.title||t.summary||i;if(t.type==="profile"){const r=t.attributes?.[0];return r?`${r.name} ${r.value}`:t.summary||i}return t.type==="fact"?t.summary||i:t.type==="episodic"?t.title||t.summary||i:t.type==="procedural"?t.steps?.[0]||t.summary||i:t.type==="state"?t.goal||t.summary||i:t.title||t.summary||i}function Zb(t,i,r){const a=new URLSearchParams({sessionId:t});return i.query!==""&&a.set("q",i.query),i.scope!=="all"&&a.set("scope",i.scope),i.lifecycle!=="all"&&a.set("lifecycle",i.lifecycle),i.type!=="all"&&a.set("type",i.type),r&&a.set("cursor",r),`/dsh-bot/api/memory/entities?${a}`}function Kb(t,i){return i(t===401||t===403?"memory.denied":"memory.failed")}function T1(t){return t==="full"?"memory.cite.full":t==="summary"?"memory.cite.summary":t==="index"?"memory.cite.index":t==="recall"?"memory.cite.recall":t==="absent"?"memory.cite.absent":"memory.cite.unknown"}function Y3(t){return t==="no_frame"?"memory.cite.reason.no_frame":"memory.cite.reason.no_manifest"}function G3(t){return t==="user"?"memory.source.user":t==="model"?"memory.source.model":t==="system"?"memory.source.system":t==="tool"?"memory.source.tool":"memory.source.unknown"}function F3(t,i){return t==="foundations_remember"?i("memory.tool.foundations_remember"):t==="foundations_correct"?i("memory.tool.foundations_correct"):t==="foundations_forget"?i("memory.tool.foundations_forget"):t==="foundations_state_update"?i("memory.tool.foundations_state_update"):t}function Ts(t,i){if(!t)return i;const r=new Date(t);if(Number.isNaN(r.getTime()))return i;const a=String(r.getHours()).padStart(2,"0"),o=String(r.getMinutes()).padStart(2,"0");return`${r.getMonth()+1}/${r.getDate()} ${a}:${o}`}function Q3(t){if(!t)return;const i=new Date(t);if(!Number.isNaN(i.getTime()))return i.toLocaleString()}function j1(t,i){return t==="workspace-write"?i("permission.preset.workspaceWrite"):t==="read-only"||t==="readonly"?i("permission.preset.readOnly"):t==="danger-full-access"?i("permission.preset.fullAccess"):t==="auto"?i("permission.preset.auto"):t}function $b(t,i,r){const a=j1(t,r);return a!==t?a:i&&i!==""?i:t}function Im({title:t,closeLabel:i,onClose:r,children:a,className:o}){C.useEffect(()=>{if(typeof document>"u")return;const f=document.body.style.overflow;document.body.style.overflow="hidden";const m=p=>{p.key==="Escape"&&r()};return document.addEventListener("keydown",m),()=>{document.body.style.overflow=f,document.removeEventListener("keydown",m)}},[r]);const u=h.jsxs("div",{className:o?`settings-drawer ${o}`:"settings-drawer",children:[h.jsx("div",{className:"settings-drawer-mask",onClick:r}),h.jsxs("div",{className:"settings-drawer-sheet",role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[h.jsx("div",{className:"settings-drawer-handle","aria-hidden":"true"}),h.jsxs("div",{className:"settings-head",children:[h.jsx("h3",{children:t}),h.jsx("button",{type:"button",className:"user-question-skip",onClick:r,children:i})]}),h.jsx("div",{className:"settings-drawer-body",children:a})]})]});return typeof document>"u"||!document.body?u:Ru.createPortal(u,document.body)}function X3({sessionId:t,current:i,onClose:r,onChanged:a}){const{t:o}=We(),[u,f]=C.useState(null),[m,p]=C.useState(null),[g,b]=C.useState(""),[y,w]=C.useState(!1);C.useEffect(()=>{rt(`/permissions?sessionId=${encodeURIComponent(t)}`).then(E=>f(E.body))},[t]);async function x(E){w(!0),b("");try{const M=await rt("/permissions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,name:E})});if(M.status===200&&M.body.ok!==!1){f(M.body),p(null),typeof M.body.currentValue=="string"&&a?.(M.body.currentValue);return}b(typeof M.body.message=="string"?M.body.message:o("permission.failed"))}catch{b(o("permission.failed"))}finally{w(!1)}}function S(E){if(!(E.value===u?.currentValue||E.value==="custom")){if(E.value==="danger-full-access"||E.value==="auto"){p(E);return}x(E.value)}}const T=u?.options??[],N=T.find(E=>E.value===(u?.currentValue??i));return h.jsxs(Im,{title:o("permission.title"),closeLabel:o("permission.close"),onClose:r,children:[u&&u.available===!1?h.jsx("p",{className:"user-question-hint",children:o("permission.unavailable")}):null,u?.currentValue||i?h.jsxs("p",{className:"user-question-hint",children:[o("permission.current"),":"," ",$b(u?.currentValue??i??"",N?.name,o)||"—"]}):null,h.jsx("ul",{className:"user-question-options",children:T.map(E=>h.jsx("li",{children:h.jsxs("button",{type:"button",className:E.value===u?.currentValue?"user-question-option selected":"user-question-option",disabled:y||E.value==="custom",onClick:()=>S(E),children:[h.jsx("span",{className:"user-question-option-label",children:$b(E.value,E.name,o)}),E.description?h.jsx("span",{className:"user-question-option-desc",children:E.description}):null]})},E.value))}),m?h.jsxs("div",{className:"settings-confirm",children:[h.jsx("p",{className:"user-question-text",children:o("permission.confirmTitle")}),h.jsx("p",{className:"user-question-hint",children:m.value==="auto"?o("permission.confirmAuto"):o("permission.confirmFull")}),h.jsxs("div",{className:"user-question-row",children:[h.jsx("button",{type:"button",className:"user-question-skip",disabled:y,onClick:()=>p(null),children:o("permission.cancel")}),h.jsx("button",{type:"button",className:"user-question-submit",disabled:y,onClick:()=>{x(m.value)},children:o("permission.confirm")})]})]}):null,g?h.jsx("p",{className:"user-question-status exception",children:g}):null]})}function Z3({onClose:t,authorization:i,catalog:r}){const{t:a}=We(),[o,u]=C.useState(!0),[f,m]=C.useState([]),[p,g]=C.useState([]),[b,y]=C.useState([]),[w,x]=C.useState({}),[S,T]=C.useState(""),[N,E]=C.useState(!1),[M]=C.useState(()=>d1(async()=>{const z=await rt("/authorization");if(z.status!==200)throw new Error("Authorization catalog unavailable");return z.body})),H=r??M,te=C.useRef(!0),ie=C.useRef(0);async function O(z=!1){if(document.hidden)return;z&&H.invalidate();const Z=++ie.current;try{const W=await H.get();if(!te.current||Z!==ie.current)return;u(W.available!==!1),m(Array.isArray(W.entries)?W.entries:[]),i||(g(Array.isArray(W.notices)?W.notices:[]),y(Array.isArray(W.prompts)?W.prompts:[]))}catch{te.current&&Z===ie.current&&T(a("auth.failed"))}}C.useEffect(()=>{i&&(u(i.available!==!1),(Array.isArray(i.prompts)&&i.prompts.length>0||Array.isArray(i.inFlight)&&i.inFlight.length>0)&&E(!1),g(Array.isArray(i.notices)?i.notices:[]),y(Array.isArray(i.prompts)?i.prompts:[]))},[i]),C.useEffect(()=>{te.current=!0,O();const z=()=>{document.hidden||O(!0)},Z=window.setInterval(()=>{O()},3e4);return document.addEventListener("visibilitychange",z),()=>{te.current=!1,ie.current++,window.clearInterval(Z),document.removeEventListener("visibilitychange",z)}},[H,i?.catalogRevision]);async function Q(z,Z){E(!0),T("");try{const W=await rt("/authorization/begin",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:z.key,method:Z})});(W.status!==200||W.body.ok===!1)&&T(typeof W.body.message=="string"?W.body.message:a("auth.failed")),await O(!0)}catch{T(a("auth.failed"))}finally{E(!1)}}async function re(z,Z=!1,W){E(!0),T("");try{const je=await rt("/authorization/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({promptId:z.promptId,value:Z?void 0:W??w[z.promptId]??"",declined:Z})});(je.status!==200||je.body.ok===!1)&&T(typeof je.body.message=="string"?je.body.message:a("auth.failed")),await O(!0)}catch{T(a("auth.failed"))}finally{E(!1)}}async function pe(z){E(!0);try{await rt("/authorization/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:z.key})}),await O(!0)}finally{E(!1)}}return h.jsxs(Im,{title:a("auth.title"),closeLabel:a("auth.close"),onClose:t,children:[o?null:h.jsx("p",{className:"user-question-hint",children:a("auth.unavailable")}),o&&f.length===0&&b.length===0?h.jsx("p",{className:"user-question-hint",children:a("auth.empty")}):null,p.map((z,Z)=>h.jsxs("p",{className:"user-question-hint",children:[z.message,z.code?` · ${z.code}`:"",z.url?h.jsxs(h.Fragment,{children:[" ",h.jsx("a",{href:z.url,target:"_blank",rel:"noreferrer",children:z.url})]}):null]},`${z.message}-${Z}`)),b.map(z=>h.jsxs("article",{className:"user-question",children:[h.jsx("p",{className:"user-question-text",children:z.message}),z.kind==="select"?h.jsx("ul",{className:"user-question-options",children:(z.options??[]).map(Z=>h.jsx("li",{children:h.jsxs("button",{type:"button",className:"user-question-option",disabled:N,onClick:()=>{re(z,!1,Z.id)},children:[h.jsx("span",{className:"user-question-option-label",children:Z.label}),Z.description?h.jsx("span",{className:"user-question-option-desc",children:Z.description}):null]})},Z.id))}):z.kind==="secret"?h.jsxs("label",{className:"user-question-custom",children:[h.jsx("span",{className:"user-question-secret",children:a("auth.secretMask")}),h.jsx("input",{type:"text",className:"user-question-secret-input",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:w[z.promptId]??"",placeholder:z.placeholder,disabled:N,onChange:Z=>x(W=>({...W,[z.promptId]:Z.target.value}))})]}):h.jsx("label",{className:"user-question-custom",children:h.jsx("input",{type:"text",value:w[z.promptId]??"",placeholder:z.placeholder,disabled:N,onChange:Z=>x(W=>({...W,[z.promptId]:Z.target.value}))})}),h.jsxs("div",{className:"user-question-row",children:[h.jsx("button",{type:"button",className:"user-question-skip",disabled:N,onClick:()=>{re(z,!0)},children:a("auth.cancel")}),z.kind!=="select"?h.jsx("button",{type:"button",className:"user-question-submit",disabled:N||z.kind!=="secret"&&!(w[z.promptId]??"").trim(),onClick:()=>{re(z)},children:a("auth.writeVault")}):null]})]},z.promptId)),f.map(z=>{const Z={...z,inFlight:z.inFlight||Array.isArray(i?.inFlight)&&i.inFlight.some(W=>JSON.stringify(W)===JSON.stringify(z.key))};return h.jsxs("article",{className:"user-question",children:[h.jsx("p",{className:"user-question-text",children:Z.label}),h.jsxs("div",{className:"user-question-row",children:[Z.methods.map(W=>h.jsx("button",{type:"button",className:"user-question-submit",disabled:N||Z.inFlight,onClick:()=>{Q(Z,W.id)},children:W.label||a("auth.start")},W.id)),Z.inFlight?h.jsx("button",{type:"button",className:"user-question-skip",disabled:N,onClick:()=>{pe(Z)},children:a("auth.cancel")}):null]})]},JSON.stringify(Z.key))}),S?h.jsx("p",{className:"user-question-status exception",children:S}):null]})}function K3({onClose:t}){const{t:i,locale:r}=We(),[a,o]=C.useState(!1),[u,f]=C.useState(!1),[m,p]=C.useState(null),[g,b]=C.useState([]),[y,w]=C.useState([]),[x,S]=C.useState(""),[T,N]=C.useState(!1);async function E(){const H=await rt(`/cua?locale=${encodeURIComponent(r)}`);f(!0),o(H.body.available===!0);const te=H.body.systemStatus;p(te&&typeof te=="object"?te:null);const ie=H.body.applications;if(ie&&typeof ie=="object"){const O=ie;b(Array.isArray(O.allowedApps)?O.allowedApps:[]),w(Array.isArray(O.blockedApps)?O.blockedApps:[])}}C.useEffect(()=>{E()},[r]);async function M(H,te={}){N(!0),S("");try{const ie=await rt("/cua",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:H,locale:r,...te})});(ie.status!==200||ie.body.ok===!1)&&S(typeof ie.body.message=="string"?ie.body.message:i("cua.failed")),await E()}catch{S(i("cua.failed"))}finally{N(!1)}}return u&&!a?null:h.jsxs(Im,{title:i("cua.title"),closeLabel:i("cua.close"),onClose:t,children:[h.jsx("h4",{className:"user-question-header",children:i("cua.system")}),["accessibility","screenRecording"].map(H=>h.jsxs("div",{className:"user-question-row",children:[h.jsxs("p",{className:"user-question-text",children:[i(H==="accessibility"?"cua.accessibility":"cua.screenRecording"),h.jsx("span",{className:"user-question-hint",children:m?.[H]?i("cua.granted"):i("cua.missing")})]}),h.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{M("requestPermission",{permission:H})},children:i("cua.request")}),h.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{M("openSettings",{permission:H})},children:i("cua.openSettings")})]},H)),h.jsx("h4",{className:"user-question-header",children:i("cua.grants")}),g.length===0?h.jsx("p",{className:"user-question-hint",children:i("cua.emptyGrants")}):null,g.map(H=>h.jsxs("div",{className:"user-question-row",children:[h.jsx("p",{className:"user-question-text",children:H.name}),h.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{M("revoke",{id:H.id})},children:i("cua.revoke")})]},H.id)),h.jsx("h4",{className:"user-question-header",children:i("cua.blocked")}),y.length===0?h.jsx("p",{className:"user-question-hint",children:i("cua.emptyBlocked")}):null,y.map(H=>h.jsxs("div",{className:"user-question-row",children:[h.jsx("p",{className:"user-question-text",children:H.name}),h.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{M("retryApproval",{id:H.id})},children:i("cua.askAgain")})]},H.id)),x?h.jsx("p",{className:"user-question-status exception",children:x}):null]})}function $3(t){const i=[],r=new Set;for(const a of t){if(a.kind==="user"){i.push({id:a.id});continue}const o=a.turn??-1;r.has(o)||(r.add(o),i.push({id:`turn:${o}`}))}return i}function C1(t){return Array.isArray(t)?t.filter(i=>i?.type==="text"&&typeof i.text=="string").map(i=>i.text??"").join(`
|
|
55
|
-
`).trim():""}function Vm(t){const i=t.message;return i&&typeof i=="object"?i:Array.isArray(t.content)||typeof t.toolCallId=="string"?t:null}function Nu(t){if(typeof t=="string")return t;if(t&&typeof t=="object")try{return JSON.stringify(t)}catch{return""}return""}function at(t){return typeof t=="number"?t:void 0}function J3(t){if(!t||typeof t!="object")return null;const i=t;if(i.kind==="error"){const r=typeof i.error?.message=="string"&&i.error.message!==""?i.error.message:"This turn failed",a=typeof i.error?.code=="string"?i.error.code:void 0;return{message:r,...a?{code:a}:{}}}return i.kind==="interrupted"?{message:"The DSH process exited before this turn finished.",code:"INTERRUPTED"}:i.kind==="aborted"&&i.reason?.kind==="hook"&&i.reason.reason==="deepseek-account/signed-out"?{message:"Stopped because you signed out of DeepSeek.",code:"ACCOUNT_SIGNED_OUT"}:null}function Fu(t,i){return`${t??""}:${i??""}`}function js(t){return t.sort((i,r)=>i.seq-r.seq)}function P3(t,i){const r=t.findIndex(a=>a.kind==="user"&&a.optimistic&&a.text.trim()===i.text.trim());if(r>=0){const a=t.slice(),o=a[r];return!o||o.kind!=="user"?t:(a[r]={...o,optimistic:!1,time:i.time??o.time,seq:i.seq,turn:i.turn},a)}return js([...t,i])}function W3(t,i){const r=i.trim();if(!r)return"";try{const a=JSON.parse(r),o=typeof a.command=="string"?a.command:"",u=typeof a.description=="string"?a.description:"",f=["path","file_path","file","target_file","target"].map(p=>a[p]).find(p=>typeof p=="string"),m=typeof a.query=="string"?a.query:typeof a.pattern=="string"?a.pattern:typeof a.prompt=="string"?a.prompt:"";return(o||(typeof f=="string"?f:"")||m||u||t).replace(/\s+/g," ").trim()}catch{return r.replace(/\s+/g," ").trim()}}function N1(t){const i=[];let r=[],a=0;const o=()=>{r.length!==0&&(i.push({type:"activity",id:`activity:${a++}`,segments:r}),r=[])};for(const u of t)u.kind==="assistant"?(o(),i.push({type:"text",segment:u})):u.kind==="tool"&&h1(u.name)?(o(),i.push({type:"question",segment:u})):(u.kind==="think"||u.kind==="tool")&&r.push(u);return o(),i}function e4(t){let i;try{const o=JSON.parse(t.args);if(!o||typeof o!="object")return null;i=o}catch{return null}const r=t.name.toLowerCase(),a=t4(i,["file_path","path","file"]);if(!a)return null;if(r==="write"){const o=typeof i.content=="string"?i.content:"",u=Au(o).map(f=>({kind:"add",text:f}));return Jb(a,o.length,u,u.length,0)}if(r==="edit"||r==="apply_patch"||r==="str_replace_editor"){const o=typeof i.old_string=="string"?i.old_string:typeof i.old_str=="string"?i.old_str:null,u=typeof i.new_string=="string"?i.new_string:typeof i.new_str=="string"?i.new_str:typeof i.content=="string"?i.content:typeof i.file_text=="string"?i.file_text:"",f=o==null||o===""?Au(u).map(g=>({kind:"add",text:g})):n4(o,u),m=f.filter(g=>g.kind==="add").length,p=f.filter(g=>g.kind==="del").length;return Jb(a,u.length,f,m,p)}return null}function Jb(t,i,r,a,o){const u=t.split("/").filter(Boolean).at(-1)??t;return{path:t,name:u,language:i4(u),kilobytes:Math.max(1,Math.ceil(i/1024)),added:a,removed:o,lines:r}}function t4(t,i){for(const r of i){const a=t[r];if(typeof a=="string"&&a.trim())return a.trim()}return""}function Au(t){return t===""?[]:(t.endsWith(`
|
|
56
|
-
`)?t.slice(0,-1):t).split(`
|
|
57
|
-
`)}function n4(t,i){const r=Au(t),a=Au(i);if(r.length>180||a.length>180)return[...r.map(b=>({kind:"del",text:b})),...a.map(b=>({kind:"add",text:b}))];const o=r.length+1,u=a.length+1,f=Array.from({length:o},()=>Array(u).fill(0));for(let b=r.length-1;b>=0;b-=1)for(let y=a.length-1;y>=0;y-=1){const w=f[b],x=f[b+1];!w||!x||(w[y]=r[b]===a[y]?(x[y+1]??0)+1:Math.max(x[y]??0,w[y+1]??0))}const m=[];let p=0,g=0;for(;p<r.length&&g<a.length;)r[p]===a[g]?(m.push({kind:"context",text:r[p]??""}),p+=1,g+=1):(f[p+1]?.[g]??0)>=(f[p]?.[g+1]??0)?(m.push({kind:"del",text:r[p]??""}),p+=1):(m.push({kind:"add",text:a[g]??""}),g+=1);for(;p<r.length;)m.push({kind:"del",text:r[p]??""}),p+=1;for(;g<a.length;)m.push({kind:"add",text:a[g]??""}),g+=1;return m}function i4(t){const i=t.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"}[i]??""}function l4(t){return(t.split(`
|
|
58
|
-
`).map(r=>r.trim()).find(Boolean)??"").replaceAll("**","")}function A1(t,i){const r=t.findIndex(y=>y.kind==="tool"&&y.callId===i.callId);if(r<0)return js([...t,i]);const a=t[r];if(!a||a.kind!=="tool")return t;const o=t.slice(),u=a.resultReceived===!0||i.resultReceived===!0,m=i.resultReceived&&(!a.resultReceived||(i.resultSeq??-1)>(a.resultSeq??-1))?i:a,g=i.callReceived&&(!a.callReceived||(i.callSeq??-1)>(a.callSeq??-1))?i:a,b=(g.name!=="tool"?g.name:i.name)||a.name;return o[r]={...a,seq:!a.callReceived&&a.resultReceived&&i.callReceived?Math.min(a.seq,i.seq):a.seq,id:`tool:${i.callId}`,name:b,args:g.callReceived?g.args:i.args||a.args,callReceived:a.callReceived||i.callReceived,callSeq:g.callSeq,requestedAt:g.requestedAt,resultReceived:u,result:u?m.result:"",error:u?m.error:!1,errorCode:m.errorCode,meta:m.meta,resultSeq:m.resultSeq,settledAt:m.settledAt,status:u?Gu(b,m.result,m.error,m.errorCode):i.status??a.status,running:!u&&(i.running||a.running),turn:a.turn??i.turn,step:a.step??i.step},js(o)}function r4(t,i,r,a,o,u){const f=`live:${i}:`,m=t.segments.filter(b=>b.id.startsWith(f));let p=t.segments.filter(b=>!b.id.startsWith(f)||b.kind==="tool"&&(b.callReceived||b.resultReceived));const g=[];for(const b of r){const y=a+b.index/100;if(b.kind==="reasoning"&&b.text.trim())g.push({kind:"think",id:`${f}think:${b.index}`,text:b.text,running:!0,seq:y,turn:o,step:u});else if(b.kind==="text"&&b.text)g.push({kind:"assistant",id:`${f}text:${b.index}`,text:b.text,streaming:!0,seq:y,turn:o,step:u});else if(b.kind==="tool-call"&&(b.name||b.args||b.id)){const w=b.id||`${f}tool:${b.index}`,x=[...p,...m].find(T=>T.kind==="tool"&&T.callId===w),S=p.findIndex(T=>T.kind==="tool"&&T.callId===w);if(S>=0){const T=p[S];if(T&&T.kind==="tool"&&!T.callReceived&&!T.resultReceived){const N=p.slice();N[S]={...T,name:b.name||T.name,args:b.args||T.args,running:T.resultReceived?!1:T.running,status:T.resultReceived||T.callReceived?T.status:"preparing"},p=N}}else g.push({kind:"tool",id:`${f}tool:${b.index}`,callId:w,name:b.name||x?.name||"tool",args:b.args||x?.args||"",result:x?.result??"",error:x?.error??!1,running:!x?.resultReceived,status:x?.status??"preparing",resultReceived:x?.resultReceived,seq:x?.seq??y,turn:o,step:u})}}return js([...p,...g])}function O1(t,i,r){const a=t.find(o=>o.index===i);return a?a.kind===r?t:t.map(o=>o.index===i?{...o,kind:r}:o):[...t,{index:i,kind:r,text:"",id:"",name:"",args:""}].sort((o,u)=>o.index-u.index)}function mu(t,i,r,a){return O1(t,i,r).map(u=>u.index===i?a({...u,kind:r}):u)}function a4(t,i){const r=at(i.index)??0,a=typeof i.type=="string"?i.type:"";if(a==="block-start"){const o=i.blockType==="reasoning"||i.blockType==="tool-call"||i.blockType==="text"?i.blockType:"text";return O1(t,r,o)}if(a==="text-delta"||a==="text-chunks"){const o=typeof i.text=="string"?i.text:Pb(i.texts);return mu(t,r,"text",u=>({...u,text:u.text+o}))}if(a==="reasoning-delta"||a==="reasoning-chunks"){const o=typeof i.text=="string"?i.text:Pb(i.texts);return mu(t,r,"reasoning",u=>({...u,text:u.text+o}))}if(a==="tool-call-delta"||a==="tool-call-chunks"){const o=typeof i.argumentsDelta=="string"?i.argumentsDelta:Nu(i.args??i.arguments);return mu(t,r,"tool-call",u=>({...u,id:typeof i.id=="string"&&i.id?i.id:u.id,name:typeof i.name=="string"&&i.name?i.name:u.name,args:a==="tool-call-chunks"&&o?o:u.args+o}))}if(a==="block-end"&&i.block&&typeof i.block=="object"){const o=i.block,u=o.type==="reasoning"||o.type==="tool-call"||o.type==="text"?o.type:"text";return mu(t,r,u,f=>({...f,kind:u,text:typeof o.text=="string"?o.text:f.text,id:o.id||f.id,name:o.name||f.name,args:Nu(o.arguments)||f.args}))}return t}function Pb(t){return Array.isArray(t)?t.filter(i=>typeof i=="string").join(""):""}function _1(t,i){const r=i.data??{},a=r.chunk;if(!a||typeof a!="object")return t;const o=at(r.turn),u=at(r.step),f=Fu(o,u),m=t.live[f]??{seq:i.seq??0,blocks:[]},p=a4(m.blocks,a),g={...t.live,[f]:{seq:m.seq||i.seq||0,blocks:p}},b=m.seq||i.seq||0;return{...t,live:g,drafting:!0,turn:o??t.turn,segments:r4({...t},f,p,b,o,u)}}function z1(t,i){const r=i.data??{},a=Vm(r),o=a?.content??[],u=at(r.turn),f=at(r.step),m=Fu(u,f),p={...t.live};delete p[m];let g=t.segments.filter(y=>!y.id.startsWith(`live:${m}:`));g=g.filter(y=>!((y.kind==="think"||y.kind==="assistant")&&y.turn===u&&y.step===f));const b=i.seq??0;return o.forEach((y,w)=>{const x=b+w/100;if(y.type==="reasoning"&&y.text?.trim())g.push({kind:"think",id:`think:${m}:${w}`,text:y.text,running:!1,seq:x,turn:u,step:f});else if(y.type==="text"&&y.text)g.push({kind:"assistant",id:`text:${m}:${w}`,text:y.text,streaming:!1,time:i.time,seq:x,turn:u,step:f,messageId:a?.id});else if(y.type==="tool-call"){const S=y.id||`call:${m}:${w}`,T=g.find(N=>N.kind==="tool"&&N.callId===S);g=g.filter(N=>!(N.kind==="tool"&&N.callId===S)),g.push({...T?.kind==="tool"?T:{},kind:"tool",id:`tool:${S}`,callId:S,name:T?.kind==="tool"&&T.callReceived?T.name:y.name||(T?.kind==="tool"?T.name:"")||"tool",args:T?.kind==="tool"&&T.callReceived?T.args:Nu(y.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?Gu(y.name||T.name,T.result,T.error,T.errorCode):T.status:"preparing",seq:x,turn:u,step:f})}}),{...t,live:p,segments:js(g)}}function s4(t,i){const r=i.data??{},a=typeof r.callId=="string"?r.callId:"";if(!a)return t;const o=at(r.turn),u=at(r.step);return{...t,segments:A1(t.segments,{kind:"tool",id:`tool:${a}`,callId:a,name:typeof r.name=="string"?r.name:"tool",args:Nu(r.arguments),status:t.turnEnds?.[o??-1]?"unknown":"waiting",callReceived:!0,callSeq:i.seq,requestedAt:i.time,result:"",error:!1,running:!0,seq:i.seq??Number.MAX_SAFE_INTEGER,turn:o,step:u})}}function o4(t,i){const r=i.data??{},a=Vm(r),o=a?.toolCallId??(typeof r.callId=="string"?r.callId:"");if(!o)return t;const u=C1(a?.content),f=at(r.turn),m=at(r.step),p=t.segments.find(g=>g.kind==="tool"&&g.callId===o);return{...t,segments:A1(t.segments,{kind:"tool",id:`tool:${o}`,callId:o,name:p?.kind==="tool"?p.name:"tool",args:p?.kind==="tool"?p.args:"",result:u,resultReceived:!0,resultSeq:i.seq,settledAt:i.time,meta:r.meta,errorCode:typeof r.error?.code=="string"?r.error.code:void 0,status:Gu(p?.kind==="tool"?p.name:"tool",u,a?.isError===!0,typeof r.error?.code=="string"?r.error.code:void 0),error:a?.isError===!0,running:!1,seq:p?.seq??i.seq??Number.MAX_SAFE_INTEGER,turn:f??(p?.kind==="tool"?p.turn:void 0),step:m??(p?.kind==="tool"?p.step:void 0)})}}function u4(t){if(!t||typeof t!="object")return null;const i=t,r=i.value;if(r&&typeof r=="object"&&!Array.isArray(r)){const a=r;if(typeof a.type=="string")return a}return typeof i.type=="string"?i:null}function R1(t,i){let r=i;for(const a of t.segments)a.seq>r&&(r=a.seq);return r+.5}function c4(t){if(!Array.isArray(t))return[];const i=[];for(const r of t){if(!r||typeof r!="object")continue;const a=r;if(a.type==="chunk"&&a.chunk&&typeof a.chunk=="object"){i.push({time:at(a.time)??0,chunk:a.chunk});continue}const o=at(a.index)??0,u=Array.isArray(a.texts)?a.texts:Array.isArray(a.args)?a.args:null;if(!u)continue;let f=at(a.time0)??0;const m=Array.isArray(a.dt)?a.dt:[];u.forEach((p,g)=>{g>0&&(f+=at(m[g-1])??0);const b=typeof p=="string"?p:"";a.type==="text-chunks"?i.push({time:f,chunk:{type:"text-delta",index:o,text:b}}):a.type==="reasoning-chunks"?i.push({time:f,chunk:{type:"reasoning-delta",index:o,text:b}}):a.type==="tool-call-chunks"&&i.push({time:f,chunk:{type:"tool-call-delta",index:o,id:typeof a.id=="string"?a.id:"",...typeof a.name=="string"?{name:a.name}:{},argumentsDelta:b}})})}return i}function q1(t,i,r,a,o,u){return _1(t,{seq:u,data:{turn:i,step:r,chunk:o}})}function mm(t,i,r,a=!1){const o=Fu(i,r),u={...t.live};return delete u[o],{...t,live:u,segments:t.segments.filter(f=>f.id.startsWith(`live:${o}:`)?f.kind==="tool"&&(f.callReceived===!0||f.resultReceived===!0):!(a&&f.kind!=="user"&&f.turn===i&&f.step===r&&(f.kind==="assistant"||f.kind==="think")))}}function f4(t,i){const r=t.streamAttempt;if(!r||i.surfaceOp!=null&&i.surfaceOp!=="append")return!1;const a=i.data??{};return at(a.turn)!==r.turn||at(a.step)!==r.step?!1:i.seq==null||i.seq>r.startedAfterSeq}function ps(t){const i=t.pendingAssistant;return{...i?z1(t,i):t,pendingAssistant:null,streamAttempt:null}}function d4(t,i,r){return{...t,streamAttempt:null,pendingAssistant:null,segments:t.segments.map(a=>a.kind==="user"||a.turn!==i||a.step!==r?a:a.kind==="think"?{...a,running:!1}:a.kind==="tool"?{...a,running:!1,status:a.resultReceived||!m1.has(Um(a))?a.status:"unknown"}:a.kind==="assistant"?{...a,streaming:!1}:a)}}function M1(t,i,r){return!!t.turnEnds?.[i]||t.segments.some(a=>a.kind!=="user"&&a.turn===i&&a.step===r&&(a.kind==="tool"?a.callReceived||a.resultReceived:a.kind==="assistant"?!a.id.startsWith("live:")&&!a.streaming:a.kind==="think"&&!a.id.startsWith("live:")&&!a.running))}function m4(t,i){const r=at(i.revision)??t.streamRevision;if(r<t.streamRevision)return t;let a={...t,streamRevision:r};const o=i.activeAttempt;if(!o||typeof o!="object")return{...a,streamAttempt:null};const u=o,f=typeof u.attemptId=="string"?u.attemptId:"",m=at(u.turn),p=at(u.step),g=at(u.startedAfterSeq)??r;if(!f||m==null||p==null)return{...a,streamAttempt:null};if(M1(a,m,p))return{...a,streamAttempt:null};a=mm(a,m,p);const b=c4(u.stream),y=Math.min(at(u.nextIndex)??b.length,b.length),w=R1(a,g);for(let x=0;x<y;x+=1){const S=b[x];S&&(a=q1(a,m,p,S.time,S.chunk,w))}return{...a,drafting:y>0||a.drafting,streamAttempt:{attemptId:f,turn:m,step:p,nextIndex:y,startedAfterSeq:g}}}function h4(t,i){const r=typeof i.type=="string"?i.type:"",a=at(i.revision),o=typeof i.attemptId=="string"?i.attemptId:"";if(a==null||!o||a<=t.streamRevision)return t;if(r==="start"){const f=at(i.turn),m=at(i.step);if(f==null||m==null||M1(t,f,m))return t;const p=t.pendingAssistant?ps(t):t;return{...mm(p,f,m,!0),drafting:!0,streamRevision:a,streamAttempt:{attemptId:o,turn:f,step:m,nextIndex:0,startedAfterSeq:at(i.startedAfterSeq)??t.streamRevision}}}if(a!==t.streamRevision+1)return{...ps(t),streamRevision:a};const u=t.streamAttempt;if(!u||t.turnEnds?.[u.turn]||u.attemptId!==o)return{...t,streamRevision:a};if(r==="chunk"){const f=at(i.index),m=i.chunk;if(f==null||!m||typeof m!="object")return{...t,streamRevision:a};if(f!==u.nextIndex)return{...ps(t),streamRevision:a};const p=Fu(u.turn,u.step),g=t.live[p]?.seq||R1(t,u.startedAfterSeq);return{...q1(t,u.turn,u.step,at(i.time)??0,m,g),streamRevision:a,streamAttempt:{...u,nextIndex:u.nextIndex+1}}}if(r==="end"){const f=i.outcome&&typeof i.outcome=="object"?i.outcome:{},m={...t,streamRevision:a};if(f.kind==="abandoned"){const p={...m,segments:m.segments.map(b=>b.kind==="tool"&&!b.callReceived&&!b.resultReceived&&b.turn===u.turn&&b.step===u.step?{...b,id:`tool:${b.callId}`,running:!1,status:"cancelled"}:b)};return{...mm(p,u.turn,u.step),streamAttempt:null,pendingAssistant:null}}return f.kind==="committed"&&f.eventType==="assistant/message"?{...ps(m),streamRevision:a}:{...d4(m,u.turn,u.step),streamRevision:a}}return{...t,streamRevision:a}}function p4(t,i,r=!1){const a=at(t.pendingAssistant?.data?.turn),o=t.pendingAssistant&&(i==null||a===i)?ps(t):t,u=Object.fromEntries(Object.entries(o.live).filter(([f])=>!f.startsWith(`${i??""}:`)));return{...o,live:u,segments:o.segments.filter(f=>!(typeof i=="number"&&f.id.startsWith(`live:${i}:`))||f.kind==="tool").map(f=>f.turn!==i?f:f.kind==="think"?{...f,running:!1}:f.kind==="tool"?{...f,running:!1,status:f.resultReceived||!m1.has(Um(f))?f.status:r&&!f.callReceived?"cancelled":"unknown"}:f.kind==="assistant"?{...f,streaming:!1}:f)}}function g4(t,i){const r=i.projections,a=r&&typeof r=="object"?r.values??{}:{},o={...t};typeof a.title=="string"&&(o.title=a.title);const u=a.modelSelection&&typeof a.modelSelection=="object"?a.modelSelection.lastUsed:void 0;u?.model&&(o.model=u.model);const f=a.permissions;if(f&&typeof f=="object"){const p=f,g=p.currentValue??p.preset??p.sandbox;typeof g=="string"&&(o.preset=g)}const m=a.sessionStats;if(m&&typeof m=="object"){const p=m.turns,g=m.steps;typeof p=="number"&&(o.turns=p),typeof g=="number"&&(o.steps=g)}return o}function y4(t,i){if(typeof i.type!="string")return t;let r=t;const a=i.data??{};if(i.type==="session/title"&&typeof a.title=="string"){const o=a.source&&typeof a.source=="object"?a.source.kind:"";return r.title&&o!=="provider"||(r={...r,title:a.title}),r}if(i.type==="request/context"){const o=typeof a.model=="string"?a.model:"";return o&&(r={...r,model:o}),r}if(i.type==="turn/start"){const o=at(a.turn);return r={...r,drafting:!0,turn:o??r.turn,turnStartedAt:typeof i.time=="number"?i.time:Date.now()},r}if(i.type==="turn/end"){const o=at(a.turn)??r.turn,u={...r.completed};o!=null&&r.turn===o&&r.turnStartedAt!=null&&typeof i.time=="number"&&(u[o]=Math.max(1,Math.round((i.time-r.turnStartedAt)/1e3)));const f=o==null?null:J3(a.reason),m=f==null||o==null?r.failures:{...r.failures,[o]:f},p=a.reason&&typeof a.reason=="object"&&typeof a.reason.kind=="string"?a.reason.kind:"",g=o==null?r.turnEnds??{}:{...r.turnEnds??{},[o]:p||r.turnEnds?.[o]||"ended"};return r=p4(r,o,p==="aborted"),r={...r,drafting:r.turn===o?!1:r.drafting,completed:u,failures:m,turnEnds:g,turnStartedAt:r.turn===o?null:r.turnStartedAt},r}if(i.type==="llm/retry"){const o=at(a.turn),u=typeof a.retryId=="string"?a.retryId:"",f=at(a.retry);if(o==null||u===""||f==null)return r;const m=a.failure&&typeof a.failure=="object"?a.failure:{},p={retryId:u,retry:f,maxRetries:at(a.maxRetries)??null,delayMs:typeof a.delayMs=="number"?a.delayMs:0,message:typeof m.message=="string"?m.message:"Request failed.",...typeof m.code=="string"?{code:m.code}:{},state:"scheduled"},g=r.retries[o]??[];return r={...r,retries:{...r.retries,[o]:[...g.filter(b=>b.retryId!==u||b.retry!==f),p]}},r}if(i.type==="llm/retry-started"){const o=at(a.turn),u=typeof a.retryId=="string"?a.retryId:"",f=at(a.retry);if(o==null||u===""||f==null)return r;const m=r.retries[o];return m&&(r={...r,retries:{...r.retries,[o]:m.map(p=>p.retryId===u&&p.retry===f?{...p,state:"started"}:p)}}),r}if(i.type==="assistant/live-chunk")return r=_1(r,i),r;if(i.type==="user/message"){const o=Vm(a);if(!o||o.source?.kind!=="user")return r;const u=C1(o.content);return u&&(r={...r,segments:P3(r.segments,{kind:"user",id:`user:${i.seq??u}`,text:u,time:i.time,seq:i.seq??Number.MAX_SAFE_INTEGER,turn:at(a.turn)})}),r}return i.type==="assistant/message"?(f4(r,i)?r={...r,pendingAssistant:i}:r=z1(r,i),r):i.type==="tool/call"?(r=s4(r,i),r):(i.type==="tool/result"&&(r=o4(r,i)),r)}function b4(t,i){const r=u4(i)??(i&&typeof i=="object"?i:null);if(!r)return t;let a=t;if(r.type==="snapshot"){a=g4(a,r);const o=r.assistantStream;o&&typeof o=="object"&&(a=m4(a,o))}if(r.type==="assistant-stream"){const o=r.frame;o&&typeof o=="object"&&(a=h4(a,o))}return a}function v4(t){for(let i=t.length-1;i>=0;i-=1){const r=t[i];if(!r||r.kind==="user"&&Lv(r.text))continue;const a=r.kind==="user"?Yu(r.text):null,o=r.kind==="user"?gm(r.text):null,f=(a?a.body:o?.body?o.body:r.kind==="user"||r.kind==="assistant"?r.text:r.kind==="tool"?r.result||W3(r.name,r.args):l4(r.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 Ou(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Wb(t,i){if(!Ou(t))return;if(i==="ticket.id"){const a=t.ticket;if(!Ou(a))return;const o=a.id;return typeof o=="string"&&o!==""?o:void 0}const r=t[i];if(typeof r=="string"&&r!=="")return r;if(typeof r=="number"&&Number.isFinite(r))return String(r)}function Cs(t,i){if(!Ou(i)||i.t!=="v"&&i.t!=="o"&&i.t!=="l")return t;const r=i;return r.t==="v"?r.v:r.t==="o"?x4(t,r):w4(t,r)}function x4(t,i){const r=Ou(t)?{...t}:{};for(const a of i.d??[])delete r[a];for(const[a,o]of Object.entries(i.s))r[a]=Cs(r[a],o);return r}function w4(t,i){const r=i.id,a=Array.isArray(t)?t.slice():[],o=new Set(i.d??[]),u=[],f=new Map;for(const p of a){const g=Wb(p,r);g!==void 0&&o.has(g)||(g!==void 0&&f.set(g,u.length),u.push(p))}for(const[p,g]of Object.entries(i.s??{})){const b=f.get(p);if(b===void 0){u.push(Cs(void 0,g));continue}u[b]=Cs(u[b],g)}if(!i.order)return u;const m=new Map;for(const p of u){const g=Wb(p,r);g!==void 0&&m.set(g,p)}return i.order.filter(p=>m.has(p)).map(p=>m.get(p))}const S4=1,k4=500,E4={minMessages:50,minTurns:2},T4=500,j4=2e3,C4=256*1024,N4=6,A4=3,O4=5e3,_4=8*1024*1024,z4=2e3,R4=500,q4=1e4,Vd=3,D1=64*1024*1024,L1="/api/dsh-bot/log/range",M4="/api/dsh-bot/log/manifest",D4="/api/dsh-bot/log/chunk",L4="/api/session/events",B4=3e3,U4=3e4,H4=1e3,I4=15e3;class V4{appliedSeq;headSeq=null;pending=new Map;pendingBytes=0;constructor(i=-1){this.appliedSeq=i}setHead(i){(this.headSeq==null||i>this.headSeq)&&(this.headSeq=i)}push(i){const r=[];for(const u of i)if(!(typeof u.seq!="number"||!Number.isFinite(u.seq))&&!(u.seq<=this.appliedSeq)){if(u.seq===this.appliedSeq+1){r.push(u),this.appliedSeq=u.seq,this.flushPending(r);continue}this.pending.has(u.seq)||(this.pending.set(u.seq,u),this.pendingBytes+=ev(u))}let a=null;(this.pending.size>O4||this.pendingBytes>_4)&&(a={afterSeq:this.appliedSeq,dropped:this.pending.size},this.pending.clear(),this.pendingBytes=0);const o=this.nextGap();return{delivered:r,gapTo:o,overflow:a}}flushPending(i){for(;this.pending.has(this.appliedSeq+1);){const r=this.pending.get(this.appliedSeq+1);if(this.pending.delete(this.appliedSeq+1),!r)break;this.pendingBytes=Math.max(0,this.pendingBytes-ev(r)),i.push(r),this.appliedSeq=r.seq}}nextGap(){if(this.pending.size===0)return null;let i=Number.POSITIVE_INFINITY;for(const r of this.pending.keys())r<i&&(i=r);return Number.isFinite(i)?i:null}}function ev(t){return 64+(typeof t.type=="string"?t.type.length:0)}function ra(t,i){return{kind:"session",sessionId:t}}function tv(t){const i=t.addressOf??(a=>ra(a)),r=t.openingMessages??S4;return{kind:"ws-follow",open(a,o,u){return new Promise(f=>{const m=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",p=typeof location<"u"?location.host:"127.0.0.1",g=t.url??`${m}//${p}/api/remote.mux`,b=(t.websocket??(N=>new WebSocket(N)))(g),y=`follow-${Math.random().toString(36).slice(2)}`;let w=!1;const x=()=>!w&&b.readyState===1,S=N=>{if(!w){w=!0,u.removeEventListener("abort",T);try{b.close()}catch{}f(N)}},T=()=>S({ok:!1,retryable:!1,code:"ABORTED"});u.addEventListener("abort",T),b.addEventListener("open",()=>{u.aborted||b.send(JSON.stringify({type:"open",streamId:y,endpoint:"session/follow",payload:{args:{request:{address:i(a.sessionId),maxMessages:r,assistantStream:!0,activate:!0}}}}))}),b.addEventListener("message",N=>{let E;try{E=JSON.parse(String(N.data))}catch{return}if(E.streamId===y){if(E.type==="error"){S({ok:!1,retryable:!0,code:"FOLLOW_ERROR",message:E.error?.message});return}if(E.type==="end"){S({ok:!0,throughSeq:-1});return}E.type==="item"&&Y4(E.value,o,x)}}),b.addEventListener("close",()=>S({ok:!1,retryable:!0,code:"FOLLOW_CLOSED"})),b.addEventListener("error",()=>S({ok:!1,retryable:!0,code:"FOLLOW_ERROR"}))})}}}function Y4(t,i,r){const a=B1(t);if(!a)return;if(a.type==="snapshot"){const u=typeof a.cursor=="number"?a.cursor:-1,f=Ns(a.records),m=f.length>0?Math.min(...f.map(g=>g.seq)):u+1,p=a.hasMore===!0;i.opened({firstSeq:m,cursor:u,hasMore:p,...r?{alive:r}:{}}),i.head(u),f.length&&i.events(f),i.ephemeral(a);return}if(a.type==="assistant-stream"){i.ephemeral(a);return}const o=Ns(a);o.length&&i.events(o)}function B1(t){if(!t||typeof t!="object")return null;const i=t;if(typeof i.type=="string"&&(i.type==="snapshot"||i.type==="assistant-stream"||i.type==="event"))return i;const r=i.value;return r&&typeof r=="object"&&!Array.isArray(r)?B1(r):i}function Ns(t){const i=[];return bu(t,i),i.sort((r,a)=>r.seq-a.seq)}function bu(t,i){if(!t)return;if(Array.isArray(t)){for(const o of t)bu(o,i);return}if(typeof t!="object")return;const r=t;if(r.event&&typeof r.event=="object"){const o=nv(r.event);o&&i.push(o);return}const a=nv(r);a&&i.push(a),Array.isArray(r.records)&&bu(r.records,i),Array.isArray(r.events)&&bu(r.events,i)}function nv(t){if(!t||typeof t!="object")return null;const i=t;return typeof i.type!="string"||typeof i.seq!="number"?null:{type:i.type,seq:i.seq,time:typeof i.time=="number"?i.time:0,data:i.data,...i.surfaceOp!==void 0?{surfaceOp:i.surfaceOp}:{},...i.sourceEventSeqs!==void 0?{sourceEventSeqs:i.sourceEventSeqs}:{}}}function iv(t={}){const i=t.fetch??fetch,r=t.url??L1;return{kind:"plugin-range",async fetch(a,o,u){if(a.throughSeq<=a.afterSeq)return{ok:!0,throughSeq:a.throughSeq};let f=a.afterSeq;try{for(;!u.aborted;){const m=new URLSearchParams({sessionId:a.sessionId,afterSeq:String(f),throughSeq:String(a.throughSeq),limit:String(T4)}),p=await i(`${r}?${m}`,{method:"GET",credentials:"same-origin",signal:u,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(),b=Ns(g.events);if(b.length&&o.events(b,{throughSeq:a.throughSeq}),g.nextAfterSeq==null)return{ok:!0,throughSeq:a.throughSeq};if(g.nextAfterSeq<=f)return{ok:!1,retryable:!0,code:"RANGE_STALLED"};f=g.nextAfterSeq}return{ok:!1,retryable:!1,code:"ABORTED"}}catch(m){return u.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"RANGE_ERROR",message:m instanceof Error?m.message:String(m)}}}}}async function G4(t=fetch,i=L1,r){try{return(await t(i,{method:"HEAD",credentials:"same-origin",signal:r})).ok}catch{return!1}}const F4=t=>{if(typeof document>"u"||typeof window>"u")return()=>{};let i=document.visibilityState==="hidden"?Date.now():null;const r=()=>i==null?0:Math.max(0,Date.now()-i),a=()=>{if(document.visibilityState==="hidden"){i==null&&(i=Date.now());return}const p=r();i=null,t({reason:"visible",hiddenMs:p})},o=()=>{i==null&&(i=Date.now())},u=p=>{const g=r();i=null,t({reason:"pageshow",hiddenMs:g,persisted:p.persisted})},f=()=>t({reason:"online",hiddenMs:r()}),m=()=>{if(document.visibilityState==="hidden")return;const p=r();i=null,t({reason:"focus",hiddenMs:p})};return document.addEventListener("visibilitychange",a),window.addEventListener("pagehide",o),window.addEventListener("pageshow",u),window.addEventListener("online",f),window.addEventListener("focus",m),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",o),window.removeEventListener("pageshow",u),window.removeEventListener("online",f),window.removeEventListener("focus",m)}};function Q4(){return typeof document<"u"&&document.visibilityState==="hidden"}function lv(t){return{open(i,r){return X4(t,i,r??{})}}}function X4(t,i,r){const a=new AbortController,o=new Set,u=new Set,f=new Set;let m={phase:"restoring",appliedSeq:-1,headSeq:null,lag:null,fraction:null},p;const g=new Promise($=>{p=$});let b=!1;const y=$=>{b||(b=!0,p($))};let w=[],x=!1,S=null;const T=t.raf??(typeof requestAnimationFrame=="function"?requestAnimationFrame:$=>setTimeout($,0)),N=t.cancelRaf??(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout),E=()=>{S!=null&&(S.kind==="timer"?clearTimeout(S.id):N(S.id),S=null)},M=t.wait??K4,H=t.random??Math.random,te=t.now??Date.now,ie=t.isHidden??Q4,O=()=>{if(S=null,w.length===0)return;const $=w;w=[];const me={events:$,fromCache:x};x=!1;for(const Ze of o)Ze(me)},Q=()=>{E(),O()},re=($,me=!1)=>{if($.length===0||(me&&(x=!0),w.push(...$),S!=null))return;const Ze={kind:ie()?"timer":"raf",id:null};S=Ze,Ze.id=Ze.kind==="timer"?setTimeout(O,0):T(O)},pe=$=>{m={...m,...$,lag:($.headSeq??m.headSeq)==null||($.appliedSeq??m.appliedSeq)==null?$.lag??m.lag:($.headSeq??m.headSeq)-($.appliedSeq??m.appliedSeq)};for(const me of f)me(m)};let z=0,Z=!1,W=0,je=!0,qe=null,le=!1,G=null,ae=null,se=!1,Ne=te(),A=Number.NEGATIVE_INFINITY;const et=async $=>{if(a.signal.aborted)return;if(le){le=!1;return}const me=new AbortController;qe=me;const Ze=()=>me.abort();a.signal.addEventListener("abort",Ze,{once:!0});try{await M($,me.signal)}catch{}finally{a.signal.removeEventListener("abort",Ze),qe===me&&(qe=null)}},ct=()=>{const $=se;return se=!1,$},q=$=>{if(!je||a.signal.aborted)return;Q();const me=te(),Ze=ae?ae():!0,Ke=me-Ne>=U4,ke=!Ze||$.reason==="online"||$.persisted===!0||$.hiddenMs>=B4||$.reason!=="focus"&&Ke;if(W=0,z=0,Z=!1,qe){qe.abort();return}if(!G){le=!0;return}ke&&(me-A<H4||(A=me,G.signal.aborted||(se=!0,G.abort())))};R();async function R(){try{await ne()}finally{je=!1,Se()}}async function ne(){const $=await t.checkpoint.getCursor(i);let me=$?.appliedSeq??-1;const Ze=await t.checkpoint.readEvents(i,-1),Ke=Z4(Ze,-1).filter(ze=>ze.seq<=me||me<0);me<0&&Ke.length&&(me=Ke[Ke.length-1].seq);const ke=new V4(me);$?.headSeq!=null&&ke.setHead($.headSeq),Ke.length&&re(Ke,!0),pe({phase:"connecting",appliedSeq:ke.appliedSeq,headSeq:ke.headSeq});let $e=r.enhancement==="off"?!1:await de();const Fe=()=>({events(ze){const Ye=ke.push(ze);ke.headSeq!=null&&ke.appliedSeq>ke.headSeq&&ke.setHead(ke.appliedSeq),Ye.delivered.length&&(re(Ye.delivered),t.checkpoint.putEvents(i,Ye.delivered),t.checkpoint.setCursor(i,ke.appliedSeq,ke.headSeq)),pe({appliedSeq:ke.appliedSeq,headSeq:ke.headSeq,fraction:m.fraction}),Ye.overflow},head(ze){ke.setHead(ze),pe({headSeq:ke.headSeq,appliedSeq:ke.appliedSeq})},progress(ze){const Ye=ze.total&&ze.total>0?Math.min(1,ze.loaded/ze.total):null;pe({fraction:Ye,appliedSeq:ke.appliedSeq,headSeq:ke.headSeq})},ephemeral(ze){for(const Ye of u)Ye(ze)},opened(){}}),Ue=async(ze,Ye,gt)=>{if(Ye<=ze)return{ok:!0,throughSeq:Ye};pe({phase:"syncing",fraction:m.fraction});const fe=Ye-ze,De=Fe(),yt=$e&&t.cdc!=null&&(fe>j4||fe*128>C4);if($e&&t.range!=null&&!yt&&t.range){const Mt=await t.range.fetch({sessionId:i,afterSeq:ze,throughSeq:Ye},De,gt);if(Mt.ok||gt.aborted)return Mt;$e=!1}else if(yt&&t.cdc){const Mt=await t.cdc.fetch({sessionId:i,afterSeq:ze,throughSeq:Ye},De,gt);if(Mt.ok||gt.aborted)return Mt;$e=!1}return t.page.fetch({sessionId:i,afterSeq:ke.appliedSeq,throughSeq:Ye},De,gt)};for(;!a.signal.aborted;){if(Z){pe({phase:"stalled",appliedSeq:ke.appliedSeq,headSeq:ke.headSeq,fraction:null});const ve=new AbortController,ht=()=>ve.abort();a.signal.addEventListener("abort",ht);const Qt=ke.headSeq??ke.appliedSeq,tn=await t.page.fetch({sessionId:i,afterSeq:ke.appliedSeq,throughSeq:Math.max(Qt,ke.appliedSeq)},Fe(),ve.signal);a.signal.removeEventListener("abort",ht),tn.ok&&ke.headSeq!=null&&ke.appliedSeq>=ke.headSeq&&(pe({phase:"live",appliedSeq:ke.appliedSeq,headSeq:ke.headSeq,fraction:null,error:void 0}),y({ok:!0,caughtUpTo:ke.appliedSeq})),W+=1;const sn=hu(W,H);await et(Math.min(sn,z4)),Z=z>=Vd}if(a.signal.aborted)break;pe({phase:m.phase==="restoring"?"connecting":m.phase==="live"?"syncing":"connecting"});const ze=new AbortController;G=ze,ae=null;const Ye=()=>ze.abort();a.signal.addEventListener("abort",Ye);const gt=()=>{a.signal.removeEventListener("abort",Ye),ze.abort(),G===ze&&(G=null,ae=null)};let fe=null;const De=Fe(),yt=()=>{G===ze&&(Ne=te())},bn={events(ve,ht){yt(),De.events(ve,ht)},head(ve){yt(),De.head(ve)},progress:De.progress,ephemeral(ve){yt(),De.ephemeral(ve)},opened(ve){yt(),fe=ve,G===ze&&(ae=ve.alive??null),ke.setHead(ve.cursor),pe({headSeq:ve.cursor,appliedSeq:ke.appliedSeq,phase:"syncing"})}},Mt=t.follow.open({sessionId:i},bn,ze.signal),X=await Promise.race([Mt.then(ve=>({kind:"done",outcome:ve})),$4(()=>fe!=null,ze.signal,M).then(()=>({kind:"opened"}))]),oe=fe;if(X.kind==="done"||oe==null||ze.signal.aborted){if(gt(),a.signal.aborted)break;if(ct())continue;z+=1,z>=Vd&&(Z=!0),W+=1,await et(hu(W,H));continue}z=0,W=0;const be=oe.firstSeq-1,we=await Ue(ke.appliedSeq,be,ze.signal);if(ze.signal.aborted){if(gt(),a.signal.aborted)break;ct();continue}if(!we.ok&&!we.retryable){pe({phase:"error",error:{code:we.code,message:we.message??we.code,retrying:!1},appliedSeq:ke.appliedSeq,headSeq:ke.headSeq}),y({ok:!1,code:we.code,message:we.message??we.code}),gt();break}if(!we.ok){gt(),pe({phase:"stalled",error:{code:we.code,message:we.message??we.code,retrying:!0},appliedSeq:ke.appliedSeq,headSeq:ke.headSeq}),W+=1,await et(hu(W,H));continue}pe({phase:"live",appliedSeq:ke.appliedSeq,headSeq:ke.headSeq,fraction:null,error:void 0}),ke.appliedSeq>=be&&y({ok:!0,caughtUpTo:ke.appliedSeq});const Ge=await Mt;if(gt(),a.signal.aborted)break;ct()||Ge.ok||(z+=1,z>=Vd&&(Z=!0),pe({phase:"stalled",error:{code:Ge.code,message:Ge.message??Ge.code,retrying:!0}}),W+=1,await et(hu(W,H)))}m.phase!=="error"&&pe({phase:"closed"}),E()}async function de(){return r.enhancement==="off"||!t.cdc&&!t.range?!1:t.probe?t.probe():G4()}const ye=(t.onResume??F4)(q),Oe=t.livenessMs===void 0?I4:t.livenessMs;let Ce=null;Oe!==!1&&Oe>0&&(Ce=setInterval(()=>{ie()||!G||!ae||ae()||q({reason:"liveness",hiddenMs:0})},Oe),Ce.unref?.());function Se(){Ce!=null&&clearInterval(Ce),Ce=null}return{onBatch($){return o.add($),()=>o.delete($)},onEphemeral($){return u.add($),()=>u.delete($)},onStatus($){return f.add($),$(m),()=>f.delete($)},get status(){return m},ready:g,close(){ye(),Se(),a.abort(),E(),pe({phase:"closed"})}}}function Z4(t,i){const r=[...t].sort((u,f)=>u.seq-f.seq),a=[];let o=i+1;for(const u of r)if(!(u.seq<o)){if(u.seq!==o)break;a.push(u),o=u.seq+1}return a}function hu(t,i){return Math.min(q4,R4*2**Math.max(0,t-1))*(.5+i()*.5)}function K4(t,i){return new Promise((r,a)=>{const o=setTimeout(()=>{i.removeEventListener("abort",u),r()},t),u=()=>{clearTimeout(o),a(new DOMException("Aborted","AbortError"))};i.aborted?u():i.addEventListener("abort",u,{once:!0})})}async function $4(t,i,r){for(;!t()&&!i.aborted;)await r(5,i).catch(()=>{})}function rv(t={}){const i=t.addressOf??(u=>ra(u)),r=t.fetch??fetch,a=t.url??L4,o=t.maxMessages??k4;return{kind:"official-page",async fetch(u,f,m){if(u.throughSeq<=u.afterSeq)return{ok:!0,throughSeq:u.throughSeq};let p=u.throughSeq+1,g=0;const b=u.throughSeq-u.afterSeq;f.progress({loaded:0,total:b,unit:"events"});try{for(;!m.aborted;){const y=await J4(r,a,{address:i(u.sessionId),throughSeq:u.throughSeq,beforeSeq:p,maxMessages:o,turnWindow:E4},m);if(!y.ok)return y;const w=Ns(y.records);w.length&&f.events(w,{throughSeq:u.throughSeq}),g+=w.length,f.progress({loaded:g,total:b,unit:"events"});const x=w.reduce((S,T)=>Math.min(S,T.seq),Number.POSITIVE_INFINITY);if(!y.hasMore||!Number.isFinite(x)||x<=u.afterSeq+1)break;if(x>=p)return{ok:!1,retryable:!0,code:"PAGE_STALLED",message:"Official page did not move."};p=x}return m.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!0,throughSeq:u.throughSeq}}catch(y){return m.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"PAGE_ERROR",message:y instanceof Error?y.message:String(y)}}}}}async function J4(t,i,r,a){const o=await t(i,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",signal:a,body:JSON.stringify({type:"client-request",rpcId:crypto.randomUUID(),method:"session/events",payload:{args:{request:r}}})});let u=null;try{u=await o.json()}catch{u=null}if(!o.ok||u?.result?.ok===!1)return{ok:!1,retryable:o.status>=500||o.status===0,code:"PAGE_ERROR",message:u?.result?.error?.message??`session/events HTTP ${o.status}`};const f=u?.result?.value??u?.result??u;return{ok:!0,records:f?.records??f?.events??f,hasMore:f?.hasMore===!0,cursor:f?.cursor}}async function av(t){const i=await crypto.subtle.digest("SHA-256",t);return[...new Uint8Array(i)].map(r=>r.toString(16).padStart(2,"0")).join("")}function sv(t){const i=t.fetch??fetch,r=t.concurrency??N4,a=t.retries??A4,o=t.manifestUrl??M4,u=t.chunkUrl??D4,f=t.wait??tO;return{kind:"cdc-snapshot",async fetch(m,p,g){if(m.throughSeq<=m.afterSeq)return{ok:!0,throughSeq:m.throughSeq};const b=new AbortController,y=()=>b.abort();g.addEventListener("abort",y);try{const w=await P4(i,o,m,b.signal);return w.ok?await W4({manifest:w.value,afterSeq:m.afterSeq,throughSeq:m.throughSeq,sink:p,cache:t.cache,fetchImpl:i,chunkUrl:u,concurrency:r,retries:a,wait:f,signal:b.signal}):w}catch(w){return g.aborted||b.signal.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"CDC_ERROR",message:w instanceof Error?w.message:String(w)}}finally{g.removeEventListener("abort",y),b.signal.aborted||b.abort()}}}}async function P4(t,i,r,a){const o=new URLSearchParams({sessionId:r.sessionId,throughSeq:String(r.throughSeq),afterSeq:String(r.afterSeq)}),u=await t(`${i}?${o}`,{method:"GET",credentials:"same-origin",signal:a,headers:{accept:"application/json"}});if(u.status===404)return{ok:!1,retryable:!1,code:"ENHANCE_UNAVAILABLE"};if(!u.ok)return{ok:!1,retryable:u.status>=500,code:"CDC_MANIFEST",message:`HTTP ${u.status}`};const f=await u.json();return Array.isArray(f.chunks)?{ok:!0,value:f}:{ok:!1,retryable:!0,code:"CDC_MANIFEST"}}async function W4(t){const i=[...t.manifest.chunks].sort((N,E)=>N.fromSeq-E.fromSeq),r=new Map;let a=0;const o=t.manifest.totalSize;t.sink.progress({loaded:a,total:o,unit:"bytes"}),t.sink.head(t.manifest.throughSeq);let u=0;const f=()=>{for(;u<i.length;){const N=i[u];if(!N||!r.has(N.fromSeq))break;const E=(r.get(N.fromSeq)??[]).filter(M=>M.seq>t.afterSeq&&M.seq<=t.throughSeq);E.length&&t.sink.events(E,{throughSeq:t.throughSeq}),u+=1}},m=[];for(const N of i){const E=await t.cache.getChunk(N.hash);E&&await av(E)===N.hash?(r.set(N.fromSeq,ov(E)),a+=N.bytes,t.sink.progress({loaded:a,total:o,unit:"bytes"}),f()):m.push(N)}if(m.length===0)return f(),{ok:!0,throughSeq:t.throughSeq};let p=0,g=0,b=null,y=null;const w=()=>{const N=y;y=null,N?.()},x=()=>new Promise(N=>{if(g===0){N();return}y=N}),S=async N=>{for(let E=0;E<t.retries;E+=1){if(t.signal.aborted||b)return;try{const M=await eO(t.fetchImpl,t.chunkUrl,t.manifest.sessionId,N,t.signal);if(await av(M)!==N.hash)throw new Error("hash mismatch");await t.cache.putChunk(N.hash,M),r.set(N.fromSeq,ov(M)),a+=N.bytes,t.sink.progress({loaded:a,total:o,unit:"bytes"}),f();return}catch(M){if(t.signal.aborted||b)return;if(E+1>=t.retries){b={ok:!1,retryable:!0,code:"CDC_CHUNK_FAILED",message:M instanceof Error?M.message:String(M)};return}await t.wait(50*2**E,t.signal).catch(()=>{})}}},T=()=>{for(;!b&&!t.signal.aborted&&g<t.concurrency&&p<m.length;){const N=m[p];if(p+=1,!N)break;g+=1,S(N).finally(()=>{g-=1,w()})}};for(T();g>0&&!t.signal.aborted;)T(),g>0&&await x();return t.signal.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:b||(f(),{ok:!0,throughSeq:t.throughSeq})}async function eO(t,i,r,a,o){const u=new URLSearchParams({sessionId:r,fromSeq:String(a.fromSeq),toSeq:String(a.toSeq),hash:a.hash}),f=await t(`${i}?${u}`,{method:"GET",credentials:"same-origin",signal:o});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 ov(t){const i=new TextDecoder().decode(t),r=[];for(const a of i.split(`
|
|
59
|
-
`))if(a.trim()!=="")try{r.push(...Ns(JSON.parse(a)))}catch{}return r.sort((a,o)=>a.seq-o.seq)}function tO(t,i){return new Promise((r,a)=>{const o=setTimeout(()=>{i.removeEventListener("abort",u),r()},t),u=()=>{clearTimeout(o),a(new DOMException("Aborted","AbortError"))};i.aborted?u():i.addEventListener("abort",u,{once:!0})})}const nO="dsh-bot",iO=2,lO=["log_chunks","log_events","log_cursors"];function rO(t){const i=globalThis.indexedDB;return i?new Promise(r=>{let a=!1;const o=u=>{a||(a=!0,r(u))};try{const u=i.open(nO,iO);u.onupgradeneeded=f=>{const m=u.result;if(f.oldVersion<2){for(const g of["chunks","events"])m.objectStoreNames.contains(g)&&m.deleteObjectStore(g);m.objectStoreNames.contains("log_chunks")||m.createObjectStore("log_chunks").createIndex("byLastUsed","lastUsed"),m.objectStoreNames.contains("log_events")||m.createObjectStore("log_events",{keyPath:["sessionId","seq"]}).createIndex("bySession","sessionId"),m.objectStoreNames.contains("log_cursors")||m.createObjectStore("log_cursors",{keyPath:"sessionId"})}},u.onblocked=()=>o({ok:!1,reason:"blocked"}),u.onsuccess=()=>{const f=u.result;if(f.onversionchange=()=>f.close(),!lO.every(m=>f.objectStoreNames.contains(m))){f.close(),o({ok:!1,reason:"unavailable"});return}o({ok:!0,db:f})},u.onerror=()=>o({ok:!1,reason:"unavailable"})}catch{o({ok:!1,reason:"unavailable"})}}):Promise.resolve({ok:!1,reason:"unavailable"})}function aO(){const t=new Map,i=new Map,r=new Map;let a=0;const o=()=>{const u=[...r.entries()].sort((f,m)=>f[1].lastUsed-m[1].lastUsed);for(;a>D1&&u.length>0;){const f=u.shift();if(!f)break;r.delete(f[0]),a-=f[1].bytes.byteLength}};return{mode:"memory",async getCursor(u){return t.get(u)??null},async setCursor(u,f,m){const p=t.get(u),g=p?Math.max(p.appliedSeq,f):f,b=m==null?p?.headSeq??null:Math.max(p?.headSeq??m,m);t.set(u,{appliedSeq:g,headSeq:b})},async putEvents(u,f){const m=i.get(u)??new Map;for(const p of f)m.set(p.seq,p);i.set(u,m)},async readEvents(u,f=-1){const m=i.get(u);return m?[...m.values()].filter(p=>p.seq>f).sort((p,g)=>p.seq-g.seq):[]},async getChunk(u){const f=r.get(u);return f?(f.lastUsed=Date.now(),f.bytes):null},async putChunk(u,f){const m=r.get(u);m&&(a-=m.bytes.byteLength),r.set(u,{bytes:f,lastUsed:Date.now()}),a+=f.byteLength,o()}}}async function uv(t){const i=await oO(t);if(i.ok!==!0)return aO();const r=i.db;return{mode:"idb",async getCursor(a){return rr(r,"log_cursors","readonly",o=>fi(o.get(a))).then(o=>o?{appliedSeq:o.appliedSeq,headSeq:o.headSeq??null}:null)},async setCursor(a,o,u){await rr(r,"log_cursors","readwrite",async f=>{const m=await fi(f.get(a)),p=m?Math.max(m.appliedSeq,o):o,g=u==null?m?.headSeq??null:Math.max(m?.headSeq??u,u);await fi(f.put({sessionId:a,appliedSeq:p,headSeq:g,updatedAt:Date.now()}))})},async putEvents(a,o){await rr(r,"log_events","readwrite",async u=>{for(const f of o)await fi(u.put({sessionId:a,seq:f.seq,event:f}))})},async readEvents(a,o=-1){return(await rr(r,"log_events","readonly",f=>{const m=f.index("bySession");return fi(m.getAll(a))})).map(f=>f.event).filter(f=>f&&f.seq>o).sort((f,m)=>f.seq-m.seq)},async getChunk(a){const o=await rr(r,"log_chunks","readonly",u=>fi(u.get(a)));return o?.bytes?(rr(r,"log_chunks","readwrite",u=>fi(u.put({...o,lastUsed:Date.now()},a))),o.bytes):null},async putChunk(a,o){await rr(r,"log_chunks","readwrite",async u=>{await fi(u.put({bytes:o,lastUsed:Date.now()},a)),await sO(u)})}}}async function sO(t){const i=t.index("byLastUsed"),r=await fi(i.getAll()),a=await fi(i.getAllKeys());let o=r.reduce((u,f)=>u+(f.bytes?.byteLength??0),0);for(let u=0;u<r.length&&o>D1;u+=1){const f=a[u],m=r[u];f==null||!m||(o-=m.bytes.byteLength,await fi(t.delete(f)))}}function oO(t){try{return rO(t)}catch{return Promise.resolve({ok:!1,reason:"unavailable"})}}function rr(t,i,r,a){return new Promise((o,u)=>{const f=t.transaction(i,r),m=f.objectStore(i);Promise.resolve(a(m)).then(o,u),f.onerror=()=>u(f.error)})}function fi(t){return new Promise((i,r)=>{t.onsuccess=()=>i(t.result),t.onerror=()=>r(t.error)})}function uO(t,i){const r=Math.max(0,Math.min(i,t.length)),a=/(?:^|\s)@([^\s@()]*)$/.exec(t.slice(0,r));if(!a||a.index==null)return null;const o=a[1]??"";return{start:a.index+a[0].length-o.length-1,query:o}}function cO(t){return t.replace(/[@()\r\n]/g," ").replace(/\s+/g," ").trim()||"Untitled"}function fO(t,i){return`@${cO(t)} (${i})`}function dO(t,i,r,a,o){const u=Math.max(0,Math.min(i,t.length)),f=`${fO(a,o)} `;return{text:t.slice(0,r)+f+t.slice(u),cursor:r+f.length}}function mO(t,i){const r=i.trim().toLowerCase();return t.filter(a=>r===""?!0:a.label.toLowerCase().includes(r)||a.sessionId.toLowerCase().includes(r)).slice(0,8)}const Yd=()=>({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 _u(t,i,r){return rk(t,i,r)}function hO({active:t,progress:i}){const{t:r}=We(),[a,o]=C.useState(t),[u,f]=C.useState(!1);if(C.useEffect(()=>{if(t){o(!0);return}f(!1)},[t]),C.useEffect(()=>{if(!a||!t)return;const g=window.requestAnimationFrame(()=>f(!0));return()=>window.cancelAnimationFrame(g)},[a,t]),C.useEffect(()=>{if(t||!a)return;const g=window.setTimeout(()=>o(!1),280);return()=>window.clearTimeout(g)},[t,a]),!a)return null;const m=i!=null&&i.total>0,p=m?Math.min(100,Math.round(i.loaded/i.total*100)):0;return h.jsx("div",{className:u?"chunk-loading visible":"chunk-loading",role:"status",children:h.jsxs("div",{className:"chunk-loading-card",children:[h.jsx("p",{children:h.jsx("span",{className:"shimmer",children:m?r("load.messagesPct",{pct:String(p)}):r("load.messages")})}),h.jsx("div",{className:"chunk-progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":m?i.total:1,"aria-valuenow":m?i.loaded:0,"aria-label":r("load.aria"),children:h.jsx("div",{className:m?"chunk-progress-fill":"chunk-progress-fill indeterminate",style:m?{width:`${p}%`}:void 0})})]})})}function cv({signal:t}){const{t:i}=We();if(!t)return null;const r=t==="wait";return h.jsx("span",{className:r?"bot-dot wait":"bot-dot",role:"img","aria-label":i(r?"bot.waiting":"bot.running")})}function pO(t){const i=[];return t.turns!=null&&i.push(`${t.turns} turns`),t.steps!=null&&i.push(`${t.steps} steps`),i.join(" · ")}function gO({health:t,usage:i,execution:r,model:a}){const{t:o}=We(),u=t?.primary?.reachable===!0,f=i&&"code"in i&&typeof i.code=="string"?i.code:"";return h.jsxs("div",{className:"status",children:[h.jsx("p",{children:o(u?"health.up":"health.down")}),a?h.jsx("p",{className:"muted",children:a}):null,h.jsx("p",{className:r.ready?"":"muted",children:r.ready?o("health.modelReady"):_u(r.reason,r.reason,o)}),h.jsx("p",{className:i?.connected?"":"muted",children:i?.connected?o("health.usageReady"):_u(f,i?.error||o("health.usageOff"),o)}),h.jsx("p",{className:"muted",children:o("health.sameSession")})]})}function yO(){return h.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[h.jsx("circle",{cx:"11",cy:"11",r:"6.25",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),h.jsx("path",{d:"M16 16.5L20 20.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})}function fv(){return h.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:h.jsx("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function bO({preset:t}){return t==="read-only"||t==="readonly"||t==="danger-full-access"||t==="auto"?h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.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"}),t==="danger-full-access"?h.jsx("path",{d:"M8 4.4V9.9M8 10.8V11.8",fill:"none",stroke:"currentColor"}):null,t==="read-only"||t==="readonly"?h.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]}):h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.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"}),h.jsx("path",{d:"M5.26 6.6H10.74M5.26 9.87H8.33",fill:"none",stroke:"currentColor"}),h.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 vO(){return h.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:h.jsx("path",{d:"M12 17V7M7 11.5L12 6.5l5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function Qu({open:t,children:i,className:r}){const[a,o]=C.useState(t),[u,f]=C.useState(t);C.useLayoutEffect(()=>{if(t){o(!0);const g=requestAnimationFrame(()=>f(!0));return()=>cancelAnimationFrame(g)}f(!1),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&o(!1)},[t]);function m(g){g.target!==g.currentTarget||g.propertyName!=="grid-template-rows"||t||o(!1)}const p=["coll-container",u?"expand":"",r].filter(Boolean).join(" ");return h.jsx("div",{className:p,onTransitionEnd:m,children:h.jsx("div",{children:a?i:null})})}function U1({ticket:t,now:i,onSupply:r,onOpen:a}){const{t:o}=We(),[u,f]=C.useState(""),[m,p]=C.useState(""),[g,b]=C.useState(!1),y=xk(t),w=t.status==="started"||t.status==="needs_user";return h.jsxs("article",{className:"work-card",children:[h.jsxs("header",{children:[h.jsx("h3",{children:t.summary}),t.status==="ready"?null:h.jsx("span",{className:w?"work-status live":"work-status",children:Dv(t.status,o)})]}),vk(t,i,o).map(x=>h.jsx("p",{children:x},x)),t.childSessionId?h.jsx("button",{type:"button",className:"work-open",onClick:()=>a(t.childSessionId??""),children:o("work.openWorker")}):null,y?h.jsx("p",{className:y.stale?"stale":"work-question",children:y.text||o("work.questionEmpty")}):null,y?.stale?h.jsx("p",{className:"work-quiet",children:o("work.questionStale")}):null,t.status==="needs_user"?h.jsxs("form",{className:"work-reply",onSubmit:x=>{x.preventDefault();const S=u.trim();!S||g||(b(!0),p(""),r(t.id,S).then(T=>{b(!1),T?p(T):f("")}))},children:[h.jsxs("label",{children:[h.jsx("span",{children:o("work.answerLabel")}),h.jsx("textarea",{value:u,rows:2,disabled:g,onChange:x=>f(x.target.value)})]}),m?h.jsx("p",{className:"work-error",children:m}):null,h.jsx("button",{type:"submit",disabled:g||u.trim()==="",children:o("work.answerSubmit")})]}):null]})}function xO({briefing:t,time:i,mark:r,onOpenFile:a}){const{t:o}=We(),[u,f]=C.useState(!1),m=t.body.split(`
|
|
60
|
-
`).map(g=>g.trim()).find(Boolean)??"",p=[t.wallMs!=null?o("work.duration",{value:wO(t.wallMs,o)}):"",t.maxTokens!=null?`token ${t.maxTokens.toLocaleString("en-US")}`:"",t.material?o("work.material",{hash:t.material.slice(0,8)}):""].filter(Boolean);return h.jsxs("div",{className:"briefing-row","data-turn":r,children:[h.jsxs("article",{className:u?"briefing-card open":"briefing-card",children:[h.jsxs("button",{type:"button",className:"briefing-toggle","aria-expanded":u,onClick:()=>f(g=>!g),children:[h.jsx("span",{className:"briefing-title",children:t.cancel?o("work.cancelTitle"):o("work.taskTitle")}),h.jsx("span",{className:"briefing-rev",children:o("work.generation",{revision:String(t.revision)})}),h.jsx(SO,{}),m&&!u?h.jsx("span",{className:"briefing-preview",children:m}):null]}),h.jsx(Qu,{open:u,children:h.jsxs("div",{className:"briefing-body",children:[t.body?h.jsx(Rs,{text:t.body,onOpenFile:a}):null,p.length?h.jsx("p",{className:"briefing-facts",children:p.join(" · ")}):null,t.notes.map(g=>h.jsx("p",{className:"briefing-note",children:g},g))]})})]}),i?h.jsx("time",{children:i}):null]})}function wO(t,i){return t%6e4===0?i("work.minutes",{count:String(t/6e4)}):t%1e3===0?i("work.seconds",{count:String(t/1e3)}):i("work.milliseconds",{count:String(t)})}function SO(){return h.jsx("svg",{className:"briefing-chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M4 6.5L8 10.5L12 6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function kO({text:t}){return h.jsx("p",{className:"work-refused",children:t})}function EO({segment:t}){const[i,r]=C.useState(!1),{t:a}=We();return h.jsxs("div",{className:"official-row","data-variant":"think","data-segment":t.id,children:[h.jsxs("button",{type:"button",className:"official-title","aria-expanded":i,onClick:()=>r(!i),children:[h.jsxs("span",{className:"official-leading",children:[h.jsx(OO,{}),h.jsx(zu,{})]}),h.jsx("span",{className:"official-label",children:t.running?a("activity.thinking"):a("activity.reasoning")})]}),h.jsx(Qu,{open:i,children:h.jsx("div",{className:"think-body",children:st(t.text)})})]})}function TO({segments:t,pending:i=!1,tickets:r=[],cwd:a,connectionPhase:o}){const{t:u}=We(),f=i||t.some(w=>w.kind==="think"?w.running:xs.has(ws(w,a,r).status)),m=t.filter(w=>w.kind==="tool").map(w=>ws(w,a,r).status),p=[[u("activity.count.active"),m.filter(w=>xs.has(w)).length],[u("activity.count.failed"),m.filter(w=>w==="failed").length],[u("activity.count.cancelled"),m.filter(w=>w==="cancelled").length],[u("activity.count.unknown"),m.filter(w=>w==="unknown").length]].filter(([,w])=>Number(w)>0).map(([w,x])=>`${w} ${x}`).join(" · "),[g,b]=C.useState(()=>f),y=o!=null&&o!=="live";return h.jsxs("section",{className:g?"activity-group open":"activity-group","aria-label":u("activity.title"),"data-state":f?"running":"settled","data-activity-start":t[0]?.id,children:[h.jsxs("button",{type:"button",className:"official-title","aria-expanded":g,onClick:()=>b(w=>!w),children:[h.jsxs("span",{className:"official-leading",children:[h.jsx(hm,{}),h.jsx(zu,{})]}),h.jsx("span",{className:"official-label",children:t.length===1?u("activity.titleOne"):u("activity.titleWithCount",{count:String(t.length)})}),p?h.jsx("span",{className:"activity-status",children:p}):null,y?h.jsx("span",{className:"activity-status",children:["restoring","connecting","syncing"].includes(o??"")?u("activity.resyncing"):u("activity.connectionLastKnown")}):null]}),h.jsx(Qu,{open:g,children:h.jsxs("div",{className:"activity-body",children:[i&&!t.some(w=>w.kind==="think"?w.running:xs.has(ws(w,a,r).status))?h.jsx("p",{className:"activity-note",children:u("activity.generating")}):null,t.map(w=>w.kind==="think"?h.jsx(EO,{segment:w},w.id):h.jsx(jO,{segment:w,cwd:a,tickets:r,stale:y},w.callId))]})})]})}function jO(t){const[i,r]=C.useState(!1),[a,o]=C.useState(!1);return h.jsx(CO,{...t,open:i,argsOpen:a,onToggle:()=>r(u=>!u),onArgsToggle:()=>o(u=>!u)})}function CO({segment:t,cwd:i,tickets:r=[],stale:a=!1,open:o,argsOpen:u,onToggle:f,onArgsToggle:m}){const p=C.useId(),{t:g,locale:b}=We(),y=ws(t,i,r),w=e4({...t,args:y.args,result:y.output}),x=Bm(t.name)?g("activity.runCommand"):y.title,S=y.description||(y.todos.length?g("activity.updatePlan"):"")||(y.ticket?st(y.ticket.summary):"")||w?.name||x,T=["failed","cancelled","unknown"].includes(y.status);return h.jsx(dv,{className:"official-row tool-activity",status:y.status,segmentId:t.id,open:o,onToggle:f,panelId:`${p}-tool`,title:h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"official-leading",children:[h.jsx(hm,{}),h.jsx(zu,{})]}),h.jsx("span",{className:"official-label",children:S}),T?h.jsxs("span",{className:"activity-status",children:[Qb(y.status,g),a?g("activity.lastKnownSuffix"):""]}):null]}),children:h.jsxs("div",{className:"activity-detail",children:[y.status!=="succeeded"&&!T?h.jsxs("p",{className:"activity-note",children:[Qb(y.status,g),a?g("activity.lastKnownSuffix"):""]}):null,y.todos.length?h.jsxs("p",{className:"activity-note",children:[y.todos.filter(N=>N.status==="completed").length,"/",y.todos.length," ",g("activity.planComplete")]}):null,h.jsxs("div",{className:"activity-facts",children:[y.title," · ",st(t.callId)]}),y.command?h.jsxs("div",{className:"activity-command",children:[h.jsx(vu,{text:y.command}),h.jsx("pre",{children:y.command})]}):null,y.cwd?h.jsxs("p",{className:"activity-facts",children:[y.cwdSource==="recorded"?g("activity.cwdRecorded"):y.cwdSource==="requested"?g("activity.cwdRequested"):g("activity.cwdSessionDefault"),": ",y.cwd]}):null,y.status==="waiting"?h.jsx("p",{className:"activity-note",children:g("activity.callRequested")}):null,y.jobId?h.jsxs("p",{className:"activity-facts",children:["Job: ",st(y.jobId)," · ",g("activity.jobRegistered")]}):null,y.ticketId?h.jsxs("p",{className:"activity-facts",children:["Ticket: ",st(y.ticketId)," ",y.ticket?.childSessionId?`· Worker: ${st(y.ticket.childSessionId)}`:""]}):null,y.latestReport?h.jsxs("p",{className:"activity-note",children:[g("activity.latestReport")," (v",y.ticket?.revision,"): ",st(y.latestReport)]}):null,y.todos.length?h.jsx("ul",{className:"activity-todos",children:y.todos.map((N,E)=>h.jsxs("li",{children:[h.jsx("span",{children:N.status})," ",N.content]},E))}):null,t.requestedAt!=null?h.jsxs("p",{className:"activity-facts",children:[g("activity.callRecorded"),":"," ",new Date(t.requestedAt).toLocaleString(b==="zh"?"zh-CN":"en"),t.settledAt!=null?` · ${g("activity.callWait")}: ${Math.max(0,t.settledAt-t.requestedAt)}ms`:""]}):null,y.exitCode!=null?h.jsxs("p",{className:"activity-facts",children:["Exit: ",y.exitCode]}):null,w?h.jsx(NO,{change:w}):null,h.jsx(dv,{className:"official-row activity-arguments",open:u,onToggle:m,panelId:`${p}-args`,title:h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"official-leading",children:[h.jsx(hm,{}),h.jsx(zu,{})]}),h.jsx("span",{className:"official-label",children:g("activity.fullArgs")})]}),trailing:u?h.jsx(vu,{text:y.args}):null,children:h.jsx("pre",{children:y.args||"{}"})}),t.resultReceived||t.result?h.jsxs("div",{className:"activity-output",children:[h.jsxs("div",{className:"activity-block-head",children:[h.jsx("span",{children:g("activity.toolResult")}),h.jsx(vu,{text:y.output})]}),h.jsx("pre",{children:y.output||g("activity.emptyResult")})]}):null]})})}function dv({className:t,status:i,segmentId:r,open:a,onToggle:o,panelId:u,title:f,trailing:m,children:p}){return h.jsxs("div",{className:`${t}${a?" open":""}`,"data-state":i,"data-segment":r,children:[h.jsx("button",{type:"button",className:"official-title","aria-expanded":a,"aria-controls":u,onClick:g=>{g.stopPropagation(),o()},children:f}),m,h.jsx("div",{id:u,className:"activity-panel",children:h.jsx(Qu,{open:a,children:p})})]})}function NO({change:t}){const i=t.lines.map(r=>`${r.kind==="del"?"- ":r.kind==="add"?"+ ":" "}${r.text}`).join(`
|
|
61
|
-
`);return h.jsxs("div",{className:"diff-card","data-diff":"",children:[h.jsxs("div",{className:"diff-head",children:[h.jsxs("span",{className:"diff-heading",children:[h.jsx("span",{className:"diff-lang",children:t.language||"Code block"}),h.jsx("span",{className:"diff-file",children:t.name})]}),h.jsx(vu,{text:i})]}),h.jsx("div",{className:"diff-body",children:t.lines.map((r,a)=>h.jsx("div",{className:AO(r.kind),children:r.text},a))})]})}function AO(t){return t==="add"?"diff-line added":t==="del"?"diff-line removed":"diff-line same"}function vu({text:t}){const[i,r]=C.useState(!1);return h.jsx("button",{type:"button",className:"diff-copy","aria-label":i?"Copied":"Copy",onClick:a=>{a.stopPropagation(),navigator.clipboard.writeText(st(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1e3)})},children:i?h.jsx(zO,{}):h.jsx(_O,{})})}function zu(){return h.jsx("svg",{className:"chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M4 6.5L8 10.5L12 6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function OO(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.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"}),h.jsx("path",{d:"M6.2 13.6h3.6",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function hm(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M3.2 4.2h9.6M3.2 8h9.6M3.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})})}function _O(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("rect",{x:"5.2",y:"5.2",width:"7.2",height:"7.6",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.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 zO(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 RO={aborted:"question.aborted",failed:"question.failed",answered:"question.answered"};function ms(t){return{selected:[...t.selected],custom:t.custom,skipped:t.skipped}}function qO(t){const i=Math.max(0,Math.ceil(t/1e3)),r=Math.floor(i/60),a=i%60;return r>0?`${r}:${String(a).padStart(2,"0")}`:`${a}s`}function MO({item:t,draft:i,interactive:r,disabled:a,onToggle:o}){const{t:u}=We();if(!t.options.length)return null;const f=new Set(i.selected);return h.jsx("ul",{className:"user-question-options",children:t.options.map(m=>{const p=f.has(m.label),g=m3(m.label,m.recommended),b=p?"user-question-option selected":"user-question-option",y=h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"user-question-option-label",children:[st(m.label),g.recommended?h.jsx("span",{className:"user-question-badge",children:u("question.recommended")}):null]}),m.description?h.jsx("span",{className:"user-question-option-desc",children:st(m.description)}):null]});return h.jsx("li",{children:r?h.jsx("button",{type:"button",className:b,"data-selected":p?"true":"false","aria-pressed":t.multiSelect?p:void 0,disabled:a,onClick:()=>o(m.label),children:y}):h.jsx("div",{className:b,"data-selected":p?"true":"false",children:y})},m.label)})})}function Ym({interactive:t,waitLabel:i,onTakeTime:r,busy:a}){const{t:o}=We();return i?h.jsxs("div",{className:"user-question-wait",children:[h.jsx("p",{className:"user-question-hint",children:i}),t&&i!==o("question.continued")&&i!==o("question.waitingNoTimer")?h.jsx("button",{type:"button",className:"user-question-skip",disabled:a,onClick:r,children:o("question.takeTime")}):null]}):null}function DO({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const u=qs(t);return u?u.presentation==="plan-review"?h.jsx(BO,{segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}):u.presentation==="approval"?h.jsx(UO,{segment:t,sessionId:i,remainingMs:a,waitState:o}):h.jsx(LO,{segment:t,sessionId:i,remainingMs:a,waitState:o}):null}function Gm(t,i,r,a,o){const{t:u}=We(),f=!!(r&&b1(r.state)),[m,p]=C.useState(o==="waiting"||r?.wait==="waiting"),[g,b]=C.useState(o==="continued"||r?.state==="continued"),[y,w]=C.useState(a??r?.timeoutMs),x=C.useRef(null),S=(o==="counting"||r?.wait==="counting"||typeof(a??r?.timeoutMs)=="number")&&!m&&!g;C.useEffect(()=>{o==="waiting"&&p(!0),(o==="continued"||r?.state==="continued")&&b(!0),typeof a=="number"&&(x.current=Date.now()+a,w(a))},[a,o,r?.state]),C.useEffect(()=>{if(!f||!S)return;const E=a??y??r?.timeoutMs;if(typeof E!="number")return;x.current==null&&(x.current=Date.now()+E);const M=()=>{const te=Math.max(0,(x.current??Date.now())-Date.now());return w(te),te<=0?(b(!0),t&&rt("/questions/timeout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,callId:i})}),!1):!0};if(!M())return;const H=window.setInterval(()=>{M()||window.clearInterval(H)},250);return()=>window.clearInterval(H)},[f,S,t,i,a,y,r?.timeoutMs]);async function T(){p(!0),x.current=null,t&&await rt("/questions/take-time",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,callId:i})})}const N=g?u("question.continued"):m?u("question.waitingNoTimer"):S&&typeof y=="number"?u("question.remaining",{time:qO(y)}):null;return{answerable:f,held:m,continued:g,waitLabel:N,takeTime:T,markHeld:()=>p(!0)}}function LO({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o}=We(),u=qs(t),f=Gm(i,u.callId,u,r,a),[m,p]=C.useState({}),[g,b]=C.useState(!1),[y,w]=C.useState(""),x=u.questions,S=C.useMemo(()=>{const O={};for(const Q of x)O[Q.id]=m[Q.id]??ms(Q);return O},[m,x]),T=!!i&&f.answerable,N=x.length>1||x.some(O=>O.multiSelect||O.options.length===0);function E(O,Q){f.markHeld(),p(re=>{const pe=x.find(Z=>Z.id===O),z=re[O]??(pe?ms(pe):{selected:[],custom:"",skipped:!1});return{...re,[O]:{...z,...Q}}})}async function M(O){if(!(!i||g)){b(!0),w("");try{const Q=await rt("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:u.callId,answers:O})});if(Q.status===200&&Q.body.ok!==!1||Q.status===409)return;const re=typeof Q.body.message=="string"?Q.body.message:o("question.submitFailed");w(re)}catch{w(o("question.submitFailed"))}finally{b(!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 te(){const O=x.map(Q=>H(Q,S[Q.id]??ms(Q)));if(O.some(Q=>Q==null)){w(o("question.incomplete"));return}M(O)}function ie(O,Q){if(!T||g)return;if(!O.multiSelect&&x.length===1&&!S[O.id]?.custom){M([{id:O.id,selected:[Q]}]);return}const re=S[O.id]??ms(O),pe=O.multiSelect?re.selected.includes(Q)?re.selected.filter(z=>z!==Q):[...re.selected,Q]:[Q];E(O.id,{selected:pe,skipped:!1,custom:O.multiSelect?re.custom:""})}return h.jsxs("section",{className:"user-question-card","data-segment":t.id,"data-state":f.continued?"continued":u.state,"data-call":u.callId,"data-session":i||void 0,"data-kind":"question",children:[h.jsx(Ym,{interactive:T,waitLabel:f.waitLabel,onTakeTime:()=>{f.takeTime()},busy:g}),u.questions.map(O=>{const Q=S[O.id]??ms(O);return h.jsxs("article",{className:"user-question","data-question":O.id,children:[O.header?h.jsx("h3",{className:"user-question-header",children:st(O.header)}):null,h.jsx("p",{className:"user-question-text",children:st(O.question)}),O.detail?h.jsx("p",{className:"user-question-hint",children:st(O.detail)}):null,O.multiSelect&&f.answerable?h.jsx("p",{className:"user-question-hint",children:o("question.multiSelect")}):null,h.jsx(MO,{item:O,draft:f.answerable?Q:{selected:O.selected,custom:O.custom,skipped:O.skipped},interactive:T,disabled:g,onToggle:re=>ie(O,re)}),T?h.jsxs("div",{className:"user-question-actions",children:[h.jsxs("label",{className:"user-question-custom",children:[h.jsx("span",{children:o("question.customLabel")}),h.jsx("textarea",{value:Q.custom,disabled:g,rows:2,placeholder:o("question.customPlaceholder"),onChange:re=>E(O.id,{custom:re.target.value,skipped:!1})})]}),h.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:o("question.skip")})]}):null,!T&&O.custom?h.jsx("p",{className:"user-question-hint",children:o("question.custom",{text:st(O.custom)})}):null,(O.skipped||Q.skipped)&&(u.state!=="open"||T)?h.jsx("p",{className:"user-question-hint",children:o("question.skipped")}):null]},O.id)}),T&&(N||x.some(O=>(S[O.id]?.custom??"").trim()!==""))?h.jsx("button",{type:"button",className:"user-question-submit",disabled:g,onClick:te,children:o(g?"question.submitting":"question.submit")}):null,y?h.jsx("p",{className:"user-question-status exception",children:y}):null,!f.answerable&&u.state!=="open"&&u.state!=="continued"?h.jsx("p",{className:u.state==="answered"?"user-question-status":"user-question-status exception",children:o(RO[u.state])}):null]})}function BO({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const{t:u}=We(),f=qs(t),m=p1(f.questions),p=Gm(i,f.callId,f,a,o),[g,b]=C.useState(!1),[y,w]=C.useState(""),[x,S]=C.useState(!1),[T,N]=C.useState(""),E=!!i&&p.answerable,M=m.item.selected[0],H=M===m.approve.label;async function te(){if(!(!i||x)){S(!0),N("");try{const O=await rt("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:f.callId,answers:[{id:m.item.id,selected:[m.approve.label]}]})});if(O.status===200&&O.body.ok!==!1||O.status===409)return;N(typeof O.body.message=="string"?O.body.message:u("question.submitFailed"))}catch{N(u("question.submitFailed"))}finally{S(!1)}}}async function ie(){if(!i||x)return;const O=y.trim();if(!O){N(u("question.changesNeeded"));return}S(!0),N("");try{const Q=await rt("/questions/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:f.callId})});if(Q.status===200&&Q.body.ok!==!1){r?.(O);return}if(Q.status===409){r?.(O);return}N(typeof Q.body.message=="string"?Q.body.message:u("question.submitFailed"))}catch{N(u("question.submitFailed"))}finally{S(!1)}}return h.jsxs("section",{className:"user-question-card","data-segment":t.id,"data-state":p.continued?"continued":f.state,"data-call":f.callId,"data-session":i||void 0,"data-kind":"plan-review",children:[h.jsx("h3",{className:"user-question-header",children:u("question.planTitle")}),h.jsx("p",{className:"user-question-text",children:st(m.item.question)}),h.jsx(Ym,{interactive:E,waitLabel:p.waitLabel,onTakeTime:()=>{p.takeTime()},busy:x}),m.plan?g?h.jsx("div",{className:"user-question-plan",children:h.jsx(Rs,{text:m.plan})}):h.jsx("p",{className:"user-question-hint",children:st(m.plan).split(`
|
|
62
|
-
`).filter(Boolean).slice(0,2).join(" ")}):null,m.plan?h.jsx("button",{type:"button",className:"user-question-skip",onClick:()=>b(O=>!O),children:u(g?"question.hidePlan":"question.viewFull")}):null,E?h.jsxs("div",{className:"user-question-actions",children:[h.jsxs("label",{className:"user-question-custom",children:[h.jsx("span",{children:u("question.changeComments")}),h.jsx("textarea",{value:y,disabled:x,rows:3,placeholder:u("question.changePlaceholder"),onChange:O=>{p.markHeld(),w(O.target.value)}})]}),h.jsxs("div",{className:"user-question-row",children:[h.jsx("button",{type:"button",className:"user-question-skip",disabled:x,onClick:()=>{ie()},children:u("question.requestChanges")}),h.jsx("button",{type:"button",className:"user-question-submit",disabled:x,onClick:()=>{te()},children:u(x?"question.submitting":"question.approvePlan")})]})]}):M?h.jsx("p",{className:"user-question-status",children:H?u("question.approvePlan"):st(M)}):f.state==="aborted"?h.jsx("p",{className:"user-question-status exception",children:u("question.aborted")}):f.state==="failed"?h.jsx("p",{className:"user-question-status exception",children:u("question.failed")}):null,T?h.jsx("p",{className:"user-question-status exception",children:T}):null]})}function UO({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o,locale:u}=We(),f=qs(t),m=g1(f.questions),p=Gm(i,f.callId,f,r,a),[g,b]=C.useState(!1),[y,w]=C.useState(""),x=!!i&&p.answerable,S=Hd(m.intent.display?.question,u,m.item.question),T=Hd(m.intent.display?.detail,u,m.item.detail),N=Hd(m.intent.display?.approve,u,m.approve.label),E=m.item.selected[0];async function M(H){if(!(!i||g)){b(!0),w("");try{const te=await rt("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:f.callId,answers:[{id:m.item.id,selected:[H]}]})});if(te.status===200&&te.body.ok!==!1||te.status===409)return;w(typeof te.body.message=="string"?te.body.message:o("question.submitFailed"))}catch{w(o("question.submitFailed"))}finally{b(!1)}}}return h.jsxs("section",{className:"user-question-card","data-segment":t.id,"data-state":p.continued?"continued":f.state,"data-call":f.callId,"data-session":i||void 0,"data-kind":"approval",children:[m.intent.subject?.name?h.jsx("h3",{className:"user-question-header",children:st(m.intent.subject.name)}):null,h.jsx("p",{className:"user-question-text",children:st(S)}),T?h.jsx("p",{className:"user-question-hint",children:st(T)}):null,h.jsx(Ym,{interactive:x,waitLabel:p.waitLabel,onTakeTime:()=>{p.takeTime()},busy:g}),x?h.jsxs("div",{className:"user-question-row",children:[h.jsx("button",{type:"button",className:"user-question-skip",disabled:g,onClick:()=>{M(m.reject.label)},children:o("question.reject")}),h.jsx("button",{type:"button",className:"user-question-submit",disabled:g,onClick:()=>{M(m.approve.label)},children:g?o("question.submitting"):st(N)||o("question.allow")}),m.always?h.jsx("button",{type:"button",className:"user-question-submit",disabled:g,onClick:()=>{M(m.always.label)},children:o("question.alwaysAllow")}):null]}):E?h.jsx("p",{className:"user-question-status",children:o("question.approvalAnswered")}):f.state==="aborted"?h.jsx("p",{className:"user-question-status exception",children:o("question.aborted")}):f.state==="failed"?h.jsx("p",{className:"user-question-status exception",children:o("question.failed")}):null,y?h.jsx("p",{className:"user-question-status exception",children:y}):null]})}function Gd({approval:t,sessionId:i}){const{t:r,locale:a}=We(),[o,u]=C.useState(!1),[f,m]=C.useState(""),[p,g]=C.useState(t.state),b=!!i&&p==="open",y=a.startsWith("zh")&&t.displayReason?.zh?t.displayReason.zh:t.displayReason?.en||t.reason;async function w(S){if(!(!i||o)){u(!0),m("");try{const T=await rt("/approvals/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,requestId:t.requestId,outcome:S})});if(T.status===200&&T.body.ok!==!1){g(S);return}if(T.status===409){g(S);return}m(typeof T.body.message=="string"?T.body.message:r("approval.submitFailed"))}catch{m(r("approval.submitFailed"))}finally{u(!1)}}}const x=p==="allowed-once"?r("approval.allowed"):p==="rejected"?r("approval.rejected"):p==="cancelled"?r("approval.cancelled"):p==="unavailable"?r("approval.failed"):null;return h.jsxs("section",{className:"user-question-card","data-kind":"tool-approval","data-state":p,"data-request":t.requestId,"data-session":i||void 0,children:[h.jsx("h3",{className:"user-question-header",children:r("approval.title")}),h.jsx("p",{className:"user-question-text",children:st(t.toolName)}),y?h.jsx("p",{className:"user-question-hint",children:st(y)}):null,b?h.jsxs("div",{className:"user-question-row",children:[h.jsx("button",{type:"button",className:"user-question-skip",disabled:o,onClick:()=>{w("rejected")},children:r("approval.reject")}),h.jsx("button",{type:"button",className:"user-question-submit",disabled:o,onClick:()=>{w("allowed-once")},children:r(o?"question.submitting":"approval.allowOnce")})]}):x?h.jsx("p",{className:p==="allowed-once"?"user-question-status":"user-question-status exception",children:x}):null,f?h.jsx("p",{className:"user-question-status exception",children:f}):null]})}function HO(t,i){if(!t)return"";const r=new Date(t);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString(i==="zh"?"zh-CN":"en",{hour:"2-digit",minute:"2-digit"})}function IO({sessionId:t,segments:i,completed:r,failures:a,retries:o,turnEnds:u,tickets:f,now:m,canRetry:p,onRetry:g,onSupply:b,onOpenSession:y,onOpenFile:w,onOpenInbox:x,botLabel:S,chat:T=!1,cwd:N,connectionPhase:E,approvals:M=[],questionWaits:H,onCompose:te}){const ie=[];let O=null;const Q=()=>{O&&(O.segments.length||a[O.turn]||o[O.turn]?.length)&&ie.push(O),O=null};for(const le of i){if(le.kind==="user"){Q(),Lv(le.text)||ie.push({type:"user",segment:le});continue}const G=le.turn??-1;(!O||O.turn!==G)&&(Q(),O={type:"turn",turn:G,seconds:r[G],segments:[]}),O.segments.push(le)}Q();const re=new Set(ie.flatMap(le=>le.type==="turn"?[le.turn]:[]));for(const le of Object.keys(a)){const G=Number(le);re.has(G)||ie.push({type:"turn",turn:G,seconds:r[G],segments:[]})}const pe=f.map(le=>({...le,summary:st(le.summary),events:le.events.map(G=>({...G,text:st(G.text)}))})),z=Bv(pe),Z=new Map(pe.map(le=>[le.id,le])),W=new Map;for(const le of ie)if(le.type==="turn"){for(const G of N1(le.segments))if(G.type==="activity")for(const ae of G.segments){if(ae.kind!=="tool")continue;const se=Hv(ae);se&&Z.has(se)&&!W.has(se)&&W.set(se,ae.id)}}const je=ie.reduce((le,G)=>G.type==="turn"?Math.max(le,G.turn):le,-1),qe=Uv(f);return h.jsxs(h.Fragment,{children:[ie.map((le,G)=>le.type==="user"?h.jsx(VO,{segment:le.segment,botLabel:S,onOpenInbox:x,onOpenFile:w},le.segment.id):h.jsx(QO,{sessionId:t,cwd:N,connectionPhase:E,block:le,index:G,blocks:ie,failures:a,retries:o,turnEnds:u,latestTurn:je,background:qe,byId:Z,anchorAt:W,now:m,canRetry:p,onRetry:g,onSupply:b,onOpenSession:y,onOpenFile:w,chat:T,approvals:M,questionWaits:H,onCompose:te,trailingApprovals:G===ie.length-1},`${t}:turn-${le.turn}`)),z.filter(le=>!W.has(le.id)).map(le=>h.jsx(U1,{ticket:le,now:m,onSupply:b,onOpen:y},le.id))]})}function VO({segment:t,botLabel:i,onOpenInbox:r,onOpenFile:a}){const o=Yu(t.text),u=gm(t.text),{locale:f}=We(),m=HO(t.time,f);if(u)return h.jsx(xO,{briefing:u,time:m,mark:t.id,onOpenFile:a});if(o){const p=J2([{kind:"in",id:t.id,seq:t.seq,time:t.time,mail:o}],i);return h.jsx(t3,{who:p?.who??"BOT",preview:p?.preview??"",time:m,mark:t.id,onOpen:r})}return h.jsxs("div",{className:"user-row","data-turn":t.id,children:[h.jsx("div",{className:"user-bubble",children:t.text}),m?h.jsx("time",{children:m}):null]})}function YO(t,i,r){for(let a=i-1;a>=0;a-=1){const o=t[a];if(o?.type==="user"&&o.segment&&o.segment.text.trim()!==""){if(Yu(o.segment.text)||gm(o.segment.text))continue;if(o.segment.turn==null||o.segment.turn===r)return o.segment.text;break}}return""}function GO(t,i){return t.slice(i+1).some(r=>r.type==="user")}function FO({seconds:t,failure:i,retries:r,prompt:a,continued:o,canRetry:u,onRetry:f,showLabel:m}){const{t:p}=We(),[g,b]=C.useState(!1);if(!i&&r.length===0)return null;const y=g||o;return h.jsxs("div",{className:"turn-failure",children:[m?h.jsxs("p",{className:"turn-failed-label",children:["Failed",t!=null?h.jsxs(h.Fragment,{children:[" ","· ",h.jsxs("span",{className:"duration",children:[t,"s"]})]}):null]}):null,r.map(w=>h.jsxs("details",{className:"retry-row",open:w.state==="scheduled",children:[h.jsxs("summary",{children:[w.state==="started"?"Retried model request":"Retrying model request"," (",w.retry,"/",w.maxRetries??"∞",") · ",Math.max(1,Math.ceil(w.delayMs/1e3)),"s"]}),h.jsxs("p",{children:["Retry delay: ",Math.round(w.delayMs),"ms"]}),h.jsxs("p",{children:["Failure reason: ",w.message]})]},`${w.retryId}:${w.retry}`)),i?h.jsxs("p",{className:"turn-error",role:"status",children:[h.jsx("span",{className:"turn-error-title",children:"This turn failed"}),h.jsx("span",{children:i.message}),i.code?h.jsx("code",{children:i.code}):null]}):null,i&&a&&!y?h.jsx("button",{type:"button",className:"retry-turn",disabled:!u,onClick:()=>{b(!0),f(a)},children:p("bot.retry")}):null]})}function QO({sessionId:t,block:i,index:r,blocks:a,failures:o,retries:u,turnEnds:f,latestTurn:m,background:p,byId:g,anchorAt:b,now:y,canRetry:w,onRetry:x,onSupply:S,onOpenSession:T,onOpenFile:N,chat:E=!1,cwd:M,connectionPhase:H,approvals:te=[],questionWaits:ie,onCompose:O,trailingApprovals:Q=!1}){const{t:re}=We(),pe=N1(i.segments),z=new Set,Z=G=>ie?.[G]??ie?.[`${t}:${G}`],W=G=>te.filter(ae=>z.has(ae.requestId)?!1:ae.callId&&G.includes(ae.callId)?(z.add(ae.requestId),!0):!1),je=()=>Q?te.filter(G=>z.has(G.requestId)?!1:(z.add(G.requestId),!0)):[],qe=pe.some(G=>G.type==="activity"),le=E&&f[i.turn]==="aborted"&&!o[i.turn]&&!(i.turn===m&&p);return h.jsx("div",{children:h.jsxs("div",{"data-turn":`turn:${i.turn}`,children:[pe.map(G=>{if(G.type==="text")return h.jsx("div",{"data-segment":G.segment.id,className:G.segment.streaming?"assistant streaming":"assistant",children:h.jsx(Rs,{text:G.segment.text,streaming:G.segment.streaming,onOpenFile:N})},G.segment.id);if(G.type==="question"){const se=Z(G.segment.callId);return h.jsxs(C.Fragment,{children:[h.jsx(DO,{segment:G.segment,sessionId:t,onCompose:O,remainingMs:se?.remainingMs,waitState:se?.waitState}),W([G.segment.callId]).map(Ne=>h.jsx(Gd,{approval:Ne,sessionId:t},Ne.requestId))]},G.segment.id)}const ae=G.segments.filter(se=>se.kind==="tool");return h.jsxs(C.Fragment,{children:[h.jsx(TO,{segments:G.segments,cwd:M,tickets:[...g.values()],connectionPhase:H}),W(ae.map(se=>se.callId)).map(se=>h.jsx(Gd,{approval:se,sessionId:t},se.requestId)),ae.filter(se=>wk(se)).map(se=>h.jsx(kO,{text:st(Sk(se.result,re))},se.id)),ae.flatMap(se=>{const Ne=Hv(se),A=Ne?g.get(Ne):void 0;return!Ne||!A||b.get(Ne)!==se.id?[]:[h.jsx(U1,{ticket:A,now:y,onSupply:S,onOpen:T},A.id)]})]},G.id)}),je().map(G=>h.jsx(Gd,{approval:G,sessionId:t},G.requestId)),le?h.jsx("p",{className:"work-note",children:re("bot.stopped")}):null,h.jsx(FO,{seconds:i.seconds,failure:o[i.turn],retries:u[i.turn]??[],prompt:YO(a,r,i.turn),continued:GO(a,r),canRetry:w,onRetry:x,showLabel:!qe}),i.turn===m&&f[i.turn]==="aborted"&&p?h.jsx("p",{className:"work-note",children:re("bot.stoppedBackground")}):null]})})}function mv(){const t=location.hash.replace(/^#\/?/,"").split("/");for(let i=0;i<t.length-1;i+=1){const r=t[i],a=t[i+1];if(r==="s"&&a)return decodeURIComponent(a)}return""}function hv(t,i,r){if(!(r in i))return i;const a={...i};return delete a[r],sessionStorage.setItem(t,JSON.stringify(a)),a}function Fd(t){try{const i=JSON.parse(sessionStorage.getItem(t)||"{}");return i&&typeof i=="object"?i:{}}catch{return{}}}function pv(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const i={};for(const[r,a]of Object.entries(t))typeof a=="string"&&a!==""&&(i[r]=a);return i}function Qd(t){fetch("/dsh-bot/api/sessions/previews",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function gv(t){return(t??"").split("/").filter(Boolean).at(-1)??""}function XO(){return new Promise(t=>{const i=location.protocol==="https:"?"wss:":"ws:",r=new WebSocket(`${i}//${location.host}/api/remote.mux`),a=window.setTimeout(()=>{r.close(),t([])},4e3),o=u=>{window.clearTimeout(a),r.close(),t(u)};r.addEventListener("open",()=>{r.send(JSON.stringify({type:"open",streamId:"archive",endpoint:"workspace/follow",payload:{args:{}}}))}),r.addEventListener("message",u=>{try{const f=JSON.parse(String(u.data)),m=f.value?.type==="baseline"?f.value.value?.archivedSessionIds:void 0;if(!Array.isArray(m))return;o(m.filter(p=>typeof p=="string"))}catch{}}),r.addEventListener("error",()=>o([]))})}function ZO(){const{t,locale:i,setLocale:r}=We(),[a,o]=C.useState(mv),[u,f]=C.useState([]),[m,p]=C.useState(""),[g,b]=C.useState(""),[y,w]=C.useState(!1),[x,S]=C.useState(()=>Fd("dsh-bot.titles")),[T,N]=C.useState(()=>Fd("dsh-bot.previews")),[E,M]=C.useState(Yd),[H,te]=C.useState(""),[ie,O]=C.useState(null),[Q,re]=C.useState(a);Q!==a&&(re(a),M(Yd()));const[pe,z]=C.useState(null),[Z,W]=C.useState({ready:!1,reason:"loading"}),[je,qe]=C.useState(null),[le,G]=C.useState(null),[ae,se]=C.useState(!1),[Ne,A]=C.useState(""),[et,ct]=C.useState(0),[q,R]=C.useState(0),[ne,de]=C.useState(""),[ye,Oe]=C.useState(""),[Ce,Se]=C.useState(!1),[$,me]=C.useState(null),[Ze,Ke]=C.useState(null),[ke,$e]=C.useState([]),[Fe,Ue]=C.useState({}),[ze,Ye]=C.useState(!1),[gt,fe]=C.useState(!1),[De,yt]=C.useState({}),[bn]=C.useState(()=>d1(async()=>{const j=await rt("/authorization");if(j.status!==200)throw new Error("Authorization catalog unavailable");return{available:j.body.available,entries:j.body.entries}})),Mt=C.useRef(void 0),X=C.useRef(null),[oe,be]=C.useState(null),[we,Ge]=C.useState(!1),[ve,ht]=C.useState(()=>new Set),[Qt,tn]=C.useState(!1),[sn,on]=C.useState(!1),[It,xt]=C.useState(!1),[Ot,vn]=C.useState(""),[xn,hi]=C.useState(0),[Vt,K]=C.useState(()=>new Set),[ue,ft]=C.useState({}),[Xt,bt]=C.useState({}),[Lt,Bt]=C.useState(!1),[dr,Ol]=C.useState({}),[mr,hr]=C.useState(()=>Date.now()),[_i,_l]=C.useState(""),zi=Z2(a,xn);C.useEffect(()=>{$e([]),Ue({});const j=o3({visible:!document.hidden,fetch:async J=>{const ge=await rt(`/interactions?compact=1&sessionId=${encodeURIComponent(a)}`,{signal:J});if(ge.status!==200)throw new Error("Interactions unavailable");return ge.body},active:J=>{const ge=J;return!!(ge.questions?.length||ge.approvals?.some(_e=>_e.state==="open")||ge.authorization?.prompts?.length||ge.authorization?.inFlight?.length)},apply:J=>{const ge=J,_e=Array.isArray(ge.approvals)?ge.approvals:[];$e(_e);const Te={};if(Array.isArray(ge.questions))for(const ot of ge.questions)typeof ot.callId=="string"&&ot.callId!==""&&(Te[ot.callId]={remainingMs:ot.remainingMs,waitState:ot.waitState});Ue(Te);const it=ge.authorization,Et=it&&typeof it=="object"?it.prompts:[];fe(Array.isArray(Et)&&Et.length>0);const dt=it&&typeof it=="object"?it:{},lt=JSON.stringify([dt.catalogRevision,dt.available]);Mt.current!==lt&&(Mt.current=lt,bn.invalidate()),yt(ot=>JSON.stringify(ot)===JSON.stringify(dt)?ot:dt)},schedule:(J,ge)=>{const _e=window.setTimeout(J,ge);return()=>window.clearTimeout(_e)}});X.current=j;const I=()=>j.setVisible(!document.hidden);return document.addEventListener("visibilitychange",I),()=>{j.close(),X.current===j&&(X.current=null),document.removeEventListener("visibilitychange",I)}},[a,bn]),C.useEffect(()=>{rt("/cua").then(j=>Ye(j.body.available===!0))},[]);const $i=C.useRef(null),Ri=C.useRef(null),ca=C.useRef(null),fa=C.useRef(null),pr=C.useRef(new Set),gr=C.useRef(0),pi=C.useRef(new Map),yr=C.useRef(0),br=C.useRef(new Map),da=C.useRef(!1),zl=C.useRef(a),Rl=C.useRef(null);zl.current=a;function ni(j){return ue[j.sessionId]||x[j.sessionId]||j.title||gv(j.cwd)||t("session.unnamed")}function vr(j){const I=u.find(J=>J.sessionId===j);return I?ni(I):ue[j]||x[j]||""}const Ms=f1(E.segments),wn=a!==""&&H!==a&&(ie==null||ie.phase==="restoring"||ie.phase==="connecting"||ie.phase==="syncing"&&H!==a),Wt=ie?.fraction!=null?{loaded:Math.round(ie.fraction*1e3),total:1e3}:null,nn=ie?.phase==="syncing"&&ie.fraction!=null,ii=C.useMemo(()=>$2(E.segments),[E.segments]),Ds=C.useMemo(()=>$3(ii),[ii]),Xu=a?ni({sessionId:a,cwd:u.find(j=>j.sessionId===a)?.cwd,title:E.title||null}):t("app.title"),Zu=a?`/#/s/${encodeURIComponent(a)}`:"/";function qi(j){xt(!1),o(j),Se(!1),Ge(!1),be(null),z(null),Oe(""),vn("");const I=j?`#/s/${encodeURIComponent(j)}`:"#/";location.hash!==I&&history.replaceState(null,"",I)}function ql(j){if(!j||j===a)return;const I=a;xt(!1),o(j),Se(!1),Ge(!1),be(null),z(null),Oe(""),vn("");const J=`#/s/${encodeURIComponent(j)}`;location.hash!==J&&history.pushState({kind:"worker",owner:I},"",J)}function Ml(){if(xt(!1),Se(!1),Ge(!1),be(null),history.state?.kind==="worker"){history.back();return}_i&&qi(_i)}C.useEffect(()=>{let j=!1;return XO().then(I=>{j||ht(new Set(I))}),()=>{j=!0}},[]);function Dl(j){const I=mk(j);I&&(Ol(I.signals),bt(I.cards),Bt(!0));const J=j.desk;if(!J||typeof J!="object"||Array.isArray(J))return;const ge=J,_e=ge.sessions;if(_e&&typeof _e=="object"&&!Array.isArray(_e)){const dt=_e,lt=dt.result;if(lt?.ok!==!0)p(lt?.error?.message||String(dt.error||t("session.listUnavailable")));else if(p(""),f(Pi(lt.value?.items)),Gt(dt.previews),!da.current){da.current=!0;const ot=pv(dt.previews),_t={};for(const[jt,un]of Object.entries(Fd("dsh-bot.previews")))pr.current.has(jt)||ot[jt]||!un||(_t[jt]=un);Object.keys(_t).length>0&&Qd({previews:_t})}}const Te=ge.bots;if(Te&&typeof Te=="object"&&!Array.isArray(Te)&&Te.ok===!0){const dt=Te,lt=Array.isArray(dt.bots)?dt.bots:[],ot=lt.flatMap(jt=>{if(!jt||typeof jt!="object")return[];const un=jt.sessionId;return typeof un=="string"?[un]:[]}),_t={};for(const jt of lt){if(!jt||typeof jt!="object")continue;const un=jt.sessionId,Ll=jt.name;typeof un=="string"&&typeof Ll=="string"&&Ll!==""&&(_t[un]=Ll)}if(ot.length===0&&Array.isArray(dt.sessionIds))for(const jt of dt.sessionIds)typeof jt=="string"&&ot.push(jt);K(new Set(ot)),ft(_t)}const it=ge.health;if(it&&typeof it=="object"&&!Array.isArray(it)){const dt=it;qe(dt),dt.execution&&W({ready:dt.execution.ready===!0,reason:dt.execution.reason||(dt.execution.ready===!0?"":"catalog_unreadable")})}const Et=ge.usage;Et&&typeof Et=="object"&&!Array.isArray(Et)&&G(Et)}C.useEffect(()=>{let j=!1;return(async()=>{try{const I=await rt("/sessions");if(j)return;const J=I.body.result;J?.ok===!0?(p(""),f(Pi(J.value?.items)),Gt(I.body.previews)):I.status!==200&&p(J?.error?.message||t("session.listUnavailable"))}catch{}try{const I=await rt("/sessions/bots");if(j||I.body.ok!==!0)return;const J=Array.isArray(I.body.bots)?I.body.bots:[],ge=J.flatMap(Te=>{if(!Te||typeof Te!="object")return[];const it=Te.sessionId;return typeof it=="string"?[it]:[]}),_e={};for(const Te of J){if(!Te||typeof Te!="object")continue;const it=Te.sessionId,Et=Te.name;typeof it=="string"&&typeof Et=="string"&&Et!==""&&(_e[it]=Et)}if(ge.length===0&&Array.isArray(I.body.sessionIds))for(const Te of I.body.sessionIds)typeof Te=="string"&&ge.push(Te);K(new Set(ge)),ft(_e)}catch{}})(),()=>{j=!0}},[]),C.useEffect(()=>{let j=!1,I=null,J=0,ge=2e3,_e,Te;const it=lt=>{let ot;try{ot=JSON.parse(String(lt.data))}catch{return null}return ot.ok===!0?ot:null},Et=()=>{if(I?.close(),_e=void 0,Te=void 0,j||document.hidden||typeof EventSource>"u")return;const lt=new EventSource(`/dsh-bot/api/live?sessionId=${encodeURIComponent(a)}`);I=lt,lt.addEventListener("interaction-error",()=>{!j&&I===lt&&X.current?.disconnected()}),lt.addEventListener("interactions",ot=>{if(j||I!==lt)return;const _t=it(ot);_t?.sessionId===a&&(ge=2e3,X.current?.ingest(_t))}),lt.addEventListener("snapshot",ot=>{if(j||I!==lt)return;const _t=it(ot);_t&&(ge=2e3,_t.desk!==void 0&&(_e=_t.desk),_t.work!==void 0&&(Te=_t.work),Dl(_t))}),lt.addEventListener("delta",ot=>{if(j||I!==lt)return;const _t=it(ot);if(!_t)return;const jt={ok:!0};_t.desk!==void 0&&_e!==void 0&&(_e=Cs(_e,_t.desk),jt.desk=_e),_t.work!==void 0&&Te!==void 0&&(Te=Cs(Te,_t.work),jt.work=Te),(jt.desk!==void 0||jt.work!==void 0)&&Dl(jt)}),lt.addEventListener("error",()=>{j||I!==lt||(X.current?.disconnected(),lt.close(),I===lt&&(I=null),J=window.setTimeout(Et,ge),ge=Math.min(15e3,ge*2))})},dt=()=>{window.clearTimeout(J),document.hidden?(I?.close(),I=null):(ge=2e3,Et())};return document.addEventListener("visibilitychange",dt),Et(),()=>{j=!0,document.removeEventListener("visibilitychange",dt),window.clearTimeout(J),I?.close()}},[a]),C.useEffect(()=>{const j=()=>{xt(!1),Se(!1),Ge(!1),be(null),z(null),Oe(""),vn(""),o(mv())};return window.addEventListener("hashchange",j),()=>window.removeEventListener("hashchange",j)},[]),C.useEffect(()=>{let j=!1;return uv().then(J=>{j||(Rl.current=lv({follow:tv({addressOf:ge=>ra(ge)}),page:rv({addressOf:ge=>ra(ge)}),cdc:sv({cache:J}),range:iv(),checkpoint:J}))}),()=>{j=!0}},[]),C.useEffect(()=>{if(!a){te(""),O(null);return}M(Yd()),O(null);let j=!1,I=null;return(async()=>{const J=await uv();if(j)return;const ge=Rl.current??lv({follow:tv({addressOf:Te=>ra(Te)}),page:rv({addressOf:Te=>ra(Te)}),cdc:sv({cache:J}),range:iv(),checkpoint:J});Rl.current=ge;const _e=ge.open(a,{enhancement:"auto"});I=_e,_e.onBatch(Te=>{j||zl.current!==a||(M(it=>{let Et=it;for(const dt of Te.events)Et=y4(Et,dt);return Et}),te(a))}),_e.onEphemeral(Te=>{j||zl.current!==a||M(it=>b4(it,Te))}),_e.onStatus(Te=>{j||zl.current!==a||(O(Te),(Te.phase==="live"||Te.phase==="stalled"||Te.phase==="error")&&te(a))})})(),()=>{j=!0,I?.close()}},[a]),C.useEffect(()=>{!a||Q!==a||!E.title||ue[a]||S(j=>{if(j[a]===E.title)return j;const I={...j,[a]:E.title};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(I)),I})},[a,Q,E.title,ue]);const Ln=!!a&&Vt.has(a),Yt=Ln&&Lt?Xt[a]??[]:[],Mi=Ln&&Lt?a:"";C.useEffect(()=>{if(!a||!ar(a)){_l("");return}let j=!1;const I=ck(a);return Ni(`/dsh-bot/api/work/ticket?id=${encodeURIComponent(I)}`).then(J=>{if(j||J.body.ok!==!0||!J.body.ticket||typeof J.body.ticket!="object")return;const ge=J.body.ticket.owner_session_id;typeof ge=="string"&&_l(ge)}),()=>{j=!0}},[a]);const Di=Yt.some(j=>j.status==="started");C.useEffect(()=>{if(!Di)return;const j=window.setInterval(()=>hr(Date.now()),1e3);return()=>window.clearInterval(j)},[Di]);function Gt(j){const I=pv(j);Object.keys(I).length!==0&&N(J=>{let ge=!1;const _e={...J};for(const[Te,it]of Object.entries(I))_e[Te]||(_e[Te]=it,ge=!0);return ge?(sessionStorage.setItem("dsh-bot.previews",JSON.stringify(_e)),_e):J})}function ma(){window.clearTimeout(yr.current),yr.current=0;const j=[...pi.current];if(pi.current.clear(),j.length!==0){if(j.length===1){const[I,J]=j[0]??[];I&&J&&Qd({sessionId:I,preview:J});return}Qd({previews:Object.fromEntries(j)})}}C.useEffect(()=>()=>{ma()},[]),C.useEffect(()=>{if(!a||Q!==a)return;const j=v4(E.segments);!j||br.current.get(a)===j||(br.current.set(a,j),N(I=>{if(I[a]===j)return I;const J={...I,[a]:j};return sessionStorage.setItem("dsh-bot.previews",JSON.stringify(J)),J}),pi.current.set(a,j),window.clearTimeout(yr.current),yr.current=window.setTimeout(ma,400))},[a,Q,E.segments]),C.useLayoutEffect(()=>{const j=fa.current;if(!j||!$)return;const I=j.getBoundingClientRect(),J=Math.max(8,Math.min($.x,window.innerWidth-I.width-8)),ge=Math.max(8,Math.min($.y,window.innerHeight-I.height-8));(J!==$.x||ge!==$.y)&&me(_e=>_e&&{..._e,x:J,y:ge}),j.querySelector("button")?.focus()},[$]),C.useEffect(()=>{if(!$)return;const j=()=>me(null),I=ge=>{const _e=ge.target;_e instanceof Node&&fa.current?.contains(_e)||j()},J=ge=>{ge.key==="Escape"&&j()};return document.addEventListener("pointerdown",I),document.addEventListener("keydown",J),document.addEventListener("scroll",j,!0),()=>{document.removeEventListener("pointerdown",I),document.removeEventListener("keydown",J),document.removeEventListener("scroll",j,!0)}},[$]),C.useEffect(()=>{if(!Ce)return;const j=J=>{const ge=J.target;ge instanceof Node&&ca.current?.contains(ge)||Se(!1)},I=J=>{J.key==="Escape"&&Se(!1)};return document.addEventListener("pointerdown",j),document.addEventListener("keydown",I),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("keydown",I)}},[Ce]),C.useEffect(()=>{xt(!1)},[a]);const Ls=Yt.map(j=>`${j.id}:${j.status}:${j.revision}`).join(`
|
|
63
|
-
`);C.useEffect(()=>{const j=$i.current;j&&(j.scrollTop=j.scrollHeight)},[E.segments,E.drafting,E.activity,a,It,Ls]);const gi=C.useMemo(()=>{const j=g.trim().toLowerCase();return u.filter(I=>ar(I.sessionId)||ve.has(I.sessionId)?!1:j?[ni(I),I.cwd??"",T[I.sessionId]??""].join(" ").toLowerCase().includes(j):!0)},[u,g,x,T,ve,ue]).filter(j=>!j.blank),En=C.useMemo(()=>{const j=g.trim().toLowerCase();return u.filter(I=>I.blank!==!0||ar(I.sessionId)?!1:j?[ni(I),I.cwd??""].join(" ").toLowerCase().includes(j):!0)},[u,g,x,ue]),ha=Qt||g.trim()!=="",Bs=C.useMemo(()=>!a||!Vt.has(a)?[]:u.flatMap(j=>!Vt.has(j.sessionId)||j.sessionId===a||ve.has(j.sessionId)||ar(j.sessionId)?[]:[{sessionId:j.sessionId,label:ni(j)}]),[u,Vt,a,ve,ue,x]),li=a&&Vt.has(a)?uO(Ne,et):null,pa=li?`${li.start}:${li.query}`:"",Ve=li?mO(Bs,li.query):[],ga=li!=null&&ne!==pa,Ji=Math.min(q,Math.max(Ve.length-1,0));C.useEffect(()=>{R(0)},[pa]);function Pi(j){const I=pr.current;return(j??[]).filter(J=>!I.has(J.sessionId))}function Bn(j){pr.current.add(j),pi.current.delete(j),br.current.delete(j),f(I=>I.filter(J=>J.sessionId!==j)),ht(I=>{const J=new Set(I);return J.delete(j),J}),S(I=>hv("dsh-bot.titles",I,j)),N(I=>hv("dsh-bot.previews",I,j)),K(I=>{if(!I.has(j))return I;const J=new Set(I);return J.delete(j),J}),ft(I=>{if(!(j in I))return I;const J={...I};return delete J[j],J}),a===j&&qi("")}function Sn(j,I){const J=new Set(ve);for(const ge of I)J.add(ge);if(Array.isArray(j))for(const ge of j)typeof ge=="string"&&J.add(ge);ht(J),I.includes(a)&&qi("")}async function Us(j){const I=await rt(`/sessions/${encodeURIComponent(j)}/archive`,{method:"POST"});if(I.status!==200){const J=I.body.upstream;p(J?.message||(I.body.error==="not_blank"?t("session.notBlankArchive"):t("session.archiveFailed")));return}p(""),Sn(I.body.archivedSessionIds,[j])}function Hs(j,I){j.preventDefault(),me({id:I,x:j.clientX,y:j.clientY})}async function ya(j){const I=await rt(`/sessions/${encodeURIComponent(j)}/delete`,{method:"POST"});if(I.status!==200){const J=I.body.error,ge=typeof I.body.message=="string"?I.body.message:"";p(J==="running"?t("session.deleteRunning"):J==="attached"?t("session.deleteAttached"):ge||t("session.deleteFailed"));return}p(""),Bn(j)}async function Is(){if(En.length===0||!window.confirm(t("session.archiveConfirm",{count:String(En.length)})))return;const j=[];let I=[];for(const J of En){const ge=await rt(`/sessions/${encodeURIComponent(J.sessionId)}/archive`,{method:"POST"});if(ge.status!==200){const _e=ge.body.upstream;p(_e?.message||t("session.archiveSomeFailed"));break}j.push(J.sessionId),I=ge.body.archivedSessionIds}j.length>0&&Sn(I,j)}async function $u(j){const I=u.find(_e=>_e.sessionId===j),J=x[j]||gv(I?.cwd)||t("session.blankName");if(!window.confirm(t("session.purgeOneConfirm",{name:J})))return;const ge=await rt(`/sessions/${encodeURIComponent(j)}/purge`,{method:"POST"});if(ge.status!==200){p(ge.body.error==="not_blank"?t("session.purgeNotBlank"):t("session.purgeFailed"));return}Bn(j)}async function An(){const j=En.filter(J=>J.blank===!0);if(j.length===0||!window.confirm(t("session.purgeAllConfirm",{count:String(j.length)})))return;const I=[];for(const J of j){if((await rt(`/sessions/${encodeURIComponent(J.sessionId)}/purge`,{method:"POST"})).status!==200){p(t("session.purgeSomeFailed"));break}I.push(J.sessionId),Bn(J.sessionId)}I.length}async function ba(j,I,J){on(!1),J!==""&&(ft(Te=>({...Te,[j]:J})),K(Te=>new Set([...Te,j])),S(Te=>{const it={...Te,[j]:J};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(it)),it}));const _e=(await rt("/sessions")).body.result;f(Pi(_e?.value?.items)),qi(j),vn(I),hi(Te=>Te+1)}function va(j,I){A(j),ct(I),window.requestAnimationFrame(()=>{const J=Ri.current;J&&(J.focus(),J.setSelectionRange(I,I))})}function xr(j){if(!li)return;const I=dO(Ne,et,li.start,j.label,j.sessionId);va(I.text,I.cursor)}function Wi(j="/"){Se(!1),A(I=>{const J=I.replace(/\s+$/,"");return J===""?j==="/"?"/":`${j} `:`${J} ${j==="/"?"/":`${j} `}`}),window.requestAnimationFrame(()=>Ri.current?.focus())}async function xa(j){const I=pe?.status==="accepted"&&E.drafting,J=Mi===a?Yt:[];if(!a||!j||!Z.ready||Jy(I,J,Vt.has(a)))return;const ge=E.drafting;A(""),Oe(""),gr.current+=1;const _e=Number.MAX_SAFE_INTEGER-gr.current;M(Et=>({...Et,drafting:!0,segments:[...Et.segments,{kind:"user",id:`optimistic:${_e}`,text:j,time:Date.now(),seq:_e,optimistic:!0}]}));const Te=await rt("/tasks",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({sessionId:a,text:j})}),it=Te.body.task;if(z(it??null),Te.status!==202){M(dt=>({...dt,drafting:ge?dt.drafting:!1,segments:dt.segments.filter(lt=>!(lt.kind==="user"&<.optimistic&<.text===j))}));const Et=Te.body.execution;Oe(Et?.reason||_u(String(Te.body.error||""),t("composer.notSent"),t))}}async function wa(){const j=Ne.trim();j&&await xa(j)}async function el(j,I){const J=await Ni("/dsh-bot/api/work/supply",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:a,ticketId:j,text:I})});return J.status!==200||J.body.ok===!1?vv(J.body,t("composer.supplyFailed")):""}async function Ju(){if(!pe||pe.status!=="accepted")return;const I=(await rt(`/tasks/${pe.id}/cancel?sessionId=${encodeURIComponent(pe.sessionId??"")}`,{method:"POST"})).body.task??pe;z(I),I.status==="cancelled"&&M(J=>({...J,drafting:!1}))}const tl=pe?.status==="accepted"&&E.drafting,wr=Jy(tl,Mi===a?Yt:[],Ln),Wu=!!a&&Z.ready&&Ne.trim()!==""&&!wr;function Vs(j){if(!Vt.has(j.sessionId))return null;const I=j.running===!0||j.sessionId===a&&(tl||E.drafting),J=j.sessionId===a&&Mi===a?Yt:(dr[j.sessionId]??[]).map(ge=>({status:ge}));return yk(J,I)}return h.jsxs("div",{className:a?"shell in-chat":"shell",children:[h.jsxs("aside",{className:"side",children:[h.jsxs("div",{className:"side-top",children:[h.jsx("strong",{className:"brand",children:t("app.title")}),h.jsxs("span",{className:"side-actions",children:[h.jsx("button",{type:"button",className:"icon-btn","aria-label":t("session.search"),onClick:()=>w(j=>!j),children:h.jsx(yO,{})}),h.jsx("button",{type:"button",className:"icon-btn","aria-label":t("new.title"),onClick:()=>on(!0),children:h.jsx(fv,{})})]})]}),y?h.jsx("input",{className:"filter",value:g,placeholder:t("session.searchPlaceholder"),onChange:j=>b(j.target.value)}):null,m?h.jsx("p",{className:"note",children:m}):null,Ot?h.jsx("p",{className:"note ok",children:Ot}):null,h.jsxs("ul",{className:"sessions",children:[gi.length===0&&En.length===0?h.jsx("li",{className:"empty",children:u.length?t("session.noMatch"):t("session.none")}):null,gi.map(j=>{const I=ni(j);return h.jsx("li",{onContextMenu:J=>Hs(J,j.sessionId),children:h.jsxs("button",{type:"button",className:j.sessionId===a?"session selected":"session",title:j.cwd||j.sessionId,onClick:()=>qi(j.sessionId),children:[h.jsxs("span",{className:Vt.has(j.sessionId)?"mark bot-mark":"mark",children:[Vt.has(j.sessionId)?"BOT":Array.from(I)[0],h.jsx(cv,{signal:Vs(j)})]}),h.jsxs("span",{className:"copy",children:[h.jsx("span",{className:"name",children:I}),h.jsx("span",{className:"preview",children:(j.sessionId===a?Sd(Yt,mr,t):"")||T[j.sessionId]||(j.running?t("session.running"):"")})]})]})},j.sessionId)}),En.length>0?h.jsxs("li",{className:"blank-head",children:[h.jsxs("button",{type:"button","aria-expanded":ha,onClick:()=>tn(j=>!j),children:[t(ha?"session.hide":"session.show")," ",t("session.blankCount",{count:String(En.length)})]}),h.jsx("button",{type:"button",onClick:()=>{Is()},children:t("session.archiveAll")}),h.jsx("button",{type:"button",onClick:()=>{An()},children:t("session.purgeAll")})]}):null,ha?En.map(j=>{const I=ni(j);return h.jsxs("li",{className:"session-row",onContextMenu:J=>Hs(J,j.sessionId),children:[h.jsxs("button",{type:"button",className:j.sessionId===a?"session selected":"session",title:j.cwd||j.sessionId,onClick:()=>qi(j.sessionId),children:[h.jsx("span",{className:Vt.has(j.sessionId)?"mark bot-mark":"mark",children:Vt.has(j.sessionId)?"BOT":Array.from(I)[0]}),h.jsxs("span",{className:"copy",children:[h.jsx("span",{className:"name",children:I}),h.jsx("span",{className:"preview",children:ve.has(j.sessionId)?t("session.archived"):t("session.blank")})]})]}),ve.has(j.sessionId)?null:h.jsx("button",{type:"button",className:"session-delete","aria-label":t("session.archiveLabel",{name:I}),onClick:()=>{Us(j.sessionId)},children:t("session.archive")}),h.jsx("button",{type:"button",className:"session-delete purge","aria-label":t("session.purgeLabel",{name:I}),onClick:()=>{$u(j.sessionId)},children:t("session.purge")})]},j.sessionId)}):null]}),ae?h.jsx(gO,{health:je,usage:le,execution:Z,model:E.model}):null,h.jsxs("div",{className:"me-row",children:[h.jsxs("button",{type:"button",className:"me",onClick:()=>se(j=>!j),children:[h.jsx("span",{className:"mark me-mark",children:t("local.mark")}),h.jsx("span",{children:je?.primary?.reachable===!1?t("local.down"):t("local.here")})]}),h.jsx("button",{type:"button",className:"lang-switch",onClick:()=>r(i==="en"?"zh":"en"),children:t("lang.switch")})]})]}),h.jsxs("section",{className:"chat",children:[h.jsxs("header",{className:"chat-head",children:[It?h.jsx("button",{type:"button",className:"bot-chat-back",onClick:()=>xt(!1),children:t("nav.back")}):ar(a)?h.jsx("button",{type:"button",className:"back",onClick:Ml,children:t("nav.back")}):h.jsx("button",{type:"button",className:"back",onClick:()=>{Ge(!1),be(null),o("")},children:t("nav.sessions")}),a&&Vt.has(a)?h.jsxs("span",{className:"bot-badge",children:["BOT",h.jsx(cv,{signal:Vs({sessionId:a,running:u.find(j=>j.sessionId===a)?.running})})]}):null,h.jsx("h1",{children:It?t("nav.botMessages"):Xu}),!It&&Sd(Yt,mr,t)?h.jsx("span",{className:"work-chip",children:Sd(Yt,mr,t)}):null,a&&!It?h.jsx("button",{type:"button",className:"files-open","aria-pressed":Ze==="memory",onClick:()=>{if(Ze==="memory"){Ke(null);return}Ge(!1),be(null),Ke("memory")},children:t("memory.open")}):null,a&&!It?h.jsx("button",{type:"button",className:"files-open","aria-pressed":we,onClick:()=>{if(we){Ge(!1),be(null);return}Ke(j=>j==="memory"?null:j),Ge(!0)},children:t("files.open")}):null,h.jsx("a",{href:Zu,children:t("nav.official")})]}),ar(a)&&!It?h.jsxs("nav",{className:"work-crumb","aria-label":t("nav.where"),children:[h.jsx("button",{type:"button",onClick:Ml,children:_i&&vr(_i)||t("nav.mainSession")}),h.jsx("span",{"aria-hidden":"true",children:"/"}),h.jsx("span",{children:t("nav.worker")})]}):null,a&&!It?h.jsx("button",{type:"button",className:"basis",onClick:()=>{Ge(!1),be(null),Ke("memory")},children:zi||t("memory.open")}):null,h.jsxs("div",{className:"chat-body",children:[h.jsx(hO,{active:wn||nn,progress:Wt}),h.jsx("div",{className:"scroll",ref:$i,"aria-busy":wn||nn||void 0,children:h.jsxs("div",{className:"column",children:[a?null:h.jsx("p",{className:"empty-thread",children:t("nav.pick")}),a&&!wn&&!nn&&!It&&ii.length===0&&Yt.length===0?h.jsx("p",{className:"empty-thread",children:t("nav.empty")}):null,h.jsx(g2,{children:wn?null:It?h.jsx(n3,{items:Ms,botLabel:vr,onOpenFile:(j,I)=>{Ke(J=>J==="memory"?null:J),be({path:j,line:I,token:Date.now()}),Ge(!0)}}):h.jsx(IO,{sessionId:a,cwd:u.find(j=>j.sessionId===a)?.cwd,connectionPhase:ie?.phase,segments:ii,approvals:ke,questionWaits:Fe,onCompose:j=>va(j,j.length),completed:E.completed,failures:E.failures,retries:E.retries,turnEnds:E.turnEnds,tickets:Yt,now:mr,canRetry:!!a&&Z.ready&&!tl,onRetry:j=>{xa(j)},onSupply:el,onOpenSession:ql,onOpenFile:(j,I)=>{Ke(J=>J==="memory"?null:J),be({path:j,line:I,token:Date.now()}),Ge(!0)},onOpenInbox:()=>xt(!0),botLabel:vr,chat:Ln})},a)]})}),It||wn?null:h.jsx(s3,{root:$i,marks:Ds,busyId:E.drafting&&E.turn!=null?`turn:${E.turn}`:void 0})]}),h.jsx("div",{className:"composer-wrap",hidden:It,children:h.jsxs("form",{className:"column",onSubmit:j=>{j.preventDefault(),wa()},children:[a&&!wn?h.jsx(T3,{segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:Yt,connectionPhase:ie?.phase,pendingApprovals:ke}):null,h.jsxs("div",{className:"card",children:[ga?h.jsx("div",{className:"mention-menu",role:"listbox","aria-label":t("composer.mention"),children:Ve.length===0?h.jsx("p",{className:"mention-empty",children:t("composer.noBot")}):Ve.map((j,I)=>h.jsxs("button",{type:"button",role:"option","aria-selected":I===Ji,className:I===Ji?"active":"",onMouseDown:J=>{J.preventDefault(),xr(j)},children:[h.jsx("span",{className:"bot-badge",children:"BOT"}),h.jsx("span",{className:"mention-name",children:j.label})]},j.sessionId))}):null,h.jsx("textarea",{ref:Ri,value:Ne,rows:1,placeholder:a?dm({segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:Yt,pendingApprovals:ke,t})?.text===t("question.waiting")||dm({segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:Yt,pendingApprovals:ke,t})?.text===t("approval.waiting")?t("question.waiting"):bk(Yt,t)??(Ln&&tl?t("composer.interrupt"):Vt.has(a)?t("composer.mentionHint"):t("composer.task")):t("composer.pick"),disabled:!a,onChange:j=>{A(j.target.value),ct(j.target.selectionStart??j.target.value.length)},onSelect:j=>ct(j.currentTarget.selectionStart??0),onKeyDown:j=>{if(!j.nativeEvent.isComposing){if(ga&&Ve.length>0){if(j.key==="ArrowDown"){j.preventDefault(),R(I=>(I+1)%Ve.length);return}if(j.key==="ArrowUp"){j.preventDefault(),R(I=>(I-1+Ve.length)%Ve.length);return}if(j.key==="Enter"||j.key==="Tab"){j.preventDefault();const I=Ve[Ji];I&&xr(I);return}if(j.key==="Escape"){j.preventDefault(),de(pa);return}}j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),wa())}}}),h.jsxs("div",{className:"card-row",children:[h.jsxs("div",{className:"tools",ref:ca,children:[h.jsx("button",{type:"button",className:"add","aria-label":t("composer.add"),"aria-haspopup":"menu","aria-expanded":Ce,disabled:!a,onClick:()=>Se(j=>!j),children:h.jsx(fv,{})}),Ce?h.jsxs("div",{className:"plus-menu",role:"menu",children:[h.jsx("button",{type:"button",role:"menuitem",onClick:()=>Wi(),children:t("composer.command")}),h.jsx("button",{type:"button",role:"menuitem",onClick:()=>{Se(!1),Ge(!1),be(null),Ke("memory")},children:t("memory.open")}),h.jsx("button",{type:"button",role:"menuitem",onClick:()=>{Se(!1),Ke("permission")},children:t("permission.open")}),h.jsx("button",{type:"button",role:"menuitem",onClick:()=>{Se(!1),Ke("authorization")},children:t("auth.open")}),ze?h.jsx("button",{type:"button",role:"menuitem",onClick:()=>{Se(!1),Ke("cua")},children:t("cua.open")}):null,h.jsx("p",{className:"plus-note",children:t("composer.filesLater")})]}):null,E.preset?h.jsxs("button",{type:"button",className:"chip",onClick:()=>Ke("permission"),children:[h.jsx(bO,{preset:E.preset}),j1(E.preset,t)]}):null]}),h.jsxs("div",{className:"trailing",children:[E.model?h.jsx("span",{className:"model",children:E.model}):null,tl?h.jsx("button",{type:"button",className:"stop","aria-label":t("composer.cancel"),onClick:()=>{Ju()},children:h.jsx("span",{className:"stop-icon"})}):null,wr?null:h.jsx("button",{type:"submit",className:"send","aria-label":t("composer.send"),disabled:!Wu,children:h.jsx(vO,{})})]})]})]}),h.jsx("p",{className:"stats",children:ye||(Z.ready?pO(E):_u(Z.reason,Z.reason,t))})]})})]}),Ze==="permission"&&a?h.jsx(X3,{sessionId:a,current:E.preset,onClose:()=>Ke(null),onChanged:()=>hi(j=>j+1)}):null,Ze==="authorization"||gt&&Ze==null?h.jsx(Z3,{authorization:De,catalog:bn,onClose:()=>Ke(null)}):null,Ze==="cua"&&ze?h.jsx(K3,{onClose:()=>Ke(null)}):null,a?h.jsx(C2,{open:we,sessionId:a,focus:oe,onClose:()=>{Ge(!1),be(null)}},a):null,a&&!It?h.jsx(q3,{open:Ze==="memory",sessionId:a,onClose:()=>Ke(null)}):null,$?h.jsx("div",{ref:fa,className:"session-menu",role:"menu","aria-label":t("session.menu"),style:{left:$.x,top:$.y},onContextMenu:j=>j.preventDefault(),children:h.jsx("button",{type:"button",role:"menuitem",onClick:()=>{const j=$.id;me(null),ya(j)},children:t("session.delete")})}):null,sn?h.jsx(X2,{onClose:()=>on(!1),onCreated:(j,I,J)=>{ba(j,I,J)}}):null]})}const H1=document.querySelector("#root");if(!H1)throw new Error("missing root");ES.createRoot(H1).render(h.jsx(C.StrictMode,{children:h.jsx(ak,{children:h.jsx(ZO,{})})}));export{KO as W,Ck as _,h as j,$O as m,C as r,We as u};
|