@workerdeck/web 2.13.0 → 2.14.0
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/dist/assets/addon-fit-DIOBYJe3.js +1 -0
- package/dist/assets/{dist-Cw2XXbqR.js → dist-BYhO38VS.js} +1 -1
- package/dist/assets/{freemarker2-BiH8thaI.js → freemarker2-BMT3npoL.js} +1 -1
- package/dist/assets/{handlebars-DJeYRsv7.js → handlebars-C1HjVIxf.js} +1 -1
- package/dist/assets/{highlighted-body-KPVGNVTW-Budv6ikk.js → highlighted-body-KPVGNVTW-eviACFLs.js} +1 -1
- package/dist/assets/{html-ClJwdCMY.js → html-DyxqjCNt.js} +1 -1
- package/dist/assets/index-BCsXFKe5.css +2 -0
- package/dist/assets/index-CSnoypph.js +211 -0
- package/dist/assets/{javascript-xpmB7Ev3.js → javascript-wde8K2s8.js} +1 -1
- package/dist/assets/{liquid-CZdXe5LM.js → liquid-CA6dtEyS.js} +1 -1
- package/dist/assets/{mdx-C3AXLrN4.js → mdx-B4s_jSh_.js} +1 -1
- package/dist/assets/mermaid-HWGCJPDP-BRHSVJqI.js +1 -0
- package/dist/assets/{python-BM5etFVV.js → python-na-LRwxf.js} +1 -1
- package/dist/assets/{razor-DFEi5Q99.js → razor-B_lApyZT.js} +1 -1
- package/dist/assets/{src-DIc6bzEh.js → src-BcRpl0IM.js} +1 -1
- package/dist/assets/{typescript-CBuxm0KT.js → typescript-CA04tTHG.js} +1 -1
- package/dist/assets/{vs-C1_WU_7M.js → vs-CdkLmTlg.js} +3 -3
- package/dist/assets/{xml-BXwqYPNQ.js → xml-N04DsKm8.js} +1 -1
- package/dist/assets/xterm-ScmBfeDI.js +16 -0
- package/dist/assets/{yaml-CjaxHJOT.js → yaml-D1nD9xzN.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +7 -5
- package/dist/assets/index-CwNNtB35.js +0 -204
- package/dist/assets/index-DwU2cbkg.css +0 -2
- package/dist/assets/mermaid-HWGCJPDP-h4mxGPk9.js +0 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vs-CdkLmTlg.js","assets/vs-DWxI6Y27.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var ee={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ee,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(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 _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(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 E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),ee=Symbol.for(`react.lazy`),B=Symbol.for(`react.activity`),V=Symbol.for(`react.legacy_hidden`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.for(`react.view_transition`),H=Symbol.for(`react.recoverable`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case B:return`Activity`;case ne:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case ee:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,ce=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function be(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?yp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=yp(t),e=bp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function xe(){me(ge),me(_e),me(ve)}function Se(e){var t=e.memoizedState;t!==null&&(gh._currentValue=t.memoizedState,he(ye,e)),t=ge.current;var n=bp(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Ce(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),gh._currentValue=ue)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ee(n):``}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee(`Lazy`);case 13:return e.child!==t&&t!==null?Ee(`Suspense Fallback`):Ee(`Suspense`);case 19:return Ee(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Ee(`Activity`);case 30:return Ee(`ViewTransition`);default:return``}}function Ae(e){try{var t=``,n=null;do t+=ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var je=Object.prototype.hasOwnProperty,Me=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,Fe=t.unstable_requestPaint,Ie=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,He=t.unstable_IdlePriority,Ue=t.log,We=t.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Je(n),i=1<<r;t|=e[r],n&=~i}return t}function at(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ot(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function st(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function lt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ut(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ut(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function dt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ft(e,t){var n=t&-t;return n=n&42?1:pt(n),(n&(e.suspendedLanes|t))===0?n:0}function pt(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 mt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ht(){var e=le.p;return e===0?(e=window.event,e===void 0?32:Mh(e.type)):e}function gt(e,t){var n=le.p;try{return le.p=e,t()}finally{le.p=n}}var _t=Math.random().toString(36).slice(2),vt=`__reactFiber$`+_t,yt=`__reactProps$`+_t,bt=`__reactContainer$`+_t,xt=`__reactEvents$`+_t,St=`__reactListeners$`+_t,Ct=`__reactHandles$`+_t,wt=`__reactResources$`+_t,Tt=`__reactMarker$`+_t,Et=`__reactLoad$`+_t;function Dt(e){delete e[vt],delete e[yt],delete e[St],delete e[Ct]}function Ot(e){var t;if(t=e[vt])return t;for(var n=e.parentNode;n;){if(t=n[bt]||n[vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xm(e);e!==null;){if(n=e[vt])return n;e=xm(e)}return t}e=n,n=e.parentNode}return null}function kt(e){if(e=e[vt]||e[bt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function At(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function jt(e){var t=e[wt];return t||=e[wt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Mt(e){e[Tt]=!0}function Nt(e){e[Et]=void 0}var Pt=new Set,Ft={};function It(e,t){Lt(e,t),Lt(e+`Capture`,t)}function Lt(e,t){for(Ft[e]=t,e=0;e<t.length;e++)Pt.add(t[e])}var Rt=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]*$`),zt={},Bt={};function Vt(e){return je.call(Bt,e)?!0:je.call(zt,e)?!1:Rt.test(e)?Bt[e]=!0:(zt[e]=!0,!1)}var Ht=!1;function Ut(){var e=Ht;return Ht=!1,e}function Wt(e,t,n){if(Vt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Gt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Yt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xt(e){if(!e._valueTracker){var t=Jt(e)?`checked`:`value`;e._valueTracker=Yt(e,t,``+e[t])}}function Zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Qt=/[\n"\\]/g;function $t(e){return e.replace(Qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function en(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+qt(t)):e.value!==``+qt(t)&&(e.value=``+qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):nn(e,qt(n)):o===`number`&&e.value==t?nn(e,qt(e.value)):nn(e,qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+qt(s):e.removeAttribute(`name`)}function tn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Xt(e);return}n=n==null?``:``+qt(n),t=t==null?n:``+qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Xt(e)}function nn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function rn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function an(e,t,n){if(t!=null&&(t=``+qt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+qt(n)}function on(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(se(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Xt(e)}function sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cn=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 ln(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function un(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Ht=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(ln(e,a,r),Ht=!0)}else for(var o in t)t.hasOwnProperty(o)&&ln(e,o,t[o])}function dn(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 fn=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`]]),pn=/^[\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 mn(e){return pn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function hn(){}var gn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vn=null,yn=null;function bn(e){var t=kt(e);if(t&&(e=t.stateNode)){var n=e[yt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(en(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+$t(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[yt]||null;if(!a)throw Error(i(90));en(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Zt(r)}break a;case`textarea`:an(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&rn(e,!!n.multiple,t,!1)}}}var xn=!1;function Sn(e,t,n){if(xn)return e(t,n);xn=!0;try{return e(t)}finally{if(xn=!1,(vn!==null||yn!==null)&&(Gd(),vn&&(t=vn,e=yn,yn=vn=null,bn(t),e)))for(t=0;t<e.length;t++)bn(e[t])}}function Cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[yt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Tn=!1;if(wn)try{var En={};Object.defineProperty(En,"passive",{get:function(){Tn=!0}}),window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return kn=i.slice(e,1<r?1-r:void 0)}function jn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mn(){return!0}function Nn(){return!1}function Pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Mn:Nn,this.isPropagationStopped=Nn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=D({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=D({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qn,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!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),U=Pn(Hn),Un=Pn(D({},Hn,{dataTransfer:0})),Wn=Pn(D({},Ln,{relatedTarget:0})),Gn=Pn(D({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),Kn=Pn(D({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),qn=Pn(D({},Fn,{data:0})),Jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Yn={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`},Xn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xn[e])?!!t[e]:!1}function Qn(){return Zn}var $n=Pn(D({},Ln,{key:function(e){if(e.key){var t=Jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Yn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qn,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),er=Pn(D({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tr=Pn(D({},Fn,{submitter:0})),nr=Pn(D({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qn})),rr=Pn(D({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ir=Pn(D({},Hn,{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})),ar=Pn(D({},Fn,{newState:0,oldState:0,source:0})),or=[9,13,27,32],sr=wn&&`CompositionEvent`in window,cr=null;wn&&`documentMode`in document&&(cr=document.documentMode);var lr=wn&&`TextEvent`in window&&!cr,ur=wn&&(!sr||cr&&8<cr&&11>=cr),dr=` `,fr=!1;function pr(e,t){switch(e){case`keyup`:return or.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function mr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var hr=!1;function gr(e,t){switch(e){case`compositionend`:return mr(t);case`keypress`:return t.which===32?(fr=!0,dr):null;case`textInput`:return e=t.data,e===dr&&fr?null:e;default:return null}}function _r(e,t){if(hr)return e===`compositionend`||!sr&&pr(e,t)?(e=An(),kn=On=Dn=null,hr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return ur&&t.locale!==`ko`?null:t.data;default:return null}}var vr={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 yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){vn?yn?yn.push(r):yn=[r]:vn=r,t=np(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Jf(e,0)}function wr(e){if(Zt(At(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(wn){var Dr;if(wn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,_n(e)),Sn(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!je.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zr(e.document)}return t}function Wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Gr=wn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jr&&Rr(Jr,r)||(Jr=r,r=np(qr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};wn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`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(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),It(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Ed.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Pd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ti(e){if(50<Fd)throw Fd=0,Id=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ji(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ki(r)&&(s=1);else if(typeof r==`string`)s=nh(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case B:return e=Oi(31,n,t,a),e.elementType=B,e.lanes=o,e;case j:return Ni(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Oi(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Oi(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Oi(19,n,t,a),e.elementType=R,e.lanes=o,e;case V:case ne:return e=a|32,e=Oi(30,n,t,e),e.elementType=ne,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case ee:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var zi=[],Bi=0,Vi=null,Hi=0,Ui=[],Wi=0,Gi=null,Ki=1,qi=``;function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e,Hi=t}function Yi(e,t,n){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Gi=e;var r=Ki;e=qi;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ki=1<<32-Je(t)+i|n<<i|r,qi=a+e}else Ki=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null;for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,qi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null}function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Ki=t.id,qi=t.overflow,Gi=e}var $i=null,ea=null,ta=!1,na=null,ra=!1,ia=Error(i(519));function aa(e){throw da(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ia}function oa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[vt]=e,t[yt]=r,n){case`dialog`:Yf(`cancel`,t),Yf(`close`,t);break;case`iframe`:case`object`:case`embed`:Yf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Kf.length;n++)Yf(Kf[n],t);break;case`source`:Yf(`error`,t);break;case`img`:case`image`:case`link`:Yf(`error`,t),Yf(`load`,t);break;case`details`:Yf(`toggle`,t);break;case`input`:Yf(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Yf(`invalid`,t);break;case`textarea`:Yf(`invalid`,t),on(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||cp(t.textContent,n)?(r.popover!=null&&(Yf(`beforetoggle`,t),Yf(`toggle`,t)),r.onScroll!=null&&Yf(`scroll`,t),r.onScrollEnd!=null&&Yf(`scrollend`,t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||aa(e,!0)}function sa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:$i=$i.return}}function ca(e){if(e!==$i)return!1;if(!ta)return sa(e),ta=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Sp(e.type,e.memoizedProps)),n=!n),n&&ea&&aa(e),sa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=bm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=bm(e)}else t===27?(t=ea,jp(e.type)?(e=ym,ym=null,ea=e):ea=t):ea=$i?vm(e.stateNode.nextSibling):null;return!0}function la(){ea=$i=null,ta=!1}function ua(){var e=na;return e!==null&&(vd===null?vd=e:vd.push.apply(vd,e),na=null),e}function da(e){na===null?na=[e]:na.push(e)}var fa=pe(null),pa=null,ma=null;function ha(e,t,n){he(fa,t._currentValue),t._currentValue=n}function ga(e){e._currentValue=fa.current,me(fa)}function _a(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function va(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),_a(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),_a(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),_a(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ya(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[gh]:e.push(gh))}a=a.return}return e!==null&&va(t,e,n,r),t.flags|=262144,e!==null}function ba(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xa(e){pa=e,ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sa(e){return wa(pa,e)}function Ca(e,t){return pa===null&&xa(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ma===null){if(e===null)throw Error(i(308));ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ma=ma.next=t;return n}var Ta=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ea=t.unstable_scheduleCallback,Da=t.unstable_NormalPriority,Oa={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ka(){return{controller:new Ta,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ea(Da,function(){e.controller.abort()})}function ja(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ma=null;function Na(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pa=null,Fa=0,Ia=0,La=null;function Ra(e,t){if(Pa===null){var n=Pa=[];Fa=0,Ia=Vf(),La={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Fa++,t.then(za,za),t}function za(){if(--Fa===0&&(Ma=null,Pa!==null)){La!==null&&(La.status=`fulfilled`);var e=Pa;Pa=null,Ia=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ba(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Va=ce.S;ce.S=function(e,t){if(xd=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=Df;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=Df;r!==null;)ja(r,n),r=r.next;if(Ia!==0){r=Ma,r===null&&(r=Ma=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Va!==null&&Va(e,t)};var Ha=pe(null);function Ua(){var e=Ha.current;return e===null?nd.pooledCache:e}function Wa(e,t){t===null?he(Ha,Ha.current):he(Ha,t.pool)}function Ga(){var e=Ua();return e===null?null:{parent:Oa._currentValue,pool:e}}var Ka=Error(i(460)),qa=Error(i(474)),Ja=Error(i(542)),Ya={then:function(){}};function Xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Za(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(hn,hn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(hn,hn);else{if(e=nd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e}throw $a=t,Ka}}function Qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?($a=e,Ka):e}}var $a=null;function eo(){if($a===null)throw Error(i(459));var e=$a;return $a=null,e}function to(e){if(e===Ka||e===Ja)throw Error(i(483))}var no=null,ro=0;function io(e){var t=ro;return ro+=1,no===null&&(no=[]),Za(no,e,t)}function ao(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function oo(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function so(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),ao(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ee&&Qa(i)===t.type)?(t=a(t,n.props),ao(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),ao(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ii(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Mi(t.type,t.key,t.props,null,e.mode,n),ao(n,t),n.return=e,n;case A:return t=Ii(t,e.mode,n),t.return=e,t;case ee:return t=Qa(t),f(e,t,n)}if(se(t)||ie(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,io(t),n);if(t.$$typeof===F)return f(e,Ca(e,t),n);oo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case ee:return n=Qa(n),p(e,t,n,r)}if(se(n)||ie(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,io(n),r);if(n.$$typeof===F)return p(e,t,Ca(e,n),r);oo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ee:return r=Qa(r),m(e,t,n,r,i)}if(se(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,io(r),i);if(r.$$typeof===F)return m(e,t,n,Ca(t,r),i);oo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ta&&Ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ta&&Ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ta&&Ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ta&&Ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ta&&Ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ta&&Ji(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),ao(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ee&&Qa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ao(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ni(o.props.children,e.mode,c,o.key),ao(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),ao(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case ee:return o=Qa(o),_(e,r,o,c)}if(se(o))return h(e,r,o,c);if(ie(o)){if(l=ie(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,io(o),c);if(o.$$typeof===F)return _(e,r,Ca(e,o),c);oo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ro=0;var i=_(e,t,n,r);return no=null,i}catch(t){if(t===Ka||t===Ja)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var W=so(!0),co=so(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,td&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dt(e,n)}}function go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _o=!1;function vo(){if(_o){var e=La;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(id&f)===f:(r&f)===f){f!==0&&f===Ia&&(_o=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:lo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),fd|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=pe(null),Co=pe(0);function wo(e,t){e=ud,he(Co,e),he(So,t),ud=e|t.baseLanes}function To(){he(Co,ud),he(So,So.current)}function Eo(){ud=Co.current,me(So),me(Co)}var Do=pe(null),Oo=null;function ko(e){var t=e.alternate;he(Po,Po.current&1),he(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){he(Po,Po.current),he(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(he(Po,Po.current),he(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){he(Po,Po.current),he(Do,Do.current)}function No(e){me(Do),Oo===e&&(Oo=null),me(Po)}var Po=pe(0);function Fo(e,t){he(Do,Do.current),he(Po,t)}function Io(e){me(Po),me(Do),Oo===e&&(Oo=null)}function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hm(n)||gm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ro=0,zo=null,Bo=null,Vo=null,Ho=!1,Uo=!1,Wo=!1,Go=0,Ko=0,qo=null,Jo=0;function Yo(){throw Error(i(321))}function Xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Zo(e,t,n,r,i,a){return Ro=a,zo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ce.H=e===null||e.memoizedState===null?mc:hc,Wo=!1,a=n(r,i),Wo=!1,Uo&&(a=$o(t,n,r,i)),Qo(e),a}function Qo(e){ce.H=pc;var t=Bo!==null&&Bo.next!==null;if(Ro=0,Vo=Bo=zo=null,Ho=!1,Ko=0,qo=null,t)throw Error(i(300));e===null||Mc||(e=e.dependencies,e!==null&&ba(e)&&(Mc=!0))}function $o(e,t,n,r){zo=e;var a=0;do{if(Uo&&(qo=null),Ko=0,Uo=!1,25<=a)throw Error(i(301));if(a+=1,Vo=Bo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ce.H=gc,o=t(n,r)}while(Uo);return o}function es(){var e=ce.H,t=e.useState()[0];return t=typeof t.then==`function`?ss(t):t,e=e.useState()[0],(Bo===null?null:Bo.memoizedState)!==e&&(zo.flags|=1024),t}function ts(){var e=Go!==0;return Go=0,e}function ns(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rs(e){if(Ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ho=!1}Ro=0,Vo=Bo=zo=null,Uo=!1,Ko=Go=0,qo=null}function is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vo===null?zo.memoizedState=Vo=e:Vo=Vo.next=e,Vo}function as(){if(Bo===null){var e=zo.alternate;e=e===null?null:e.memoizedState}else e=Bo.next;var t=Vo===null?zo.memoizedState:Vo.next;if(t!==null)Vo=t,Bo=e;else{if(e===null)throw zo.alternate===null?Error(i(467)):Error(i(310));Bo=e,e={memoizedState:Bo.memoizedState,baseState:Bo.baseState,baseQueue:Bo.baseQueue,queue:Bo.queue,next:null},Vo===null?zo.memoizedState=Vo=e:Vo=Vo.next=e}return Vo}function os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ss(e){var t=Ko;return Ko+=1,qo===null&&(qo=[]),e=Za(qo,e,t),t=zo,(Vo===null?t.memoizedState:Vo.next)===null&&(t=t.alternate,ce.H=t===null||t.memoizedState===null?mc:hc),e}function cs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ss(e);if(e.$$typeof===H)return;if(e.$$typeof===F)return Sa(e)}throw Error(i(438,String(e)))}function ls(e){var t=null,n=zo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=zo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=os(),zo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=te;return t.index++,n}function us(e,t){return typeof t==`function`?t(e):t}function ds(e){return fs(as(),Bo,e)}function fs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ro&f)===f:(id&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ia&&(d=!0);else if((Ro&p)===p){u=u.next,p===Ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,zo.lanes|=p,fd|=p;f=u.action,Wo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,zo.lanes|=f,fd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(Mc=!0,d&&(n=La,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ps(e){var t=as(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Lr(o,t.memoizedState)||(Mc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ms(e,t,n){var r=zo,a=as(),o=ta;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((Bo||a).memoizedState,n);if(s&&(a.memoizedState=n,Mc=!0),a=a.queue,zs(_s.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Vo!==null&&!!(Vo.memoizedState.tag&1),Ps(e?9:8,{destroy:void 0},gs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,nd===null)throw Error(i(349));o||Ro&127||hs(r,t,n)}return n}function hs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=zo.updateQueue,t===null?(t=os(),zo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gs(e,t,n,r){t.value=n,t.getSnapshot=r,vs(t)&&ys(e)}function _s(e,t,n){return n(function(){vs(t)&&ys(e)})}function vs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function ys(e){var t=Ci(e,2);t!==null&&Bd(t,e,2)}function bs(e){var t=is();if(typeof e==`function`){var n=e;if(e=n(),Wo){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:e},t}function xs(e,t,n,r){return e.baseState=n,fs(e,Bo,typeof r==`function`?r:us)}function Ss(e,t,n,r,a){if(uc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};ce.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Cs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Cs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=ce.T,o={};o.types=a===null?null:a.types,ce.T=o;try{var s=n(i,r),c=ce.S;c!==null&&c(o,s),ws(e,t,s)}catch(n){Es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),ce.T=a}}else try{a=n(i,r),ws(e,t,a)}catch(n){Es(e,t,n)}}function ws(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ts(e,t,n)},function(n){return Es(e,t,n)}):Ts(e,t,n)}function Ts(e,t,n){t.status=`fulfilled`,t.value=n,Ds(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Cs(e,n)))}function Es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ds(t),t=t.next;while(t!==r)}e.action=null}function Ds(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Os(e,t){return t}function ks(e,t){if(ta){var n=nd.formState;if(n!==null){a:{var r=zo;if(ta){if(ea){b:{for(var i=ea,a=ra;i.nodeType!==8;){if(!a){i=null;break b}if(i=vm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=vm(i.nextSibling),r=i.data===`F!`;break a}}aa(r)}r=!1}r&&(t=n[0])}}return n=is(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:t},n.queue=r,n=sc.bind(null,zo,r),r.dispatch=n,r=bs(!1),a=lc.bind(null,zo,!1,r.queue),r=is(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ss.bind(null,zo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function As(e){return js(as(),Bo,e)}function js(e,t,n){if(t=fs(e,t,Os)[0],e=ds(us)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ss(t)}catch(e){throw e===Ka?Ja:e}else r=t;t=as();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(zo.flags|=2048,Ps(9,{destroy:void 0},Ms.bind(null,i,n),null)),[r,a,e]}function Ms(e,t){e.action=t}function Ns(e){var t=as(),n=Bo;if(n!==null)return js(t,n,e);as(),t=t.memoizedState,n=as();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ps(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=zo.updateQueue,t===null&&(t=os(),zo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Fs(){return as().memoizedState}function Is(e,t,n,r){var i=is();zo.flags|=e,i.memoizedState=Ps(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ls(e,t,n,r){var i=as();r=r===void 0?null:r;var a=i.memoizedState.inst;Bo!==null&&r!==null&&Xo(r,Bo.memoizedState.deps)?i.memoizedState=Ps(t,a,n,r):(zo.flags|=e,i.memoizedState=Ps(1|t,a,n,r))}function Rs(e,t){Is(8390656,8,e,t)}function zs(e,t){Ls(2048,8,e,t)}function Bs(e){zo.flags|=4;var t=zo.updateQueue;if(t===null)t=os(),zo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Vs(e){var t=as().memoizedState;return Bs({ref:t,nextImpl:e}),function(){if(td&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Hs(e,t){return Ls(4,2,e,t)}function Us(e,t){return Ls(4,4,e,t)}function Ws(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Gs(e,t,n){n=n==null?null:n.concat([e]),Ls(4,4,Ws.bind(null,t,e),n)}function Ks(){}function qs(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Js(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xo(t,r[1]))return r[0];if(r=e(),Wo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Ys(e,t,n){return n===void 0||Ro&1073741824&&!(id&261930)?e.memoizedState=t:(e.memoizedState=n,e=Rd(),zo.lanes|=e,fd|=e,n)}function Xs(e,t,n,r){return Lr(n,t)?n:So.current===null?!(Ro&106)||Ro&1073741824&&!(id&261930)?(Mc=!0,e.memoizedState=n):(e=Rd(),zo.lanes|=e,fd|=e,t):(e=Ys(e,n,r),Lr(e,t)||(Mc=!0),e)}function Zs(e,t,n,r,i){var a=le.p;le.p=a!==0&&8>a?a:8;var o=ce.T,s={};s.types=o===null?null:o.types,ce.T=s,lc(e,!1,t,n);try{var c=i(),l=ce.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?cc(e,t,Ba(c,r),Ld(e)):cc(e,t,r,Ld(e))}catch(n){cc(e,t,{then:function(){},status:`rejected`,reason:n},Ld())}finally{le.p=a,o!==null&&s.types!==null&&(o.types=s.types),ce.T=o}}function Qs(){}function $s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ec(e).queue;Zs(e,a,t,ue,n===null?Qs:function(){return tc(e),n(r)})}function ec(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tc(e){var t=ec(e);t.next===null&&(t=e.alternate.memoizedState),cc(e,t.next.queue,{},Ld())}function nc(){return Sa(gh)}function rc(){return as().memoizedState}function ic(){return as().memoizedState}function ac(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ld();e=po(n);var r=mo(t,e,n);r!==null&&(Bd(r,t,n),ho(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function oc(e,t,n){var r=Ld();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)?dc(t,n):(n=Si(e,t,n,r),n!==null&&(Bd(n,e,r),fc(n,t,r)))}function sc(e,t,n){cc(e,t,n,Ld())}function cc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(uc(e))dc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Lr(s,o))return xi(e,t,i,0),nd===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return Bd(n,e,r),fc(n,t,r),!0}return!1}function lc(e,t,n,r){if(r={lane:2,revertLane:Vf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&Bd(t,e,2)}function uc(e){var t=e.alternate;return e===zo||t!==null&&t===zo}function dc(e,t){Uo=Ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dt(e,n)}}var pc={readContext:Sa,use:cs,useCallback:Yo,useContext:Yo,useEffect:Yo,useImperativeHandle:Yo,useLayoutEffect:Yo,useInsertionEffect:Yo,useMemo:Yo,useReducer:Yo,useRef:Yo,useState:Yo,useDebugValue:Yo,useDeferredValue:Yo,useTransition:Yo,useSyncExternalStore:Yo,useId:Yo,useHostTransitionStatus:Yo,useFormState:Yo,useActionState:Yo,useOptimistic:Yo,useMemoCache:Yo,useCacheRefresh:Yo,useEffectEvent:Yo},mc={readContext:Sa,use:cs,useCallback:function(e,t){return is().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:Rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Is(4194308,4,Ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Is(4194308,4,e,t)},useInsertionEffect:function(e,t){Is(4,2,e,t)},useMemo:function(e,t){var n=is();t=t===void 0?null:t;var r=e();if(Wo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=is();if(n!==void 0){var i=n(t);if(Wo){qe(!0);try{n(t)}finally{qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=oc.bind(null,zo,e),[r.memoizedState,e]},useRef:function(e){var t=is();return e={current:e},t.memoizedState=e},useState:function(e){e=bs(e);var t=e.queue,n=sc.bind(null,zo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ks,useDeferredValue:function(e,t){return Ys(is(),e,t)},useTransition:function(){var e=bs(!1);return e=Zs.bind(null,zo,e.queue,!0,!1),is().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=zo,a=is();if(ta){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),nd===null)throw Error(i(349));id&127||hs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Rs(_s.bind(null,r,o,e),[e]),r.flags|=2048,Ps(9,{destroy:void 0},gs.bind(null,r,o,n,t),null),n},useId:function(){var e=is(),t=nd.identifierPrefix;if(ta){var n=qi,r=Ki;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Jo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:nc,useFormState:ks,useActionState:ks,useOptimistic:function(e){var t=is();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lc.bind(null,zo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ls,useCacheRefresh:function(){return is().memoizedState=ac.bind(null,zo)},useEffectEvent:function(e){var t=is(),n={impl:e};return t.memoizedState=n,function(){if(td&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},hc={readContext:Sa,use:cs,useCallback:qs,useContext:Sa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ds,useRef:Fs,useState:function(){return ds(us)},useDebugValue:Ks,useDeferredValue:function(e,t){return Xs(as(),Bo.memoizedState,e,t)},useTransition:function(){var e=ds(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:As,useActionState:As,useOptimistic:function(e,t){return xs(as(),Bo,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs},gc={readContext:Sa,use:cs,useCallback:qs,useContext:Sa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ps,useRef:Fs,useState:function(){return ps(us)},useDebugValue:Ks,useDeferredValue:function(e,t){var n=as();return Bo===null?Ys(n,e,t):Xs(n,Bo.memoizedState,e,t)},useTransition:function(){var e=ps(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){var n=as();return Bo===null?(n.baseState=e,[e,n.queue.dispatch]):xs(n,Bo,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs};function _c(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Bd(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Bd(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ld(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Bd(t,e,n),ho(t,e,n))}};function yc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(i,a):!0}function bc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&vc.enqueueReplaceState(t,t.state,null)}function xc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Sc(e){gi(e)}function Cc(e){console.error(e)}function wc(e){gi(e)}function Tc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Dc(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){Tc(e,t)},n}function Oc(e){return e=po(e),e.tag=3,e}function kc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ec(t,n,r),typeof i!=`function`&&(wd===null?wd=new Set([this]):wd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ac(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ya(t,n,a,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?Qd():n.alternate===null&&dd===0&&(dd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),xf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),xf(e,r,a)),!1}throw Error(i(435,n.tag))}return xf(e,r,a),Qd(),!1}if(ta)return t=Do.current,t===null?(r!==ia&&(t=Error(i(423),{cause:r}),da(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=Dc(e.stateNode,r,a),go(e,a),dd!==4&&(dd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ia&&(e=Error(i(422),{cause:r}),da(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),_d===null?_d=[o]:_d.push(o),dd!==4&&(dd=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Dc(n.stateNode,r,e),go(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(wd===null||!wd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Oc(a),kc(a,e,n,r),go(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var jc=Error(i(461)),Mc=!1;function Nc(e,t,n,r){t.child=e===null?co(t,null,n,r):W(t,e.child,n,r)}function Pc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return xa(t),r=Zo(e,t,n,o,a,i),s=ts(),e!==null&&!Mc?(ns(e,t,i),cl(e,t,i)):(ta&&s&&Xi(t),t.flags|=1,Nc(e,t,r,i),t.child)}function Fc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ic(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ll(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return cl(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(Mc=!1,t.pendingProps=r=a,ll(e,i))e.flags&131072&&(Mc=!0);else return t.lanes=e.lanes,cl(e,t,i)}}return Wc(e,t,n,r,i)}function Lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return zc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,zc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Wa(t,null),To(),Mo()):(Wa(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Nc(e,t,i,n),t.child}function Rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zc(e,t,n,r,i){var a=Ua();return a=a===null?null:{parent:Oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Wa(t,null),To(),jo(t),e!==null&&ya(e,t,r,!0),t.childLanes=i,null}function Bc(e,t){return t=$c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Vc(e,t,n){return W(t,e.child,null,n),e=Bc(t,t.pendingProps),e.flags|=2,No(t),t.memoizedState=null,e}function Hc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ta){if(r.mode===`hidden`)return e=Bc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Rc(null,e);if(Ao(t),(e=ea)?(e=mm(e,ra),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=536870912,null}return Bc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ao(t),a){if(t.flags&256)t.flags&=-257,t=Vc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Mc||ya(e,t,n,!1),a=(n&e.childLanes)!==0,Mc||a){if(So.current===null){if(r=nd,r!==null&&(s=ft(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),Bd(r,e,s),jc;Qd()}t=Vc(e,t,n)}else e=o.treeContext,ea=vm(s.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=Bc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Wc(e,t,n,r,i){return xa(t),n=Zo(e,t,n,r,void 0,i),r=ts(),e!==null&&!Mc?(ns(e,t,i),cl(e,t,i)):(ta&&r&&Xi(t),t.flags|=1,Nc(e,t,n,i),t.child)}function Gc(e,t,n,r,i,a){return xa(t),t.updateQueue=null,n=$o(t,r,n,i),Qo(e),r=ts(),e!==null&&!Mc?(ns(e,t,a),cl(e,t,a)):(ta&&r&&Xi(t),t.flags|=1,Nc(e,t,n,a),t.child)}function Kc(e,t,n,r,i){if(xa(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=Sa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=vc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(_c(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&vc.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=xc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=Sa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&bc(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(_c(t,n,d,r),l=t.memoizedState),(c=lo||yc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,fo(e,t),o=t.memoizedProps,u=xc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=Sa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&bc(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ba(e.dependencies)?(typeof s==`function`&&(_c(t,n,s,r),p=t.memoizedState),(u=lo||yc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ba(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=W(t,e.child,null,i),t.child=W(t,null,n,i)):Nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=cl(e,t,i),e}function qc(e,t,n,r){return la(),t.flags|=256,Nc(e,t,n,r),t.child}var Jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yc(e){return{baseLanes:e,cachePool:Ga()}}function Xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=hd),e}function Zc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Po.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ta){if(i?ko(t):Mo(),(e=ea)?(e=mm(e,ra),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=gm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=$c({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Yc(n),r.childLanes=Xc(e,o,n),t.memoizedState=Jc,Rc(null,r)):(ko(t),Qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return tl(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Rc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Yc(n):(a=i.cachePool,a===null?a=Ga():(s=Oa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Xc(e,o,n),t.memoizedState=Jc,Rc(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=Ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Qc(e,t){return t=$c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function $c(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function el(e,t,n){return W(t,e.child,null,n),e=Qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,el(e,t,c)):t.memoizedState===null?(Mo(),o=a.fallback,s=t.mode,a=$c({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,W(t,e.child,null,c),a=t.child,a.memoizedState=Yc(c),a.childLanes=Xc(e,r,c),t.memoizedState=Jc,Rc(null,a)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),gm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,da({value:a,source:null,stack:null})),el(e,t,c)}if(Mc||ya(e,t,c,!1),r=(c&e.childLanes)!==0,Mc||r){if(So.current!==null)return el(e,t,c);if(r=nd,r!==null&&(a=ft(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),Bd(r,e,a),jc;return hm(o)||Qd(),el(e,t,c)}return hm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=vm(o.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=Qc(t,a.children),t.flags|=134221824,t)}function nl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_a(e.return,t,n)}function rl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Lo(n)===null&&(t=e),e=e.sibling}return t}function il(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function al(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ol(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Po.current;if(t.flags&128)return Fo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Fo(t,o),i===`backwards`&&e!==null?(al(e),Nc(e,t,r,n),al(e)):Nc(e,t,r,n),r=ta?Hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nl(e,n,t);else if(e.tag===19)nl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=rl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,al(t)),il(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}il(t,!0,n,null,a,r);break;case`together`:il(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=rl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),il(t,!1,i,n,a,r)}return t.child}function sl(e,t,n){var r=t.pendingProps;return ha(t,t.type,r.value),Nc(e,t,r.children,n),t.child}function cl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),fd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ya(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ll(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ba(e)))}function ul(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),ha(t,Oa,e.memoizedState.cache),la();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=ya(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Zc(e,t,n):(ko(t),e=cl(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return ol(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ya(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ol(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Fo(t,Po.current),r)break;return null;case 22:return t.lanes=0,Lc(e,t,n,t.pendingProps);case 24:ha(t,Oa,e.memoizedState.cache)}return cl(e,t,n)}function dl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Mc=!0;else{if(!ll(e,n)&&!(t.flags&128))return Mc=!1,ul(e,t,n);Mc=!!(e.flags&131072)}}else Mc=!1,ta&&t.flags&1048576&&Yi(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Qa(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=xc(e,r),t.tag=1,t=Kc(null,t,e,r,n)):(t.tag=0,t=Wc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Pc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Fc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=sl(null,t,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return Wc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=xc(r,t.pendingProps),Kc(e,t,r,a,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ha(t,Oa,r),r!==o.cache&&va(t,[Oa],n,!0),vo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=qc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),da(a),t=qc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ea=vm(e.firstChild),$i=t,ta=!0,na=null,ra=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(la(),r===a){t=cl(e,t,n);break a}Nc(e,t,r,n)}t=t.child}return t;case 26:return Uc(e,t),e===null?(n=Hm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ta||(t.stateNode=xp(t.type,t.pendingProps,ve.current,t)):t.memoizedState=Hm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&ta&&(r=t.stateNode=wm(t.type,t.pendingProps,ve.current),$i=t,ra=!0,a=ea,jp(t.type)?(ym=a,ea=vm(r.firstChild)):ea=a),Nc(e,t,t.pendingProps.children,n),Uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ta&&((a=r=ea)&&(r=fm(r,t.type,t.pendingProps,ra),r===null?a=!1:(t.stateNode=r,$i=t,ea=vm(r.firstChild),ra=!1,a=!0)),a||aa(t)),Se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Sp(a,o)?r=null:s!==null&&Sp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Zo(e,t,es,null,null,n),gh._currentValue=a),Uc(e,t),Nc(e,t,r,n),t.child;case 6:return e===null&&ta&&((e=n=ea)&&(n=pm(n,t.pendingProps,ra),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||aa(t)),null;case 13:return Zc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=W(t,null,r,n):Nc(e,t,r,n),t.child;case 11:return Pc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Uc(e,t),Nc(e,t,r,n),t.child;case 8:return Nc(e,t,t.pendingProps.children,n),t.child;case 12:return Nc(e,t,t.pendingProps.children,n),t.child;case 10:return sl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,xa(t),a=Sa(a),r=r(a),t.flags|=1,Nc(e,t,r,n),t.child;case 14:return Fc(e,t,t.type,t.pendingProps,n);case 15:return Ic(e,t,t.type,t.pendingProps,n);case 19:return ol(e,t,n);case 31:return Hc(e,t,n);case 22:return Lc(e,t,n,t.pendingProps);case 24:return xa(t),r=Sa(Oa),e===null?(a=Ua(),a===null&&(a=nd,o=ka(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},uo(t),ha(t,Oa,a)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ha(t,Oa,r),r!==a.cache&&va(t,[Oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ha(t,Oa,r))),Nc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ta&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Uc(e,t),Nc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function fl(e){e.flags|=4}function pl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?rh(t,r):rh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Yd())e.flags|=8192;else throw $a=Ya,qa}}else e.flags&=-16777217}function ml(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ih(t)){if(Yd())e.flags|=8192;else throw $a=Ya,qa}}function hl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ot(),e.lanes|=t,gd|=t)}function gl(e,t){if(!ta)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function _l(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vl(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _l(t),null;case 1:return _l(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ga(Oa),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ca(t)?fl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ua())),_l(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(fl(t),o===null?(_l(t),pl(t,a,null,r,n)):(_l(t),ml(t,o))):o?o===e.memoizedState?(_l(t),t.flags&=-16777217):(fl(t),_l(t),ml(t,o)):(e=e.memoizedProps,e!==r&&fl(t),_l(t),pl(t,a,e,r,n)),null;case 27:if(Ce(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}e=ge.current,ca(t)?oa(t,e):(e=wm(a,r,n),t.stateNode=e,fl(t))}return _l(t),t.subtreeFlags&=-33554433,null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}if(o=ge.current,ca(t))oa(t,o);else{var s=vp(ve.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[vt]=t,o[yt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(dp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&fl(t)}}return _l(t),t.subtreeFlags&=-33554433,pl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,ca(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=$i,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[vt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||cp(e.nodeValue,n)),e||aa(t,!0)}else e=vp(e).createTextNode(r),e[vt]=t,t.stateNode=e}return _l(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ca(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[vt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),e=!1}else n=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(No(t),t):(No(t),null);if(t.flags&128)throw Error(i(558))}return _l(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ca(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[vt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),a=!1}else a=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(No(t),t):(No(t),null)}return No(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),hl(t,t.updateQueue),_l(t),null);case 4:return xe(),e===null&&Qf(t.stateNode.containerInfo),t.flags|=67108864,_l(t),null;case 10:return ga(t.type),_l(t),null;case 19:if(Io(t),r=t.memoizedState,r===null)return _l(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)gl(r,!1);else{if(dd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Lo(e),o!==null){for(t.flags|=128,gl(r,!1),e=o.updateQueue,t.updateQueue=e,hl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return Fo(t,Po.current&1|2),ta&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>Sd&&(t.flags|=128,a=!0,gl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,hl(t,e),gl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ta)return _l(t),null}else 2*Ie()-r.renderingStartTime>Sd&&n!==536870912&&(t.flags|=128,a=!0,gl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,o=Po.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ta?Fo(t,o):(n=o,he(Do,t),he(Po,n),Oo===null&&(Oo=t)),ta&&Ji(t,r.treeForkCount),e}return _l(t),null;case 22:case 23:return No(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(_l(t),t.subtreeFlags&6&&(t.flags|=8192)):_l(t),n=t.updateQueue,n!==null&&hl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&me(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ga(Oa),_l(t),null;case 25:return null;case 30:return t.flags|=33554432,_l(t),null}throw Error(i(156,t.tag))}function yl(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Oa),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(No(t),t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(No(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return xe(),null;case 10:return ga(t.type),null;case 22:case 23:return No(t),Eo(),e!==null&&me(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Oa),null;case 25:return null;default:return null}}function bl(e,t){switch(Zi(t),t.tag){case 3:ga(Oa),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&No(t);break;case 13:No(t);break;case 19:Io(t);break;case 10:ga(t.type);break;case 22:case 23:No(t),Eo(),e!==null&&me(Ha);break;case 24:ga(Oa)}}function xl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){bf(t,t.return,e)}}function Sl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){bf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){bf(t,t.return,e)}}function Cl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){bf(e,e.return,t)}}}function wl(e,t,n){n.props=xc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){bf(e,t,n)}}function Tl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Up(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Wp(e);m(e.child,!1,sm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){bf(e,t,n)}}function El(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){bf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){bf(e,t,n)}else n.current=null}}function Dl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)lm(e.stateNode,t[n])}function Ol(e){for(var t=e.return;t!==null&&(jl(t)&&lm(e.stateNode,t.stateNode),!Al(t));)t=t.return}function kl(e){for(var t=e.return;t!==null&&(jl(t)&&um(e.stateNode,t.stateNode),!Al(t));)t=t.return}function Al(e){return e.tag===5||e.tag===3||e.tag===27}function jl(e){return e&&e.tag===7&&e.stateNode!==null}function Ml(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){bf(e,e.return,t)}}function Nl(e,t,n){try{var r=e.stateNode;pp(r,e.type,n,t),r[yt]=t}catch(t){bf(e,e.return,t)}}function Pl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&jp(e.type)||e.tag===4}function Fl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Pl(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&&jp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hn)),Dl(e,r),Ht=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,jp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Dl(e,r),Ht=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,jp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);dp(t,r,n),t[vt]=e,t[yt]=n}catch(t){bf(e,e.return,t)}}var zl=!1,Bl=null;function Vl(e){(e.tag===30||e.subtreeFlags&33554432)&&(zl=!0)}var Hl=null;function Ul(){var e=Hl;return Hl=null,e}var Wl=0;function Gl(e,t,n,r,i){return Wl=0,Kl(e.child,t,n,r,i)}function Kl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Lp(o);r.push(s),s.view&&(a=!0)}else a||Lp(o).view&&(a=!0);zl=!0,Pp(o,Wl===0?t:t+`_`+Wl,n),Wl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Kl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function ql(e,t){for(;e!==null;)e.tag===5?Fp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ql(e.child,t)),e=e.sibling}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Jl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=hi(t.default,t.share),t!==`none`&&(Gl(e,n,t,null,!1)||ql(e.child,!1))}e=e.sibling}}function Yl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?Jl(e):Gl(e,i,a,null,!1)?(Jl(e),n.paired||t||zd(e,r.onEnter)):ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e,t),e=e.sibling;else Jl(e)}function Xl(e){if(Bl!==null&&Bl.size!==0){var t=Bl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=hi(n.default,n.share);if(a!==`none`&&(Gl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,zd(e,n.onShare)):ql(e.child,!1)),t.delete(r),t.size===0)break}}}Xl(e)}e=e.sibling}}}function Zl(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=Bl===null?void 0:Bl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Gl(e,n,i,null,!1)?r===void 0?zd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Bl.delete(n),zd(e,t.onShare)):ql(e.child,!1)),Bl!==null&&Xl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Bl!==null&&Xl(e)}function Ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&Gl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Ql(e);e=e.sibling}}function $l(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,ql(e.child,!1))}$l(e)}e=e.sibling}}function eu(e){if(e.tag===30)e.stateNode.paired=null,ql(e.child,!1),$l(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else $l(e)}function tu(e){for(e=e.child;e!==null;)e.tag===30?ql(e.child,!1):e.subtreeFlags&33554432&&tu(e),e=e.sibling}function nu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Wl<a.length){var l=a[Wl],u=Lp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Pp(c,Wl===0?n:n+`_`+Wl,i),s&&e.flags&4||(Hl===null&&(Hl=[]),Hl.push(c,Wl===0?r:r+`_`+Wl,t.memoizedProps)),Wl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:nu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ru(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Rp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Wl=0,i=nu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||zd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ru(e,t);e=e.sibling}}var iu=!1,au=!1,ou=!1,su=!1,cu=typeof WeakSet==`function`?WeakSet:Set,lu=null,uu=!1,du=!1,fu=!1,pu=!1;function mu(e,t,n){if(e=e.containerInfo,gp=Th,e=Ur(e),Wr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(_p={focusedElem:e,selectionRange:r},Th=!1,n=(n&335544064)===n,lu=t,t=n?9270:1024;lu!==null;){if(e=lu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Zl(r[a]);if(e.alternate===null&&e.flags&2)n&&Vl(e),hu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Zl(r),hu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Vl(e),hu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,lu=r):(n&&Ql(e),hu(n))}}Bl=null}function hu(e){for(;lu!==null;){var t=lu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=xc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){bf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)dm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:dm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=pi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=hi(a.default,a.update),a!==`none`&&Gl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,lu=r;break}lu=t.return}}function gu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Iu(e,n),r&4&&xl(5,n);break;case 1:if(Iu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){bf(n,n.return,e)}else{var i=xc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){bf(n,n.return,e)}}}r&64&&Cl(n),r&512&&Tl(n,n.return);break;case 3:if(Iu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{xo(e,t)}catch(e){bf(n,n.return,e)}}break;case 27:t===null&&r&4&&Rl(n);case 26:case 5:Iu(e,n),t===null&&r&4&&Ml(n),r&512&&Tl(n,n.return);break;case 12:Iu(e,n);break;case 31:Iu(e,n),r&4&&Tu(e,n);break;case 13:Iu(e,n),r&4&&Eu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=wf.bind(null,n),_m(e,n))));break;case 22:if(r=n.memoizedState!==null||iu,!r){var a=t!==null&&t.memoizedState!==null||au;t=iu,i=au,iu=r,(au=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ru(e,n,r)):Iu(e,n),iu=t,au=i}break;case 30:Iu(e,n),r&512&&Tl(n,n.return);break;case 7:r&512&&Tl(n,n.return);default:Iu(e,n)}}function _u(e,t){for(e=e.child;e!==null;)vu(e,t),e=e.sibling}function vu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){bf(e,e.return,t)}yu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Ht=!0}catch(t){bf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Np(s,!0):Np(e.stateNode,!1)}catch(t){bf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&_u(e,t);break;default:_u(e,t)}}function yu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:vu(n,r);break a;case 22:n.memoizedState===null&&yu(n,r);break a;default:yu(n,r)}}e=e.sibling}}function bu(e){var t=e.alternate;t!==null&&(e.alternate=null,bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Dt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var xu=null,Su=!1;function Cu(e,t,n){for(n=n.child;n!==null;)wu(e,t,n),n=n.sibling}function wu(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:au||El(n,t),Cu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!au&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:au||El(n,t),kl(n);var r=xu,i=Su;jp(n.type)&&(xu=n.stateNode,Su=!1),Cu(e,t,n),Tm(n.stateNode,n.type,n.memoizedProps),xu=r,Su=i;break;case 5:au||El(n,t),kl(n);case 6:if(n.tag===6&&kl(n),r=xu,i=Su,xu=null,Cu(e,t,n),xu=r,Su=i,xu!==null){if(Su)try{(xu.nodeType===9?xu.body:xu.nodeName===`HTML`?xu.ownerDocument.body:xu).removeChild(n.stateNode),Ht=!0}catch(e){bf(n,t,e)}else try{xu.removeChild(n.stateNode),Ht=!0}catch(e){bf(n,t,e)}}break;case 18:xu!==null&&(Su?(e=xu,Mp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Zh(e)):Mp(xu,n.stateNode));break;case 4:r=xu,i=Su,xu=n.stateNode.containerInfo,Su=!0,Cu(e,t,n),xu=r,Su=i;break;case 0:case 11:case 14:case 15:Sl(2,n,t),au||Sl(4,n,t),Cu(e,t,n);break;case 1:au||(El(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&wl(n,t,r)),Cu(e,t,n);break;case 21:Cu(e,t,n);break;case 22:au=(r=au)||n.memoizedState!==null,Cu(e,t,n),au=r;break;case 30:El(n,t),Cu(e,t,n);break;case 7:au||El(n,t),Cu(e,t,n);break;default:Cu(e,t,n)}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zh(e)}catch(e){bf(t,t.return,e)}}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zh(e)}catch(e){bf(t,t.return,e)}}function Du(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cu),t;default:throw Error(i(435,e.tag))}}function Ou(e,t){var n=Du(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Tf.bind(null,e,t);t.then(r,r)}})}function ku(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(jp(l.type)){xu=l.stateNode,Su=!1;break a}break;case 5:xu=l.stateNode,Su=!1;break a;case 3:case 4:xu=l.stateNode.containerInfo,Su=!0;break a}l=l.return}if(xu===null)throw Error(i(160));wu(s,c,o),xu=null,Su=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ju(t,e,n),t=t.sibling}var Au=null;function ju(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ku(t,e,n),Mu(e),a&4&&(Sl(3,e,e.return),xl(3,e),Sl(5,e,e.return));break;case 1:ku(t,e,n),Mu(e),a&512&&(au||r===null||El(r,r.return)),a&64&&iu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Au,ku(t,e,n),Mu(e),a&512&&(au||r===null||El(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(iu)e.stateNode=xp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Tt]||r[vt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),dp(r,t,n),r[vt]=e,Mt(r),t=r;break a;case`link`:if(o=eh(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),dp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=eh(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),dp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[vt]=e,Mt(r),t=r}e.stateNode=t}}else iu||th(o,e.type,e.stateNode)}else e.stateNode=Ym(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Nl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||au||t.parentNode.removeChild(t)):a.count--,n===null?iu||th(o,e.type,e.stateNode):Ym(o,n,e.memoizedProps))}break;case 27:ku(t,e,n),Mu(e),a&512&&(au||r===null||El(r,r.return)),r!==null&&a&4&&Nl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ou,ou=!1,ku(t,e,n),ou=o,Mu(e),a&512&&(au||r===null||El(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),Ht=!0}catch(t){bf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Nl(e,t,r===null?t:r.memoizedProps)),a&1024&&(su=!0);break;case 6:if(ku(t,e,n),Mu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ht=!0}catch(t){bf(e,e.return,t)}}break;case 3:if(Ht=!1,$m=null,o=Au,Au=km(t.containerInfo),ku(t,e,n),Au=o,Mu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Zh(t.containerInfo)}catch(t){bf(e,e.return,t)}su&&(su=!1,Nu(e)),Ht=!1;break;case 4:a=ou,ou=iu,r=Ut(),o=Au,Au=km(e.stateNode.containerInfo),ku(t,e,n),Mu(e),Au=o,Ht&&du&&(fu=!0),Ht=r,ou=a;break;case 12:ku(t,e,n),Mu(e);break;case 31:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 13:ku(t,e,n),Mu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(bd=Ie()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=iu,l=au,u=ou;iu=c||o,ou=u||o,au=l||s,ku(t,e,n),au=l,ou=u,iu=c,Mu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||iu||au||(t=s||au,n=iu,r=au,iu=o||iu,au=t,Lu(e,2),iu=n,au=r),!o&&ou||_u(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ou(e,n))));break;case 19:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 30:a&512&&(au||r===null||El(r,r.return)),a=Ut(),o=du,s=(n&335544064)===n,c=e.memoizedProps,du=s&&hi(c.default,c.update)!==`none`,ku(t,e,n),Mu(e),s&&r!==null&&Ht&&(e.flags|=4),du=o,Ht=a;break;case 21:break;case 7:a&512&&(au||r===null||El(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ku(t,e,n),Mu(e)}}function Mu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Pl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(jl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Al(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ll(e,Fl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),Ll(e,Fl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Il(e,Fl(e),u,s);break;default:throw Error(i(161))}}catch(t){bf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Th=!0,t.reset(),Th=!1),e=e.sibling}}function Pu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Fu(t,e),t=t.sibling;else ru(t,!1)}function Fu(e,t){var n=e.alternate;if(n===null)Yl(e,!1);else switch(e.tag){case 3:if(pu=uu=!1,Ul(),Pu(t,e),!uu&&!fu){if(e=Hl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Fp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),pu=!0}Hl=null;break;case 5:Pu(t,e);break;case 4:r=uu,uu=!1,Pu(t,e),uu&&(fu=!0),uu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Pu(t,e):Yl(e,!1));break;case 30:r=uu,i=Ul(),uu=!1,Pu(t,e),uu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Wl=0,t=nu(e,n,t,o,s,a,!0),Wl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(zd(e,e.memoizedProps.onUpdate),Hl=i):i!==null&&(i.push.apply(i,Hl),Hl=i),uu=e.flags&32?!0:r;break;default:Pu(t,e)}}function Iu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gu(e,t.alternate,t),t=t.sibling}function Lu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Sl(4,n,n.return),Lu(n,r);break;case 1:El(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&wl(n,n.return,i),Lu(n,r);break;case 27:r&2&&Tm(n.stateNode,n.type,n.memoizedProps);case 5:El(n,n.return),n.tag!==5&&n.tag!==27||kl(n),Lu(n,r);break;case 6:kl(n);break;case 26:El(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||au||i.parentNode.removeChild(i),Lu(n,r);break;case 22:n.memoizedState===null&&Lu(n,r);break;case 30:El(n,n.return),Lu(n,r);break;case 7:El(n,n.return);default:Lu(n,r)}e=e.sibling}}function Ru(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Ru(i,a,n),xl(4,a);break;case 1:if(Ru(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){bf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)bo(l[i],c)}catch(e){bf(r,r.return,e)}}s&&o&64&&Cl(a),Tl(a,a.return);break;case 27:n&2&&Rl(a);case 5:a.tag!==5&&a.tag!==27||Ol(a),Ru(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 6:Ol(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||iu||th(km(c.ownerDocument),a.type,c),Ru(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 12:Ru(i,a,n);break;case 31:Ru(i,a,n),s&&o&4&&Tu(i,a);break;case 13:Ru(i,a,n),s&&o&4&&Eu(i,a);break;case 22:a.memoizedState===null&&Ru(i,a,n),Tl(a,a.return);break;case 30:Ru(i,a,n),Tl(a,a.return);break;case 7:Tl(a,a.return);default:Ru(i,a,n)}t=t.sibling}}function zu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Aa(n))}function Bu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Vu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Hu(e,t,n,r),t=t.sibling;else i&&tu(t)}function Hu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&eu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Vu(e,t,n,r),a&2048&&xl(9,t);break;case 1:Vu(e,t,n,r);break;case 3:Vu(e,t,n,r),i&&pu&&(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=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Aa(a)));break;case 12:if(a&2048){Vu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){bf(t,t.return,e)}}else Vu(e,t,n,r);break;case 31:Vu(e,t,n,r);break;case 13:Vu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&eu(t),o._visibility&2?Vu(e,t,n,r):(o._visibility|=2,Uu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&eu(s),o._visibility&2?Vu(e,t,n,r):Wu(e,t)),a&2048&&zu(s,t);break;case 24:Vu(e,t,n,r),a&2048&&Bu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(ql(a.child,!0),ql(t.child,!0))),Vu(e,t,n,r);break;default:Vu(e,t,n,r)}}function Uu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Uu(a,o,s,c,i),xl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Uu(a,o,s,c,i)):u._visibility&2?Uu(a,o,s,c,i):Wu(a,o),i&&l&2048&&zu(o.alternate,o);break;case 24:Uu(a,o,s,c,i),i&&l&2048&&Bu(o.alternate,o);break;default:Uu(a,o,s,c,i)}t=t.sibling}}function Wu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Wu(n,r),i&2048&&zu(r.alternate,r);break;case 24:Wu(n,r),i&2048&&Bu(r.alternate,r);break;default:Wu(n,r)}t=t.sibling}}var Gu=8192;function Ku(e,t,n){if(e.subtreeFlags&Gu)for(e=e.child;e!==null;)qu(e,t,n),e=e.sibling}function qu(e,t,n){switch(e.tag){case 26:Ku(e,t,n),e.flags&Gu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&oh(n,e)):sh(n,Au,e.memoizedState,e.memoizedProps));break;case 5:Ku(e,t,n),e.flags&Gu&&(e=e.stateNode,(t&335544128)===t&&oh(n,e));break;case 3:case 4:var r=Au;Au=km(e.stateNode.containerInfo),Ku(e,t,n),Au=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Gu,Gu=16777216,Ku(e,t,n),Gu=r):Ku(e,t,n));break;case 30:if((e.flags&Gu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Bl===null&&(Bl=new Map),Bl.set(r,i)}Ku(e,t,n);break;default:Ku(e,t,n)}}function Ju(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Qu(r,e)}Ju(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xu(e),e=e.sibling}function Xu(e){switch(e.tag){case 0:case 11:case 15:Yu(e),e.flags&2048&&Sl(9,e,e.return);break;case 3:Yu(e);break;case 12:Yu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):Yu(e);break;default:Yu(e)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Qu(r,e)}Ju(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sl(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Qu(e,t){for(;lu!==null;){var n=lu;switch(n.tag){case 0:case 11:case 15:Sl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,lu=r;else a:for(n=e;lu!==null;){r=lu;var i=r.sibling,a=r.return;if(bu(r),r===n){lu=null;break a}if(i!==null){i.return=a,lu=i;break a}lu=a}}}var $u={getCacheForType:function(e){var t=Sa(Oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Sa(Oa).controller.signal}},ed=typeof WeakMap==`function`?WeakMap:Map,td=0,nd=null,rd=null,id=0,ad=0,od=null,sd=!1,cd=!1,ld=!1,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=null,vd=null,yd=!1,bd=0,xd=0,Sd=1/0,Cd=null,wd=null,Td=0,Ed=null,Dd=null,Od=0,kd=0,Ad=null,jd=null,Md=null,Nd=null,Pd=null,Fd=0,Id=null;function Ld(){return td&2&&id!==0?id&-id:ce.T===null?ht():Vf()}function Rd(){if(hd===0){if(!(id&536870912)||ta){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),hd=e}else hd=536870912}return e=Do.current,e!==null&&(e.flags|=32),hd}function zd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Up(pi(e.memoizedProps,n))),Nd===null&&(Nd=[]),Nd.push(t.bind(null,r))}}function Bd(e,t,n){(e===nd&&(ad===2||ad===9)||e.cancelPendingCommit!==null)&&(qd(e,0),Wd(e,id,hd,!1)),ct(e,n),(!(td&2)||e!==nd)&&(e===nd&&(!(td&2)&&(pd|=n),dd===4&&Wd(e,id,hd,!1)),Nf(e))}function Vd(e,t,n){if(td&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||rt(e,t),a=r?tf(e,t):$d(e,t,!0),o=r;do{if(a===0){cd&&!r&&Wd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ud(n)){a=$d(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=_d;var l=c.current.memoizedState.isDehydrated;if(l&&(qd(c,s).flags|=256),s=$d(c,s,!1),s!==2&&s!==6){if(ld&&!l){c.errorRecoveryDisabledLanes|=o,pd|=o,a=4;break a}o=vd,vd=a,o!==null&&(vd===null?vd=o:vd.push.apply(vd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){qd(e,0),Wd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Wd(r,t,hd,!sd);break a;case 2:vd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=bd+300-Ie(),10<a)){if(Wd(r,t,hd,!sd),nt(r,0,!0)!==0)break a;Od=t,r.timeoutHandle=Tp(Hd.bind(null,r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,`Throttled`,-0,0),a);break a}Hd(r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,null,-0,0)}break}while(1);Nf(e)}function Hd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},Bl=null,qu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=dh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?bd-Ie():(a&4194048)===a?xd-Ie():0,m=lh(d,m),m!==null)){Od=a,e.cancelPendingCommit=m(lf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Wd(e,a,o,!l);return}lf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ud(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Lr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wd(e,t,n,r){t=it(e,t),t&=~md,t&=~pd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ut(e,n,t)}function Gd(){return td&6?!0:(Pf(0,!1),!1)}function Kd(){if(rd!==null){if(ad===0)var e=rd.return;else e=rd,ma=pa=null,rs(e),no=null,ro=0,e=rd;for(;e!==null;)bl(e.alternate,e),e=e.return;rd=null}}function qd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Ep(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Od=0,Kd(),nd=e,rd=n=Ai(e.current,null),id=t,ad=0,od=null,sd=!1,cd=rt(e,t),ld=!1,gd=hd=md=pd=fd=dd=0,vd=_d=null,yd=!1,ud=it(e,t),bi(),n}function Jd(e,t){zo=null,ce.H=pc,t===Ka||t===Ja?(t=eo(),ad=3):t===qa?(t=eo(),ad=4):ad=t===jc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,od=t,rd===null&&(dd=1,Tc(e,Ri(t,e.current)))}function Yd(){var e=Do.current;return e===null?!0:(id&4194048)===id?Oo===null:(id&62914560)===id||id&536870912?e===Oo:!1}function Xd(){var e=ce.H;return ce.H=pc,e===null?pc:e}function Zd(){var e=ce.A;return ce.A=$u,e}function Qd(){dd=4,sd||(id&4194048)!==id&&Do.current!==null||(cd=!0),!(fd&134217727)&&!(pd&134217727)||nd===null||Wd(nd,id,hd,!1)}function $d(e,t,n){var r=td;td|=2;var i=Xd(),a=Zd();(nd!==e||id!==t)&&(Cd=null,qd(e,t)),t=!1;var o=dd;a:do try{if(ad!==0&&rd!==null){var s=rd,c=od;switch(ad){case 8:Kd(),o=6;break a;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=ad;if(ad=0,od=null,of(e,s,c,l),n&&cd){o=0;break a}break;default:l=ad,ad=0,od=null,of(e,s,c,l)}}ef(),o=dd;break}catch(t){Jd(e,t)}while(1);return t&&e.shellSuspendCounter++,ma=pa=null,td=r,ce.H=i,ce.A=a,rd===null&&(nd=null,id=0,bi()),o}function ef(){for(;rd!==null;)rf(rd)}function tf(e,t){var n=td;td|=2;var r=Xd(),a=Zd();nd!==e||id!==t?(Cd=null,Sd=Ie()+500,qd(e,t)):cd=rt(e,t);a:do try{if(ad!==0&&rd!==null){t=rd;var o=od;b:switch(ad){case 1:ad=0,od=null,of(e,t,o,1);break;case 2:case 9:if(Xa(o)){ad=0,od=null,af(t);break}t=function(){ad!==2&&ad!==9||nd!==e||(ad=7),Nf(e)},o.then(t,t);break a;case 3:ad=7;break a;case 4:ad=5;break a;case 7:Xa(o)?(ad=0,od=null,af(t)):(ad=0,od=null,of(e,t,o,7));break;case 5:var s=null;switch(rd.tag){case 26:s=rd.memoizedState;case 5:case 27:var c=rd;if(s?ih(s):c.stateNode.complete){ad=0,od=null;var l=c.sibling;if(l!==null)rd=l;else{var u=c.return;u===null?rd=null:(rd=u,sf(u))}break b}}ad=0,od=null,of(e,t,o,5);break;case 6:ad=0,od=null,of(e,t,o,6);break;case 8:Kd(),dd=6;break a;default:throw Error(i(462))}}nf();break}catch(t){Jd(e,t)}while(1);return ma=pa=null,ce.H=r,ce.A=a,td=n,rd===null?(nd=null,id=0,bi(),dd):0}function nf(){for(;rd!==null&&!Pe();)rf(rd)}function rf(e){var t=dl(e.alternate,e,ud);e.memoizedProps=e.pendingProps,t===null?sf(e):rd=t}function af(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gc(n,t,t.pendingProps,t.type,void 0,id);break;case 11:t=Gc(n,t,t.pendingProps,t.type.render,t.ref,id);break;case 5:rs(t);var r=t;r===$i&&(ta?(sa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(sa(r),ta=!0));default:bl(n,t),t=rd=ji(t,ud),t=dl(n,t,ud)}e.memoizedProps=e.pendingProps,t===null?sf(e):rd=t}function of(e,t,n,r){ma=pa=null,rs(t),no=null,ro=0;var i=t.return;try{if(Ac(e,i,t,n,id)){dd=1,Tc(e,Ri(n,e.current)),rd=null;return}}catch(t){if(i!==null)throw rd=i,t;dd=1,Tc(e,Ri(n,e.current)),rd=null;return}t.flags&32768?(ta||r===1?e=!0:cd||id&536870912?e=!1:(sd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),cf(t,e)):sf(t)}function sf(e){var t=e;do{if(t.flags&32768){cf(t,sd);return}e=t.return;var n=vl(t.alternate,t,ud);if(n!==null){rd=n;return}if(t=t.sibling,t!==null){rd=t;return}rd=t=e}while(t!==null);dd===0&&(dd=5)}function cf(e,t){do{var n=yl(e.alternate,e);if(n!==null){n.flags&=32767,rd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){rd=e;return}rd=e=n}while(e!==null);dd=6,rd=null}function lf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do _f();while(Td!==0);if(td&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===nd&&(rd=nd=null,id=0),Dd=t,Ed=e,Od=n,Ad=a,jd=r,uf(e,t,n,s,c,l,f)}}function uf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(kd=s,s|=yi,lt(e,n,s,r,i,a),Nd=null,(n&335544064)===n?(Pd=Na(e),r=10262):(Pd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Ef(Be,function(){return vf(),null})):(e.callbackNode=null,e.callbackPriority=0),zl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=ce.T,ce.T=null,i=le.p,le.p=2,a=td,td|=4;try{mu(e,t,n)}finally{td=a,le.p=i,ce.T=r}}Td=1,zl?Md=Vp(o,e.containerInfo,Pd,pf,mf,ff,hf,vf,df,null,null):(pf(),mf(),hf())}function df(e){if(Td!==0){var t=Ed.onRecoverableError;t(e,{componentStack:null})}}function ff(){Td===3&&(Td=0,Fu(Dd,Ed),Td=4)}function pf(){if(Td===1){Td=0;var e=Ed,t=Dd,n=Od,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=ce.T,ce.T=null;var i=le.p;le.p=2;var a=td;td|=4;try{du=fu=!1,ju(t,e,n),n=_p;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Vr(s,h),v=Vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Th=!!gp,_p=gp=null}finally{td=a,le.p=i,ce.T=r}}e.current=t,Td=2}}function mf(){if(Td===2){Td=0;var e=Ed,t=Dd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=ce.T,ce.T=null;var r=le.p;le.p=2;var i=td;td|=4;try{gu(e,t.alternate,t)}finally{td=i,le.p=r,ce.T=n}}Td=3}}function hf(){if(Td===4||Td===3){Td=0;var e=Md;Md=null,Fe();var t=Ed,n=Dd,r=Od,i=jd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Td=5:(Td=0,Dd=Ed=null,gf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(wd=null),mt(r),n=n.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=ce.T,a=le.p,le.p=2,ce.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{ce.T=n,le.p=a}}if(i=Nd,o=Pd,Pd=null,i!==null&&(Nd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Od&3&&_f(),Nf(t),a=t.pendingLanes,r&261930&&a&42?t===Id?Fd++:(Fd=0,Id=t):(Fd=0,Id=null),Pf(0,!1)}}function gf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function _f(){return Md!==null&&(Md.skipTransition(),Md=null),pf(),mf(),hf(),vf()}function vf(){if(Td!==5)return!1;var e=Ed,t=kd;kd=0;var n=mt(Od),r=ce.T,a=le.p;try{le.p=32>n?32:n,ce.T=null,n=Ad,Ad=null;var o=Ed,s=Od;if(Td=0,Dd=Ed=null,Od=0,td&6)throw Error(i(331));var c=td;if(td|=4,Xu(o.current),Hu(o,o.current,s,n),td=c,Pf(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{le.p=a,ce.T=r,gf(e,t)}}function yf(e,t,n){t=Ri(n,t),t=Dc(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(ct(e,2),Nf(e))}function bf(e,t,n){if(e.tag===3)yf(e,e,n);else for(;t!==null;){if(t.tag===3){yf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(wd===null||!wd.has(r))){e=Ri(n,e),n=Oc(2),r=mo(t,n,2),r!==null&&(kc(n,r,t,e),ct(r,2),Nf(r));break}}t=t.return}}function xf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ed;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ld=!0,i.add(n),e=Sf.bind(null,e,t,n),t.then(e,e))}function Sf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,nd===e&&(id&n)===n&&(dd===4||dd===3&&(id&62914560)===id&&300>Ie()-bd?td&2?md|=n:qd(e,0):md|=n,gd===id&&(gd=0)),Nf(e)}function Cf(e,t){t===0&&(t=ot()),e=Ci(e,t),e!==null&&(ct(e,t),Nf(e))}function wf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cf(e,n)}function Tf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Cf(e,n)}function Ef(e,t){return Me(e,t)}var Df=null,Of=null,kf=!1,Af=!1,jf=!1,Mf=0;function Nf(e){e!==Of&&e.next===null&&(Of===null?Df=Of=e:Of=Of.next=e),Af=!0,kf||(kf=!0,Bf())}function Pf(e,t){if(!jf&&Af){jf=!0;do for(var n=!1,r=Df;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,zf(r,a))}else a=id,a=nt(r,r===nd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,zf(r,a))}r=r.next}while(n);jf=!1}}function Ff(){If()}function If(){Af=kf=!1;var e=0;Mf!==0&&wp()&&(e=Mf);for(var t=Ie(),n=null,r=Df;r!==null;){var i=r.next,a=Lf(r,t);a===0?(r.next=null,n===null?Df=i:n.next=i,i===null&&(Of=n)):(n=r,(e!==0||a&3)&&(Af=!0)),r=i}Td!==0&&Td!==5||Pf(e,!1),Mf!==0&&(Mf=0)}function Lf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=at(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=nd,n=id,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ad===2||ad===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),mt(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=Rf.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function Rf(e,t){if(Td!==0&&Td!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_f()&&e.callbackNode!==n)return null;var r=id;return r=nt(e,e===nd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Vd(e,r,t),Lf(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?Rf.bind(null,e):null)}function zf(e,t){if(_f())return null;Vd(e,t,!0)}function Bf(){kp(function(){td&6?Me(Re,Ff):If()})}function Vf(){if(Mf===0){var e=Ia;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),Mf=e}return Mf}function Hf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:mn(e)}function Uf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Hf((i[yt]||null).action),o=r.submitter;o&&(t=(t=o[yt]||null)?Hf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new In(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Mf!==0){var e=new FormData(i,o);$s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),$s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Wf=0;Wf<ui.length;Wf++){var Gf=ui[Wf];di(Gf.toLowerCase(),`on`+(Gf[0].toUpperCase()+Gf.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),Lt(`onMouseEnter`,[`mouseout`,`mouseover`]),Lt(`onMouseLeave`,[`mouseout`,`mouseover`]),Lt(`onPointerEnter`,[`pointerout`,`pointerover`]),Lt(`onPointerLeave`,[`pointerout`,`pointerover`]),It(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),It(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),It(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),It(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),It(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),It(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Kf=`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(` `),qf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Kf));function Jf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}}}}function Yf(e,t){var n=t[xt];n===void 0&&(n=t[xt]=new Set);var r=e+`__bubble`;n.has(r)||($f(t,e,2,!1),n.add(r))}function Xf(e,t,n){var r=0;t&&(r|=4),$f(n,e,r,t)}var Zf=`_reactListening`+Math.random().toString(36).slice(2);function Qf(e){if(!e[Zf]){e[Zf]=!0,Pt.forEach(function(t){t!==`selectionchange`&&(qf.has(t)||Xf(t,!1,e),Xf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zf]||(t[Zf]=!0,Xf(`selectionchange`,!1,t))}}function $f(e,t,n,r){switch(Mh(t)){case 2:var i=Eh;break;case 8:i=Dh;break;default:i=Oh}n=i.bind(null,t,n,e),i=void 0,!Tn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function ep(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Ot(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Sn(function(){var r=a,i=_n(n),s=[];a:{var c=li.get(e);if(c!==void 0){var l=In,u=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:l=$n;break;case`focusin`:u=`focus`,l=Wn;break;case`focusout`:u=`blur`,l=Wn;break;case`beforeblur`:case`afterblur`:l=Wn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=U;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Un;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=nr;break;case ni:case ri:case ii:l=Gn;break;case ci:l=rr;break;case`scroll`:case`scrollend`:l=Rn;break;case`wheel`:l=ir;break;case`copy`:case`cut`:case`paste`:l=Kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=er;break;case`submit`:l=tr;break;case`toggle`:case`beforetoggle`:l=ar}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Cn(m,p),g!=null&&d.push(tp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==gn&&(u=n.relatedTarget||n.fromElement)&&(Ot(u)||u[bt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ot(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=U,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=er,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:At(c),h=l==null?u:At(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ot(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,rp):null,c!==null&&ip(s,u,c,d,!1),l!==null&&f!==null&&ip(s,f,l,d,!0)))}a:{if(c=r?At(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Tr;else if(yr(c)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&dn(r.elementType)&&(_=Tr):_=Pr;if(_&&=_(e,r)){br(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?At(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(s,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(s,n,i)}var y;if(sr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else hr?pr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ur&&n.locale!==`ko`&&(hr||b!==`onCompositionStart`?b===`onCompositionEnd`&&hr&&(y=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,hr=!0)),v=np(r,b),0<v.length&&(b=new qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=mr(n),y!==null&&(b.data=y)))),(y=lr?gr(e,n):_r(e,n))&&(b=np(r,`onBeforeInput`),0<b.length&&(v=new qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Uf(s,e,r,n,i)}Jf(s,t)})}function tp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function np(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Cn(e,n),i!=null&&r.unshift(tp(e,i,a)),i=Cn(e,t),i!=null&&r.push(tp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function rp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ip(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Cn(n,a),l!=null&&o.unshift(tp(n,l,c))):i||(l=Cn(n,a),l!=null&&o.push(tp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ap=/\r\n?/g,op=/\u0000|\uFFFD/g;function sp(e){return(typeof e==`string`?e:``+e).replace(ap,`
|
|
10
|
+
`).replace(op,``)}function cp(e,t){return t=sp(t),sp(e)===t}function lp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&sn(e,``+r);else return;break;case`className`:Gt(e,`class`,r);break;case`tabIndex`:Gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Gt(e,n,r);break;case`style`:un(e,r,o);return;case`data`:if(t!==`object`){Gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&lp(e,t,`name`,a.name,a,null),lp(e,t,`formEncType`,a.formEncType,a,null),lp(e,t,`formMethod`,a.formMethod,a,null),lp(e,t,`formTarget`,a.formTarget,a,null)):(lp(e,t,`encType`,a.encType,a,null),lp(e,t,`method`,a.method,a,null),lp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=hn);return;case`onScroll`:r!=null&&Yf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Yf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=mn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Yf(`beforetoggle`,e),Yf(`toggle`,e),Wt(e,`popover`,r);break;case`xlinkActuate`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Wt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=fn.get(n)||n,Wt(e,n,r);else return}Ht=!0}function up(e,t,n,r,a,o){switch(n){case`style`:un(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)sn(e,``+r);else return;break;case`onScroll`:r!=null&&Yf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Yf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=hn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ft.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[yt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Ht=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Wt(e,n,r)}return}Ht=!0}function dp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Yf(`error`,e),Yf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:lp(e,t,o,s,n,null)}}a&&lp(e,t,`srcSet`,n.srcSet,n,null),r&&lp(e,t,`src`,n.src,n,null);return;case`input`:Yf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:lp(e,t,r,d,n,null)}}tn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Yf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:lp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&rn(e,!!r,n,!0):rn(e,!!r,t,!1);return;case`textarea`:for(s in Yf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:lp(e,t,s,c,n,null)}on(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:lp(e,t,l,r,n,null)}return;case`dialog`:Yf(`beforetoggle`,e),Yf(`toggle`,e),Yf(`cancel`,e),Yf(`close`,e);break;case`iframe`:case`object`:Yf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Kf.length;r++)Yf(Kf[r],e);break;case`image`:Yf(`error`,e),Yf(`load`,e);break;case`details`:Yf(`toggle`,e);break;case`embed`:case`source`:case`link`:Yf(`error`,e),Yf(`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 n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:lp(e,t,u,r,n,null)}return;default:if(dn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&up(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&lp(e,t,c,r,n,null))}var fp={};function pp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||lp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Ht=!0),o=m;break;case`name`:m!==f&&(Ht=!0),a=m;break;case`checked`:m!==f&&(Ht=!0),u=m;break;case`defaultChecked`:m!==f&&(Ht=!0),d=m;break;case`value`:m!==f&&(Ht=!0),s=m;break;case`defaultValue`:m!==f&&(Ht=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&lp(e,t,p,m,r,f)}}en(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||lp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Ht=!0),p=o;break;case`defaultValue`:o!==l&&(Ht=!0),c=o;break;case`multiple`:o!==l&&(Ht=!0),s=o;default:o!==l&&lp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?rn(e,!!n,n?[]:``,!1):rn(e,!!n,t,!0)):rn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:lp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Ht=!0),p=a;break;case`defaultValue`:a!==o&&(Ht=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&lp(e,t,s,a,r,o)}an(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:lp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Ht=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:lp(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&lp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:lp(e,t,u,p,r,m)}return;default:if(dn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&up(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||up(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&lp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||lp(e,t,f,p,r,m)}function mp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function hp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&mp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&mp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var gp=null,_p=null;function vp(e){return e.nodeType===9?e:e.ownerDocument}function yp(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 bp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function xp(e,t,n,r){return n=vp(n).createElement(e),n[vt]=r,n[yt]=t,dp(n,e,t),Mt(n),n}function Sp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Cp=null;function wp(){var e=window.event;return e&&e.type===`popstate`?e!==Cp&&(Cp=e,!0):(Cp=null,!1)}var Tp=typeof setTimeout==`function`?setTimeout:void 0,Ep=typeof clearTimeout==`function`?clearTimeout:void 0,Dp=typeof Promise==`function`?Promise:void 0,Op=typeof requestAnimationFrame==`function`?requestAnimationFrame:Tp,kp=typeof queueMicrotask==`function`?queueMicrotask:Dp===void 0?Tp:function(e){return Dp.resolve(null).then(e).catch(Ap)};function Ap(e){setTimeout(function(){throw e})}function jp(e){return e===`head`}function Mp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Zh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Em(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Em(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Tt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Em(e.ownerDocument.body)}n=i}while(n);Zh(t)}function Np(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Pp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Fp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Ip(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Lp(e){return Ip(e.getBoundingClientRect(),getComputedStyle(e),e)}function Rp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Ip(t,n,e)}function zp(e){return e.documentElement.clientHeight}function Bp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Vp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(zp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=ah(f),u>ch){s.length=o;break}f=new Promise(Bp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Hp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Hp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Hp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Hp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Up(e){return{name:e,group:new Hp(`group`,e),imagePair:new Hp(`image-pair`,e),old:new Hp(`old`,e),new:new Hp(`new`,e)}}function Wp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Wp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Yp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=qp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Gp,e,s,r)}this._eventListeners=a}};function Gp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Wp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Yp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=qp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Kp,e,n,i),r.splice(t,1),a!==null&&a()}};function Kp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function qp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Jp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Yp(e,t,n,r){if(e.length===0)return-1;r=Jp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Jp(a.optionsOrUseCapture)===r)return i}return-1}Wp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Wp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=b(e),Sm(e,t))}Wp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Zp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Xp(t[n],e);n--);};function Zp(e,t){return t.push(e),!1}Wp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=vp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Qp,e,void 0,void 0))};function Qp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Wp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,$p,e,void 0,void 0)};function $p(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Wp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,em,e,void 0,void 0);for(var n=t=0;n<tm.length;n++){var r=tm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):tm[t++]=r}tm.length=t}};function em(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var tm=[],nm=!1;function rm(e,t,n){tm.push({fragmentInstance:e,observer:t,instance:n}),nm||(nm=!0,Cm(function(){nm=!1;var e=tm;tm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Wp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,im,e,void 0,void 0),e};function im(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Wp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Wp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Zp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||am(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function am(e,t,n,r,i){var a=Ot(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function om(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Wp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Zp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),om(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),om(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function sm(e,t){return e=b(e),cm(e,t),!1}function cm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function lm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<tm.length;i++){var a=tm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(tm[r++]=a)}tm.length=r,n.observe(e)}),cm(e,t))}function um(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?rm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function dm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:dm(n),Dt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function fm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Tt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=vm(e.nextSibling),e===null)break}return null}function pm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=vm(e.nextSibling),e===null))return null;return e}function mm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=vm(e.nextSibling),e===null))return null;return e}function hm(e){return e.data===`$?`||e.data===`$~`}function gm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _m(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function vm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var ym=null;function bm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return vm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function xm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Sm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Cm(e){Op(function(){Op(function(t){return e(t)})})}function wm(e,t,n){switch(t=vp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Tm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&lp(e,t,r,null,fp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===hn&&(e.onclick=null),Dt(e)}function Em(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Dt(e)}var Dm=new Map,Om=new Set;function km(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Am=le.d;le.d={f:jm,r:Mm,D:Fm,C:Im,L:Lm,m:Rm,X:Bm,S:zm,M:Vm};function jm(){var e=Am.f(),t=Gd();return e||t}function Mm(e){var t=kt(e);t!==null&&t.tag===5&&t.type===`form`?tc(t):Am.r(e)}var Nm=typeof document>`u`?null:document;function Pm(e,t,n){var r=Nm;if(r&&typeof t==`string`&&t){var i=$t(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Om.has(i)||(Om.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),dp(t,`link`,e),Mt(t),r.head.appendChild(t)))}}function Fm(e){Am.D(e),Pm(`dns-prefetch`,e,null)}function Im(e,t){Am.C(e,t),Pm(`preconnect`,e,t)}function Lm(e,t,n){Am.L(e,t,n);var r=Nm;if(r&&e&&t){var i=`link[rel="preload"][as="`+$t(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+$t(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+$t(n.imageSizes)+`"]`)):i+=`[href="`+$t(e)+`"]`;var a=i;switch(t){case`style`:a=Um(e);break;case`script`:a=qm(e)}if(!(Dm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Dm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Wm(a))||t===`script`&&r.querySelector(Jm(a))))){var o=r.createElement(`link`);dp(o,`link`,e),t===`style`&&(o[Et]=!0,o.onload=o.onerror=function(){Nt(o)}),Mt(o),r.head.appendChild(o)}}}function Rm(e,t){Am.m(e,t);var n=Nm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+$t(r)+`"][href="`+$t(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=qm(e)}if(!Dm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Dm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Jm(a)))return}r=n.createElement(`link`),dp(r,`link`,e),Mt(r),n.head.appendChild(r)}}}function zm(e,t,n){Am.S(e,t,n);var r=Nm;if(r&&e){var i=jt(r).hoistableStyles,a=Um(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Wm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Dm.get(a))&&Zm(e,n);var c=o=r.createElement(`link`);Mt(c),dp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Xm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Bm(e,t){Am.X(e,t);var n=Nm;if(n&&e){var r=jt(n).hoistableScripts,i=qm(e),a=r.get(i);a||(a=n.querySelector(Jm(i)),a||(e=D({src:e,async:!0},t),(t=Dm.get(i))&&Qm(e,t),a=n.createElement(`script`),Mt(a),dp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t){Am.M(e,t);var n=Nm;if(n&&e){var r=jt(n).hoistableScripts,i=qm(e),a=r.get(i);a||(a=n.querySelector(Jm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Dm.get(i))&&Qm(e,t),a=n.createElement(`script`),Mt(a),dp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hm(e,t,n,r){var a=(a=ve.current)?km(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Um(n.href),t=jt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Um(n.href);var o=jt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Wm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Dm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Dm.set(e,o)),Km(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=qm(n),t=jt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Um(e){return`href="`+$t(e)+`"`}function Wm(e){return`link[rel="stylesheet"][`+e+`]`}function Gm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Km(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Et]){r.loading=1;return}}else t=e.createElement(`link`),t[Et]=!0,t.onload=t.onerror=Nt.bind(null,t),dp(t,`link`,n),Mt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function qm(e){return`[src="`+$t(e)+`"]`}function Jm(e){return`script[async]`+e}function Ym(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+$t(n.href)+`"]`);if(r)return t.instance=r,Mt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Mt(r),dp(r,`style`,a),Xm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Um(n.href);var o=e.querySelector(Wm(a));if(o)return t.state.loading|=4,t.instance=o,Mt(o),o;r=Gm(n),(a=Dm.get(a))&&Zm(r,a),o=(e.ownerDocument||e).createElement(`link`),Mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),dp(o,`link`,r),t.state.loading|=4,Xm(o,n.precedence,e),t.instance=o;case`script`:return o=qm(n.src),(a=e.querySelector(Jm(o)))?(t.instance=a,Mt(a),a):(r=n,(a=Dm.get(o))&&(r=D({},n),Qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Mt(a),dp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Xm(r,n.precedence,e));return t.instance}function Xm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var $m=null;function eh(e,t,n){if($m===null){var r=new Map,i=$m=new Map;i.set(n,r)}else i=$m,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Tt]||a[vt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function th(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function nh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function rh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ih(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ah(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function oh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ah(t),e.suspenseyImages.push(t)),e=fh.bind(e),t.decode().then(e,e))}function sh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Um(r.href),a=t.querySelector(Wm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=dh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Mt(a);return}a=t.ownerDocument||t,r=Gm(r),(i=Dm.get(i))&&Zm(r,i),a=a.createElement(`link`),Mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),dp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=dh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ch=0;function lh(e,t){return e.stylesheets&&e.count===0&&mh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&mh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ch===0&&(ch=62500*hp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&mh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ch?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function uh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)mh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function dh(){this.count--,uh(this)}function fh(){this.imgCount--,uh(this)}var ph=null;function mh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ph=new Map,t.forEach(hh,e),ph=null,dh.call(e))}function hh(e,t){if(!(t.state.loading&4)){var n=ph.get(e);if(n)var r=n.get(null);else{n=new Map,ph.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=dh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var gh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function _h(e,t,n,r,i,a,o,s,c){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=st(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=st(0),this.hiddenUpdates=st(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function vh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new _h(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=ka(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function yh(e){return e?(e=Ei,e):Ei}function bh(e,t,n,r,i,a){i=yh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Bd(n,e,t),ho(n,e,t))}function xh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sh(e,t){xh(e,t),(e=e.alternate)&&xh(e,t)}function Ch(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&Bd(t,e,67108864),Sh(e,67108864)}}function wh(e){if(e.tag===13||e.tag===31){var t=Ld();t=pt(t);var n=Ci(e,t);n!==null&&Bd(n,e,t),Sh(e,t)}}var Th=!0;function Eh(e,t,n,r){var i=ce.T;ce.T=null;var a=le.p;try{le.p=2,Oh(e,t,n,r)}finally{le.p=a,ce.T=i}}function Dh(e,t,n,r){var i=ce.T;ce.T=null;var a=le.p;try{le.p=8,Oh(e,t,n,r)}finally{le.p=a,ce.T=i}}function Oh(e,t,n,r){if(Th){var i=kh(r);if(i===null)ep(e,t,r,Ah,n),Vh(e,r);else if(Uh(i,e,t,n,r))r.stopPropagation();else if(Vh(e,r),t&4&&-1<Bh.indexOf(e)){for(;i!==null;){var a=kt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}Nf(a),!(td&6)&&(Sd=Ie()+500,Pf(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&Bd(s,a,2),Gd(),Sh(a,2)}if(a=kh(r),a===null&&ep(e,t,r,Ah,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else ep(e,t,r,null,n)}}function kh(e){return e=_n(e),jh(e)}var Ah=null;function jh(e){if(Ah=null,e=Ot(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ah=e,null}function Mh(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(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var Nh=!1,Ph=null,Fh=null,Ih=null,Lh=new Map,Rh=new Map,zh=[],Bh=`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 Vh(e,t){switch(e){case`focusin`:case`focusout`:Ph=null;break;case`dragenter`:case`dragleave`:Fh=null;break;case`mouseover`:case`mouseout`:Ih=null;break;case`pointerover`:case`pointerout`:Lh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Rh.delete(t.pointerId)}}function Hh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=kt(t),t!==null&&Ch(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Uh(e,t,n,r,i){switch(t){case`focusin`:return Ph=Hh(Ph,e,t,n,r,i),!0;case`dragenter`:return Fh=Hh(Fh,e,t,n,r,i),!0;case`mouseover`:return Ih=Hh(Ih,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Lh.set(a,Hh(Lh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Rh.set(a,Hh(Rh.get(a)||null,e,t,n,r,i)),!0}return!1}function Wh(e){var t=Ot(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,gt(e.priority,function(){wh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,gt(e.priority,function(){wh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gn=r,n.target.dispatchEvent(r),gn=null}else return t=kt(n),t!==null&&Ch(t),e.blockedOn=n,!1;t.shift()}return!0}function Kh(e,t,n){Gh(e)&&n.delete(t)}function qh(){Nh=!1,Ph!==null&&Gh(Ph)&&(Ph=null),Fh!==null&&Gh(Fh)&&(Fh=null),Ih!==null&&Gh(Ih)&&(Ih=null),Lh.forEach(Kh),Rh.forEach(Kh)}function Jh(e,n){e.blockedOn===n&&(e.blockedOn=null,Nh||(Nh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qh)))}var Yh=null;function Xh(e){Yh!==e&&(Yh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Yh===e&&(Yh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(jh(r||n)===null)continue;break}var a=kt(n);a!==null&&(e.splice(t,3),t-=3,$s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Zh(e){function t(t){return Jh(t,e)}Ph!==null&&Jh(Ph,e),Fh!==null&&Jh(Fh,e),Ih!==null&&Jh(Ih,e),Lh.forEach(t),Rh.forEach(t);for(var n=0;n<zh.length;n++){var r=zh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<zh.length&&(n=zh[0],n.blockedOn===null);)Wh(n),n.blockedOn===null&&zh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[yt]||null;if(typeof a==`function`)o||Xh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[yt]||null)s=o.formAction;else if(jh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Xh(n)}}}function Qh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function $h(e){this._internalRoot=e}eg.prototype.render=$h.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;bh(n,Ld(),e,t,null,null)},eg.prototype.unmount=$h.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bh(e.current,2,null,e,null,null),Gd(),t[bt]=null}};function eg(e){this._internalRoot=e}eg.prototype.unstable_scheduleHydration=function(e){if(e){var t=ht();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zh.length&&t!==0&&t<zh[n].priority;n++);zh.splice(n,0,e),n===0&&Wh(e)}};var tg=n.version;if(tg!==`19.3.0`)throw Error(i(527,tg,`19.3.0`));le.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var ng={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:ce,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var rg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rg.isDisabled&&rg.supportsFiber)try{Ge=rg.inject(ng),Ke=rg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Sc,s=Cc,c=wc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=vh(e,1,!1,null,null,n,r,null,o,s,c,Qh),e[bt]=t.current,Qf(e),new $h(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_();function b(e){try{return localStorage.getItem(e)??void 0}catch{return}}function x(e,t){try{t===void 0?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}function S(e,t){let n=b(e);if(n===void 0)return t;try{return JSON.parse(n)}catch{return t}}function C(e,t){x(e,JSON.stringify(t))}var w=`workerdeck.theme`;function T(){let e=b(w);return e===`light`||e===`dark`?e:matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function E(e=T()){return document.documentElement.setAttribute(`data-theme`,e)}function D(e){x(w,e),E(e)}function O(){let e=T()===`dark`?`light`:`dark`;return D(e),e}var k=v.useLayoutEffect;function A(e){return e[e.length-1]}function j(e,t){return typeof e==`function`?e(t):e}var M=Object.prototype.hasOwnProperty;function N(e){for(let t in e)if(M.call(e,t))return!0;return!1}var P=()=>Object.create(null),F=(e,t)=>I(e,t,!0);function I(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(L(e)&&L(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&A(a)!==`${o-1}`||c&&A(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?I(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?I(d,o,n,r):o,i&&=u===d&&(a[l]===f||M.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?P():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?I(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function L(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function R(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!R(a,o,n,r))return!1}return!0}if(L(e)&&L(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!R(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!R(e[a],t[a],n,r)))return!1;return i===0}return!1}var z=/[\x00-\x1f\x7f"<>`{}]/g;function ee(e){return e.replace(z,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function B(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ee(t)}var V=[`http:`,`https:`,`mailto:`,`tel:`];function te(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var ne=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function H(e,t){if(!e)return!1;if(ne.test(e))return!0;let n=te(e);return n?!t.has(n):!1}function re(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=B(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=B(r?e.slice(r):e)}return t}function ie(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ae(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oe(){throw Error(`Invariant failed`)}function se(e){return e.replace(/\/{2,}/g,`/`)}function ce(e){return e===`/`?e:e.replace(/^\/+/,``)}function le(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function ue(e){return le(ce(e))}function de(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function fe(e,t,n=`never`,r){if(t.includes(`//`)&&(t=se(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=se(e)),o=e.split(`/`);o.length>1&&A(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(A(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?se(s):s)||`/`;return a&&r&&r.set(a,c),c}function pe(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function me(e){return e==null||e===``}function he(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function ge(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&me(f)){if(c===`/`&&!d)continue;f=``}o+=c+he(s,f,r)+(d||``)}}return o+a||`/`}function _e(e){return e?.isNotFound===!0}function ve(){try{return sessionStorage}catch{return}}var ye=`tsr-scroll-restoration-v1_3`,be=ve();function xe(){try{return JSON.parse(be?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Se(){try{be?.setItem(ye,JSON.stringify(Ce))}catch{}}var Ce=xe(),we=`data-scroll-restoration-id`,Te=e=>e.state.__TSR_key||e.href;function Ee(e){let t=e.getAttribute(we);if(t)return`[${we}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var De=!1,Oe=`window`;function ke(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ae(e){let t=new Set;for(let n of e){if(n===Oe)continue;let e=ke(n);e&&t.add(e)}return t}function je(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Te,a=new Set,o=e=>{let t=Ce[e]||={};for(let e of a)e===document?t[Oe]={scrollX,scrollY}:e.isConnected&&(t[Ee(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,De=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{De||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Se()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=Ce[d];if(e){let t=Ce[u];for(let n in e){if(n===Oe){if(s)continue}else{let e=ke(n);if(!e||s&&o&&(l??=Ae(o),l.has(e)))continue}t||=Ce[u]={},t[n]??=e[n]}}}De=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Ae(o));let t=e&&i&&c,s=r.restoring?Ce[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Oe){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=ke(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{De=!1}}))}function Me(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function Ne(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Pe(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Ne(r):Array.isArray(t)?t.push(Ne(r)):n[e]=[t,Ne(r)]}return n}var Fe=/^(?:\s|["[{\d-]|fa|nu|tr)/,Ie=Re(JSON.parse),Le=ze(JSON.stringify,JSON.parse);function Re(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=Pe(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!Fe.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function ze(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!Fe.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Me(e,r);return t?`?${t}`:``}}var Be=`__root__`;function Ve(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function He(e){return e instanceof Response&&!!e.options}function Ue(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var We=4,Ge=5;function Ke(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function qe(e,t,n){let r=e.substring(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.substring(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.substring(s,a);return[o?3:c?1:2,c||`_splat`,r.substring(0,i),e.substring(t+a+1,c?n:e.length)]}}return r}function Je(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,m=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=A(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],m=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=qe(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=Xe(r);c=n,t.set(e,n)}}else{let t=a[0],h=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&m<n&&(m<e-1&&p.push(s.substring(m,e-1)),a[2]=`/`+h,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),m=n),!r)continue;let _=d&&!!(h||g);d||(h=h.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=Xe(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m<u&&p.push(s.substring(m,u));let h=p?.slice();if(!r)return h;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=Xe(r,Ge);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=Xe(r,We);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=h,g&&(r.route=t)),[r,o,h]}function Ye(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Xe(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Ze(e,t){let n=Xe(),r=[];function i(e,t,n,a){let[o,s,c]=Je(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(Ye);t.masksTree=n,t.flatCache=Ue(1e3)}function Qe(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=nt(e,t.masksTree);return t.flatCache.set(e,r),r}function $e(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Xe(),Je(t,{from:e},1,o),i.singleCache.set(a,o)),nt(r,o,n)}function et(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=nt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=it(a.route)),t.matchCache.set(r,a),a}function tt(e,t=!1){let n=Xe(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&oe(),i[e.id]=e,o!==0&&e.path){let t=le(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=Je(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(Ye);return{processedTree:{segmentTree:n,singleCache:Ue(1e3),matchCache:Ue(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function nt(e,t,n=!1){let r=e.split(`/`),i=ot(e,r,t,n);if(!i)return null;let[a]=rt(e,r,i);return{route:i.node.route,rawParams:a}}function rt(e,t,n){let r=at(n.node),i=n.node.data&&Ke(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===We)break;if(u.kind===Ge){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function it(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function at(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function ot(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!A(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!ut(l,n))continue;if(i.parse){if(!lt(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==We&&ut(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===We||i.kind===2)&&ut(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(lt(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&ct(f,o))return n;ut(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+st(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+st(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+st(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+st(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function st(e,t){return 2**(e-t-1)}function ct(e,t){return e===2**(t-1)-1}function lt(e,t,n){let r,i;try{[r,i]=rt(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function ut(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===We)>(e.node.kind===We)||t.node.kind===We==(e.node.kind===We)&&t.node.depth>e.node.depth)))}function dt(e,t,n){let r=ue(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=se(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>ft(n,s.input({url:e})),output:({url:e})=>s.output({url:pt(n,e)})}:s}function ft(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function pt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function mt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{ae(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var ht=`__TSR_index`,gt=`popstate`,_t=`beforeunload`,vt=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function yt(e){let t=vt.exec(e);return t?`/`+e.slice(t[0].length):e}function bt(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
11
|
+
\r`.includes(e)?``:encodeURIComponent(e))),yt(e)}function xt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Tt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[ht];i=St(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[ht];i=St(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[ht]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function St(e,t){let n=Et();return{...t,key:n,__TSR_key:n,[ht]:e}}function Ct(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>bt(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>Tt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Et();t.history.replaceState({[ht]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=Tt(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[ht]-l.state[ht],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=xt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(_t,x,{capture:!0}),t.removeEventListener(gt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(_t,x,{capture:!0}),t.addEventListener(gt,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function wt(e){let t=e?.window??(typeof document<`u`?window:void 0);return Ct({window:t,parseLocation:()=>{let e=t.location.hash.split(`#`).slice(1),n=e[0]??`/`,r=t.location.search,i=e.slice(1);return Tt(`${n}${r}${i.length===0?``:`#${i.join(`#`)}`}`,t.history.state)},createHref:e=>`${t.location.pathname}${t.location.search}#${e}`})}function Tt(e,t){let n=bt(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=Et();t={[ht]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function Et(){return(Math.random()+1).toString(36).substring(7)}function Dt(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function Ot(e){return e.pathname+e.search+e.hash}function kt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function At(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function jt({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Mt(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Nt(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Pt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Ct()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&ue(n)?dt(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=mt(this.latestLocation,e),je(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=tt(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Ze(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:Ue(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:re(e),external:!1,searchStr:o,search:F(t?.search,i),hash:re(r.slice(1)),state:I(t?.state,a)}}let o=ft(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:re(yt(o.pathname)),external:!!this.rewrite&&Dt(o,this.origin),searchStr:c,search:F(t?.search,s),hash:re(o.hash.slice(1)),state:I(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=et(le(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=Tt(n.href,{});n={...n,to:ft(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=n._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>(t=!0,i??=this.matchRoutesLightweight(r)),s=n.to?`${n.to}`:`.`,c=fe(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[le(c)],u=c.includes(`$`),d;if(l)d=l._branch??=it(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??Je(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=zt(n.params,e),!N(p))break;p===e&&(p=Object.assign(P(),p));try{Object.assign(p,t(p))}catch{}}}p??=zt(n.params,Bt(n.params,f)?o()[3]:Vt);let m=e.leaveParams?c:yt(re(f?ge(c,f,p,this.pathParamsDecoder):c)),h=Ht(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Rt(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?Ut(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Vt,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,x=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Vt,S=`${m}${v}${b}`,C,w,T=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=pt(this.rewrite,e);C=Ot(e),Dt(n,t)?(w=n.href,T=!0):w=yt(Ot(n))}else C=ie(S),w=C;return{publicHref:w,href:C,pathname:m,search:_,searchStr:v,state:x,hash:y??``,external:T,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Qe(r.pathname,this.processedTree);if(t){let i=Object.assign(P(),t.rawParams),{from:a,params:o,...s}=t.route,c=zt(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&!r.maskedLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return Ft(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=le(this.latestLocation.href)===le(n.href)&&R(jt(n.state),jt(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?te(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return Ft(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await In(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(At(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&kt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(ne.test(n)||(r=te(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:Dt(e,this.origin)||(n=Ot(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Jt,this.preloadRoute=e=>Ln(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?fe(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=$e(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!R(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?R(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=pe(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Le,parseSearch:e.parseSearch??Ie,protocolAllowlist:e.protocolAllowlist??V}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Je(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:le(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Wt(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Rt(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof It||(r=new It(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=P(),_=i._interpolation?ge(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,v=i.id+_+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(g,d);let x;if(!b)try{Gt(i,d)}catch(e){if(x=_e(e)||He(e)?e:new Lt(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:F(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=kt(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:y?F(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?I(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?F(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=A(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=A(a),c={...e.search};for(let e of a)try{Object.assign(c,Rt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{Gt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function Ft(e,t,{replace:n,ignoreBlocker:r}){if(!H(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var It=class extends Error{},Lt=class extends Error{};function Rt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new It(`Async validation not supported`);if(n.issues)throw new It(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function zt(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Bt(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!M.call(e,t[1]))}var Vt=Object.freeze({});function Ht(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Rt(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Ut(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=j(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function Wt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Be}function Gt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Kt(e,t){return e.options[t]?.preload?.()}function qt(e,t){let n=Kt(e,`component`),r=Kt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Jt(e,t,n){let r=()=>t===!1?void 0:t?Kt(e,t):qt(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Yt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var Xt=0,Zt=1,Qt=2,$t=3,en=[4];function tn(e){return typeof e[0]==`number`}function nn(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function rn(e,t){return e.routesById[t.routeId]}function an(e,t,n){return He(e)?[$t,e]:_e(e)?(e.routeId||=n,[Qt,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Zt,e]):[Xt,e]}function on(e,t){let n=an(t,!0,e.id);if(n[0]!==Zt)return n;try{e.options.onError?.(n[1])}catch(t){n=an(t,!0,e.id)}return n}function sn(e,t,n,r,i){return i[0].signal.aborted?en:Cn(e,t,n,on(n,r),i)}async function cn(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=rn(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return un(e,r),[i,sn(e,t,u,a,n)]}if(c.aborted)return[i,en];let p=r.paramsError??r.searchError;if(p!==void 0)return un(e,r),[i,sn(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{pn(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?nn(a,c):a);if(c.aborted)return[i,en];let s=Cn(e,t,u,an(o,!1,u.id),n);if(s[0]!==Xt)return un(e,r),[i,s];r.context={...r.context,...o}}catch(a){return un(e,r),[i,sn(e,t,u,a,n)]}finally{r.status=h,pn(e,r,!1,n[0])}}i()}function ln(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function un(e,t){let n=t._flight;t._flight=void 0,ln(e,t,n)?.abort()}function dn(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=ln(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function fn(e){for(let t of e){let e=t._flight;e&&e[2]++}}function pn(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function mn(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function hn(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return en;if(!i)return[Xt,void 0];let l=n._flight;pn(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(mn(e,t,n,r,s,a,!!o[3]))).then(e=>an(e,!1,r.id),e=>an(e,!0,r.id)).then(t=>(t[0]!==Xt&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Zt&&l[2]?on(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Cn(e,t,r,await nn(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return un(e,n),en}finally{pn(e,n,!1,s)}}function gn(e,t,n){t[0]!==$t&&(e.status=`success`,e.error=void 0,t[0]===Xt?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function _n(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&un(e,r)}function vn(e,t){return t[0]===Zt||t[0]===Qt?{...e,status:t[0]===Zt?`error`:`notFound`,error:t[1],_flight:void 0}:e}function yn(e,t,n,r,i,a,o){let s=t[1][n],c=rn(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(mn(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=en)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,un(e,s),p=sn(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,ln(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?hn(e,t,s,c,g,i,a).then(t=>(gn(s,t,l),t[0]===Xt&&(m&&!a[0].signal.aborted&&_n(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Xt,s.loaderData]),T=(async()=>{try{let e=Jt(c,void 0,C);e&&await nn(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,sn(e,t,c,r,a)]}let r=await w;x&&r[0]===Xt&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>vn(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=hn(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,gn(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>vn(E,e))}async function bn(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=rn(e,t[n]);try{let e=Jt(i,!1);e&&await nn(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function xn(e,t){t[2]&&=(dn(e,t[2].map(e=>e[3])),void 0)}async function Sn(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=$t)throw[a,t];!i&&t[0]!==Xt&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===$t)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Cn(e,t,n,r,i,a){for(;r[0]===$t;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[$t,t]:[$t,t,a]}return[$t,o,n]}catch(e){r=a?[Zt,e]:on(n,e),a=!0}}return r}async function wn(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Qt?bn(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=$t)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Xt&&t[0]<$t&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=$t){let n=s[1];if(n[0]!==$t||n[1].options.reloadDocument||n[2])return xn(e,t),n;c=!0,s=[0,[Zt,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Zt?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=rn(e,u);try{await nn(i?Promise.resolve().then(()=>Jt(m,l===Zt?`errorComponent`:`notFoundComponent`)):Promise.all([Jt(m),Jt(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return xn(e,t),en}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),xn(e,t),dn(e,o),p()):u.status=`success`}return t}async function Tn(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=rn(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await nn(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function En(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await bn(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=yn(e,i,t,u,f,r,l)},m=await cn(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Qt){let t=await bn(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=$t&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=wn(e,i,u,r[0],Sn(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Sn(i[2],void 0,void 0,h.then(e=>tn(e)?0:Yt(n).length,()=>0))),o=await h}catch(t){if(xn(e,i),t===a&&a.aborted)return en;throw t}return tn(o)?o:Tn(e,o,a,r[6]===n.length?r[6]:0)}function Dn(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=rn(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Dn(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function On(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function kn(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Yt(t[3]).some(e=>e.id===n[1]))return;let i;try{await nn(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function An(e,t){e._committed=t,e.stores.setMatches(t)}function jn(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Yt(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=rn(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Mt(n);An(e,n),dn(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Nt(e,i,n,a,l,t)}async function Mn(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Nn(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Pn(e,t,n,r,i){let a=n.map(e=>({...e}));fn(a);for(let t of r)un(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await wn(e,o,r,t[0],i)}catch(t){throw dn(e,a),t}if(tn(s)){dn(e,a),s[0]===$t&&e._tx===t&&e._committed===n&&await Nn(e,t,s);return}if(await Tn(e,s,t[0].signal),e._tx!==t||e._committed!==n){dn(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),un(e,n))}An(e,a),dn(e,n,a)}async function Fn(e,t,n,r,i,a){let o=await En(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(tn(o)){let n=o[0]===$t&&e._tx===t;if((!n||o[1].options.reloadDocument)&&On(e,t),dn(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){On(e,t);return}await Nn(e,t,o);return}let s=o[1];if(e._tx===t&&await kn(e,t),e._tx!==t){On(e,t),dn(e,s),xn(e,o);return}let c=t[2],l=At(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await kn(e,t),e._tx!==t){On(e,t),dn(e,s),xn(e,o);return}let n=await e.startTransition(()=>{On(e,t),jn(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){xn(e,o);return}u?.length&&Pn(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function In(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=At(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Mn(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});fn(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){dn(e,m),await Mn(e,n);return}e._preflight=void 0;let g,_=()=>Fn(e,y,f,()=>Dn(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>Mn(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&pn(e,t,!1)}n[0].abort(),dn(e,n[3],y[3],!0)}if(e._tx!==y){dn(e,y[3]),y[3]=[],g?.(),await Mn(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Dn(e,y),g?.(_()),await y[5]}async function Ln(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),fn(a),o=(e._preloads??=new Map).set(i,a),s=await En(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),dn(e,a)),i.abort()}if(!tn(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){_e(e)||console.error(e);return}}}var Rn=`Error preloading route! ☝️`,zn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Be:this.parentRoute||oe();let r=n?Be:t?.path;r&&r!==`/`&&(r=ce(r));let i=t?.id||r,a=n?Be:se((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:se(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=le(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Ve({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Bn=class extends zn{constructor(e){super(e)}},Vn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Hn=o(((e,t)=>{t.exports=Vn()})),U=Hn(),Un=class extends v.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?v.createElement(this.props.errorComponent??Wn,{error:e[0],reset:this.reset}):this.props.children}};function Wn({error:e}){let[t,n]=v.useState(!1);return(0,U.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,U.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,U.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,U.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,U.jsx)(`div`,{children:(0,U.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,U.jsx)(`code`,{children:e.message}):null})}):null]})}var Gn=()=>!0,Kn=()=>!1;function qn({children:e,fallback:t=null}){return(0,U.jsx)(v.Fragment,{children:Jn()?e:t})}function Jn(){return v.useSyncExternalStore(Yn,Gn,Kn)}function Yn(){return()=>{}}var Xn=v.createContext(null);function Zn(e){return v.useContext(Xn)}var Qn=v.createContext(void 0),$n=v.createContext(void 0);function er({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function tr(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var nr=[],rr=0,{link:ir,unlink:ar,propagate:or,checkDirty:sr,shallowPropagate:cr}=er({update(e){return e._update()},notify(e){nr[ur++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,mr(e))}}),lr=0,ur=0,dr,fr=0;function pr(e){try{++fr,e()}finally{--fr||hr()}}function mr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=ar(n,e)}function hr(){if(!(fr>0)){for(;lr<ur;){let e=nr[lr];nr[lr++]=void 0,e.notify()}lr=0,ur=0}}function gr(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return dr!==void 0&&ir(i,dr,rr),i._snapshot},subscribe(e){let t=tr(e),n={current:!1},r=_r(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=dr,o=t?.compare??Object.is;if(n)dr=i,++rr,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{dr=a,n&&(i.flags&=-5),mr(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&sr(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&cr(e)}}else e&32&&(i.flags=e&-33);return dr!==void 0&&ir(i,dr,rr),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(or(e),cr(e),hr())}},i}function _r(e){let t=()=>{let t=dr;dr=n,++rr,n.depsTail=void 0,n.flags=6;try{return e()}finally{dr=t,n.flags&=-5,mr(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&sr(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,mr(this)}};return t(),n}var vr=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),yr=o(((e,t)=>{t.exports=vr()})),br=o((e=>{var t=d(),n=yr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),xr=o(((e,t)=>{t.exports=br()}))();function Sr(e,t){return e===t}function Cr(e,t=e=>e,n){let r=n?.compare??Sr,i=(0,v.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,v.useCallback)(()=>e.get(),[e]);return(0,xr.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var wr={};function Tr(e,t){let n=v.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=I(n.current,i):i}}function Er(e){let t=Zn(),n=v.useContext(e.from?$n:Qn),r=e.from??n,i=t.stores.getMatchStore(r),a=Tr(e,t),o=Cr(i,e=>e?a(e):wr);if(o!==wr)return o;(e.shouldThrow??!0)&&oe()}function Dr(e){return Er({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Or(e){let{select:t,...n}=e;return Er({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function kr(e){return Er({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ar(e){return Er({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function jr(e){let t=Zn();return v.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Mr(e){return Er({...e,select:t=>e.select?e.select(t.context):t.context})}function Nr(...e){let t=v.useRef(e),n=t.current;return e.forEach((e,t)=>{R(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Pr(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(Rn)})}var Fr={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function Ir(e,t){let n=typeof e==`string`&&te(e);if(n)return t.has(n)?e:null}function Lr(e,t,n,r,i){let a=de(e.pathname,r),o=de(t.pathname,r);return(n?.exact?a!==o:!a.startsWith(o)||a.length!==o.length&&a[o.length]!==`/`)||(n?.includeSearch??!0)&&!R(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||i&&e.hash===t.hash}function Rr(e,t,n){let r=Zn(),i=v.useRef(null),a=v.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:m,ignoreBlocker:h,disabled:g,target:_,onClick:y,onBlur:b,onFocus:x,onMouseEnter:S,onMouseLeave:C,onTouchStart:w}=e,T=Jn(),[E,D,O]=Nr(e.search,e.params,o),[k,A]=v.useMemo(()=>[e,{...e}],[r,e.from,e._fromLocation,e.hash,e.to,E,D,e.state,e.mask,e.unsafeRelative]),j=v.useCallback(e=>{let t=Ir(s,r.protocolAllowlist);if(t!==void 0)return[t??void 0];k._fromLocation||(A._fromLocation=e);let n=r.buildLocation(A),i=qr(n,r,g);return[i,!g&&(!i||te(i))?void 0:Lr(e,n,O,r.basepath,T)]},[O,g,T,k,A,r,s]),[M,N]=Cr(r.stores.location,j,Fr),P=N===void 0?M:void 0,F=g||M===void 0,I=v.useRef(!1),L=e.reloadDocument||P||F?!1:c??r.options.defaultPreload,R=l??r.options.defaultPreloadDelay??0,z=v.useCallback(e=>{let t=e?.isIntersecting;if(!(t??L===`intent`)){t===!1&&Gr(i);return}if(!R){Pr(r,k);return}Wr.has(i)||Wr.set(i,setTimeout(()=>{Wr.delete(i),Pr(r,k)},R))},[r,k,i,L,R]);v.useEffect(()=>{L===`render`&&!I.current&&(I.current=!0,Pr(r,k));let e;return L===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(e=new IntersectionObserver(e=>z(e.pop()),{rootMargin:`100px`}),e.observe(i.current)),()=>{e?.disconnect(),Gr(i)}},[r,k,L,z,i]);let ee=Hr(e,n);if(ee.ref=t?a:i,P)return ee.href=P,ee;let B=e=>{let t=_??e.currentTarget.getAttribute(`target`);!F&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!t||t===`_self`)&&e.button===0&&(e.preventDefault(),r.navigate({...k,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:m,ignoreBlocker:h}))},V=()=>{L===`intent`&&Pr(r,k)},ne=()=>{L===`intent`&&Gr(i)};return ee.onClick=Kr(y,B),ee.onBlur=Kr(b,ne),ee.onFocus=Kr(x,z),ee.onMouseEnter=Kr(S,z),ee.onMouseLeave=Kr(C,ne),ee.onTouchStart=Kr(w,V),Ur(ee,e,N,M,F,n)}var zr={},Br={className:`active`},Vr=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`_fromLocation`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function Hr(e,t){let n={};for(let r in e)Vr.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function Ur(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=j(n?o:s,{})??(n?Br:zr);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var Wr=new WeakMap,Gr=e=>{clearTimeout(Wr.get(e)),Wr.delete(e)},Kr=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function qr(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!H(i,t.protocolAllowlist))return i}var Jr=v.memo(v.forwardRef((e,t)=>{let n=e._asChild||`a`,r=Rr(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return v.createElement(n,r,i)}),Yr);function Yr(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!Vr.has(r)||!R(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var Xr=class extends zn{constructor(e){super(e),this.useMatch=e=>Er({...e,from:this.id}),this.useRouteContext=e=>Mr({...e,from:this.id}),this.useSearch=e=>Ar({...e,from:this.id}),this.useParams=e=>kr({...e,from:this.id}),this.useLoaderDeps=e=>Or({...e,from:this.id}),this.useLoaderData=e=>Dr({...e,from:this.id}),this.useNavigate=()=>jr({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,U.jsx)(Jr,{ref:t,from:this.fullPath,...e}))}};function Zr(e){return new Xr(e)}var Qr=class extends Bn{constructor(e){super(e),this.useMatch=e=>Er({...e,from:this.id}),this.useRouteContext=e=>Mr({...e,from:this.id}),this.useSearch=e=>Ar({...e,from:this.id}),this.useParams=e=>kr({...e,from:this.id}),this.useLoaderDeps=e=>Or({...e,from:this.id}),this.useLoaderData=e=>Dr({...e,from:this.id}),this.useNavigate=()=>jr({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,U.jsx)(Jr,{ref:t,from:this.fullPath,...e}))}};function $r(e){return new Qr(e)}function ei(e){let t=Zn(),n=`not-found-${Cr(t.stores.location,e=>e.pathname)}-${Cr(t.stores.status)}`;return(0,U.jsx)(Un,{getResetKey:()=>n,onCatch:(t,n)=>{if(_e(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(_e(t))return e.fallback?.(t);throw t},children:e.children})}function ti(){return(0,U.jsx)(`p`,{children:`Not Found`})}function ni(e){return(0,U.jsx)(U.Fragment,{children:e.children})}function ri(e,t,n){return t.options.notFoundComponent?(0,U.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,U.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,U.jsx)(ti,{})}function ii(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,U.jsx)(n,{}):null}var ai=(e,t)=>e[0]===t[0]&&e[1]===t[1],oi=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,si=v.memo(function({routeId:e}){let t=Zn();return(0,U.jsx)(ci,{router:t,match:Cr(t.stores.getMatchStore(e))})});function ci({router:e,match:t}){let n=e.routesById[t.routeId],r=ii(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=oi(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?v.Suspense:ni,l=i?Un:ni,u=o?ei:ni;return(0,U.jsxs)(n.isRoot?n.options.shellComponent??ni:ni,{children:[(0,U.jsx)(Qn.Provider,{value:t.routeId,children:(0,U.jsx)(c,{fallback:r,children:(0,U.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(_e(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,U.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return v.createElement(o,e)},children:s?(0,U.jsx)(qn,{fallback:r,children:(0,U.jsx)(li,{match:t})}):(0,U.jsx)(li,{match:t})})})})}),null]})}var li=v.memo(function({match:e}){let t=Zn(),n=e.routeId,r=t.routesById[n],i=v.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=v.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,U.jsx)(e,{},i):(0,U.jsx)(ui,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!oi(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return ii(t,r)}if(e.status===`notFound`)return ri(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ui=v.memo(function(){let e=Zn(),t=v.useContext(Qn),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Cr(a,e=>[!!e._notFound,e.error],{compare:ai}),i=Cr(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return ri(e,e.routesById[t],r);if(!i)return null;let a=(0,U.jsx)(si,{routeId:i});return t===`__root__`?(0,U.jsx)(v.Suspense,{fallback:ii(e),children:a}):a});function di(e,t){let n=e[1];e.length=0,n?.(t)}function fi({t:e}){let t=Zn(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{di(n,!1),n.push(i,a),e(t),v.startTransition(r)}),k(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(le(r.publicHref)!==le(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...At(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function pi(){let e=Zn(),t=e.routesById[Be],n=ii(e,t),r=e.ssr?ni:v.Suspense,i=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(fi,{t:v.useState()[1]}),(0,U.jsx)(r,{fallback:n,children:(0,U.jsx)(mi,{})})]});return e.options.InnerWrap?(0,U.jsx)(e.options.InnerWrap,{children:i}):i}function mi(){let e=Zn(),t=e._rendered,n=Cr(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;k(()=>{t[0]===n&&di(t,!0)},[t,n]);let a=i?(0,U.jsx)(si,{routeId:i}):null;return(0,U.jsx)(Qn.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,U.jsx)(Un,{getResetKey:()=>r,onCatch:void 0,children:a})})}var hi=e=>({createMutableStore:gr,createReadonlyStore:gr,batch:pr}),gi=e=>new _i(e),_i=class extends Pt{constructor(e){super(e,hi)}};function vi({router:e,children:t,...n}){N(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,U.jsx)(Xn.Provider,{value:e,children:t});return e.options.Wrap?(0,U.jsx)(e.options.Wrap,{children:r}):r}function yi({router:e,...t}){return(0,U.jsx)(vi,{router:e,...t,children:(0,U.jsx)(pi,{})})}function bi(e){let t=Zn({warn:e?.router===void 0}),n=e?.router||t;return Cr(n.stores.__store,Tr(e,n))}function xi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Si(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xi(e))&&(r&&(r+=` `),r+=t);return r}var Ci=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,wi=Si,Ti=(e,t)=>n=>{if(t?.variants==null)return wi(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ci(t)||Ci(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return wi(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Ei=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Di=(e,t)=>({classGroupId:e,validator:t}),Oi=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ki=`-`,Ai=[],ji=`arbitrary..`,Mi=e=>{let t=Fi(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Pi(e);let n=e.split(ki);return Ni(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ei(i,t):t:i||Ai}return n[e]||Ai}}},Ni=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Ni(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(ki):e.slice(t).join(ki),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Pi=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ji+r:void 0})(),Fi=e=>{let{theme:t,classGroups:n}=e;return Ii(n,t)},Ii=(e,t)=>{let n=Oi();for(let r in e){let i=e[r];Li(i,n,r,t)}return n},Li=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ri(i,t,n,r)}},Ri=(e,t,n,r)=>{if(typeof e==`string`){zi(e,t,n);return}if(typeof e==`function`){Bi(e,t,n,r);return}Vi(e,t,n,r)},zi=(e,t,n)=>{let r=e===``?t:Hi(t,e);r.classGroupId=n},Bi=(e,t,n,r)=>{if(Ui(e)){Li(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Di(n,e))},Vi=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Li(o,Hi(t,a),n,r)}},Hi=(e,t)=>{let n=e,r=t.split(ki),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Oi(),n.nextPart.set(t,i)),n=i}return n},Ui=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Wi=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Gi=`!`,Ki=`:`,qi=[],Ji=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Yi=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Ki){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Gi)?(c=s.slice(0,-1),l=!0):s.startsWith(Gi)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Ji(t,l,c,u)};if(t){let e=t+Ki,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ji(qi,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Xi=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Zi=e=>({cache:Wi(e.cacheSize),parseClassName:Yi(e),sortModifiers:Xi(e),postfixLookupClassGroupIds:Qi(e),...Mi(e)}),Qi=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},$i=/\s+/,ea=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split($i),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Gi:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},ta=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=na(n))&&(i&&(i+=` `),i+=r);return i},na=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=na(e[r]))&&(n&&(n+=` `),n+=t);return n},ra=(e,...t)=>{let n,r,i,a,o=o=>(n=Zi(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ea(e,n);return i(e,a),a};return a=o,(...e)=>a(ta(...e))},ia=[],aa=e=>{let t=t=>t[e]||ia;return t.isThemeGetter=!0,t.themeKey=e,t},oa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ca=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,la=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ua=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,da=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,fa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pa=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ma=e=>ca.test(e),ha=e=>!!e&&!Number.isNaN(Number(e)),ga=e=>!!e&&Number.isInteger(Number(e)),_a=e=>e.endsWith(`%`)&&ha(e.slice(0,-1)),va=e=>la.test(e),ya=()=>!0,ba=e=>ua.test(e)&&!da.test(e),xa=()=>!1,Sa=e=>fa.test(e),Ca=e=>pa.test(e),wa=e=>!Da(e)&&!Fa(e),Ta=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Ea=e=>Ua(e,qa,xa),Da=e=>oa.test(e),Oa=e=>Ua(e,Ja,ba),ka=e=>Ua(e,Ya,ha),Aa=e=>Ua(e,Za,ya),ja=e=>Ua(e,Xa,xa),Ma=e=>Ua(e,Ga,xa),Na=e=>Ua(e,Ka,Ca),Pa=e=>Ua(e,Qa,Sa),Fa=e=>sa.test(e),Ia=e=>Wa(e,Ja),La=e=>Wa(e,Xa),Ra=e=>Wa(e,Ga),za=e=>Wa(e,qa),Ba=e=>Wa(e,Ka),Va=e=>Wa(e,Qa,!0),Ha=e=>Wa(e,Za,!0),Ua=(e,t,n)=>{let r=oa.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Wa=(e,t,n=!1)=>{let r=sa.exec(e);return r?r[1]?t(r[1]):n:!1},Ga=e=>e===`position`||e===`percentage`,Ka=e=>e===`image`||e===`url`,qa=e=>e===`length`||e===`size`||e===`bg-size`,Ja=e=>e===`length`,Ya=e=>e===`number`,Xa=e=>e===`family-name`,Za=e=>e===`number`||e===`weight`,Qa=e=>e===`shadow`,$a=()=>{let e=aa(`color`),t=aa(`font`),n=aa(`text`),r=aa(`font-weight`),i=aa(`tracking`),a=aa(`leading`),o=aa(`breakpoint`),s=aa(`container`),c=aa(`spacing`),l=aa(`radius`),u=aa(`shadow`),d=aa(`inset-shadow`),f=aa(`text-shadow`),p=aa(`drop-shadow`),m=aa(`blur`),h=aa(`perspective`),g=aa(`aspect`),_=aa(`ease`),v=aa(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Fa,Da],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Fa,Da,c],T=()=>[ma,`full`,`auto`,...w()],E=()=>[ga,`none`,`subgrid`,Fa,Da],D=()=>[`auto`,{span:[`full`,ga,Fa,Da]},ga,Fa,Da],O=()=>[ga,`auto`,Fa,Da],k=()=>[`auto`,`min`,`max`,`fr`,Fa,Da],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ma,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,ma,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ma,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Fa,Da],L=()=>[...b(),Ra,Ma,{position:[Fa,Da]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,za,Ea,{size:[Fa,Da]}],ee=()=>[_a,Ia,Oa],B=()=>[``,`none`,`full`,l,Fa,Da],V=()=>[``,ha,Ia,Oa],te=()=>[`solid`,`dashed`,`dotted`,`double`],ne=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],H=()=>[ha,_a,Ra,Ma],re=()=>[``,`none`,m,Fa,Da],ie=()=>[`none`,ha,Fa,Da],ae=()=>[`none`,ha,Fa,Da],oe=()=>[ha,Fa,Da],se=()=>[ma,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[va],breakpoint:[va],color:[ya],container:[va],"drop-shadow":[va],ease:[`in`,`out`,`in-out`],font:[wa],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[va],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[va],shadow:[va],spacing:[`px`,ha],text:[va],"text-shadow":[va],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ma,Da,Fa,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Fa,Da]}],"container-named":[Ta],columns:[{columns:[ha,`auto`,Da,Fa,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ga,`auto`,Fa,Da]}],basis:[{basis:[ma,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ha,ma,`auto`,`initial`,`none`,Da]}],grow:[{grow:[``,ha,Fa,Da]}],shrink:[{shrink:[``,ha,Fa,Da]}],order:[{order:[ga,`first`,`last`,`none`,Fa,Da]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Ia,Oa]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ha,Aa]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,_a,Da]}],"font-family":[{font:[La,ja,t]}],"font-features":[{"font-features":[Da]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Fa,Da]}],"line-clamp":[{"line-clamp":[ha,`none`,Fa,ka]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Fa,Da]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Fa,Da]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...te(),`wavy`]}],"text-decoration-thickness":[{decoration:[ha,`from-font`,`auto`,Fa,Oa]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[ha,`auto`,Fa,Da]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ga,Fa,Da]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Fa,Da]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Fa,Da]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ga,Fa,Da],radial:[``,Fa,Da],conic:[``,ga,Fa,Da]},Ba,Na]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...te(),`hidden`,`none`]}],"divide-style":[{divide:[...te(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...te(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ha,Fa,Da]}],"outline-w":[{outline:[``,ha,Ia,Oa]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,Va,Pa]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Va,Pa]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[ha,Oa]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Va,Pa]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[ha,Fa,Da]}],"mix-blend":[{"mix-blend":[...ne(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[ha]}],"mask-image-linear-from-pos":[{"mask-linear-from":H()}],"mask-image-linear-to-pos":[{"mask-linear-to":H()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":H()}],"mask-image-t-to-pos":[{"mask-t-to":H()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":H()}],"mask-image-r-to-pos":[{"mask-r-to":H()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":H()}],"mask-image-b-to-pos":[{"mask-b-to":H()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":H()}],"mask-image-l-to-pos":[{"mask-l-to":H()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":H()}],"mask-image-x-to-pos":[{"mask-x-to":H()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":H()}],"mask-image-y-to-pos":[{"mask-y-to":H()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Fa,Da]}],"mask-image-radial-from-pos":[{"mask-radial-from":H()}],"mask-image-radial-to-pos":[{"mask-radial-to":H()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ha]}],"mask-image-conic-from-pos":[{"mask-conic-from":H()}],"mask-image-conic-to-pos":[{"mask-conic-to":H()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Fa,Da]}],filter:[{filter:[``,`none`,Fa,Da]}],blur:[{blur:re()}],brightness:[{brightness:[ha,Fa,Da]}],contrast:[{contrast:[ha,Fa,Da]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Va,Pa]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,ha,Fa,Da]}],"hue-rotate":[{"hue-rotate":[ha,Fa,Da]}],invert:[{invert:[``,ha,Fa,Da]}],saturate:[{saturate:[ha,Fa,Da]}],sepia:[{sepia:[``,ha,Fa,Da]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Fa,Da]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[ha,Fa,Da]}],"backdrop-contrast":[{"backdrop-contrast":[ha,Fa,Da]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ha,Fa,Da]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ha,Fa,Da]}],"backdrop-invert":[{"backdrop-invert":[``,ha,Fa,Da]}],"backdrop-opacity":[{"backdrop-opacity":[ha,Fa,Da]}],"backdrop-saturate":[{"backdrop-saturate":[ha,Fa,Da]}],"backdrop-sepia":[{"backdrop-sepia":[``,ha,Fa,Da]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Fa,Da]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ha,`initial`,Fa,Da]}],ease:[{ease:[`linear`,`initial`,_,Fa,Da]}],delay:[{delay:[ha,Fa,Da]}],animate:[{animate:[`none`,v,Fa,Da]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Fa,Da]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":[`scale-3d`],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[Fa,Da,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":[`translate-none`],zoom:[{zoom:[ga,Fa,Da]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Fa,Da]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Fa,Da]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[ha,Ia,Oa,ka]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},eo=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(to(e,`cacheSize`,t),to(e,`prefix`,n),to(e,`experimentalParseClassName`,r),no(e.theme,a.theme),no(e.classGroups,a.classGroups),no(e.conflictingClassGroups,a.conflictingClassGroups),no(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),to(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),to(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),ro(e.theme,i.theme),ro(e.classGroups,i.classGroups),ro(e.conflictingClassGroups,i.conflictingClassGroups),ro(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),io(e,i,`postfixLookupClassGroups`),io(e,i,`orderSensitiveModifiers`),e),to=(e,t,n)=>{n!==void 0&&(e[t]=n)},no=(e,t)=>{if(t)for(let n in t)to(e,n,t[n])},ro=(e,t)=>{if(t)for(let n in t)io(e,t,n)},io=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},ao=(e,...t)=>typeof e==`function`?ra($a,e,...t):ra(()=>eo($a(),e),...t),oo=ra($a),so=ao({extend:{classGroups:{"font-size":[{text:[`display-xl`,`display-lg`,`display-md`,`display-sm`,`heading-1`,`heading-2`,`heading-3`,`body`,`body-sm`,`label`,`code`]}]}}});function W(...e){return so(Si(e))}var co=Ti(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 focus-visible:ring-offset-bg disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-accent-hover`,outline:`border-border bg-surface hover:border-border-strong hover:bg-surface-hover`,secondary:`bg-secondary text-secondary-foreground hover:bg-surface-hover`,ghost:`text-fg-2 hover:bg-surface-hover hover:text-foreground`,destructive:`text-danger hover:bg-danger-bg`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3`,xs:`h-6 gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 px-2.5 text-xs`,lg:`h-9 gap-1.5 px-3.5`,icon:`size-8`,"icon-sm":`size-7`}},defaultVariants:{variant:`default`,size:`default`}}),lo=(0,v.forwardRef)(({className:e,variant:t=`default`,size:n=`default`,type:r=`button`,...i},a)=>(0,U.jsx)(`button`,{ref:a,type:r,"data-slot":`button`,className:W(co({variant:t,size:n,className:e})),...i}));lo.displayName=`Button`;var uo=Ti(`inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-label font-medium whitespace-nowrap`,{variants:{variant:{neutral:`border-border bg-surface text-fg-2`,accent:`border-transparent bg-accent-bg text-fg-1`,success:`border-transparent bg-success-bg text-success`,warning:`border-transparent bg-warning-bg text-warning`,danger:`border-transparent bg-danger-bg text-danger`,info:`border-transparent bg-info-bg text-info`},mono:{true:`font-mono text-code`,false:``}},defaultVariants:{variant:`neutral`,mono:!1}});function fo({className:e,variant:t=`neutral`,mono:n,dot:r,children:i,...a}){return(0,U.jsxs)(`span`,{"data-slot":`badge`,className:W(uo({variant:t,mono:n,className:e})),...a,children:[r?(0,U.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 self-center rounded-full bg-current`}):null,i]})}function po({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card`,className:W(`rounded-lg border border-border bg-surface`,e),...t})}function mo({className:e,...t}){return(0,U.jsx)(`div`,{className:W(`flex items-start justify-between gap-3 px-4 pt-3.5 pb-3`,e),...t})}function ho({className:e,...t}){return(0,U.jsx)(`h3`,{className:W(`text-heading-3 font-semibold text-text`,e),...t})}function go({className:e,...t}){return(0,U.jsx)(`div`,{className:W(`px-4 pb-4`,e),...t})}var _o=(0,v.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`input`,{ref:n,"data-slot":`input`,className:W(`h-8 w-full rounded-md border border-border bg-bg px-2.5 text-body-sm text-text`,`placeholder:text-fg-4 transition-colors outline-none`,`hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`disabled:pointer-events-none disabled:opacity-50`,e),...t}));_o.displayName=`Input`;var vo=(0,v.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`textarea`,{ref:n,"data-slot":`textarea`,className:W(`w-full resize-none rounded-md border border-border bg-bg px-2.5 py-2 text-body-sm text-text`,`placeholder:text-fg-4 transition-colors outline-none`,`hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`disabled:pointer-events-none disabled:opacity-50`,e),...t}));vo.displayName=`Textarea`;var yo={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},bo={...yo,position:`fixed`,top:0,left:0},xo={...yo,position:`absolute`},So={};function Co(e,t){let n=v.useRef(So);return n.current===So&&(n.current=e(t)),n}function wo(e,t,n,r){let i=Co(Eo).current;return Do(i,e,t,n,r)&&ko(i,[e,t,n,r]),i.callback}function To(e){let t=Co(Eo).current;return Oo(t,e)&&ko(t,e),t.callback}function Eo(){return{callback:null,cleanup:null,refs:[]}}function Do(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Oo(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function ko(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Ao(e){let t=v.useRef(!0);t.current&&(t.current=!1,e())}function jo(e){let[t,n]=v.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function Mo(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function No({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=v.useRef(e!==void 0),[a,o]=v.useState(t);return[i&&e!==void 0?e:a,v.useCallback(e=>{i||o(e)},[])]}var Po=typeof document<`u`?v.useLayoutEffect:()=>{},Fo={...v},Io=Fo.useInsertionEffect,Lo=Io&&Io!==Fo.useLayoutEffect?Io:e=>e();function Ro(e){let t=Co(zo).current;return t.next=e,Lo(t.effect),t.trampoline}function zo(){let e={next:void 0,callback:Bo,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Bo(){}function Vo(e){let t=Co(Ho,e).current;return t.next=e,Po(t.effect),t}function Ho(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Uo(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Wo=Uo(`https://base-ui.com/production-error`,`Base UI`),Go=19;function Ko(e){return Go>=e}var qo=[],Jo=void 0;function Yo(){return Jo}function Xo(e){qo.push(e)}function Zo(e){let t=(t,n)=>{let r=Co($o).current,i;try{Jo=r;for(let e of qo)e.before(r);i=e(t,n);for(let e of qo)e.after(r);r.didInitialize=!0}finally{Jo=void 0}return i};return t.displayName=e.displayName||e.name,t}function Qo(e){return v.forwardRef(Zo(e))}function $o(){return{didInitialize:!1}}var es=yr(),ts=Ko(19)?is:as;function ns(e,t,n,r,i){return ts(e,t,n,r,i)}function rs(e,t,n,r,i){let a=v.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,es.useSyncExternalStore)(e.subscribe,a,a)}Xo({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,es.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function is(e,t,n,r,i){let a=Yo();if(!a)return rs(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function as(e,t,n,r,i){return(0,xr.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var os=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return ns(this,e,t,n,r)}};function ss(){}var cs=Object.freeze([]),ls=Object.freeze({}),us=class extends os{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){v.useDebugValue(e);let n=this;Po(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Po(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Po(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){v.useDebugValue(e);let n=this,r=t!==void 0;Po(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return v.useDebugValue(e),ns(this,this.selectors[e],t,n,r)}useContextCallback(e,t){v.useDebugValue(e);let n=Ro(t??ss);this.context[e]=n}useStateSetter(e){let t=v.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function ds(){return typeof window<`u`}function fs(e){return hs(e)?(e.nodeName||``).toLowerCase():`#document`}function ps(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ms(e){return((hs(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function hs(e){return ds()?e instanceof Node||e instanceof ps(e).Node:!1}function gs(e){return ds()?e instanceof Element||e instanceof ps(e).Element:!1}function _s(e){return ds()?e instanceof HTMLElement||e instanceof ps(e).HTMLElement:!1}function vs(e){return!ds()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ps(e).ShadowRoot}function ys(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=As(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function bs(e){return/^(table|td|th)$/.test(fs(e))}function xs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ss=/transform|translate|scale|rotate|perspective|filter/,Cs=/paint|layout|strict|content/,ws=e=>!!e&&e!==`none`,Ts;function Es(e){let t=gs(e)?As(e):e;return ws(t.transform)||ws(t.translate)||ws(t.scale)||ws(t.rotate)||ws(t.perspective)||!Os()&&(ws(t.backdropFilter)||ws(t.filter))||Ss.test(t.willChange||``)||Cs.test(t.contain||``)}function Ds(e){let t=Ms(e);for(;_s(t)&&!ks(t);){if(Es(t))return t;if(xs(t))return null;t=Ms(t)}return null}function Os(){return Ts??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ts}function ks(e){return/^(html|body|#document)$/.test(fs(e))}function As(e){return ps(e).getComputedStyle(e)}function js(e){return gs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ms(e){if(fs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||vs(e)&&e.host||ms(e);return vs(t)?t.host:t}function Ns(e){let t=Ms(e);return ks(t)?(e.ownerDocument||e).body:_s(t)&&ys(t)?t:Ns(t)}function Ps(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ns(e),i=r===e.ownerDocument?.body,a=ps(r);if(i){let e=Fs(a);return t.concat(a,a.visualViewport||[],ys(r)?r:[],e&&n?Ps(e):[])}return t.concat(r,Ps(r,[],n))}function Fs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Is(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Ls(e){return e?.ownerDocument||document}function Rs(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function zs(e){v.useEffect(e,cs)}var Bs=null;globalThis.requestAnimationFrame;var Vs=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Hs=class e{static create(){return new e}static request(e){return Vs.request(e)}static cancel(e){return Vs.cancel(e)}currentId=Bs;request(e){this.cancel(),this.currentId=Vs.request(()=>{this.currentId=Bs,e()})}cancel=()=>{this.currentId!==Bs&&(Vs.cancel(this.currentId),this.currentId=Bs)};disposeEffect=()=>this.cancel};function Us(){let e=Co(Hs.create).current;return zs(e.disposeEffect),e}var Ws=0,Gs=class e{static create(){return new e}currentId=Ws;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ws,t()},e)}isStarted(){return this.currentId!==Ws}clear=()=>{this.currentId!==Ws&&(clearTimeout(this.currentId),this.currentId=Ws)};disposeEffect=()=>this.clear};function Ks(){let e=Co(Gs.create).current;return zs(e.disposeEffect),e}function qs(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Js,platform:Ys,maxTouchPoints:Xs}=qs(),Zs=Js.toLowerCase(),Qs=Ys.toLowerCase(),$s=/^i(os$|p)/.test(Qs)||Qs===`macintel`&&Xs>1,ec=`android`,tc=Qs===ec||Zs.includes(ec),nc=!$s&&Qs.startsWith(`mac`);Qs.startsWith(`win`),!tc&&/^(linux|chrome os)/.test(Qs);var rc=nc||$s,ic=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ic&&Zs.includes(`firefox`),!ic&&Zs.includes(`chrom`);var ac=rc,oc=/jsdom|happydom/.test(Zs);function sc(e){e.preventDefault(),e.stopPropagation()}function cc(e){return`nativeEvent`in e}function lc(e){return e.pointerType===``&&e.isTrusted?!0:tc&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function uc(e){return oc?!1:!tc&&e.width===0&&e.height===0||tc&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function dc(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function fc(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function pc(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function mc(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&vs(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function hc(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var gc=`data-base-ui-focusable`,_c=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,vc=`ArrowLeft`,yc=`ArrowRight`,bc=`ArrowUp`,xc=`ArrowDown`,Sc=`data-starting-style`,Cc=`data-ending-style`,wc={[Sc]:``},Tc={[Cc]:``},Ec={transitionStatus(e){return e===`starting`?wc:e===`ending`?Tc:null}},Dc=`data-open`,Oc=`data-closed`,kc=`data-anchor-hidden`,Ac=`data-popup-open`,jc=`data-pressed`,Mc={[Ac]:``},Nc={[Ac]:``,[jc]:``},Pc={[Dc]:``},Fc={[Oc]:``},Ic={[kc]:``},Lc={open(e){return e?Mc:null}},Rc={open(e){return e?Nc:null}},zc={open(e){return e?Pc:Fc},anchorHidden(e){return e?Ic:null}},Bc={...zc,...Ec},Vc=`data-trigger-disabled`;function Hc(e,t){if(!gs(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Vc);for(let[,e]of t.entries())if(mc(e,n))return!e.hasAttribute(Vc);return!1}function Uc(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Wc(e){return e.matches(`html,body`)}function Gc(e){return _s(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Kc(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${_c}`)!=null}function qc(e){return e?e.getAttribute(`role`)===`combobox`&&Gc(e):!1}function Jc(e){if(!e||oc)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Yc(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Xc(e,t){return t!=null&&!dc(t)?0:typeof e==`function`?e():e}function Zc(e,t,n){let r=Xc(e,n);return typeof r==`number`?r:r?.[t]}function Qc(e){return typeof e==`function`?e():e}function $c(e,t){return t||e===`click`||e===`mousedown`}function el(e){return e?.includes(`mouse`)&&e!==`mousedown`}var tl=`none`,nl=`trigger-press`,rl=`trigger-hover`,il=`trigger-focus`,al=`outside-press`,ol=`item-press`,sl=`close-press`,cl=`focus-out`,ll=`escape-key`,ul=`list-navigation`,dl=`cancel-open`,fl=`sibling-open`,pl=`disabled`,ml=`imperative-action`,hl=`window-resize`;function gl(e,t,n,r){let i=!1,a=!1,o=r??ls;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var _l=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Gs,currentIdRef:{current:null},currentContextRef:{current:null}});function vl(e,t){e.current=t.current}function yl(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=v.useRef(n),a=v.useRef(n),o=v.useRef(null),s=v.useRef(null),c=Ks();return Po(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Zc(i.current,`open`),close:Zc(n,`close`)}},[n,o,i,a]),(0,U.jsx)(_l.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function bl(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=v.useContext(_l),[f,p]=v.useState(!1),m=v.useRef(n);return Po(()=>{m.current=n},[n]),Po(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),Po(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Zc(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,gl(tl))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),Po(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,vl(o,c),d.clear()}},[l,a,o,i,c,d]),v.useMemo(()=>({activeIdRef:a,hasProvider:u,delayRef:o,isInstantPhase:f}),[a,u,o,f])}var xl=v.forwardRef(function(e,t){let[n,r]=v.useState();Po(()=>{ac&&ic&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,U.jsx)(`span`,{...e,ref:t,style:bo,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Sl=Math.min,Cl=Math.max,wl=Math.round,Tl=Math.floor,El=e=>({x:e,y:e}),Dl={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ol(e,t,n){return Cl(e,Sl(t,n))}function kl(e,t){return typeof e==`function`?e(t):e}function Al(e){return e.split(`-`)[0]}function jl(e){return e.split(`-`)[1]}function Ml(e){return e===`x`?`y`:`x`}function Nl(e){return e===`y`?`height`:`width`}function Pl(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Fl(e){return Ml(Pl(e))}function Il(e,t,n){n===void 0&&(n=!1);let r=jl(e),i=Fl(e),a=Nl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Gl(o)),[o,Gl(o)]}function Ll(e){let t=Gl(e);return[Rl(e),t,Rl(t)]}function Rl(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var zl=[`left`,`right`],Bl=[`right`,`left`],Vl=[`top`,`bottom`],Hl=[`bottom`,`top`];function Ul(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Bl:zl:t?zl:Bl;case`left`:case`right`:return t?Vl:Hl;default:return[]}}function Wl(e,t,n,r){let i=jl(e),a=Ul(Al(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Rl)))),a}function Gl(e){let t=Al(e);return Dl[t]+e.slice(t.length)}function Kl(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ql(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Kl(e)}function Jl(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Yl(e,t){return t<0||t>=e.length}function Xl(e,t){return Ql(e.current,{disabledIndices:t})}function Zl(e,t){return Ql(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ql(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&$l(e,a,r));return a}function $l(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!tu(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function eu(e){return e.visibility===`hidden`||e.visibility===`collapse`}function tu(e,t=e?As(e):null){return!e||!e.isConnected||!t||eu(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var nu=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function ru(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return vs(n)?n.host:null}function iu(e){for(let t of Array.from(e.children))if(fs(t)===`summary`)return t;return null}function au(e,t){let n=iu(t);return!!n&&(e===n||mc(n,e))}function ou(e){let t=e?fs(e):``;return e!=null&&e.matches(nu)&&(t!==`summary`||e.parentElement!=null&&fs(e.parentElement)===`details`&&iu(e.parentElement)===e)&&(t!==`details`||iu(e)==null)&&(t!==`input`||e.type!==`hidden`)}function su(e){if(!ou(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=ru(t)){let n=t!==e,r=fs(t)===`slot`;if(t.hasAttribute(`inert`)||n&&fs(t)===`details`&&!t.open&&!au(e,t)||t.hasAttribute(`hidden`)||!r&&!cu(t,n))return!1}return!0}function cu(e,t){let n=As(e);return t?n.display!==`none`:tu(e,n)}function lu(e){let t=e.tabIndex;if(t<0){let t=fs(e);if(t===`details`||t===`audio`||t===`video`||_s(e)&&e.isContentEditable)return 0}return t}function uu(e){if(fs(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function du(e,t){let n=uu(e);if(!n)return!0;let r=t.find(e=>{let t=uu(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=uu(e);return t?.name===n.name&&t.form===n.form})===n}function fu(e){if(_s(e)&&fs(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return _s(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function pu(e,t){fu(e).forEach(e=>{ou(e)&&t.push(e),pu(e,t)})}function mu(e,t,n){fu(e).forEach(e=>{_s(e)&&e.matches(t)&&n.push(e),mu(e,t,n)})}function hu(e){return su(e)&&lu(e)>=0}function gu(e){let t=[];return pu(e,t),t.filter(su)}function _u(e){let t=gu(e);return t.filter(e=>lu(e)>=0&&du(e,t))}function vu(e,t){let n=_u(e),r=n.length;if(r===0)return;let i=pc(Ls(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function yu(e){return vu(Ls(e).body,1)||e}function bu(e){return vu(Ls(e).body,-1)||e}function xu(e,t){if(!e)return null;let n=_u(Ls(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Su(e){return xu(e,1)}function Cu(e){return xu(e,-1)}function wu(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!mc(n,r)}function Tu(e){_u(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Eu(e){let t=[];mu(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Du(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Du(e,t.id,n)])}function Ou(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ku(e){return`data-base-ui-${e}`}var Au=0;function ju(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Au);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),ss;let o=requestAnimationFrame(a);return Au=o,()=>{Au===o&&(cancelAnimationFrame(o),Au=0)}}var Mu={inert:new WeakMap,"aria-hidden":new WeakMap},Nu=`data-base-ui-inert`,Pu={inert:new WeakSet,"aria-hidden":new WeakSet},Fu=new WeakMap,Iu=0;function Lu(e){return Pu[e]}function Ru(e){return e?vs(e)?e.host:Ru(e.parentNode):null}var zu=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ru(t);return e.contains(n)?n:null}).filter(e=>e!=null),Bu=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Vu=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{fs(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Hu(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=zu(t,e),l=i?Vu(t,Bu(c),new Set(c)):[],u=[],d=[];if(a){let e=Mu[a],n=Lu(a);s=n,o=e;let r=zu(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Vu(t,Bu(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Fu.get(e)||0)+1;Fu.set(e,t),d.push(e),t===1&&e.setAttribute(Nu,``)}),Iu+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Fu.get(e)||0)-1;Fu.set(e,t),t||e.removeAttribute(Nu)}),--Iu,Iu||(Mu.inert=new WeakMap,Mu[`aria-hidden`]=new WeakMap,Pu.inert=new WeakSet,Pu[`aria-hidden`]=new WeakSet,Fu=new WeakMap)}}function Uu(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Ls(e[0]).body;return Hu(e,a,n,r,{mark:i})}var Wu=0;function Gu(e,t=`mui`){let[n,r]=v.useState(e),i=e||n;return v.useEffect(()=>{n??(Wu+=1,r(`${t}-${Wu}`))},[n,t]),i}var Ku=Fo.useId;function qu(e,t){if(Ku!==void 0){let n=Ku();return e??(t?`${t}-${n}`:n)}return Gu(e,t)}function Ju(e){if(!v.isValidElement(e))return null;let t=e,n=t.props;return(Ko(19)?n?.ref:t.ref)??null}function Yu(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Xu(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Zu(e,t){return typeof e==`function`?e(t):e}function Qu(e,t){return typeof e==`function`?e(t):e}var $u={};function ed(e,t,n,r,i){if(!n&&!r&&!i&&!e)return nd(t);let a=nd(e);return t&&(a=rd(a,t)),n&&(a=rd(a,n)),r&&(a=rd(a,r)),i&&(a=rd(a,i)),a}function td(e){if(e.length===0)return $u;if(e.length===1)return nd(e[0]);let t=nd(e[0]);for(let n=1;n<e.length;n+=1)t=rd(t,e[n]);return t}function nd(e){return sd(e)?{...cd(e,$u)}:id(e)}function rd(e,t){return sd(t)?cd(t,e):ad(e,t)}function id(e){let t={...e};for(let e in t){let n=t[e];od(e,n)&&(t[e]=ud(n))}return t}function ad(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Yu(e.style,r);break;case`className`:e[n]=fd(e.className,r);break;default:e[n]=od(n,r)?ld(e[n],r):r}}return e}function od(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function sd(e){return typeof e==`function`}function cd(e,t){return sd(e)?e(t):e??$u}function ld(e,t){return t?e?(...n)=>{let r=n[0];if(pd(r)){let i=r;dd(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:ud(t):e}function ud(e){return e&&((...t)=>{let n=t[0];return pd(n)&&dd(n),e(...t)})}function dd(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fd(e,t){return t?e?t+` `+e:t:e}function pd(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function md(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=vd(r));let i=hd(t,n,r);if(n.enabled===!1)return null;let a=n.state??ls;return yd(e,r,i,a)}function hd(e,t,n){let{className:r,style:i}=e,{state:a=ls,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Zu(r,a):void 0,d=l?Qu(i,a):void 0,f=l?Xu(a,c):ls,p=l&&s?gd(s):void 0,m=l?Yu(f,p)??{}:ls;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?To([m.ref,Ju(n),...o]):wo(m.ref,Ju(n),o):wo(null,null)),l?(u!==void 0&&(m.className=fd(m.className,u)),d!==void 0&&(m.style=Yu(m.style,d)),m):ls}function gd(e){return Array.isArray(e)?td(e):ed(void 0,e)}var _d=Symbol.for(`react.lazy`);function vd(e){if(e?.$$typeof!==_d)return e;let t=v.Children.toArray(e)[0];return v.isValidElement(t)?t:e}function yd(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ed(n,t.props);return e.ref=n.ref,v.cloneElement(t,e)}if(e&&typeof e==`string`)return bd(e,n);throw Error(Wo(8))}function bd(e,t){return e===`button`?(0,v.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,v.createElement)(`img`,{alt:``,...t,key:t.key}):v.createElement(e,t)}var xd={style:{transition:`none`}},Sd=`data-base-ui-click-trigger`,Cd={fallbackAxisSide:`none`},wd={fallbackAxisSide:`end`},Td={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Ed=l(h(),1),Dd=v.createContext(null),Od=()=>v.useContext(Dd),kd=ku(`portal`);function Ad(e={}){let{ref:t,container:n,componentProps:r=ls,elementProps:i}=e,a=qu(),o=Od()?.portalNode,[s,c]=v.useState(null),[l,u]=v.useState(null),d=Ro(e=>{e!==null&&u(e)}),f=v.useRef(null);Po(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(hs(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=md(`div`,r,{ref:[t,d],props:[{id:a,[kd]:``},i]}),m=s&&p?Ed.createPortal(p,s):null;return{node:l,nodeId:v.isValidElement(p)?p.props.id:void 0,subtree:m}}var jd=v.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Ad({container:o,ref:t,componentProps:e,elementProps:c}),f=v.useRef(null),p=v.useRef(null),m=v.useRef(null),h=v.useRef(null),[g,_]=v.useState(null),y=v.useRef(!1),b=g?.modal,x=g?.open,S=!!g&&!g.modal&&g.open&&!!l;v.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&wu(e)&&(e.type===`focusin`?y.current&&=(Eu(l),!1):(Tu(l),y.current=!0))}return Is(Rs(l,`focusin`,e,!0),Rs(l,`focusout`,e,!0))},[l,b]),Po(()=>{l&&x===!0&&y.current&&(Eu(l),y.current=!1)},[x,l]);let C=v.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,U.jsxs)(v.Fragment,{children:[d,(0,U.jsxs)(Dd.Provider,{value:C,children:[S&&l&&(0,U.jsx)(xl,{"data-type":`outside`,ref:f,onFocus:e=>{wu(e,l)?m.current?.focus():bu(g?g.domReference:null)?.focus()}}),S&&l&&(0,U.jsx)(`span`,{role:s,"aria-owns":u,style:Td}),l&&Ed.createPortal(a,l),S&&l&&(0,U.jsx)(xl,{"data-type":`outside`,ref:p,onFocus:e=>{wu(e,l)?h.current?.focus():(yu(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,gl(`focus-out`,e.nativeEvent)))}})]})]})});function Md(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Nd=class{nodesRef={current:[]};events=Md();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Pd=v.createContext(null),Fd=v.createContext(null),Id=()=>v.useContext(Pd)?.id||null,Ld=e=>{let t=v.useContext(Fd);return e??t};function Rd(e){let t=qu(),n=Ld(e),r=Id();return Po(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function zd(e){let{children:t,id:n}=e,r=Id();return(0,U.jsx)(Pd.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Bd(e){let{children:t,externalTree:n}=e,r=Co(()=>n??new Nd).current;return(0,U.jsx)(Fd.Provider,{value:r,children:t})}function Vd(e){return e==null?e:`current`in e?e.current:e}function Hd(e,t){let n=ps(hc(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ud=20,Wd=[];function Gd(){Wd=Wd.filter(e=>e.deref()?.isConnected)}function Kd(e){Gd(),e&&fs(e)!==`body`&&(Wd.push(new WeakRef(e)),Wd.length>Ud&&(Wd=Wd.slice(-20)))}function qd(){return Gd(),Wd[Wd.length-1]?.deref()}function Jd(e){return e?hu(e)?e:_u(e)[0]||e:null}function Yd(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=gu(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return hu(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Xd(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),y=h.useState(`floatingElement`),{events:b,dataRef:x}=h.context,S=Ro(()=>x.current.floatingContext?.nodeId),C=i===!1,w=qc(_)&&C,T=Vo(i),E=Vo(a),D=Vo(l),O=Vo(g),k=Ld(p),A=Od(),j=v.useRef(!1),M=v.useRef(!1),N=v.useRef(!1),P=v.useRef(null),F=v.useRef(``),I=v.useRef(``),L=v.useRef(null),R=v.useRef(null),z=wo(L,f,A?.beforeInsideRef),ee=wo(R,A?.afterInsideRef),B=Ks(),V=Ks(),te=Us(),ne=A!=null,H=Yc(y),re=Ro((e=H)=>e?_u(e):[]),ie=Ro(()=>m?.().filter(e=>e!=null)??[]);v.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&mc(H,pc(Ls(H)))&&re().length===0&&!w&&sc(e)}return Rs(Ls(H),`keydown`,e)},[r,H,s,w,re]),v.useEffect(()=>{if(r||!g)return;let e=Ls(H);function t(){N.current=!1}function n(e){let t=hc(e),n=ie(),r=mc(y,t)||mc(_,t)||mc(A?.portalNode,t)||n.some(e=>e===t||mc(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,V.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return Is(Rs(e,`pointerdown`,n,!0),Rs(e,`pointerup`,t,!0),Rs(e,`pointercancel`,t,!0),Rs(e,`keydown`,i,!0),t)},[r,y,_,H,g,A,V,ie]),v.useEffect(()=>{if(r||!c)return;let e=Ls(H);function t(){M.current=!0,V.start(0,()=>{M.current=!1})}function n(e){let t=hc(e);hu(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=hc(t);s&&n==null&&i!=null&&mc(y,i)&&Kd(i),queueMicrotask(()=>{let a=S(),c=h.context.triggerElements,l=ie(),f=n?.hasAttribute(ku(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Vd(d),Vd(u)].includes(n),p=!(mc(_,n)||mc(y,n)||mc(n,y)||mc(A?.portalNode,n)||l.some(e=>e===n||mc(e,n))||c.hasMatchingElement(e=>mc(e,n))||f||k&&(Du(k.nodesRef.current,a).find(e=>mc(e.context?.elements.floating,n)||mc(e.context?.elements.domReference,n))||Ou(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Yc(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&H&&Yd(H),o&&r!==_&&!tu(i)&&pc(e)===e.body){if(_s(H)&&(H.focus(),o===`popup`)){te.request(()=>{H.focus()});return}let e=re(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;_s(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==qd())&&(j.current=!0,h.setOpen(!1,gl(cl,t)))})}function a(){N.current||(x.current.insideReactTree=!0,B.start(0,()=>{x.current.insideReactTree=!1}))}let l=_s(_)?_:null;if(y||l)return Is(l&&Rs(l,`focusout`,i),l&&Rs(l,`pointerdown`,t),y&&Rs(y,`focusin`,n),y&&Rs(y,`focusout`,i),y&&A&&Rs(y,`focusout`,a,!0))},[r,_,y,H,s,k,A,h,c,o,re,w,S,x,B,V,te,u,d,ie]),v.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${ku(`portal`)}]`)||[]),t=(k?Ou(k.nodesRef.current,S()):[]).find(e=>qc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Uu([y,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ie(),t,Vd(d),Vd(u),w?_:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=Uu([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,y,s,A,w,k,S,u,d,ie]),Po(()=>{if(!g||r||!_s(H))return;F.current=``,I.current=``;let e=Ls(H),t=pc(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||mc(H,t))return;let i=null,a=()=>(i??=re(H),i[0]||H),o;o=r===!0||r===null?a():Vd(r),o||=a();let s=mc(H,pc(e));ju(o,{preventScroll:o===H,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=pc(e);return!(t!==o&&mc(H,t))}})})},[r,g,H,re,T,D,O]),Po(()=>{if(r||!H)return;let e=Ls(H),t=pc(e),n=D.current==null;Kd(t);function i(e){if(e.open||(F.current=Hd(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(lc(e.nativeEvent)||uc(e.nativeEvent))j.current=!1;else{let e=!1;Ls(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&fs(t)!==`body`?t:null,s=n?o||a:a||o;return s||=qd()||null,typeof i==`boolean`?s:Vd(i)||s||null}return()=>{b.off(`openchange`,i);let t=pc(e),n=ie(),r=mc(y,t)||n.some(e=>e===t||mc(e,t))||k&&Du(k.nodesRef.current,S(),!1).some(e=>mc(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=Jd(c),i=typeof o!=`boolean`;if(o&&!j.current&&_s(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,y,H,E,D,b,k,_,S,ie]),Po(()=>{if(!ic||g||!y)return;let e=pc(Ls(y));_s(e)&&Gc(e)&&mc(y,e)&&e.blur()},[g,y]),Po(()=>{if(!r&&A)return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),Po(()=>{if(!r&&H)return Yd(H),()=>{queueMicrotask(Gd)}},[r,H]);let ae=!r&&(!s||!w)&&(ne||s);return(0,U.jsxs)(v.Fragment,{children:[ae&&(0,U.jsx)(xl,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=re();ju(e[e.length-1])}else A?.portalNode&&(j.current=!1,wu(e,A.portalNode)?yu(_)?.focus():Vd(d??A.beforeOutsideRef)?.focus())}}),n,ae&&(0,U.jsx)(xl,{"data-type":`inside`,ref:ee,onFocus:e=>{s?ju(re()[0]):A?.portalNode&&(c&&(j.current=!0),wu(e,A.portalNode)?bu(_)?.focus():Vd(u??A.afterOutsideRef)?.focus())}})]})}function Zd(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=nl}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=v.useRef(void 0),f=Us(),p=Ks(),m=v.useMemo(()=>{function e(e,t,n,r){let i=gl(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=dc(e.pointerType,!0)&&uc(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||dc(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=hc(o);if(Gc(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}dc(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return v.useMemo(()=>n?{reference:m}:ls,[n,m])}function Qd(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function $d(e){return e!=null&&e.clientX!=null}function ef(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=v.useRef(!1),u=v.useRef(null),[d,f]=v.useState(),[p,m]=v.useState([]),h=Ro(e=>{i.set(`positionReference`,e)}),g=Ro((e,t,n)=>{l.current||(!c.current.openEvent||$d(c.current.openEvent))&&i.set(`positionReference`,Qd(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=Ro(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),y=dc(d)?o:a;v.useEffect(()=>{if(!n){h(s);return}if(!y)return;function e(){u.current?.(),u.current=null}let t=ps(o);function r(t){let n=hc(t);mc(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||$d(c.current.openEvent)?u.current=Rs(t,`mousemove`,r):h(s),e},[y,n,o,c,s,i,g,h,p]),v.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),v.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),v.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let b=v.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return v.useMemo(()=>n?{reference:b,trigger:b}:{},[n,b])}function tf(){return!1}function nf(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function rf(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=tf,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=Ld(c),h=Ro(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,y=Ro(()=>a),{escapeKey:b,outsidePress:x}=nf(s),S=v.useRef(!1),C=v.useRef(!1),w=v.useRef(!1),T=v.useRef(!1),E=v.useRef(!1),D=v.useRef(``),O=v.useRef(null),k=Ks(),A=Ks(),j=Ro(()=>{A.clear(),f.current.insideReactTree=!1}),M=Ro(e=>{let t=f.current.floatingContext?.nodeId;return(m?Du(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Ro(e=>Uc(e,l.select(`floatingElement`))||Uc(e,l.select(`domReferenceElement`))),P=Ro(e=>{o()&&l.setOpen(!1,gl(nl,e.nativeEvent))}),F=Ro(e=>{if(!u||!n||!r||e.key!==`Escape`||E.current||!b&&M(`__escapeKeyBubbles`))return;let t=gl(ll,cc(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!b&&!t.isPropagationAllowed&&e.stopPropagation()}),I=Ro(()=>{f.current.insideReactTree=!0,A.start(0,j)}),L=Ro(e=>{if(!u||!n||e.button!==0)return;let t=hc(e.nativeEvent);mc(l.select(`floatingElement`),t)&&(S.current||(S.current=!0,C.current=!1))}),R=Ro(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&S.current&&(C.current=!0)});v.useEffect(()=>{function e(e){e.open||(T.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),v.useEffect(()=>{if(!u||!n)return u||(T.current=!1),j;f.current.__escapeKeyBubbles=b,f.current.__outsidePressBubbles=x;let e=new Gs,t=new Gs,i=Ls(d);function a(){e.clear(),E.current=!0}function o(){e.start(ic?5:0,()=>{E.current=!1})}function s(){w.current=!0,t.start(0,()=>{w.current=!1})}function c(){S.current=!1,C.current=!1}function p(){let e=D.current,t=e===`pen`||!e?`mouse`:e,n=y(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function v(e){let t=f.current.floatingContext?.nodeId,n=m&&Du(m.nodesRef.current,t).some(t=>Uc(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),w.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=hc(e),r=`[${ku(`inert`)}]`,i=gs(n)?n.getRootNode():null,a=Array.from((vs(i)?i:Ls(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>mc(e,n))))return;let s=gs(n)?n:null;for(;s&&!ks(s);){let e=Ms(s);if(ks(e)||!gs(e))break;s=e}if(!(a.length&&gs(n)&&!Wc(n)&&!mc(n,l.select(`floatingElement`))&&a.every(e=>!mc(s,e)))){if(_s(n)&&!(`touches`in e)){let t=ks(n),r=As(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!v(e)){if(p()===`intentional`){if(e.detail!==0&&!lc(e)&&!T.current)return;if(w.current){t.clear(),w.current=!1;return}}(typeof g!=`function`||g(e))&&(M(`__outsidePressBubbles`)||(l.setOpen(!1,gl(al,e)),j()))}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(O.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=hc(e);if(!n)return;let r=Rs(n,e.type,()=>{t(e),r()})}function R(e){D.current=`touch`,L(e,I)}function z(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(T.current=!0),D.current=e.pointerType),(e.type!==`mousedown`||!O.current||O.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function ee(e){if(e.type===`pointercancel`&&(T.current=!1),!S.current)return;let n=C.current;if(c(),p()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!v(e)){if(n){s();return}(typeof g!=`function`||g(e))&&(t.clear(),w.current=!0,j())}}}function B(e){if(p()!==`sloppy`||!O.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(A(e),k.clear(),O.current=null)}function V(e){L(e,B)}function te(e){p()===`sloppy`&&O.current&&!N(e)&&(O.current.dismissOnTouchEnd&&A(e),k.clear(),O.current=null)}function ne(e){L(e,te)}let H=Is(r&&Is(Rs(i,`keydown`,F),Rs(i,`compositionstart`,a),Rs(i,`compositionend`,o)),_&&Is(Rs(i,`click`,z,!0),Rs(i,`pointerdown`,z,!0),Rs(i,`pointerup`,ee,!0),Rs(i,`pointercancel`,ee,!0),Rs(i,`mousedown`,z,!0),Rs(i,`mouseup`,ee,!0),Rs(i,`touchstart`,R,{capture:!0,passive:!0}),Rs(i,`touchmove`,V,{capture:!0,passive:!0}),Rs(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{H(),e.clear(),t.clear(),c(),w.current=!1,j()}},[f,d,r,_,g,u,n,b,x,F,j,y,M,N,m,l,k]);let z=v.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ee=v.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return v.useMemo(()=>n?{reference:z,floating:ee,trigger:z}:{},[n,z,ee])}function af(e,t,n){let{reference:r,floating:i}=e,a=Pl(t),o=Fl(t),s=Nl(o),c=Al(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=jl(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function of(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=kl(t,e),p=ql(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Jl(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Jl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var sf=50,cf=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:of},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=af(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<sf&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=af(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},lf=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=kl(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Al(r),_=Pl(o),v=Al(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Gl(o)]:Ll(o)),x=p!==`none`;!d&&x&&b.push(...Wl(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Il(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Pl(t)||T.every(e=>Pl(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Pl(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},uf=new Set([`left`,`top`]);async function df(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Al(n),s=jl(n),c=Pl(n)===`y`,l=uf.has(o)?-1:1,u=a&&c?-1:1,d=kl(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ff=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await df(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},pf=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=kl(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Pl(i),p=Ml(f),m=u[p],h=u[f],g=(e,t)=>Ol(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},mf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=kl(e,t),u={x:n,y:r},d=Pl(i),f=Ml(d),p=u[f],m=u[d],h=kl(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=uf.has(Al(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},hf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=kl(e,t),c=await i.detectOverflow(t,s),l=Al(n),u=jl(n),d=Pl(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Sl(p-c[m],g),y=Sl(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Cl(c.left,c.right):S=p-2*Cl(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function gf(e){let t=As(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=_s(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=wl(n)!==a||wl(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function _f(e){return gs(e)?e:e.contextElement}function vf(e){let t=_f(e);if(!_s(t))return El(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=gf(t),o=(a?wl(n.width):n.width)/r,s=(a?wl(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var yf=El(0);function bf(e){let t=ps(e);return!Os()||!t.visualViewport?yf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xf(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ps(e)}function Sf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=_f(e),o=El(1);t&&(r?gs(r)&&(o=vf(r)):o=vf(e));let s=xf(a,n,r)?bf(a):El(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ps(a),t=gs(r)?ps(r):r,n=e,i=Fs(n);for(;i&&t!==n;){let e=vf(i),t=i.getBoundingClientRect(),r=As(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ps(i),i=Fs(n)}}return Jl({width:u,height:d,x:c,y:l})}function Cf(e,t){let n=js(e).scrollLeft;return t?t.left+n:Sf(ms(e)).left+n}function wf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Cf(e,n),y:n.top+t.scrollTop}}function Tf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ms(r),s=t?xs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=El(1),u=El(0),d=_s(r);if((d||!a)&&((fs(r)!==`body`||ys(o))&&(c=js(r)),d)){let e=Sf(r);l=vf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?wf(o,c):El(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ef(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Df(e){let t=js(e),n=e.ownerDocument.body,r=Cl(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Cl(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Cf(e),o=-t.scrollTop;return As(n).direction===`rtl`&&(a+=Cl(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Of=25;function kf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ps(e),a=ms(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Os()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Cf(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Of&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Af(e,t){let n=Sf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=vf(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function jf(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=kf(e,n,t);else if(t===`document`)r=Df(ms(e));else if(gs(t))r=Af(t,n);else{let n=bf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Jl(r)}function Mf(e,t){let n=t.get(e);if(n)return n;let r=Ps(e,[],!1).filter(e=>gs(e)&&fs(e)!==`body`),i=null,a=As(e).position===`fixed`,o=a?Ms(e):e;for(;gs(o)&&!ks(o);){let e=As(o),t=Es(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ms(o)}return t.set(e,r),r}function Nf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?xs(t)?[]:Mf(t,this._c):[].concat(n),r],o=jf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=jf(t,a[e],i);s=Cl(n.top,s),c=Sl(n.right,c),l=Sl(n.bottom,l),u=Cl(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Pf(e){let{width:t,height:n}=gf(e);return{width:t,height:n}}function Ff(e,t,n){let r=_s(t),i=ms(t),a=n===`fixed`,o=Sf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=El(0);if((r||!a)&&((fs(t)!==`body`||ys(i))&&(s=js(t)),r)){let e=Sf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Cf(i));let l=i&&!r&&!a?wf(i,s):El(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function If(e){return As(e).position===`static`}function Lf(e,t){if(!_s(e)||As(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ms(e)===n&&(n=n.ownerDocument.body),n}function Rf(e,t){let n=ps(e);if(xs(e))return n;if(!_s(e)){let t=Ms(e);for(;t&&!ks(t);){if(gs(t)&&!If(t))return t;t=Ms(t)}return n}let r=Lf(e,t);for(;r&&bs(r)&&If(r);)r=Lf(r,t);return r&&ks(r)&&If(r)&&!Es(r)?n:r||Ds(e)||n}var zf=async function(e){let t=this.getOffsetParent||Rf,n=this.getDimensions,r=await n(e.floating);return{reference:Ff(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Bf(e){return As(e).direction===`rtl`}var Vf={convertOffsetParentRelativeRectToViewportRelativeRect:Tf,getDocumentElement:ms,getClippingRect:Nf,getOffsetParent:Rf,getElementRects:zf,getClientRects:Ef,getDimensions:Pf,getScale:vf,isElement:gs,isRTL:Bf};function Hf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Uf(e,t,n){let r=null,i,a=ms(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Tl(d),h=Tl(a.clientWidth-(u+f)),g=Tl(a.clientHeight-(d+p)),_=Tl(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Cl(0,Sl(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Hf(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ps(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Wf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=_f(e),u=i||a?[...l?Ps(l):[],...t?Ps(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Uf(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Sf(e):null;c&&g();function g(){let t=Sf(e);h&&!Hf(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Gf=ff,Kf=pf,qf=lf,Jf=hf,Yf=mf,Xf=(e,t,n)=>{let r=new Map,i=n??{},a={...Vf,...i.platform,_c:r};return cf(e,t,{...i,platform:a})},Zf=typeof document<`u`?v.useLayoutEffect:function(){};function Qf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Qf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function $f(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ep(e,t){let n=$f(e);return Math.round(t*n)/n}function tp(e){let t=v.useRef(e);return Zf(()=>{t.current=e}),t}function np(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Qf(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=tp(c),O=tp(i),k=tp(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Xf(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Qf(T.current,t)&&(T.current=t,Ed.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Zf(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Zf(()=>(j.current=!0,()=>{j.current=!1}),[]),Zf(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ep(N.floating,u.x),r=ep(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...$f(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var rp=(e,t)=>{let n=Gf(e);return{name:n.name,fn:n.fn,options:[e,t]}},ip=(e,t)=>{let n=Kf(e);return{name:n.name,fn:n.fn,options:[e,t]}},ap=(e,t)=>({fn:Yf(e).fn,options:[e,t]}),op=(e,t)=>{let n=qf(e);return{name:n.name,fn:n.fn,options:[e,t]}},sp=(e,t)=>{let n=Jf(e);return{name:n.name,fn:n.fn,options:[e,t]}},cp={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},lp=class extends us{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Md(),nested:n,triggerElements:i},cp),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&fc(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function up(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=v.useRef(null);r===void 0&&f.current===null&&(f.current=new lp({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Po(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};gs(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function dp(e,t=!1,n=!1,r=!1){let[i,a]=v.useState(e&&t?`idle`:void 0),[o,s]=v.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Po(()=>{if(!e&&o&&i!==`ending`&&n){let e=Hs.request(()=>{a(`ending`)});return()=>{Hs.cancel(e)}}},[e,o,i,n]),Po(()=>{if(!e||t)return;let n=Hs.request(()=>{a(void 0)});return()=>{Hs.cancel(n)}},[t,e]),Po(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Hs.request(()=>{a(`idle`)});return()=>{Hs.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var fp=null;function pp(e){if(!fp){let e=[];fp=e,queueMicrotask(()=>{fp=null,Ed.flushSync(()=>{for(let t of e)t()})})}fp.push(e)}function mp(e,t=!1,n=!1){let r=Us();return Ro((i,a=null)=>{r.cancel();let o=Vd(e);if(o==null)return;let s=o,c=()=>{if(!n){Ed.flushSync(i);return}pp(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Sc;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function hp(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Ro(a),s=mp(r,n,i);v.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var gp={tabIndex:-1,[gc]:``};function _p(e){return t=>t!==`touch`||e.current}function vp(e,t=!1){let n=qu(),r=Id()!=null,i=Co(()=>e(n,r)).current;return up({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function yp({handle:e,store:t}){return Po(()=>e.attachStore(t),[e,t]),null}function bp(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function xp(e,t){let n=v.useRef(null);return Ro(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),bp(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),bp(t))})}function Sp(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function Cp(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function wp(e,t,n,r={}){let i=n.reason,a=i===rl,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Cp(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Sp(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Ed.flushSync(l):l()}function Tp(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=xp(e,n),o=Ro(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Ro(e=>{a(e),e&&o(e)});return Po(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Po(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Ep(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=v.useRef(null),i=e.useState(`open`);Po(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=gl(tl);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Dp(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=dp(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=Ro(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return hp({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function Op(e,t){e.useSyncedValues(t),Po(()=>()=>{e.update({activeTriggerProps:ls,inactiveTriggerProps:ls,popupProps:ls})},[e])}function kp(e,t){Po(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Po(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ap=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function jp(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new lp({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ls,inactiveTriggerProps:ls,popupProps:ls}}var Mp=e=>e.triggerIdProp??e.activeTriggerId,Np=e=>e.openProp??e.open,Pp=e=>(e.popupElement?.id??e.floatingId)||void 0;function Fp(e,t){return t!==void 0&&Np(e)&&Mp(e)===t}function Ip(e,t){return Fp(e,t)?!0:t!==void 0&&Np(e)&&Mp(e)==null&&e.triggerCount===1}var Lp={open:Np,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Mp,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Pp,isTriggerActive:(e,t)=>t!==void 0&&Mp(e)===t,isOpenedByTrigger:(e,t)=>Fp(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Mp(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ip(e,t)?Pp(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Rp(e){let t=v.useCallback(t=>e===void 0?ss:e.subscribeStore(t),[e]),n=v.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,es.useSyncExternalStore)(t,n,()=>e?.serverStore)}function zp(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=qu(),a=Id()!=null,o=Co(()=>new lp({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Ap,floatingId:i,syncOnly:!1,nested:a})).current;return Po(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=gs(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function Bp(e){return Vp(e,e.rootContext)}function Vp(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=v.useState(null),[d,f]=v.useState(void 0),[p,m]=v.useState(void 0),h=v.useRef(null),g=Ld(r),_=v.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=np({...e,elements:{..._,...l&&{reference:l}}}),b=gs(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=v.useCallback(e=>{let t=gs(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=v.useCallback(e=>{(gs(e)||e===null)&&(h.current=e,f(e)),(gs(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!gs(e))&&y.refs.setReference(e)},[y.refs,f]),w=v.useCallback(e=>{m(e),y.refs.setFloating(e)},[y.refs]),T=v.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[y.refs,C,w,S]),E=v.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),D=v.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return Po(()=>{o&&(h.current=o)},[o]),Po(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),v.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:t}),[y,T,E,D,t])}var Hp=nc&⁣function Up(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=v.useRef(!1),c=v.useRef(null),l=v.useRef(!0),u=Ks();v.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=ps(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&_s(e)&&e===pc(Ls(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return Is(Rs(t,`blur`,r),Hp&&Rs(t,`keydown`,a,!0),Hp&&Rs(t,`pointerdown`,o,!0))},[i,n]),v.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);gs(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=v.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=hc(t.nativeEvent);if(gs(a)){if(Hp&&!t.relatedTarget){if(!l.current&&!Gc(a))return}else if(!Jc(a))return}let o=Hc(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,gl(il,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,gl(il,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=gs(n)&&n.hasAttribute(ku(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=pc(Ls(e));(n||t!==e)&&(mc(o.current.floatingContext?.refs.floating.current,t)||mc(e,t)||a||Hc(n??t,i.context.triggerElements)||i.setOpen(!1,gl(il,r)))})}}},[o,r,i,u]);return v.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var Wp=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Gs,this.restTimeout=new Gs,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Gp=new WeakMap;function Kp(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Gp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Gp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function qp(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Gp.get(n);a&&a!==e&&Kp(a),Kp(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Gp.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Jp(e){let t=e.context.dataRef.current,n=Co(()=>t.hoverInteractionState??Wp.create()).current;return t.hoverInteractionState||=n,zs(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Yp(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=Ld(),d=Id(),f=Jp(a),p=Ks(),m=Ro(()=>$c(l.current.openEvent?.type,f.interactedInside)),h=Ro(()=>el(l.current.openEvent?.type)),g=Ro(()=>{Kp(f)});Po(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),v.useEffect(()=>g,[g]),Po(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&gs(c)&&s){let e=c,t=s,n=Ls(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return qp(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),v.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&Du(u.nodesRef.current,d).length>0)}function t(e){let t=Zc(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,gl(rl,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=hc(e);if(!Kc(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Hc(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&gs(o)&&Du(u.nodesRef.current,r,!1).some(e=>mc(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,gl(rl,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Is(y&&Rs(y,`mouseenter`,c),y&&Rs(y,`mouseleave`,_),y&&Rs(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var Xp={current:null};function Zp(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Xp,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,y=Ld(l),b=Jp(h),x=v.useRef(!1),S=Vo(i),C=Vo(r),w=Vo(o),T=Vo(n),E=Vo(p),D=Vo(f),O=Ro(()=>$c(g.current.openEvent?.type,b.interactedInside)),k=Ro(()=>E.current?.()!==!1),A=Ro((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!mc(e,t);if(!gs(n))return!1;let i=n;return r.hasMatchingElement(e=>mc(e,i))&&(!e||!mc(e,i))}),j=Ro(()=>{b.handler&&=(Ls(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=Ro(()=>{Kp(b)});return u&&(b.handleCloseOptions=i?.__options),v.useEffect(()=>j,[j]),v.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===rl,j(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,b,j]),v.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Zc(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{h.setOpen(!1,gl(rl,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),h.setOpen(!1,gl(rl,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!gs(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!dc(b.pointerType))return;let t=Qc(w.current),n=Zc(C.current,`open`,b.pointerType),r=hc(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(gs(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(mc(e,r)){s=e;break}}gs(i)&&gs(o)&&!h.context.triggerElements.hasElement(i)&&mc(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&gs(s)&&gs(o)&&mc(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,gl(rl,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,gl(rl,e,s))}):g&&k()&&h.setOpen(!0,gl(rl,e,s)))}function i(t){if(O()){M();return}j();let n=Ls(h.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Hc(t.relatedTarget,h.context.triggerElements)){if(S.current&&r){h.select(`open`)||b.openChangeTimeout.clear();let i=c.current;b.handler=S.current({...r,tree:y,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!mc(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){mc(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=m?Rs(t,`mouseout`,o):void 0;return s?Is(Rs(t,`mousemove`,r,{once:!0}),Rs(t,`mouseenter`,r),Rs(t,`mouseleave`,i),l):Is(Rs(t,`mouseenter`,r),Rs(t,`mouseleave`,i),l)},[j,M,g,C,h,n,S,b,u,A,O,a,s,w,c,y,T,d,D,k,m]),v.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!dc(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;qp(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Qc(w.current);if(i&&!o||s===0||!o&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function c(){if(b.restTimeoutPending=!1,O())return;let e=h.select(`open`);!b.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,gl(rl,t,n))}b.pointerType===`touch`?Ed.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,h,w,k])}var Qp=`Escape`;function $p(e){return ic&&e.movementX===0&&e.movementY===0}function em(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function tm(e,t){return em(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function nm(e,t,n){return em(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function rm(e,t,n){return em(t,n?e===vc:e===yc,e===xc)}function im(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Qp:em(t,n?e===yc:e===vc,e===bc)}function am(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:y,resetOnPointerLeave:b=!0,externalTree:x,grid:S}=t,C=S!=null,w=`rootStore`in e?e.rootStore:e,T=w.useState(`open`),E=w.useState(`floatingElement`),D=w.useState(`domReferenceElement`),O=w.context.dataRef,k=Yc(E),A=qc(D),j=Vo(k),M=Id(),N=Ld(x),P=v.useRef(f),F=v.useRef(o??-1),I=v.useRef(null),L=v.useRef(!0),R=Ro(e=>{i(F.current===-1?null:F.current,e)}),z=v.useRef(!!E),ee=v.useRef(T),B=v.useRef(!1),V=v.useRef(!1),te=v.useRef(null),ne=Vo(h),H=Vo(T),re=Vo(o),ie=Vo(b),ae=Us(),oe=Us(),se=Ro(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):te.current=ju(e,{sync:B.current,preventScroll:!0})}let t=n.current[F.current],r=V.current;t&&e(t),(B.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),pe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Po(()=>{O.current.orientation=g},[O,g]),Po(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(V.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),Po(()=>{if(a){if(!T){B.current=!1;return}if(E){if(r==null){if(B.current=!1,re.current!=null)return;if(z.current&&(F.current=-1,se()),(!ee.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||nm(I.current,g,u)||l?Xl(n):Zl(n),I.current=null,R())};t()}}else Yl(n.current,r)||(F.current=r,se(),V.current=!1)}}},[a,T,E,r,re,l,n,g,u,R,se,oe]),Po(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=pc(Ls(D??t??null)),r=e.some(e=>e.context&&mc(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),Po(()=>{ee.current=T,z.current=!!E}),Po(()=>{T||(I.current=null,P.current=f)},[T,f]);let ce=r!=null,le=Ro(e=>{if(!H.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),ue=Ro(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),de=Ro(()=>Xl(n,ne.current)),fe=Ro(e=>{if(L.current=!1,B.current=!0,e.which===229||!H.current&&e.currentTarget===j.current)return;if(l&&im(e.key,g,u,C)){tm(e.key,ue())||sc(e),w.setOpen(!1,gl(ul,e.nativeEvent)),_s(D)&&(d?N?.events.emit(`virtualfocus`,D):D.focus());return}let t=F.current,r=Xl(n,h),i=Zl(n,h);if(A||(e.key===`Home`&&(sc(e),F.current=r,R(e)),e.key===`End`&&(sc(e),F.current=i,R(e))),S!=null){let t=S(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,R(e)),g===`both`)return}if(tm(e.key,g)){if(sc(e),T&&!d&&pc(e.currentTarget.ownerDocument)===e.currentTarget){F.current=nm(e.key,g,u)?r:i,R(e);return}nm(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(B.current=!1,F.current=r):F.current=Ql(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,Ql(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(B.current=!1,F.current=i):F.current=Ql(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,Ql(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),Yl(n.current,F.current)&&(F.current=-1),R(e)}}),pe=v.useMemo(()=>({onFocus(e){B.current=!0,le(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){$p(e)||(B.current=!0,V.current=!1,p&&le(e))},onPointerLeave(e){if(!H.current||!L.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ie.current&&(te.current?.(),te.current=null,F.current=-1,R(e),!d)){let e=j.current,t=pc(Ls(e));e&&mc(e,t)&&e.focus({preventScroll:!0})}}}),[le,H,j,p,n,R,ie,d]),me=v.useMemo(()=>d&&T&&ce&&{"aria-activedescendant":`${y}-${r}`},[d,T,ce,y,r]),he=v.useMemo(()=>({...A?{}:me,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&T&&!d){let t=hc(e.nativeEvent);if(t&&!mc(j.current,t))return;sc(e),w.setOpen(!1,gl(cl,e.nativeEvent)),_s(D)&&D.focus();return}fe(e)},onPointerMove(e){$p(e)||(L.current=!0)}}),[me,fe,j,A,w,T,d,D]),ge=v.useMemo(()=>{function e(e){w.setOpen(!0,gl(ul,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&lc(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&uc(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=w.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=rm(t.key,ue(),u),a=tm(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return fe(t);if(n||m||!r){if(o){let e=tm(t.key,ue());I.current=l&&e?null:t.key}if(l){i&&(sc(t),n?(F.current=de(),R(t)):e(t));return}a&&(re.current!=null&&(F.current=re.current),sc(t),!n&&m?e(t):fe(t),n&&R(t))}},onFocus(e){w.select(`open`)&&!d&&(F.current=-1,R(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[fe,f,de,l,R,w,m,g,ue,u,re,d]),_e=v.useMemo(()=>({...me,...ge}),[me,ge]);return v.useMemo(()=>a?{reference:_e,floating:he,item:pe,trigger:ge}:{},[a,_e,he,ge,pe])}function om(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=Ks(),m=v.useRef(``),h=v.useRef(u??i??-1),g=v.useRef(null),_=Ro(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!tu(n)||n?.matches(`:disabled`)?!1:o==null||!$l(cs,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(sc(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(sc(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),y=Ro(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);mc(n,t)||mc(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Po(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let b=v.useMemo(()=>({onKeyDown:_,onBlur:y}),[_,y]);return v.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var sm=.1,cm=sm*sm,lm=.5;function um(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function dm(e,t,n,r,i,a,o,s,c,l){let u=!1;return um(e,t,n,r,i,a)&&(u=!u),um(e,t,i,a,o,s)&&(u=!u),um(e,t,o,s,c,l)&&(u=!u),um(e,t,c,l,n,r)&&(u=!u),u}function fm(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function pm(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function mm(e={}){let{blockPointerEvents:t=!1}=e,n=new Gs,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*cm;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=hc(r),g=r.type===`mouseleave`,_=mc(u,h),v=mc(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&gs(r.relatedTarget)&&mc(u,r.relatedTarget))return;function y(){return!!(s&&Du(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=pm(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=pm(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=pm(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=pm(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!fm(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?lm/2:lm*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+lm+1,o=C||T?S.bottom-lm:S.top,s=C?T?S.bottom-lm:S.top:S.bottom-lm;M=dm(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?lm/2:lm*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-lm,o=C||T?S.top+lm:S.bottom,s=C?T?S.top+lm:S.bottom:S.top+lm;M=dm(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?lm/2:lm*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+lm+1,o=w||E?S.right-lm:S.left,s=w?E?S.right-lm:S.left:S.right-lm;M=dm(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?lm/2:lm*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-lm,o=w||E?S.left+lm:S.right,s=w?E?S.left+lm:S.right:S.left+lm;M=dm(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var hm=v.createContext(void 0),gm=v.createContext(void 0),_m=v.createContext(void 0);function vm(){let e=v.useContext(hm);if(e===void 0)throw Error(Wo(60));return e}function ym(){let e=v.useContext(gm);if(e===void 0)throw Error(Wo(101));return e}function bm(){let e=v.useContext(_m);if(e===void 0)throw Error(Wo(61));return e}var xm=`data-valid`,Sm=`data-invalid`,Cm={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},wm={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Tm={valid(e){return e===null?null:e?{[xm]:``}:{[Sm]:``}}},Em={invalid:void 0,name:void 0,validityData:{state:Cm,errors:[],error:``,value:``,initialValue:null},setValidityData:ss,disabled:void 0,setTouched:ss,setDirty:ss,setFilled:ss,setFocused:ss,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:wm,registerFieldControl:ss,validation:{getValidationProps:(e,t=ls)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:ss,getInputControl:()=>null,commit:async()=>{},change:ss}},Dm=v.createContext(Em);function Om(e=!0){let t=v.useContext(Dm);if(t.setValidityData===ss&&!e)throw Error(Wo(28));return t}function km(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Om(),s=Co(()=>Symbol());Po(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Po(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Am(e){return qu(e,`base-ui`)}var jm=v.createContext({controlId:void 0,registerControlId:ss,resetControlId:ss,labelId:void 0,setLabelId:ss,messageIds:[],setMessageIds:ss,getDescriptionProps:e=>e});function Mm(){return v.useContext(jm)}function Nm(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Mm(),o=Am(),s=Co(()=>Symbol()),c=v.useRef(!1),l=v.useRef(!1),u=Ro(()=>{c.current&&i!==ss&&(c.current=!1,i(s.current,void 0))});return Po(()=>{if(!n||i===ss){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),Po(()=>u,[u]),(n?r:void 0)??t??o}function Pm(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var Fm=(e,t)=>Object.is(e,t);function Im(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Lm(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Pm(e,t,(e,t)=>Im(e,t,n)):e!==t}function Rm(e,t,n){return e?e.some(e=>e!==void 0&&Im(t,e,n)):!1}function zm(e,t,n){return e?e.findIndex(e=>e!==void 0&&Im(e,t,n)):-1}function Bm(e,t){if(t!==Fm)return n=>Rm(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function Vm(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(Bm(t,n)):zm(e,t,n);return i===-1?null:i}function Hm(e,t,n,r,i,a){return Rm(r,t,i)?a!=null&&e>a&&Rm(r,n[a],i)?a:e:e===a?Vm(n,r,i,!0):a}function Um(e,t,n){return e.filter(e=>!Im(t,e,n))}function Wm(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Gm(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function Km(e){return Gm(e?.[0])}function qm(e){return Km(e)?e.flatMap(e=>e.items):e}function Jm(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Km(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Ym(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Wm(e)}function Xm(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Wm(e.value):Wm(e)}function Zm(e,t,n){function r(){return Ym(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=qm(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Qm(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,U.jsx)(v.Fragment,{children:Zm(r,t,n)},i)),e),[])}var $m={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Xm(t,r)!==``},hasNullItemLabel:(e,t)=>t?Jm(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>Im(t,e,n)):Im(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows},eh=v.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:ss,validationMode:`onSubmit`,submitCountRef:{current:0}});function th(){return v.useContext(eh)}function nh(e,t){let n=v.useRef(e),r=Ro(t);Po(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function rh(e){let t=v.useRef(``),n=v.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:v.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function ih(e,t){let{onClick:n,onPointerDown:r}=rh(Ro((n,r)=>{(typeof e==`function`?e():e)||t(r||($s?`touch`:``))}));return v.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function ah(e){let[t,n]=v.useState(null),r=ih(e,n);return nh(e,t=>{t&&!e&&n(null)}),v.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function oh(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function sh(e,t){return Math.max(0,e-t)}function ch(e,t){if(t<=0)return 0;let n=oh(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function lh(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:y,multiple:b=!1,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C=Fm,highlightItemOnHover:w=!0,children:T}=e,{clearErrors:E}=th(),{setDirty:D,setTouched:O,setFocused:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=Om(),I=Nm({id:t}),L=N||d,R=M??c,[z,ee]=No({controlled:n,default:b?r??cs:r,name:`Select`,state:`value`}),[B,V]=No({controlled:a,default:o,name:`Select`,state:`open`}),te=v.useRef([]),ne=v.useRef([]),H=v.useRef(null),re=v.useRef(null),ie=v.useRef(0),ae=v.useRef(null),oe=v.useRef([]),se=v.useRef(!1),ce=v.useRef(null),le=v.useRef(null),ue=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),de=v.useRef(!1),fe=v.useRef(z),{mounted:pe,setMounted:me,transitionStatus:he}=dp(B),{openMethod:ge,triggerProps:_e}=ah(B),ve=Co(()=>new us({id:I,labelId:void 0,modal:m,multiple:b,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,value:z,open:B,mounted:pe,transitionStatus:he,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:ls,triggerProps:ls,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:ss,setOpen:ss,handleScrollArrowVisibility:ss,onOpenChangeComplete:ss,listRef:te,popupRef:H,scrollHandlerRef:re,scrollArrowsMountedCountRef:ie,valueRef:ae,valuesRef:oe,labelsRef:ne,typingRef:se,selectionRef:ue,firstItemTextRef:ce,selectedItemTextRef:le,alignItemWithTriggerActiveRef:de,initialValueRef:fe},$m)).current,ye=ve.useState(`activeIndex`),be=ve.useState(`selectedIndex`),xe=ve.useState(`triggerElement`),Se=ve.useState(`positionerElement`),Ce=jo(ge),we=ge??Ce,Te=v.useMemo(()=>b?``:Xm(z,S),[b,z,S]),Ee=v.useMemo(()=>b&&Array.isArray(z)?z.map(e=>Xm(e,S)):Xm(z,S),[b,z,S]);km(Vo(xe),I,z,Ro(()=>Ee),!L,c);let De=b?Array.isArray(z)&&z.length>0:z!=null&&Te!==``;Po(()=>{j(De)},[De,j]),Po(function(){let e=Vm(oe.current,z,C,b);e===null&&(le.current=null),!B&&ve.set(`selectedIndex`,e)},[b,B,z,C,ve]),nh(z,()=>{E(R),D(Lm(z,A.initialValue,C)),P.change(z)});let Oe=Ro((e,t)=>{s?.(e,t),!t.isCanceled&&(V(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),F===`onBlur`&&P.commit(z)))}),ke=Ro(()=>{me(!1),ve.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});hp({enabled:!h,open:B,ref:H,onComplete(){B||ke()}}),v.useImperativeHandle(h,()=>({unmount:ke}),[ke]);let Ae=Ro((e,t)=>{i?.(e,t),!t.isCanceled&&ee(e)}),je=Ro(e=>{let t=sh(e.scrollHeight,e.clientHeight),n=ch(e.scrollTop,t),r=n>0,i=n<t;ve.set(`scrollUpArrowVisible`,r),ve.set(`scrollDownArrowVisible`,i)}),Me=zp({open:B,onOpenChange:Oe,elements:{reference:xe,floating:Se}}),Ne=Zd(Me,{enabled:!L,event:`mousedown`}),Pe=rf(Me),Fe=am(Me,{enabled:!L,listRef:te,activeIndex:ye,selectedIndex:be,disabledIndices:cs,onNavigate(e){(e!==null||B)&&ve.set(`activeIndex`,e)},focusItemOnHover:w}),Ie=om(Me,{enabled:!L&&(B||!f&&!b),listRef:ne,activeIndex:ye,selectedIndex:be,disabledIndices:e=>Mo(te.current[e]),onMatch(e){B?ve.set(`activeIndex`,e):Ae(oe.current[e],gl(tl))},onTyping(e){se.current=e}}),Le=v.useMemo(()=>ed(Ie.reference,Fe.reference,Pe.reference,Ne.reference,_e),[Ne.reference,Ie.reference,Fe.reference,Pe.reference,_e]),Re=v.useMemo(()=>ed(gp,Ie.floating,Fe.floating,Pe.floating),[Ie.floating,Fe.floating,Pe.floating]),ze=Fe.item??ls;ve.useContextCallback(`setValue`,Ae),ve.useContextCallback(`setOpen`,Oe),ve.useContextCallback(`handleScrollArrowVisibility`,je),ve.useContextCallback(`onOpenChangeComplete`,_),Ao(()=>{ve.update({popupProps:Re,triggerProps:Le})}),ve.useSyncedValues({id:I,modal:m,multiple:b,value:z,open:B,mounted:pe,transitionStatus:he,popupProps:Re,triggerProps:Le,items:y,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,openMethod:we});let Be=v.useMemo(()=>({disabled:L,readOnly:f,required:p,multiple:b,highlightItemOnHover:w,itemProps:ze}),[L,f,p,b,w,ze]),Ve=wo(g,P.inputRef),He=b?void 0:R,Ue=v.useMemo(()=>!b||!Array.isArray(z)||!R?null:z.map(e=>{let t=Xm(e,S);return(0,U.jsx)(`input`,{type:`hidden`,form:l,name:R,value:t,disabled:L},t)}),[b,z,l,R,S,L]);return(0,U.jsxs)(hm.Provider,{value:ve,children:[(0,U.jsx)(gm.Provider,{value:Be,children:(0,U.jsx)(_m.Provider,{value:Me,children:T})}),(0,U.jsx)(`input`,{...P.getValidationProps(L,{onFocus(){ve.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||L||f)return;let t=e.currentTarget.value,n=gl(tl,e.nativeEvent);function r(){if(b)return;let e=t.toLowerCase(),r=oe.current.findIndex(t=>Xm(t,S).toLowerCase()===e||Ym(t,x).toLowerCase()===e);r===-1&&(r=oe.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=oe.current[r];i!=null&&Ae(i,n)}ve.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&He==null?`${I}-hidden-input`:void 0,form:l,name:He,autoComplete:u,value:Te,disabled:L,required:p&&!(b&&De),readOnly:f,ref:Ve,style:R?xo:bo,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ue]})}function uh(e,t){return e??t}var dh=5;function fh(e,t){let n=ph(t);return e.clientX>=n.left-dh&&e.clientX<=n.right+dh&&e.clientY>=n.top-dh&&e.clientY<=n.bottom+dh}function ph(e){let t=e.getBoundingClientRect(),n=ps(e);if(oc)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var mh=v.createContext(void 0);function hh(e=!1){let t=v.useContext(mh);if(t===void 0&&!e)throw Error(Wo(16));return t}function gh(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:v.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function _h(e,t,{detail:n=0}={}){e.dispatchEvent(new(ps(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function vh(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=v.useRef(null),s=hh(!0),c=a??s!==void 0,{props:l}=gh({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=v.useCallback(()=>{let e=o.current;yh(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Po(u,[u]),{getButtonProps:v.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return ed({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(dd(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=yh(r),s=!i&&bh(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),_h(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),_h(r,e)))},onKeyUp(e){if(!t){if(dd(e),a?.(e),e.target===e.currentTarget&&i&&c&&yh(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),_h(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Ro(e=>{o.current=e,u()})}}function yh(e){return _s(e)&&e.tagName===`BUTTON`}function bh(e){return _s(e)&&e.tagName===`A`&&!!e.href}var xh=`data-popup-side`,Sh=400,Ch={...Rc,...Tm,popupSide:e=>e?{[xh]:e}:null,value:()=>null},wh=v.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,validation:f,state:p,disabled:m}=Om(),{labelId:h}=Mm(),g=vm(),{readOnly:_,required:y,disabled:b}=ym(),x=m||b||a,S=g.useState(`open`),C=g.useState(`mounted`),w=g.useState(`value`),T=g.useState(`triggerProps`),E=g.useState(`positionerElement`),D=g.useState(`listElement`),O=g.useState(`popupSide`),k=g.useState(`id`),A=g.useState(`labelId`),j=g.useState(`hasSelectedValue`),M=C&&E?O:null,N=i??k,P=uh(h,A);Nm({id:i});let F=Vo(E),I=v.useRef(null),{getButtonProps:L,buttonRef:R}=vh({disabled:x,native:o}),z=g.useStateSetter(`triggerElement`),ee=Ks(),B=Ks(),V=Ks();v.useEffect(()=>{if(S)return V.start(Sh,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{V.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[S,g,B,V]);let te=ed(T,{id:N,role:`combobox`,"aria-expanded":S,"aria-haspopup":`listbox`,"aria-controls":S?D?.id??Yc(E)?.id:void 0,"aria-labelledby":P,"aria-readonly":_||void 0,"aria-required":y||void 0,tabIndex:x?-1:0,onFocus(e){u(!0),S&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,gl(tl,e.nativeEvent)),ee.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){mc(E,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&f.commit(w))},onMouseDown(e){if(S)return;let t=Ls(e.currentTarget);function n(e){if(!I.current)return;let t=e.target;mc(I.current,t)||mc(F.current,t)||fh(e,I.current)||g.context.setOpen(!1,gl(dl,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,L),ne=f.getValidationProps(x,te);ne.role=`combobox`;let H={...p,open:S,disabled:x,value:w,readOnly:_,popupSide:M,placeholder:!j};return md(`button`,e,{ref:[t,I,R,z],state:H,stateAttributesMapping:Ch,props:ne})}),Th={value:()=>null},Eh=v.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=vm(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?Qm(l,u,d):Zm(l,u,d)),md(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:Th})}),Dh=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return md(`span`,e,{state:{open:vm().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Lc})}),Oh=v.forwardRef(function(e,t){let n=vm(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,U.jsx)(jd,{ref:t,...e}):null});function kh(e){return Ko(19)?e:e?`true`:void 0}var Ah=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function jh(){return v.useContext(Ah)}function Mh(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Ro(i),[,o]=v.useState(!1),s=Co(Ph).current,c=Co(Nh).current,l=v.useRef(0),u=v.useRef(!0),d=v.useRef(null),f=v.useRef(null),p=Ro(()=>{u.current||(u.current=!0,o(e=>!e))}),m=Ro((e,t)=>{c.set(e,t),p()}),h=Ro(e=>{c.delete(e),p()}),g=Ro(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Lh(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Rh(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Ih(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=Ro(()=>{let[e,t]=Fh(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Po(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Po(()=>{u.current&&y()}),Po(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=Ro(e=>(s.add(e),()=>{s.delete(e)})),x=v.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,U.jsx)(Ah.Provider,{value:x,children:t})}function Nh(){return new Map}function Ph(){return new Set}function Fh(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Rh(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Ih(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Lh(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Rh(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var zh=v.createContext(void 0);function Bh(){return v.useContext(zh)?.direction??`ltr`}var Vh=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=kl(e,t)||{};if(l==null)return{};let f=ql(u),p={x:n,y:r},m=Fl(i),h=Nl(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Ol(k,j,A),N=!c.arrow&&jl(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Hh=(e,t)=>{let{name:n,fn:r}=Vh(e);return{name:n,fn:r,options:[e,t]}},Uh={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Wh={sideX:`left`,sideY:`top`},Gh=`--available-width`,Kh=`--available-height`,qh=`--anchor-width`,Jh=`--anchor-height`,Yh=`--transform-origin`,Xh=Gh,Zh=Kh;function Qh(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function $h(e,t,n){let{rects:r,placement:i}=e;return{side:Qh(t,Al(i),n),align:jl(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function eg(e){return tg(e,Bp)}function tg(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=v.useState(null);!g&&w!==null&&T(null);let E=_.side||`flip`,D=_.align||`flip`,O=_.fallbackAxisSide||`end`,k=y?.crossAxis??!1,A=y?.rootBoundary,j=typeof n==`function`?n:void 0,M=Ro(j),N=j?M:n,P=Vo(n),F=Vo(g),I=Bh()===`rtl`,L=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],R=o===`center`?L:`${L}-${o}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let ee=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),te=+(i===`left`),ne={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},H=v.useRef(null),re=Vo(a),ie=Vo(s),ae=typeof a==`function`?0:a,oe=typeof s==`function`?0:s,se=[];p&&se.push(p),se.push(rp(e=>{let t=$h(e,i,I),n=typeof re.current==`function`?re.current(t):re.current,r=typeof ie.current==`function`?ie.current(t):ie.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ae,oe,I,i]));let ce=D===`none`&&E!==`shift`,le=!ce&&(u||k||E===`shift`),ue=E===`none`?null:op({...ne,padding:{top:z.top+1+ee,right:z.right+1+te,bottom:z.bottom+1+B,left:z.left+1+V},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),de=ce?null:ip({...ne,rootBoundary:A,mainAxis:D!==`none`,crossAxis:le,limiter:u||k?void 0:ap(e=>{if(!H.current)return{};let{width:t,height:n}=H.current.getBoundingClientRect(),r=Pl(Al(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[ne,u,k,A,z,D]);E===`shift`||D===`shift`||o===`center`?se.push(de,ue):se.push(ue,de),se.push(sp({...ne,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(Xh,`${t}px`),i.setProperty(Zh,`${n}px`);let a=ps(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(qh,`${u}px`),i.setProperty(Jh,`${d}px`)}}),Hh(e=>({element:H.current||Ls(e.elements.floating).createElement(`div`),padding:H.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Al(r),u=jl(r),d=Pl(l)===`y`,f=H.current,p=typeof a==`function`?a($h(e,i,I)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return le&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Yh,d?`${m} ${h}`:`${h} ${m}`),{}}},Uh,x),Po(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=v.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:pe,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:R,middleware:se,strategy:r,whileElementsMounted:m?void 0:(...e)=>Wf(...e,fe),nodeId:b,externalTree:C}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||Wh,Te=xe?r:`fixed`,Ee=v.useMemo(()=>{let e;return e=xe?x?{position:Te,[Ce]:he,[we]:ge}:{...Se,position:Te}:{position:Te,top:0,left:0},e[Xh]=`100vw`,e[Zh]=`100vh`,xe||(e.opacity=0),e},[x,Te,Ce,he,we,ge,Se,xe]),De=v.useRef(null);Po(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(ng(t)?t.current:t)||null;n!==De.current&&(pe.setPositionReference(n),De.current=n)},[g,pe,N,P]),v.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&ng(e)&&e.current!==De.current&&(pe.setPositionReference(e.current),De.current=e.current)},[g,pe,N,P]),v.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return Wf(me.reference,me.floating,ve,fe)},[m,g,me,ve,fe]);let Oe=Al(ye),ke=Qh(i,Oe,I),Ae=jl(ye)||`center`,je=!!_e.hide?.referenceHidden;Po(()=>{S&&g&&xe&&Oe!==L&&T(Oe)},[S,g,xe,Oe,L]);let Me=v.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:H,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,H,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function ng(e){return e!=null&&`current`in e}var rg=v.createContext(void 0);function ig(){let e=v.useContext(rg);if(!e)throw Error(Wo(59));return e}var ag=v.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,U.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function og(e,t){e&&Object.assign(e.style,t)}var sg={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function cg(e){return e===`starting`?xd:ls}function lg(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),md(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},cg(r),i],stateAttributesMapping:zc})}var ug={},dg={},fg=``;function pg(e,t){return ys(e)?e:t}function mg(e,t,n){return/hidden|clip/.test(e.getComputedStyle(pg(t,n)).overflowY)}function hg(e){if(typeof document>`u`)return!1;let t=Ls(e);return ps(t).innerWidth-t.documentElement.clientWidth>0}function gg(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Ls(e),n=t.documentElement,r=t.body,i=pg(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function _g(e){let t=Ls(e),n=t.documentElement,r=t.body,i=pg(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function vg(e){let t=Ls(e),n=t.documentElement,r=t.body,i=ps(n),a=0,o=0,s=!1,c=Hs.create();if(ic&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,ug={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},fg=n.style.scrollBehavior,dg={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=pg(n,r);if(s=gg(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,ug),Object.assign(r.style,dg),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=fg)}function d(){u(),c.request(l)}l();let f=Rs(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var yg=new class{lockCount=0;restore=null;timeoutLock=Gs.create();timeoutUnlock=Gs.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Ls(e),n=t.documentElement,r=t.body,i=ps(n);if(mg(i,n,r)){let t=new i.MutationObserver(()=>{mg(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=$s||!hg(e);this.restore=a?_g(e):vg(e)}};function bg(e=!0,t=null){Po(()=>{if(e)return yg.acquire(t)},[e,t])}var xg=20;function Sg(e,t,n,r){let[i,a]=v.useState(!1);Po(()=>{if(!e||!t||n==null){a(!1);return}let r=Ls(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-xg)},[e,t,n]),bg(e&&(!t||i),r)}var Cg={position:`fixed`},wg=v.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Cd,style:_,...y}=e,b=vm(),x=bm(),S=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`modal`),T=b.useState(`value`),E=b.useState(`openMethod`),D=b.useState(`positionerElement`),O=b.useState(`triggerElement`),k=b.useState(`isItemEqualToValue`),A=b.useState(`transitionStatus`),j=v.useRef(null),M=v.useRef(null),[N,P]=v.useState(h),F=C&&N&&E!==`touch`;!C&&N!==h&&P(h),v.useImperativeHandle(b.context.alignItemWithTriggerActiveRef,()=>F),Sg((F||w)&&S,E===`touch`,D,O);let I=eg({anchor:n,floatingRootContext:x,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??F,collisionAvoidance:g,keepMounted:!0}),L=F?`none`:I.side,R=F?Cg:I.positionerStyles,z={open:S,side:L,align:I.align,anchorHidden:I.anchorHidden};Po(()=>{b.set(`popupSide`,I.side)},[b,I.side]);let ee=lg(e,z,{styles:R,transitionStatus:A,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!C,inert:!S}),B=v.useRef(0),V=Ro(e=>{if(b.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=gl(tl);if(t!==0&&!b.state.multiple&&T!==null&&zm(b.context.valuesRef.current,T,k)===-1){let e=b.context.initialValueRef.current,t=e!=null&&zm(b.context.valuesRef.current,e,k)!==-1?e:null;b.context.setValue(t,n),t===null&&(b.set(`selectedIndex`,null),b.context.selectedItemTextRef.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(T)){let e=T.filter(e=>zm(b.context.valuesRef.current,e,k)!==-1);e.length!==T.length&&(b.context.setValue(e,n),e.length===0&&(b.set(`selectedIndex`,null),b.context.selectedItemTextRef.current=null))}if(S&&F){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};og(D,e),og(b.context.popupRef.current,e)}}),te=v.useMemo(()=>({...I,side:L,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:P,scrollUpArrowRef:j,scrollDownArrowRef:M}),[I,L,F,P]);return(0,U.jsx)(Mh,{elementsRef:b.context.listRef,labelsRef:b.context.labelsRef,onMapChange:V,children:(0,U.jsxs)(rg.Provider,{value:te,children:[C&&w&&(0,U.jsx)(ag,{inert:kh(!S),cutout:O}),ee]})})}),Tg=`base-ui-disable-scrollbar`,Eg={className:Tg,getElement(e){return(0,U.jsx)(`style`,{nonce:e,href:Tg,precedence:`base-ui:low`,children:`.${Tg}{scrollbar-width:none}.${Tg}::-webkit-scrollbar{display:none}`})}},Dg=v.createContext(void 0);function Og(e){let t=v.useContext(Dg);if(t===void 0&&!e)throw Error(Wo(69));return t}var kg=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Ag=v.createContext(void 0),jg={disableStyleElements:!1};function Mg(){return v.useContext(Ag)??jg}var Ng=`--transform-origin`,Pg={...zc,...Ec},Fg=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=vm(),{multiple:c,readOnly:l,highlightItemOnHover:u}=ym(),d=bm(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=ig(),_=Og(!0)!=null,y=Bh(),{nonce:b,disableStyleElements:x}=Mg(),S=s.useState(`id`),C=s.useState(`open`),w=s.useState(`openMethod`),T=s.useState(`mounted`),E=s.useState(`popupProps`),D=s.useState(`transitionStatus`),O=s.useState(`triggerElement`),k=s.useState(`positionerElement`),A=s.useState(`listElement`),j=v.useRef(!1),M=v.useRef(!1),N=v.useRef({}),P=Us(),F=Ro(e=>{if(!k||!s.context.popupRef.current||!M.current)return;let t=k.style.top===`0px`,n=k.style.bottom===`0px`;if(j.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=Rg(k),i=zg(k.getBoundingClientRect().height,`y`,r),a=Ls(k),o=ps(k),c=o.getComputedStyle(k),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=Ig(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=Lg(e),g=null,_=e=>{k.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=oh(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(j.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=oh(g,0,Lg(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(j.current=!0),s.context.handleScrollArrowVisibility(e)});v.useImperativeHandle(s.context.scrollHandlerRef,()=>F,[F]),hp({open:C,ref:s.context.popupRef,onComplete(){C&&s.context.onOpenChangeComplete(!0)}});let I={open:C,transitionStatus:D,side:f,align:p};Po(()=>{k&&s.context.popupRef.current&&!Object.keys(N.current).length&&(N.current={top:k.style.top||`0`,left:k.style.left||`0`,right:k.style.right,height:k.style.height,bottom:k.style.bottom,minHeight:k.style.minHeight,maxHeight:k.style.maxHeight,marginTop:k.style.marginTop,marginBottom:k.style.marginBottom})},[s,k]),Po(()=>{C||m||(M.current=!1,j.current=!1,og(k,N.current))},[C,m,k]),Po(()=>{let e=s.context.popupRef.current;if(!C||!O||!k||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(M.current=!0,e.style.removeProperty(Ng),!m){P.request(()=>s.context.handleScrollArrowVisibility(A||e));return}let t=Hg(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=ps(k),i=r.getComputedStyle(k),a=r.getComputedStyle(e),o=Ls(O),c=Rg(O),l=Bg(O.getBoundingClientRect(),c),d=Bg(k.getBoundingClientRect(),c),f=l.height,p=A||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,v=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=Ig(a),S=o.documentElement.clientHeight-_-v,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=y===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=Bg(n.getBoundingClientRect(),c);T=Bg(t.getBoundingClientRect(),c),E=d.left+(y===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let M=w+D+v+h,P=Math.min(S,M),F=S-_-v,I=M-P,L=C-5;k.style.left=`${oh(E,5,L-d.width)}px`,k.style.height=`${P}px`,k.style.maxHeight=`none`,k.style.marginTop=`${_}px`,k.style.marginBottom=`${v}px`,e.style.height=`100%`;let R=Lg(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let ee=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),B=(r.visualViewport?.scale??1)!==1&⁣if(ee||B){og(k,N.current),g(!1);return}let V=Math.max(b,P);if(z){let e=Math.max(0,S-M);k.style.top=d.height>=F?`0`:`${e}px`,k.style.height=`${P}px`,p.scrollTop=Lg(p)}else k.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=oh(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Ng,`50% ${i}%`)}(V===S||P>=x)&&(j.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,C,k,O,m,g,P,A,u,y,h]),v.useEffect(()=>{if(!m||!k||!C)return;let e=ps(k);function t(e){s.context.setOpen(!1,gl(hl,e))}return Rs(e,`resize`,t)},[s,m,k,C]);let L={...A?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${S}-list`},onKeyDown(e){_&&kg.has(e.key)&&e.stopPropagation()},onScroll(e){A||F(e.currentTarget)},...m&&{style:A?{height:`100%`}:sg},className:!A&&m?Eg.className:void 0},R=md(`div`,e,{ref:[t,s.context.popupRef],state:I,stateAttributesMapping:Pg,props:[E,L,cg(D),o]});return(0,U.jsxs)(v.Fragment,{children:[!x&&Eg.getElement(b),(0,U.jsx)(Xd,{context:d,modal:!1,disabled:!T,openInteractionType:w,returnFocus:a,restoreFocus:!0,children:R})]})});function Ig(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Lg(e){return sh(e.scrollHeight,e.clientHeight)}function Rg(e){return Vf.getScale(e)}function zg(e,t,n){return e/n[t]}function Bg(e,t){return Jl({x:zg(e.x,`x`,t),y:zg(e.y,`y`,t),width:zg(e.width,`x`,t),height:zg(e.height,`y`,t)})}var Vg=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Hg(e){let{style:t}=e,n={};for(let[e,r]of Vg)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Vg){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}function Ug(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=jh(),u=v.useRef(-1),[d,f]=v.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=v.useRef(null),h=v.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Po(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Wg=v.createContext(void 0);function Gg(){let e=v.useContext(Wg);if(!e)throw Error(Wo(57));return e}var Kg=v.memo(v.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=v.useRef(null),d=Ug({guess:!0,label:o,textRef:u}),f=vm(),{itemProps:p,multiple:m,disabled:h,readOnly:g}=ym(),_=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),S=f.useState(`isSelectedByFocus`,d.index),C=f.useState(`isItemEqualToValue`),w=d.index,T=v.useRef(null);Po(()=>{let e=f.context.valuesRef.current;return e[w]=a,()=>{delete e[w]}},[w,a,f]),Po(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=Hm(w,a,f.context.valuesRef.current,e,C,t),r=n===w,w===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&Im(a,e,C),r&&(n=w)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[w,m,C,f,a]);let E=v.useRef(`mouse`),D=v.useRef(!1),{getButtonProps:O,buttonRef:k}=vh({disabled:_,focusableWhenDisabled:!0,native:c,composite:!0}),A={disabled:_,selected:x,highlighted:y};function j(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?Um(n,a,C):[...n,a];f.context.setValue(r,gl(ol,e))}else f.context.setValue(a,gl(ol,e)),f.context.setOpen(!1,gl(ol,e))}function M(){f.context.selectionRef.current.dragY=0}let N={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,w),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&lc(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!D.current;D.current=!1,!(_||i)&&j(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,M()},onMouseUp(){if(M(),_||E.current===`touch`||D.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(D.current=!0,T.current?.click(),D.current=!1)}},P=md(`div`,e,{ref:[k,t,d.ref,T],state:A,props:[p,N,l,O]}),F=v.useMemo(()=>({selected:x,index:w,textRef:u,selectedByFocus:S}),[x,w,u,S]);return(0,U.jsx)(Wg.Provider,{value:F,children:P})})),eee=v.forwardRef(function(e,t){let{selected:n}=Gg();return e.keepMounted||n?(0,U.jsx)(tee,{...e,ref:t}):null}),tee=v.memo(v.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=Gg(),c=v.useRef(null),{transitionStatus:l,setMounted:u}=dp(s),d=md(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:Ec});return hp({batch:!0,enabled:!s,open:s,ref:c,onComplete(){s||u(!1)}}),d})),nee=v.memo(v.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=Gg(),a=vm(),{render:o,className:s,style:c,...l}=e;return md(`div`,e,{ref:[v.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),qg=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Jg(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:qg(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Yg=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},Xg=e=>{let t=Yg(e);return t.charAt(0).toUpperCase()+t.slice(1)},Zg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Qg={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function $g(e){return e!=null}function e_(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Qg.width,a=e.size??e.height??Qg.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Zg(...c):Zg(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Qg[`stroke-width`])*Number(e.size??e.width??Qg.width)/Number(t.size??t.width??Qg.width):t.strokeWidth??Qg[`stroke-width`];return[`svg`,{...Object.entries(Qg).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&$g(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&$g(t.width)&&{[r(`width`)]:t.width},...`height`in t&&$g(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function t_(e,t={}){return e_(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var n_=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},r_=(0,v.createContext)({}),i_=()=>(0,v.useContext)(r_),a_=(0,v.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:y=``}=i_()??{},b=!!c||n_(d),[x,S,C=[]]=t_(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Zg(y,s),hasA11yProp:b,attributes:d});return(0,v.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function G(e,t=[],n=[]){let r=typeof e==`string`?Jg(e,t,n):e,i=(0,v.forwardRef)(({className:e,...t},n)=>(0,v.createElement)(a_,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Xg(r.name)),i}var o_={name:`anchor`,size:24,node:[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]};o_.node;var s_=G(o_),c_={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};c_.node;var l_=G(c_),u_={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};u_.node;var d_=G(u_),f_={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};f_.node;var p_=G(f_),m_={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};m_.node;var h_=G(m_),g_={name:`atom`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z`,key:`1l2ple`}],[`path`,{d:`M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z`,key:`1wam0m`}]]};g_.node;var __=G(g_),v_={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};v_.node;var y_=G(v_),b_={name:`beaker`,size:24,node:[[`path`,{d:`M4.5 3h15`,key:`c7n0jr`}],[`path`,{d:`M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3`,key:`m1uhx7`}],[`path`,{d:`M6 14h12`,key:`4cwo0f`}]]};b_.node;var x_=G(b_),S_={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};S_.node;var C_=G(S_),w_={name:`bike`,size:24,node:[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]};w_.node;var T_=G(w_),E_={name:`binary`,size:24,node:[[`rect`,{x:`14`,y:`14`,width:`4`,height:`6`,rx:`2`,key:`p02svl`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`6`,rx:`2`,key:`xm4xkj`}],[`path`,{d:`M6 20h4`,key:`1i6q5t`}],[`path`,{d:`M14 10h4`,key:`ru81e7`}],[`path`,{d:`M6 14h2v6`,key:`16z9wg`}],[`path`,{d:`M14 4h2v6`,key:`1idq9u`}]]};E_.node;var D_=G(E_),O_={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};O_.node;var k_=G(O_),A_={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};A_.node;var j_=G(A_),M_={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};M_.node;var N_=G(M_),P_={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]};P_.node;var F_=G(P_),I_={name:`briefcase`,size:24,node:[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]};I_.node;var L_=G(I_),R_={name:`brush`,size:24,node:[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]};R_.node;var z_=G(R_),B_={name:`bug`,size:24,node:[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]};B_.node;var V_=G(B_),H_={name:`building-complex`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]],aliases:[`building-2`]};H_.node;var U_=G(H_),W_={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};W_.node;var G_=G(W_),K_={name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]};K_.node;var q_=G(K_),J_={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};J_.node;var Y_=G(J_),X_={name:`car`,size:24,node:[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]};X_.node;var Z_=G(X_),Q_={name:`cat`,size:24,node:[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]};Q_.node;var $_=G(Q_),ev={name:`chart-pie`,size:24,node:[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]],aliases:[`pie-chart`]};ev.node;var tv=G(ev),nv={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};nv.node;var rv=G(nv),iv={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};iv.node;var av=G(iv),ov={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};ov.node;var sv=G(ov),cv={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};cv.node;var lv=G(cv),uv={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};uv.node;var dv=G(uv),fv={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};fv.node;var pv=G(fv),mv={name:`circle-arrow-down`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 8v8`,key:`napkw2`}],[`path`,{d:`m8 12 4 4 4-4`,key:`k98ssh`}]],aliases:[`arrow-down-circle`]};mv.node;var hv=G(mv),gv={name:`circle-pause`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]],aliases:[`pause-circle`]};gv.node;var _v=G(gv),vv={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};vv.node;var yv=G(vv),bv={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};bv.node;var xv=G(bv),Sv={name:`circuit-board`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M11 9h4a2 2 0 0 0 2-2V3`,key:`1ve2rv`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`M7 21v-4a2 2 0 0 1 2-2h4`,key:`1fwkro`}],[`circle`,{cx:`15`,cy:`15`,r:`2`,key:`3i40o0`}]]};Sv.node;var Cv=G(Sv),wv={name:`clipboard-list`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]};wv.node;var Tv=G(wv),Ev={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};Ev.node;var Dv=G(Ev),Ov={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};Ov.node;var kv=G(Ov),Av={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};Av.node;var jv=G(Av),Mv={name:`coffee`,size:24,node:[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]};Mv.node;var Nv=G(Mv),Pv={name:`cog`,size:24,node:[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]};Pv.node;var Fv=G(Pv),Iv={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};Iv.node;var Lv=G(Iv),Rv={name:`container`,size:24,node:[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]};Rv.node;var zv=G(Rv),Bv={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Bv.node;var Vv=G(Bv),Hv={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Hv.node;var Uv=G(Hv),Wv={name:`credit-card`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}],[`path`,{d:`M6 14h2`,key:`mk7k0u`}]]};Wv.node;var Gv=G(Wv),Kv={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};Kv.node;var qv=G(Kv),Jv={name:`diamond`,size:24,node:[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]};Jv.node;var Yv=G(Jv),Xv={name:`dog`,size:24,node:[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]};Xv.node;var Zv=G(Xv),Qv={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Qv.node;var $v=G(Qv),ey={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};ey.node;var ty=G(ey),ny={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};ny.node;var ree=G(ny),ry={name:`feather`,size:24,node:[[`path`,{d:`M14.086 18.412A2 2 0 0112.67 19H5v-7.672a2 2 0 01.586-1.414L11.75 3.75a6 6 0 118.49 8.49z`,key:`1nq9jb`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.488 15H9`,key:`16yirz`}]]};ry.node;var iee=G(ry),iy={name:`file-diff`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]};iy.node;var aee=G(iy),ay={name:`file-exclamation-point`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`file-warning`]};ay.node;var oee=G(ay),oy={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};oy.node;var sy=G(oy),cy={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};cy.node;var ly=G(cy),uy={name:`film`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]};uy.node;var see=G(uy),dy={name:`flame`,size:24,node:[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]};dy.node;var fy=G(dy),py={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};py.node;var my=G(py),hy={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};hy.node;var gy=G(hy),_y={name:`folder-search`,size:24,node:[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]};_y.node;var vy=G(_y),yy={name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]};yy.node;var by=G(yy),xy={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};xy.node;var Sy=G(xy),Cy={name:`funnel`,size:24,node:[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]],aliases:[`filter`]};Cy.node;var wy=G(Cy),Ty={name:`gamepad-2`,size:24,node:[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]};Ty.node;var Ey=G(Ty),Dy={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};Dy.node;var Oy=G(Dy),ky={name:`gem`,size:24,node:[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]};ky.node;var Ay=G(ky),jy={name:`ghost`,size:24,node:[[`path`,{d:`M15 10v1`,key:`oj8wfp`}],[`path`,{d:`M7.528 20.472a1.6 1.6 0 012.277 0l1.057 1.056a1.6 1.6 0 002.276 0l1.057-1.056a1.6 1.6 0 012.277 0l1.114 1.114a1.4 1.4 0 002.414-1V10a8 8 0 00-16 0v10.586a1.4 1.4 0 002.414 1z`,key:`13lou3`}],[`path`,{d:`M9 10v1`,key:`1e14fa`}]]};jy.node;var My=G(jy),Ny={name:`gift`,size:24,node:[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]};Ny.node;var Py=G(Ny),Fy={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};Fy.node;var Iy=G(Fy),Ly={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Ly.node;var Ry=G(Ly),zy={name:`graduation-cap`,size:24,node:[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]};zy.node;var By=G(zy),Vy={name:`hammer`,size:24,node:[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]};Vy.node;var Hy=G(Vy),Uy={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};Uy.node;var Wy=G(Uy),Gy={name:`hexagon`,size:24,node:[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]};Gy.node;var Ky=G(Gy),qy={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};qy.node;var Jy=G(qy),Yy={name:`id-card`,size:24,node:[[`path`,{d:`M13 19a4 4 0 00-8 0`,key:`cugzd5`}],[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]};Yy.node;var Xy=G(Yy),Zy={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Zy.node;var Qy=G(Zy),$y={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};$y.node;var eb=G($y),tb={name:`key`,size:24,node:[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]};tb.node;var nb=G(tb),rb={name:`landmark`,size:24,node:[[`path`,{d:`M10 18v-7`,key:`wt116b`}],[`path`,{d:`M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z`,key:`yxxwt6`}],[`path`,{d:`M14 18v-7`,key:`vav6t3`}],[`path`,{d:`M18 18v-7`,key:`aexdmj`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M6 18v-7`,key:`1ivflk`}]]};rb.node;var ib=G(rb),ab={name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]};ab.node;var ob=G(ab),sb={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};sb.node;var cb=G(sb),lb={name:`leaf`,size:24,node:[[`path`,{d:`M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20`,key:`1wjnjv`}],[`path`,{d:`M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13`,key:`c1ejpn`}]]};lb.node;var ub=G(lb),db={name:`library`,size:24,node:[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]};db.node;var fb=G(db),pb={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};pb.node;var mb=G(pb),hb={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};hb.node;var gb=G(hb),_b={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};_b.node;var vb=G(_b),yb={name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]};yb.node;var bb=G(yb),xb={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};xb.node;var Sb=G(xb),Cb={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Cb.node;var wb=G(Cb),Tb={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};Tb.node;var Eb=G(Tb),Db={name:`map`,size:24,node:[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]};Db.node;var Ob=G(Db),kb={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};kb.node;var Ab=G(kb),jb={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]};jb.node;var Mb=G(jb),Nb={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};Nb.node;var Pb=G(Nb),Fb={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};Fb.node;var Ib=G(Fb),Lb={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};Lb.node;var Rb=G(Lb),zb={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};zb.node;var Bb=G(zb),Vb={name:`mountain`,size:24,node:[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]};Vb.node;var Hb=G(Vb),Ub={name:`music`,size:24,node:[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]};Ub.node;var Wb=G(Ub),Gb={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};Gb.node;var Kb=G(Gb),qb={name:`newspaper`,size:24,node:[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]};qb.node;var Jb=G(qb),Yb={name:`notebook`,size:24,node:[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M16 2v20`,key:`rotuqe`}]]};Yb.node;var Xb=G(Yb),Zb={name:`orbit`,size:24,node:[[`path`,{d:`M20.341 6.484A10 10 0 0 1 10.266 21.85`,key:`1enhxb`}],[`path`,{d:`M3.659 17.516A10 10 0 0 1 13.74 2.152`,key:`1crzgf`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}]]};Zb.node;var Qb=G(Zb),$b={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};$b.node;var ex=G($b),tx={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};tx.node;var nx=G(tx),rx={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};rx.node;var ix=G(rx),ax={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};ax.node;var ox=G(ax),sx={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};sx.node;var cx=G(sx),lx={name:`pen-tool`,size:24,node:[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]};lx.node;var ux=G(lx),dx={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};dx.node;var fx=G(dx),px={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};px.node;var mx=G(px),hx={name:`phone`,size:24,node:[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]};hx.node;var gx=G(hx),_x={name:`piggy-bank`,size:24,node:[[`path`,{d:`M11 17h3v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a3.16 3.16 0 0 0 2-2h1a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-1a5 5 0 0 0-2-4V3a4 4 0 0 0-3.2 1.6l-.3.4H11a6 6 0 0 0-6 6v1a5 5 0 0 0 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1z`,key:`1piglc`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M2 8v1a2 2 0 0 0 2 2h1`,key:`1env43`}]]};_x.node;var vx=G(_x),yx={name:`plane`,size:24,node:[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]};yx.node;var bx=G(yx),xx={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};xx.node;var Sx=G(xx),Cx={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Cx.node;var wx=G(Cx),Tx={name:`power-off`,size:24,node:[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Tx.node;var Ex=G(Tx),Dx={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};Dx.node;var Ox=G(Dx),kx={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};kx.node;var Ax=G(kx),jx={name:`radar`,size:24,node:[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]};jx.node;var Mx=G(jx),Nx={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};Nx.node;var Px=G(Nx),Fx={name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]};Fx.node;var Ix=G(Fx),Lx={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Lx.node;var Rx=G(Lx),zx={name:`rocket`,size:24,node:[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]};zx.node;var Bx=G(zx),Vx={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Vx.node;var Hx=G(Vx),Ux={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Ux.node;var Wx=G(Ux),Gx={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Gx.node;var Kx=G(Gx),qx={name:`ruler`,size:24,node:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]};qx.node;var Jx=G(qx),Yx={name:`satellite`,size:24,node:[[`path`,{d:`m13.5 6.5-3.148-3.148a1.205 1.205 0 0 0-1.704 0L6.352 5.648a1.205 1.205 0 0 0 0 1.704L9.5 10.5`,key:`dzhfyz`}],[`path`,{d:`M16.5 7.5 19 5`,key:`1ltcjm`}],[`path`,{d:`m17.5 10.5 3.148 3.148a1.205 1.205 0 0 1 0 1.704l-2.296 2.296a1.205 1.205 0 0 1-1.704 0L13.5 14.5`,key:`nfoymv`}],[`path`,{d:`M9 21a6 6 0 0 0-6-6`,key:`1iajcf`}],[`path`,{d:`M9.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l4.296-4.296a1.205 1.205 0 0 0 0-1.704l-2.296-2.296a1.205 1.205 0 0 0-1.704 0z`,key:`nv9zqy`}]]};Yx.node;var Xx=G(Yx),Zx={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};Zx.node;var Qx=G(Zx),$x={name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]};$x.node;var eS=G($x),tS={name:`scissors`,size:24,node:[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]};tS.node;var nS=G(tS),rS={name:`search-x`,size:24,node:[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]};rS.node;var iS=G(rS),aS={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};aS.node;var oS=G(aS),sS={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};sS.node;var cS=G(sS),lS={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};lS.node;var uS=G(lS),dS={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};dS.node;var fS=G(dS),pS={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};pS.node;var mS=G(pS),hS={name:`ship`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 9.189V13`,key:`yp40p3`}],[`path`,{d:`M19 12V6a2 2 0 00-2-2H7a2 2 0 00-2 2v6`,key:`1wcigf`}],[`path`,{d:`M19.38 19A11.6 11.6 0 0021 13l-8.188-3.639a2 2 0 00-1.624 0L3 13.001a11.6 11.6 0 002.81 7.76`,key:`1kdp0u`}],[`path`,{d:`M2 20c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1l8w7g`}]]};hS.node;var gS=G(hS),_S={name:`shopping-cart`,size:24,node:[[`path`,{d:`m2.05 2.05 1.099-.028a1 1 0 0 1 1.008.815l2.69 14.347A1 1 0 0 0 7.83 18H18`,key:`uebgi3`}],[`path`,{d:`M4.563 5h16.435a1 1 0 0 1 .981 1.204l-1.026 6.226A2 2 0 0 1 18.962 14H6.25`,key:`1j7c9p`}],[`circle`,{cx:`18`,cy:`20`,r:`2`,key:`t9985n`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]};_S.node;var vS=G(_S),yS={name:`signal`,size:24,node:[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]};yS.node;var bS=G(yS),xS={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};xS.node;var SS=G(xS),CS={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};CS.node;var wS=G(CS),TS={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};TS.node;var ES=G(TS),DS={name:`sprout`,size:24,node:[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]};DS.node;var OS=G(DS),kS={name:`square-check-big`,size:24,node:[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-square`]};kS.node;var AS=G(kS),jS={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};jS.node;var MS=G(jS),NS={name:`square-slash`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]],aliases:[`slash-square`]};NS.node;var PS=G(NS),FS={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};FS.node;var IS=G(FS),LS={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};LS.node;var RS=G(LS),zS={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};zS.node;var BS=G(zS),VS={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};VS.node;var HS=G(VS),US={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};US.node;var WS=G(US),GS={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};GS.node;var KS=G(GS),qS={name:`telescope`,size:24,node:[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]};qS.node;var JS=G(qS),YS={name:`target`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};YS.node;var XS=G(YS),ZS={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};ZS.node;var QS=G(ZS),$S={name:`test-tube`,size:24,node:[[`path`,{d:`M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2`,key:`125lnx`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M14.5 16h-5`,key:`1ox875`}]]};$S.node;var eC=G($S),tC={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};tC.node;var nC=G(tC),rC={name:`tree-pine`,size:24,node:[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]};rC.node;var iC=G(rC),aC={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};aC.node;var oC=G(aC),sC={name:`trophy`,size:24,node:[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]};sC.node;var cC=G(sC),lC={name:`truck`,size:24,node:[[`path`,{d:`M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2`,key:`wrbu53`}],[`path`,{d:`M15 18H9`,key:`1lyqi6`}],[`path`,{d:`M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14`,key:`lysw3i`}],[`circle`,{cx:`17`,cy:`18`,r:`2`,key:`332jqn`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}]]};lC.node;var uC=G(lC),dC={name:`umbrella`,size:24,node:[[`path`,{d:`M12 13v7a2 2 0 0 0 4 0`,key:`rpgb42`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M20.992 13a1 1 0 0 0 .97-1.274 10.284 10.284 0 0 0-19.923 0A1 1 0 0 0 3 13z`,key:`124nyo`}]]};dC.node;var fC=G(dC),pC={name:`users-round`,size:24,node:[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]],aliases:[`users-2`]};pC.node;var mC=G(pC),hC={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};hC.node;var gC=G(hC),_C={name:`wallet`,size:24,node:[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]};_C.node;var vC=G(_C),yC={name:`wand`,size:24,node:[[`path`,{d:`M15 4V2`,key:`z1p9b7`}],[`path`,{d:`M15 16v-2`,key:`px0unx`}],[`path`,{d:`M8 9h2`,key:`1g203m`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M17.8 11.8 19 13`,key:`yihg8r`}],[`path`,{d:`M15 9h.01`,key:`x1ddxp`}],[`path`,{d:`M17.8 6.2 19 5`,key:`fd4us0`}],[`path`,{d:`m3 21 9-9`,key:`1jfql5`}],[`path`,{d:`M12.2 6.2 11 5`,key:`i3da3b`}]]};yC.node;var cee=G(yC),bC={name:`waves-horizontal`,size:24,node:[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]],aliases:[`waves`]};bC.node;var lee=G(bC),xC={name:`webhook`,size:24,node:[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]};xC.node;var uee=G(xC),SC={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};SC.node;var dee=G(SC),CC={name:`wifi`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]};CC.node;var fee=G(CC),wC={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};wC.node;var TC=G(wC),EC={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};EC.node;var DC=G(EC),OC={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};OC.node;var kC=G(OC),AC=({children:e})=>(0,U.jsx)(`div`,{className:`wd-root`,style:{display:`contents`},children:e}),jC=lh,MC=Eh,NC=nee,PC=({className:e,children:t,...n})=>(0,U.jsxs)(wh,{"data-slot":`select-trigger`,className:W(`inline-flex h-7 items-center justify-between gap-1.5 rounded-md border border-border bg-bg px-2 text-body-sm text-text`,`transition-colors outline-none hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`data-popup-open:border-border-strong disabled:pointer-events-none disabled:opacity-50`,e),...n,children:[t,(0,U.jsx)(Dh,{className:`text-fg-4`,children:(0,U.jsx)(dv,{className:`size-3.5`})})]}),FC=({className:e,align:t=`start`,alignItemWithTrigger:n=!1,side:r=`bottom`,sideOffset:i=6,...a})=>(0,U.jsx)(Oh,{children:(0,U.jsx)(AC,{children:(0,U.jsx)(wg,{align:t,alignItemWithTrigger:n,side:r,sideOffset:i,className:`isolate z-80 outline-none`,children:(0,U.jsx)(Fg,{"data-slot":`select-content`,className:W(`max-h-[min(24rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto`,`rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none`,e),...a})})})}),IC=({className:e,children:t,...n})=>(0,U.jsxs)(Kg,{"data-slot":`select-item`,className:W(`flex cursor-pointer items-start gap-2 rounded-sm px-2 py-1.5 text-body-sm text-text outline-none select-none`,`data-highlighted:bg-surface-hover`,e),...n,children:[(0,U.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:t}),(0,U.jsx)(eee,{className:`mt-0.5 text-fg-1`,children:(0,U.jsx)(rv,{className:`size-3.5`})})]});function pee({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=v.useState(0),[u,d]=v.useState(0),f=c===0,p=rf(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=hc(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||mc(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return bg(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Po(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),Op(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var LC=v.createContext(void 0);function RC(e){let t=v.useContext(LC);if(!e&&t===void 0)throw Error(Wo(27));return t}var mee={...Lp,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},hee=class extends us{constructor(e,t,n){let r=new Ap,i=gee(e,r,t,n);super(i,_ee(r),mee)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Sp(this.state,e,t.trigger)))}};function gee(e,t,n,r=!1){return{...jp(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function _ee(e){return{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function zC(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,y=RC(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:_},x=vp((e,t)=>new hee({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);kp(x,S),Ep(x);let{forceUnmount:T}=Dp(S,x);v.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,gl(ml))}),[T,x]);let E=S||C;return(0,U.jsxs)(LC.Provider,{value:x,children:[u&&(0,U.jsx)(yp,{handle:u,store:x}),E&&(0,U.jsx)(pee,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}function vee(e){return zC(`alert-dialog`,e)}var BC=v.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=RC(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return md(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Bc,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),VC=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=RC(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=vh({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,gl(sl,e.nativeEvent))}return md(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),HC=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=RC(),c=Am(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),md(`p`,e,{ref:t,props:[{id:c},o]})}),UC=v.createContext(void 0);function yee(){let e=v.useContext(UC);if(e===void 0)throw Error(Wo(26));return e}var bee=`--nested-dialogs`,xee=`data-nested-dialog-open`,See={...zc,...Ec,nestedDialogOpen(e){return e?{[xee]:``}:null}},WC=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=RC(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);yee(),hp({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?_p(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=md(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...gp,hidden:!m,onKeyDown(e){kg.has(e.key)&&e.stopPropagation()},style:{[bee]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:See});return(0,U.jsx)(Xd,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),GC=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=RC(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,U.jsx)(UC.Provider,{value:n,children:(0,U.jsxs)(jd,{ref:t,...r,children:[a&&o===!0&&(0,U.jsx)(ag,{ref:i.context.internalBackdropRef,inert:kh(!s)}),e.children]})}):null}),KC=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=RC(),c=Am(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),md(`h2`,e,{ref:t,props:[{id:c},o]})}),Cee=Qo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=RC(!0),f=Rp(l)??d;if(!f)throw Error(Wo(79));let p=Am(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=v.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=Tp(p,_,f,{payload:c}),{getButtonProps:x,buttonRef:S}=vh({disabled:a,native:o}),C=Zd(m),w=ih(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,b);return md(`button`,e,{state:T,ref:[S,t,y,_],props:[C.reference,E,w,{[Sd]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:Lc})}),qC=vee,JC=Cee,YC=VC,XC=({className:e,children:t,...n})=>(0,U.jsx)(GC,{children:(0,U.jsxs)(AC,{children:[(0,U.jsx)(BC,{className:W(`fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]`,`transition-opacity duration-(--motion-base)`,`data-starting-style:opacity-0 data-ending-style:opacity-0`)}),(0,U.jsx)(WC,{"data-slot":`alert-dialog-content`,className:W(`fixed top-1/2 left-1/2 z-70 w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2`,`rounded-lg border border-border bg-surface p-5 shadow-(--shadow-lg) outline-none`,`transition-[opacity,transform] duration-(--motion-base)`,`data-starting-style:scale-95 data-starting-style:opacity-0`,`data-ending-style:scale-95 data-ending-style:opacity-0`,e),...n,children:t})]})}),ZC=({className:e,...t})=>(0,U.jsx)(KC,{className:W(`text-heading-3 font-semibold text-text`,e),...t}),QC=({className:e,...t})=>(0,U.jsx)(HC,{className:W(`mt-1.5 text-body-sm text-muted-foreground`,e),...t}),$C=v.createContext(void 0);function ew(e){let t=v.useContext($C);if(t===void 0&&!e)throw Error(Wo(33));return t}var tw=v.createContext(void 0);function nw(e){let t=v.useContext(tw);if(t===void 0&&!e)throw Error(Wo(36));return t}var rw=v.createContext(void 0);function iw(e=!0){let t=v.useContext(rw);if(t===void 0&&!e)throw Error(Wo(25));return t}function aw(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=iw(!0),f=d!==void 0;return v.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:ol})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!nc&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&_h(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var ow={type:`regular-item`};function sw(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=v.useRef(null),{getButtonProps:d,buttonRef:f}=vh({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=aw({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=v.useCallback(e=>ed(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=wo(u,f);return v.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var cw=v.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=Ug({guess:!0,label:a}),f=ew(!0),p=Am(i),{store:m}=nw(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=sw({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:ow});return md(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),lw=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=nw(),{side:c,align:l}=ew(),u=Og(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),y=s.useState(`lastOpenChangeReason`),b=s.useState(`rootId`),x=s.useState(`floatingRootContext`),S=s.useState(`floatingTreeRoot`),C=s.useState(`closeDelay`),w=s.useState(`hoverEnabled`),T=s.useState(`disabled`),E=s.useState(`openMethod`),D=_.type===`context-menu`;hp({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function e(e){s.setOpen(!1,gl(e.reason,e.domEvent))}return S.events.on(`close`,e),()=>{S.events.off(`close`,e)}},[S.events,s]),Yp(x,{enabled:w&&!T&&!D&&_.type!==`menubar`,closeDelay:C});let O=s.useStateSetter(`popupElement`),k=md(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:Bc,props:[p,{onKeyDown(e){u&&kg.has(e.key)&&e.stopPropagation()}},cg(f),o,{"data-rootownerid":b}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&y!==`outside-press`)&&(A=!0),(0,U.jsx)(Xd,{context:x,openInteractionType:E,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:S,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),uw=v.createContext(void 0);function dw(){let e=v.useContext(uw);if(e===void 0)throw Error(Wo(32));return e}var fw=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=nw();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,U.jsx)(uw.Provider,{value:n,children:(0,U.jsx)(jd,{ref:t,...r,portalOwnerRole:o})})}),pw=v.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Cd,style:g,..._}=e,{store:y}=nw(),b=dw(),x=iw(!0),S=y.useState(`parent`),C=y.useState(`floatingRootContext`),w=y.useState(`floatingTreeRoot`),T=y.useState(`mounted`),E=y.useState(`open`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`activeTriggerElement`),A=y.useState(`transitionStatus`),j=y.useState(`positionerElement`),M=y.useState(`instantType`),N=y.useState(`adaptiveOrigin`),P=y.useState(`lastOpenChangeReason`),F=y.useState(`floatingNodeId`),I=y.useState(`floatingParentNodeId`),L=C.useState(`domReferenceElement`),R=v.useRef(null),z=mp(j),ee=n,B=c,V=l,te=s,ne=h;S.type===`context-menu`&&(ee=n??S.context?.anchor,te??=`start`,!o&&te!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let H=o,re=te;S.type===`menu`?(H??=`inline-end`,re??=`start`,ne=e.collisionAvoidance??wd):S.type===`menubar`&&(H??=S.context.orientation===`vertical`?`inline-end`:`bottom`,re??=`start`);let ie=S.type===`context-menu`,ae=eg({anchor:ee,floatingRootContext:C,positionMethod:x?`fixed`:r,mounted:T,side:H,sideOffset:B,align:re,alignOffset:V,arrowPadding:ie?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:b,disableAnchorTracking:m,collisionAvoidance:ne,shift:ie?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:w,adaptiveOrigin:N});v.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&y.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,gl(fl)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[y,w.events,F]),v.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,gl(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,y]);let oe=Ks();v.useEffect(()=>{E||oe.clear()},[E,oe]),v.useEffect(()=>{function e(e){if(E&&e.nodeId===y.select(`floatingParentNodeId`)){if(e.target&&k&&k!==e.target){let e=y.select(`closeDelay`);e>0?oe.isStarted()||oe.start(e,()=>{y.setOpen(!1,gl(fl))}):y.setOpen(!1,gl(fl))}else oe.clear()}}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,k,y,oe]),v.useEffect(()=>{let e={open:E,nodeId:F,parentNodeId:I,reason:y.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,y,F,I]),Po(()=>{let e=L,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return z(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,z,y]);let se={open:E,side:ae.side,align:ae.align,anchorHidden:ae.anchorHidden,nested:S.type===`menu`,instant:M},ce=S.type===`menubar`&&S.context.modal;Sg(E&&(ce||D&&P!==`trigger-hover`),O===`touch`,j,k);let le=lg(e,se,{styles:ae.positionerStyles,transitionStatus:A,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!T,inert:!E}),ue=T&&S.type!==`menu`&&(S.type!==`menubar`&&D&&P!==`trigger-hover`||S.type===`menubar`&&S.context.modal),de=null;return S.type===`menubar`?de=S.context.contentElement:S.type===void 0&&(de=k),(0,U.jsxs)($C.Provider,{value:ae,children:[ue&&(0,U.jsx)(ag,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:kh(!E),cutout:de}),(0,U.jsx)(zd,{id:F,children:(0,U.jsx)(Mh,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:le})})]})}),mw=v.createContext(null);function hw(e){let t=v.useContext(mw);if(t===null&&!e)throw Error(Wo(5));return t}var gw={...Lp,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},_w=class extends us{constructor(e,t,n=!1){let r=new Ap,i=yw(r,t,n,e);super(i,vw(r),gw),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function vw(e){return{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function yw(e,t,n=!1,r){return{...jp(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Nd,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ls,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var bw=v.createContext(void 0);function xw(){return v.useContext(bw)}var Sw=Zo(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=iw(!0),_=nw(!0),y=hw(!0),b=xw(),x=v.useMemo(()=>b&&_?{type:`menu`,store:_.store}:y?{type:`menubar`,context:y}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,y,b]),S=qu(),C=qu(),w=Id(),T=x.type===`menu`?x.store:void 0,E=(n??a)&&T?.state.transitionStatus===`starting`,D=Co(()=>E?T?.state.instantType:void 0).current,O=Cw({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:x,disabled:o,highlightItemOnHover:h,modal:x.type===void 0?s:void 0,rootId:S,instantType:D},C,w!=null);O.useControlledProp(`openProp`,n),O.useControlledProp(`triggerIdProp`,p),O.useContextCallback(`onOpenChangeComplete`,i);let k=O.useState(`floatingTreeRoot`),A=Rd(k),j=O.useState(`open`),M=O.useState(`activeTriggerElement`),N=O.useState(`positionerElement`),P=O.useState(`hoverEnabled`),F=O.useState(`disabled`),I=O.useState(`lastOpenChangeReason`),L=O.useState(`parent`),R=O.useState(`activeIndex`),z=O.useState(`payload`),ee=O.useState(`floatingParentNodeId`),B=v.useRef(null),V=v.useRef(L.type!==`context-menu`),te=Ks(),ne=v.useRef(!0),H=Ks(),re=ee!=null,{openMethod:ie,triggerProps:ae}=ah(j);O.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:L.type===void 0?s:void 0,openMethod:ie,rootId:S}),Ep(O);let{forceUnmount:oe,transitionStatus:se}=Dp(j,O,()=>{O.set(`allowMouseEnter`,!1)},E),ce=mp(O.context.popupRef);v.useEffect(()=>{if(D===void 0)return;let e=()=>{O.state.instantType===D&&O.set(`instantType`,void 0)};if(!j){e();return}if(se!==void 0)return;if(O.context.popupRef.current==null){e();return}let t=new AbortController;return ce(e,t.signal),()=>{t.abort()}},[D,j,se,ce,O]),Po(()=>{g&&!_?O.update({parent:{type:`context-menu`,context:g},floatingNodeId:A,floatingParentNodeId:w}):_&&O.update({floatingNodeId:A,floatingParentNodeId:w})},[g,_,A,w,O]),v.useEffect(()=>{if(j||(B.current=null),L.type===`context-menu`){if(!j){te.clear(),V.current=!1;return}te.start(500,()=>{V.current=!0})}},[te,j,L.type]),Po(()=>{!j&&!P&&O.set(`hoverEnabled`,!0)},[j,P,O]);let le=Ro((e,t)=>{let n=t.reason;if(!e&&!O.select(`open`)||j===e&&t.trigger===M&&I===n)return;let i=Cp(t);if(!e&&t.trigger==null&&(t.trigger=M??void 0),r?.(e,t),t.isCanceled)return;O.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!ne.current)return;e&&n===`trigger-focus`?(ne.current=!1,H.start(300,()=>{ne.current=!0})):(ne.current=!0,H.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);B.current=t.event;let c=Sp(O.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=L.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,O.update(c)}),ue=up({popupStore:O,floatingRootContext:O.state.floatingRootContext,floatingId:C,nested:w!=null,onOpenChange:le}),de=ue.context.events;Po(()=>{let e=({open:e,eventDetails:t})=>le(e,t);return de.on(`setOpen`,e),()=>{de?.off(`setOpen`,e)}},[de,le]);let fe=v.useCallback(()=>{O.setOpen(!1,gl(ml))},[O]);v.useImperativeHandle(u,()=>({unmount:oe,close:fe}),[oe,fe]);let pe;L.type===`context-menu`&&(pe=L.context),v.useImperativeHandle(pe?.positionerRef,()=>N,[N]),v.useImperativeHandle(pe?.actionsRef,()=>({setOpen:le}),[le]);let me=rf(ue,{enabled:!F,bubbles:{escapeKey:d&&L.type===`menu`},outsidePress(){return L.type!==`context-menu`||B.current?.type===`contextmenu`||V.current},externalTree:re?k:void 0}),he=Bh(),ge=v.useCallback(e=>{O.select(`activeIndex`)!==e&&O.set(`activeIndex`,e)},[O]),_e=am(ue,{enabled:!F,listRef:O.context.itemDomElements,activeIndex:R,nested:L.type!==void 0,loopFocus:c,orientation:l,parentOrientation:L.type===`menubar`?L.context.orientation:void 0,rtl:he===`rtl`,disabledIndices:cs,onNavigate:ge,openOnArrowKeyDown:L.type!==`context-menu`,externalTree:re?k:void 0,focusItemOnHover:h}),ve=v.useCallback(e=>{O.context.typingRef.current=e},[O]),ye=om(ue,{enabled:!F,listRef:O.context.itemLabels,elementsRef:O.context.itemDomElements,activeIndex:R,resetMs:500,onMatch:e=>{j&&e!==R&&O.set(`activeIndex`,e)},onTyping:ve}),be=v.useMemo(()=>{let e=ed(ye.reference,_e.reference,me.reference,{onMouseMove(){O.set(`allowMouseEnter`,!0)}},ae);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=j,e},[O,ye.reference,_e.reference,me.reference,ae,j]),xe=v.useMemo(()=>{let e=ed(_e.trigger,me.trigger,ae);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[_e.trigger,me.trigger,ae]);Co(()=>(O.update({inactiveTriggerProps:xe}),null)),Op(O,{floatingRootContext:ue,activeTriggerProps:be,inactiveTriggerProps:xe,popupProps:v.useMemo(()=>ed(gp,{id:C,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":M?.id,onMouseMove(){O.set(`allowMouseEnter`,!0),L.type===`menu`&&O.set(`hoverEnabled`,!1)},onClick(){O.select(`hoverEnabled`)&&O.set(`hoverEnabled`,!1)},onKeyDown(e){let t=O.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},ye.floating,_e.floating,me.floating),[M,C,l,L.type,O,ye.floating,_e.floating,me.floating]),itemProps:_e.item??ls});let Se=v.useMemo(()=>({store:O,parent:x}),[O,x]),Ce=(0,U.jsxs)(tw.Provider,{value:Se,children:[f&&(0,U.jsx)(yp,{handle:f,store:O}),typeof t==`function`?t({payload:z}):t]});return L.type===void 0||L.type===`context-menu`?(0,U.jsx)(Bd,{externalTree:k,children:Ce}):Ce});function Cw(e,t,n){return Co(()=>new _w(e,t,n)).current}function ww(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=hh(),{ref:i,index:a}=Ug(e),o=n===a,s=v.useRef(null),c=wo(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function wee(e){let{render:t,className:n,style:r,state:i=ls,props:a=cs,refs:o=cs,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=ww({metadata:s});return md(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Tw(e){if(_s(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!ks(e))return Tw(Ms(e))}function Ew(e,t){let n=v.useRef(null);function r(t){Ed.flushSync(()=>{e.setOpen(!1,gl(cl,t.nativeEvent,t.currentTarget))}),Cu(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&wu(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Ed.flushSync(()=>{e.setOpen(!1,gl(cl,n.nativeEvent,n.currentTarget))});let i=Su(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&mc(r,i);){let e=i;if(i=yu(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Dw(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=v.useRef(!1);return v.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Ls(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:ls,[t,n,r])}var Ow=Qo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=nw(!0),h=Rp(d)??m?.store;if(!h)throw Error(Wo(85));let g=Am(s),_=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=v.useRef(null),C=Aw(),w=hh(!0),T=Ld(),E=v.useMemo(()=>T??new Nd,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=Tp(g,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:Rd(E),floatingParentNodeId:Id(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=vh({disabled:j,native:o});v.useEffect(()=>{!b&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,C.type]);let P=v.useRef(null),F=Ks(),I=Ro(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;mc(P.current,t)||mc(h.select(`positionerElement`),t)||t===P.current||(t==null||Tw(t)!==h.select(`rootId`))&&(fh(e,P.current)||E.events.emit(`close`,{domEvent:e,reason:dl}))});v.useEffect(()=>{b&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Ls(P.current).addEventListener(`mouseup`,I,{once:!0})},[b,I,h]);let L=k&&C.context.hasSubmenuOpen,R=Zp(y,{enabled:(c??L)&&!j&&(!k||L&&!O),handleClose:mm({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),z=kw(b,h.select(`lastOpenChangeReason`)),ee=Zd(y,{enabled:!j,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&z}),B=Up(y,{enabled:!j&&L}),V=Dw({open:b,enabled:k,mouseDownAction:`open`}),te=v.useMemo(()=>ed(B.reference,ee.reference),[B.reference,ee.reference]),ne=h.useState(`triggerProps`,O),{preFocusGuardRef:H,handlePreFocusGuardFocus:re,handleFocusTargetFocus:ie}=Ew(h,S),ae={disabled:j,open:b},oe=[P,t,N,D,S],se=[te,R??ls,ne,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Ls(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},k?{role:`menuitem`}:{},V,p,M],ce=md(`button`,e,{enabled:!k,stateAttributesMapping:Rc,state:ae,ref:oe,props:se});return k?(0,U.jsx)(wee,{tag:`button`,render:n,className:r,style:i,state:ae,refs:oe,props:se,stateAttributesMapping:Rc}):b?(0,U.jsxs)(v.Fragment,{children:[(0,U.jsx)(xl,{ref:H,onFocus:re},`${g}-pre-focus-guard`),(0,U.jsx)(v.Fragment,{children:ce},g),(0,U.jsx)(xl,{ref:h.context.triggerFocusTargetRef,onFocus:ie},`${g}-post-focus-guard`)]}):(0,U.jsx)(v.Fragment,{children:ce},g)});function kw(e,t){let n=Ks(),[r,i]=v.useState(!1);return Po(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Aw(){let e=hw(!0);return v.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var jw=Sw,Mw=Ow,Nw=({className:e,align:t=`end`,side:n=`bottom`,sideOffset:r=6,...i})=>(0,U.jsx)(fw,{children:(0,U.jsx)(AC,{children:(0,U.jsx)(pw,{align:t,side:n,sideOffset:r,className:`isolate z-80 outline-none`,children:(0,U.jsx)(lw,{"data-slot":`menu-content`,className:W(`min-w-48 rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none`,`transition-[opacity,transform] duration-(--motion-base)`,`data-starting-style:scale-95 data-starting-style:opacity-0`,`data-ending-style:scale-95 data-ending-style:opacity-0`,e),...i})})})}),Pw=({className:e,destructive:t,...n})=>(0,U.jsx)(cw,{"data-slot":`menu-item`,className:W(`flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-body-sm outline-none select-none`,`data-highlighted:bg-surface-hover`,t?`text-danger`:`text-text`,e),...n}),Fw=Zo(function(e){return zC(`dialog`,e)}),Iw=({className:e,children:t,size:n=`md`,...r})=>(0,U.jsx)(GC,{children:(0,U.jsxs)(AC,{children:[(0,U.jsx)(BC,{className:W(`fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]`,`transition-opacity duration-(--motion-base)`,`data-starting-style:opacity-0 data-ending-style:opacity-0`)}),(0,U.jsx)(WC,{"data-slot":`dialog-content`,className:W(`fixed top-1/2 left-1/2 z-70 flex max-h-[min(42rem,calc(100dvh-3rem))] -translate-x-1/2 -translate-y-1/2 flex-col`,n===`sm`&&`w-[min(24rem,calc(100vw-2rem))]`,n===`md`&&`w-[min(32rem,calc(100vw-2rem))]`,n===`lg`&&`w-[min(46rem,calc(100vw-2rem))]`,`rounded-lg border border-border bg-surface shadow-(--shadow-lg) outline-none`,`transition-[opacity,transform] duration-(--motion-base)`,`data-starting-style:scale-95 data-starting-style:opacity-0`,`data-ending-style:scale-95 data-ending-style:opacity-0`,e),...r,children:t})]})}),Lw=({title:e,description:t,actions:n})=>(0,U.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-border px-4 py-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(KC,{className:`truncate text-body-sm font-semibold text-text`,children:e}),t?(0,U.jsx)(HC,{className:`mt-0.5 text-label text-fg-4`,children:t}):null]}),n,(0,U.jsx)(VC,{"aria-label":`Close`,className:`-mr-1 flex size-6 shrink-0 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1`,children:(0,U.jsx)(DC,{className:`size-3.5`})})]}),Rw=({className:e,...t})=>(0,U.jsx)(`div`,{className:W(`min-h-0 flex-1 overflow-y-auto p-4`,e),...t}),zw=({label:e,children:t,mono:n})=>(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-1.5`,children:[(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-3`,children:e}),(0,U.jsx)(`span`,{className:W(`min-w-0 truncate text-right text-body-sm text-fg-1`,n&&`font-mono text-label`),children:t})]}),Bw=v.createContext(void 0);function Vw(e){let t=v.useContext(Bw);if(t===void 0&&!e)throw Error(Wo(72));return t}var Hw={...Lp,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Uw=class extends us{constructor(e,t,n){let r=new Ap;super(Ww(e,r,t,n),Gw(r),Hw)}setOpen=(e,t)=>{wp(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,gl(nl,e))}};function Ww(e,t,n,r=!1){return{...jp(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Gw(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Kw=Zo(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=vp((e,t)=>new Uw({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Ep(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=Dp(h,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=v.useRef(null);Po(()=>{m&&t&&p.setOpen(!1,gl(pl))},[m,t,p]),Po(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),Po(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),v.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,gl(ml))}),[b,p]);let E=h||_||!t&&a!==`none`;return(0,U.jsxs)(Bw.Provider,{value:p,children:[l&&(0,U.jsx)(yp,{handle:l,store:p}),E&&(0,U.jsx)(qw,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function qw({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=rf(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=ef(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=v.useMemo(()=>ed(a.reference,i.reference),[a.reference,i.reference]);return Op(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??ls}),null}var Jw=v.createContext(void 0);function Yw(){return v.useContext(Jw)}var Xw=`data-base-ui-tooltip-trigger`;function Zw(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(gs(n))return n}}let t=e.target;return gs(t)?t:null}function Qw(e){let t=e;for(;t;){let e=t.closest(`[${Xw}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&gs(n.host)?n.host:null}return null}var $w=Qo(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=Vw(!0),m=Rp(a)??p;if(!m)throw Error(Wo(82));let h=Am(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=v.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Tp(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),w=Yw(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=bl(y,{open:_}),k=Jp(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Vo(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=v.useRef(!1),I=Ks(),L=v.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=Qw(e);return n!==null&&n!==t&&mc(t,n)}function ee(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let B=Zp(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?mm():null,restMs:R,delay(){return u==null&&O?{close:Zc(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),V=Up(y,{enabled:!j}).reference,te=e=>{let t=F.current,n=Zw(e),r=ee(n),i=b.current,a=i&&n&&mc(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,gl(rl,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&dc(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,gl(rl,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ne=m.useState(`triggerProps`,C);return md(`button`,e,{state:{open:_},ref:[t,S,b],props:[B,V,C||N!==`none`?ne:void 0,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){z(Zw(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Vc]:j?``:void 0,[Xw]:j?void 0:``},f],stateAttributesMapping:Lc})}),eT=v.createContext(void 0);function tT(){let e=v.useContext(eT);if(e===void 0)throw Error(Wo(70));return e}var nT=v.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Ad({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,U.jsxs)(v.Fragment,{children:[l,c&&Ed.createPortal(n,c)]})}),rT=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Vw().useState(`mounted`)||n?(0,U.jsx)(eT.Provider,{value:n,children:(0,U.jsx)(nT,{ref:t,...r})}):null}),iT=v.createContext(void 0);function aT(){let e=v.useContext(iT);if(e===void 0)throw Error(Wo(71));return e}var oT=v.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=wd,style:g,..._}=e,y=Vw(),b=tT(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=eg({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=lg(e,v.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,U.jsx)(iT.Provider,{value:O,children:k})}),sT=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Vw(),{side:s,align:c}=aT(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);hp({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Yp(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return md(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[gp,f,cg(d),a],stateAttributesMapping:Bc})}),cT=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=v.useMemo(()=>({open:t,close:n}),[t,n]);return(0,U.jsx)(Jw.Provider,{value:t,children:(0,U.jsx)(yl,{delay:i,timeoutMs:r,children:e.children})})},lT=({className:e,side:t=`top`,sideOffset:n=6,...r})=>(0,U.jsx)(rT,{children:(0,U.jsx)(AC,{children:(0,U.jsx)(oT,{side:t,sideOffset:n,className:`isolate z-90`,children:(0,U.jsx)(sT,{"data-slot":`tooltip-content`,className:W(`rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none`,e),...r})})})});function uT({content:e,render:t,side:n,children:r}){return(0,U.jsxs)(Kw,{children:[(0,U.jsx)($w,{render:t??(0,U.jsx)(`span`,{className:`inline-flex`}),children:r}),(0,U.jsx)(lT,{side:n,children:e})]})}function dT(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var fT=e=>{switch(e){case`success`:return hT;case`info`:return _T;case`warning`:return gT;case`error`:return vT;default:return null}},pT=Array(12).fill(0),mT=({visible:e,className:t})=>v.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},v.createElement(`div`,{className:`sonner-spinner`},pT.map((e,t)=>v.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),hT=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),gT=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),_T=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),vT=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),yT=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},v.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),v.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),bT=()=>{let[e,t]=v.useState(document.hidden);return v.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},xT=1,ST=100,CT=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:xT++,wT=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-ST;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=CT(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],v.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ET(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=CT(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},TT=(e,t)=>wT.message(e,t),ET=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,DT=Object.assign(TT,{success:wT.success,info:wT.info,warning:wT.warning,error:wT.error,custom:wT.custom,message:wT.message,promise:wT.promise,dismiss:wT.dismiss,loading:wT.loading},{getHistory:()=>wT.toasts,getToasts:()=>wT.getActiveToasts()});dT(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function OT(e){return e.label!==void 0}var kT=3,AT=`24px`,jT=`16px`,MT=4e3,NT=356,PT=14,FT=45,IT=200;function LT(...e){return e.filter(Boolean).join(` `)}function Tee(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Eee=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=v.useState(null),[k,A]=v.useState(null),[j,M]=v.useState(!1),[N,P]=v.useState(!1),[F,I]=v.useState(!1),[L,R]=v.useState(!1),[z,ee]=v.useState(!1),[B,V]=v.useState(0),[te,ne]=v.useState(0),H=v.useRef(n.duration||b||MT),re=v.useRef(null),ie=v.useRef(null),ae=c===0,oe=c+1<=o,se=n.type,ce=se??`default`,le=n.dismissible!==!1,ue=n.className||``,de=n.descriptionClassName||``,fe=v.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),pe=v.useMemo(()=>n.closeButton??p,[n.closeButton,p]),me=v.useMemo(()=>n.duration||b||MT,[n.duration,b]),he=v.useRef(0),ge=v.useRef(0),_e=v.useRef(0),ve=v.useRef(null),[ye,be]=x.split(`-`),xe=v.useMemo(()=>s.reduce((e,t,n)=>n>=fe?e:e+t.height,0),[s,fe]),Se=bT(),Ce=v.useMemo(()=>e.swipeDirections??Tee(x),[e.swipeDirections,x]),we=n.invert||t,Te=se===`loading`;ge.current=v.useMemo(()=>fe*S+xe,[fe,xe]),v.useEffect(()=>{H.current=me},[me]),v.useEffect(()=>{M(!0)},[]),v.useEffect(()=>{let e=ie.current;if(e){let t=e.getBoundingClientRect().height;return ne(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),v.useLayoutEffect(()=>{if(!j)return;let e=ie.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ne(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ee=v.useCallback(()=>{P(!0),V(ge.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},IT)},[n,d,a,ge]);v.useEffect(()=>{if(n.promise&&se===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Se?(()=>{if(_e.current<he.current){let e=new Date().getTime()-he.current;H.current-=e}_e.current=new Date().getTime()})():H.current!==1/0&&(he.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ee()},H.current)),()=>clearTimeout(e)},[u,i,n,se,Se,Ee]),v.useEffect(()=>{n.delete&&(Ee(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ee,n.delete]);function De(){return T?.loading?v.createElement(`div`,{className:LT(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":se===`loading`},T.loading):v.createElement(mT,{className:LT(w?.loader,n?.classNames?.loader),visible:se===`loading`})}let Oe=n.icon||T?.[se]||fT(se);return v.createElement(`li`,{tabIndex:0,ref:ie,className:LT(_,ue,w?.toast,n?.classNames?.toast,w?.[ce],n?.classNames?.[ce]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":z,"data-removed":N,"data-visible":oe,"data-y-position":ye,"data-x-position":be,"data-index":c,"data-front":ae,"data-swiping":F,"data-dismissible":le,"data-type":se,"data-invert":we,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?B:ge.current}px`,"--initial-height":C?`auto`:`${te}px`,...m,...n.style},onDragEnd:()=>{I(!1),O(null),ve.current=null},onPointerDown:e=>{e.button!==2&&!Te&&le&&(re.current=new Date,V(ge.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),ve.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(L||!le)return;ve.current=null;let e=Number(ie.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ie.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-re.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Ce.includes(e>0?`right`:`left`):Ce.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=FT||a>.11)){V(ge.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ee(),R(!0);return}var o,s;(o=ie.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ie.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ee(!1),I(!1),O(null)},onPointerMove:e=>{var t,n;if(!ve.current||!le||window.getSelection()?.toString().length>0)return;let r=e.clientY-ve.current.y,i=e.clientX-ve.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&O(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(Ce.includes(`top`)||Ce.includes(`bottom`)){if(Ce.includes(`top`)&&r<0||Ce.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(Ce.includes(`left`)||Ce.includes(`right`))){if(Ce.includes(`left`)&&i<0||Ce.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ee(!0),(t=ie.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ie.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},pe&&!n.jsx&&se!==`loading`?v.createElement(`button`,{"aria-label":E,"data-disabled":Te,"data-close-button":!0,onClick:Te||!le?()=>{}:()=>{Ee(),n.onDismiss==null||n.onDismiss.call(n,n)},className:LT(w?.closeButton,n?.classNames?.closeButton)},T?.close??yT):null,(se||n.icon||n.promise)&&n.icon!==null&&(T?.[se]!==null||n.icon)?v.createElement(`div`,{"data-icon":``,className:LT(w?.icon,n?.classNames?.icon)},se===`loading`?n.icon||De():n.promise?De():null,se===`loading`?null:Oe):null,v.createElement(`div`,{"data-content":``,className:LT(w?.content,n?.classNames?.content)},v.createElement(`div`,{"data-title":``,className:LT(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?v.createElement(`div`,{"data-description":``,className:LT(y,de,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),v.isValidElement(n.cancel)?n.cancel:n.cancel&&OT(n.cancel)?v.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{OT(n.cancel)&&le&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ee())},className:LT(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,v.isValidElement(n.action)?n.action:n.action&&OT(n.action)?v.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{OT(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ee())},className:LT(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function RT(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function zT(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?jT:AT;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var BT=v.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=kT,toastOptions:g,dir:_=RT(),gap:y=PT,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=v.useState([]),T=v.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=v.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=v.useState([]),[k,A]=v.useState(!1),[j,M]=v.useState(!1),[N,P]=v.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),F=v.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=v.useRef(null),R=v.useRef(!1),z=v.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||wT.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return v.useEffect(()=>wT.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Ed.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),v.useEffect(()=>{if(d!==`system`){P(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),v.useEffect(()=>{C.length<=1&&A(!1)},[C]),v.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),v.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),v.createElement(`section`,{ref:t,"aria-label":x??`${S} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?v.createElement(`ol`,{key:t,dir:_===`auto`?RT():_,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${NT}px`,"--gap":`${y}px`,...m,...zT(l,u)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>v.createElement(Eee,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:j,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:z,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:y,expanded:k,swipeDirections:e.swipeDirections}))):null}))});function VT(){return(0,U.jsx)(BT,{position:`bottom-right`,toastOptions:{style:{background:`var(--surface)`,color:`var(--text)`,border:`1px solid var(--border)`,boxShadow:`var(--shadow-md)`,fontFamily:`var(--cw-font-sans)`,fontSize:`var(--text-body-sm)`}}})}async function HT(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return UT(e)}function UT(e){if(typeof document>`u`)return!1;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t);let n=document.activeElement;try{return t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{document.body.removeChild(t),n instanceof HTMLElement&&n.focus()}}function WT({value:e,glyph:t,className:n,variant:r=`ghost`,size:i=`icon-sm`,...a}){let[o,s]=(0,v.useState)(!1);return(0,U.jsx)(lo,{variant:r,size:i,"aria-label":`Copy`,className:W(`text-fg-3`,n),onClick:()=>{HT(e).then(e=>{e&&(s(!0),setTimeout(()=>s(!1),1500))})},...a,children:t?(0,U.jsx)(`span`,{className:W(`font-mono text-body-sm leading-5`,o&&`text-success`),children:o?`✓`:`⧉`}):o?(0,U.jsx)(rv,{className:`size-3.5 text-success`}):(0,U.jsx)(Vv,{className:`size-3.5`})})}function GT({className:e}){return(0,U.jsx)(Sb,{"aria-label":`Loading`,className:W(`size-4 animate-spin text-fg-3`,e)})}function KT({code:e,label:t,copyable:n=!0,variant:r=`panel`,className:i}){let a=r===`plain`,o=t!==void 0||n;return a?(0,U.jsxs)(`div`,{"data-slot":`code-block`,"data-variant":`plain`,className:W(`min-w-0`,i),children:[o?(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`truncate text-label leading-5 text-fg-4`,children:t}),n?(0,U.jsx)(WT,{glyph:!0,value:e,className:`size-5 shrink-0 rounded-sm`}):null]}):null,(0,U.jsx)(`pre`,{className:`max-h-64 overflow-auto bg-code-bg px-2 font-mono text-label leading-5 whitespace-pre-wrap text-fg-2`,children:e})]}):(0,U.jsxs)(`div`,{"data-slot":`code-block`,className:W(`overflow-hidden rounded-md border border-border bg-code-bg`,i),children:[o?(0,U.jsxs)(`div`,{className:`flex h-8 items-center justify-between border-b border-border px-2.5`,children:[(0,U.jsx)(`span`,{className:`font-mono text-label text-fg-3`,children:t}),n?(0,U.jsx)(WT,{value:e}):null]}):null,(0,U.jsx)(`pre`,{className:`max-h-64 overflow-auto px-3 py-2 font-mono text-label whitespace-pre-wrap text-fg-2`,children:e})]})}function qT({orientation:e,value:t,onValueChange:n,min:r,max:i,step:a=16,defaultValue:o,inverted:s,"aria-label":c,className:l}){let u=(0,v.useRef)(null),d=e===`vertical`,f=(0,v.useCallback)(e=>Math.min(i,Math.max(r,e)),[r,i]),p=e=>{e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),u.current={origin:d?e.clientX:e.clientY,start:t})},m=e=>{let t=u.current;if(!t)return;let r=(d?e.clientX:e.clientY)-t.origin;n(f(t.start+(s?-r:r)))},h=e=>{u.current&&(u.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,U.jsx)(`div`,{"data-slot":`splitter`,role:`separator`,tabIndex:0,"aria-label":c,"aria-orientation":e,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":i,onPointerDown:p,onPointerMove:m,onPointerUp:h,onPointerCancel:h,onDoubleClick:()=>{o!==void 0&&n(f(o))},onKeyDown:e=>{let o=d?`ArrowRight`:`ArrowDown`,c=d?`ArrowLeft`:`ArrowUp`,l=s?-1:1;if(e.key===o)n(f(t+a*l));else if(e.key===c)n(f(t-a*l));else if(e.key===`Home`)n(r);else if(e.key===`End`)n(i);else return;e.preventDefault()},className:W(`group relative shrink-0 touch-none bg-border transition-colors`,`hover:bg-border-strong focus-visible:bg-accent focus-visible:outline-none`,d?`w-px cursor-col-resize`:`h-px cursor-row-resize`,l),children:(0,U.jsx)(`span`,{"aria-hidden":!0,className:W(`absolute`,d?`-inset-x-[3px] inset-y-0`:`-inset-y-[3px] inset-x-0`)})})}function JT({icon:e,title:t,description:n,action:r,onAction:i}){return(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-5 py-8 text-center`,children:[(0,U.jsx)(`div`,{className:`text-fg-4 opacity-60 [&_svg]:size-7`,children:e}),(0,U.jsx)(`p`,{className:`text-body-sm font-medium text-fg-2`,children:t}),n?(0,U.jsx)(`p`,{className:`max-w-[26ch] text-balance text-label leading-relaxed text-fg-4`,children:n}):null,r&&i?(0,U.jsx)(lo,{variant:`outline`,size:`sm`,className:`mt-1`,onClick:i,children:r}):null]})}function YT({children:e}){return(0,U.jsx)(`span`,{className:`rounded border border-border px-1 font-mono text-fg-3`,children:e})}function XT({value:e,size:t=13,strokeWidth:n=2,className:r}){let i=Math.min(100,Math.max(0,e)),a=(t-n)/2,o=2*Math.PI*a;return(0,U.jsxs)(`svg`,{"data-slot":`progress-ring`,width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:`img`,"aria-label":`${Math.round(i)}%`,className:W(`shrink-0 -rotate-90`,r),children:[(0,U.jsx)(`circle`,{cx:t/2,cy:t/2,r:a,fill:`none`,stroke:`currentColor`,strokeOpacity:.2,strokeWidth:n}),(0,U.jsx)(`circle`,{cx:t/2,cy:t/2,r:a,fill:`none`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeDasharray:o,strokeDashoffset:o*(1-i/100)})]})}function ZT(e){return`${e.sigil??e.trigger}${e.displayText}`}function QT(e){return e.map(e=>e.type===`text`?e.text:ZT(e)).join(``)}function $T(e){return e?[{type:`text`,text:e}]:[]}function eE(e,t){if(t<=0)return[];let n=[],r=0;for(let i of e){let e=i.type===`text`?i.text.length:ZT(i).length;if(r+e<=t){n.push(i),r+=e;continue}if(i.type===`text`){let e=t-r;if(e>0){let t=i.text.charCodeAt(e-1);t>=55296&&t<=56319&&--e,e>0&&n.push({type:`text`,text:i.text.slice(0,e)})}}break}return n}function tE(e){return e===` `||e===`
|
|
12
|
+
`||e===` `}function nE(e){let t=new Map;for(let n of e)t.has(n.char)||t.set(n.char,n);return t}function rE(e,t,n){if(t===0)return!0;let r=e[t-1];return n===`start`?r===`
|
|
13
|
+
`:tE(r)}function iE(e,t,n){if(!e||t===0||n.length===0)return null;let r=nE(n);for(let n=t-1;n>=0;n--){let i=e[n];if(tE(i)){if(n+1<t){let i=e[n+1],a=r.get(i);if(a&&rE(e,n+1,a.position))return{config:a,startOffset:n+1,query:e.slice(n+2,t)}}return null}let a=r.get(i);if(a&&rE(e,n,a.position))return{config:a,startOffset:n,query:e.slice(n+1,t)}}return null}function aE(e,t,n,r=` `){let i=t.startOffset,a=i+1+t.query.length,o=[],s=0;for(let c of e)if(c.type===`chip`){let e=ZT(c),t=s,n=s+e.length;(n<=i||t>=a)&&o.push(c),s=n}else{let e=s,l=s+c.text.length;if(l<=i)o.push(c);else if(e>=a)o.push(c);else{let s=c.text.slice(0,Math.max(0,i-e)),l=c.text.slice(Math.min(c.text.length,a-e));s&&o.push({type:`text`,text:s});let u={type:`chip`,trigger:t.config.char,value:n.value,displayText:n.displayText,...n.sigil===void 0?{}:{sigil:n.sigil},...n.data===void 0?{}:{data:n.data},...n.autoResolved?{autoResolved:!0}:{}};o.push(u),l?o.push({type:`text`,text:r+l.replace(/^\s/,``)}):o.push({type:`text`,text:r})}s=l}let c=hE(o),l=-1,u=0;for(let e of c)e.type===`text`?u+=e.text.length:(u+=ZT(e).length,e.value===n.value&&e.displayText===n.displayText&&e.trigger===t.config.char&&(l=u));return{segments:c,cursorOffset:l===-1?u:l+r.length}}function oE(e,t,n){let r=t.startOffset,i=r+1+t.query.length,a=[],o=0,s=r+n.length;for(let t of e){if(t.type===`chip`){let e=o+ZT(t).length;(e<=r||o>=i)&&a.push(t),o=e;continue}let e=o,s=o+t.text.length;if(s<=r||e>=i)a.push(t);else{let o=t.text.slice(0,Math.max(0,r-e)),s=t.text.slice(Math.min(t.text.length,i-e));o&&a.push({type:`text`,text:o}),a.push({type:`text`,text:n}),s&&a.push({type:`text`,text:s})}o=s}let c=hE(a),l=QT(c).length;return s>l&&(s=l),{segments:c,cursorOffset:s}}function sE(e,t){return t<0||t>=e.length||e[t].type!==`chip`?e:hE([...e.slice(0,t),...e.slice(t+1)])}function cE(e,t){if(t<0||t>=e.length)return null;let n=e[t];if(n.type!==`chip`||!n.autoResolved)return null;let r=ZT(n);return{segments:hE([...e.slice(0,t),{type:`text`,text:r},...e.slice(t+1)]),revertedText:r}}function lE(e,t){let n=t.filter(e=>e.resolveOnSpace);if(n.length===0)return e;let r=nE(n),i=[];for(let t of e){if(t.type===`chip`){i.push(t);continue}let e=uE(t.text,r);i.push(...e)}return hE(i)}function uE(e,t){if(!e)return[];let n=[],r=0;for(;r<e.length;){let i=e[r];if(t.has(i)&&(r===0||tE(e[r-1]))){let a=t.get(i);if(a&&rE(e,r,a.position)){let t=r+1;for(;t<e.length&&!tE(e[t]);)t++;let o=e.slice(r+1,t);if(o.length>0){let e=a.onSelect?.({value:o,label:o})||o;n.push({type:`chip`,trigger:i,value:o,displayText:e,autoResolved:!0}),r=t;continue}}}let a=r;for(r++;r<e.length&&!(t.has(e[r])&&tE(e[r-1]));)r++;n.push({type:`text`,text:e.slice(a,r)})}return n}function dE(e,t,n,r){let i=[],a=0,o=!1;for(let s of e)if(s.type===`chip`){let e=ZT(s),c=a,l=a+e.length;!o&&t===n&&c===t&&(i.push({type:`text`,text:r}),o=!0),(l<=t||c>=n)&&i.push(s),a=l}else{let e=a,c=a+s.text.length,l=t===n?c<t:c<=t,u=t===n?e>n:e>=n;if(l)i.push(s);else if(u)i.push(s);else{let a=s.text.slice(0,Math.max(0,t-e)),c=s.text.slice(Math.min(s.text.length,n-e));a&&i.push({type:`text`,text:a}),!o&&e<=t&&(i.push({type:`text`,text:r}),o=!0),c&&i.push({type:`text`,text:c})}a=c}return!o&&r&&i.push({type:`text`,text:r}),hE(i)}function fE(e,t,n,r){if(t===n)return null;let i=QT(e),a=r.length,o=t>=a&&i.slice(t-a,t)===r,s=n+a<=i.length&&i.slice(n,n+a)===r,c=o&&s;if(c&&a===1){let e=t>a?i[t-a-1]:``,o=n+a<i.length?i[n+a]:``;(e===r||o===r)&&(c=!1)}return c?{segments:dE(dE(e,n,n+a,``),t-a,t,``),selectionStart:t-a,selectionEnd:n-a}:{segments:dE(dE(e,n,n,r),t,t,r),selectionStart:t+a,selectionEnd:n+a}}function pE(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.type!==i.type)return!1;if(r.type===`text`){if(i.type!==`text`||r.text!==i.text)return!1}else if(i.type!==`chip`||r.trigger!==i.trigger||r.value!==i.value||r.displayText!==i.displayText||r.autoResolved!==i.autoResolved)return!1}return!0}function mE(e,t){return pE(hE(e),hE(t))}function hE(e){let t=[];for(let n of e){if(n.type===`text`&&n.text===``)continue;let e=t[t.length-1];n.type===`text`&&e?.type===`text`?t[t.length-1]={type:`text`,text:e.text+n.text}:t.push(n)}return t}function gE(e){let t=e.match(/^(\s*)([•\-*]) /);if(t)return{kind:`bullet`,indent:Math.floor(t[1].length/2),marker:t[2],prefixLen:t[0].length};let n=e.match(/^(\s*)(\d+)\. /);if(n){let e=n[1].length;return{kind:`numbered`,indent:Math.floor(n[1].length/2),number:parseInt(n[2],10),numberStart:e,numberEnd:e+n[2].length,prefixLen:n[0].length}}return null}function _E(e,t){let n=e.lastIndexOf(`
|
|
14
|
+
`,t-1)+1,r=e.indexOf(`
|
|
15
|
+
`,t),i=e.slice(n,r===-1?e.length:r),a=gE(i);return a?{lineStart:n,prefix:i.slice(0,a.prefixLen),indent:a.indent,listType:a.kind,...a.kind===`bullet`?{marker:a.marker}:{number:a.number},contentStart:n+a.prefixLen}:null}function vE(e,t){let n=QT(e),r=n.lastIndexOf(`
|
|
16
|
+
`,t-1)+1,i=n.slice(r,t),a=i.match(/^(\s*)[-*] $/);if(!a)return null;let o=`${a[1]}• `;return{segments:dE(e,r,r+i.length,o),cursorOffset:r+o.length}}function yE(e,t){let n=QT(e),r=_E(n,t);if(!r)return null;let i=n.indexOf(`
|
|
17
|
+
`,t);if(n.slice(r.contentStart,i===-1?n.length:i).trim()===``)return r.indent>0?{segments:dE(e,r.lineStart,r.lineStart+2,``),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:dE(e,r.lineStart,r.lineStart+r.prefix.length,``),cursorOffset:r.lineStart};let a=` `.repeat(r.indent),o;o=r.listType===`bullet`?`${a}${r.marker??`•`} `:`${a}${(r.number??1)+1}. `;let s=`\n${o}`;return{segments:dE(e,t,t,s),cursorOffset:t+s.length}}function bE(e,t){if(t===0)return null;let n=e.lastIndexOf(`
|
|
18
|
+
`,t-2)+1,r=gE(e.slice(n,t-1));return r?r.indent:null}function xE(e,t){let n=QT(e),r=_E(n,t);if(!r)return null;let i=bE(n,r.lineStart),a=i===null?0:i+1;return r.indent>=a?null:{segments:dE(e,r.lineStart,r.lineStart,` `),cursorOffset:t+2}}function SE(e,t){let n=_E(QT(e),t);return!n||n.indent===0?null:{segments:dE(e,n.lineStart,n.lineStart+2,``),cursorOffset:Math.max(n.lineStart,t-2)}}function CE(e,t){let n=_E(QT(e),t);return!n||t>n.contentStart?null:{segments:dE(e,n.lineStart,n.contentStart,` `.repeat(n.indent)),cursorOffset:n.lineStart+n.indent*2}}var wE=/^\s*```/;function TE(e,t){return t?e.replace(/^(\s*)- /,`$1• `):e.replace(/^(\s*)• /,`$1- `)}function EE(e){let t=new Set,n=-1;return e.forEach((e,r)=>{if(wE.test(e)){if(n===-1)n=r;else{for(let e=n;e<=r;e++)t.add(e);n=-1}}}),t}function DE(e,t){let n=e.split(`
|
|
19
|
+
`),r=EE(n);return n.map((e,n)=>r.has(n)?e:TE(e,t)).join(`
|
|
20
|
+
`)}function OE(e,t){let n=[];e.forEach(e=>{e.type===`text`&&n.push(...e.text.split(`
|
|
21
|
+
`))});let r=EE(n),i=0,a=!1,o=e.map(e=>{if(e.type!==`text`)return e;let n=e.text.split(`
|
|
22
|
+
`).map(e=>{let n=r.has(i)?e:TE(e,t);return i++,n}).join(`
|
|
23
|
+
`);return n===e.text?e:(a=!0,{...e,text:n})});return a?o:e}function kE(e){let t=null,n=0,r=0,i=0,a=!0;for(let o of e.split(`
|
|
24
|
+
`)){let e=gE(o);if(e?.kind===`numbered`&&e.indent===t){if(a&&=e.number===r+1,r=e.number,i++,i>=2&&(n===1||a))return!0}else e?.kind===`numbered`?(t=e.indent,n=e.number,r=e.number,i=1,a=!0):(t=null,i=0)}return!1}function AE(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};let t=new Map,n=[],r=e.split(`
|
|
25
|
+
`),i=``,a=0,o=(e,n)=>{for(let r of t.keys())(n?r>=e:r>e)&&t.delete(r)};for(let e=0;e<r.length;e++){let s=r[e],c=gE(s);if(!c)t.clear(),i+=s;else if(c.kind===`bullet`)o(c.indent,!0),i+=s;else{let e=c.indent;o(e,!1);let r=t.get(e),l=r===void 0?1:r+1;t.set(e,l);let u=String(l);u===String(c.number)?i+=s:(n.push({oldStart:a+c.numberStart,oldEnd:a+c.numberEnd,newText:u}),i+=s.slice(0,c.numberStart)+u+s.slice(c.numberEnd))}e<r.length-1&&(i+=`
|
|
26
|
+
`),a+=s.length+1}return n.length===0?{text:e,edits:n}:{text:i,edits:n}}function jE(e,t){let n=0;for(let r of t)if(r.oldEnd<=e)n+=r.newText.length-(r.oldEnd-r.oldStart);else if(r.oldStart>=e)break;else return r.oldStart+n+Math.min(e-r.oldStart,r.newText.length);return e+n}function ME(e){let{edits:t}=AE(QT(e));if(t.length===0)return{segments:e,edits:t};let n=e;for(let e=t.length-1;e>=0;e--){let r=t[e];n=dE(n,r.oldStart,r.oldEnd,r.newText)}return{segments:n,edits:t}}var NE=/https?:\/\/[^\s),]+/g,PE=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g,FE=/(^|\n)([ \t]*)•/g,IE=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function LE(e){return e instanceof HTMLElement}function RE(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function zE(e){return e instanceof HTMLBRElement}function BE(e){return e instanceof Text}function VE(e){return RE(e)&&e.dataset.chipAutoResolved===`true`}function HE(e){return e instanceof HTMLAnchorElement&&e.dataset.url===`true`}function UE(e){try{return JSON.parse(e)}catch{return}}function WE(e){try{return JSON.stringify(e)}catch{return}}function GE(e){if(RE(e))return e.dataset.chipTrigger}function KE(e){if(RE(e))return e.dataset.chipValue}function qE(e){if(RE(e))return e.dataset.chipDisplay??e.textContent??void 0}function JE(e){if(!RE(e))return;let t=e.dataset.chipData;if(t)return UE(t)}function YE(e){if(RE(e))return e.dataset.chipSigil}function XE(e){let t=e.dataset.chipSigil??e.dataset.chipTrigger??``,n=e.dataset.chipDisplay??e.textContent??``;return t.length+n.length}function ZE(e){if(!RE(e))return null;let t=GE(e),n=KE(e),r=qE(e);if(!t||n===void 0||!r)return null;let i=YE(e),a=JE(e),o=VE(e);return{type:`chip`,trigger:t,value:n,displayText:r,...i===void 0?{}:{sigil:i},...a===void 0?{}:{data:a},...o?{autoResolved:!0}:{}}}function QE(e,t){let n=e.childNodes;for(let e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function $E(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??``)!==``:zE(e)?!e.dataset.sentinel:RE(e)?ZE(e)!==null:LE(e)?(e.textContent??``)!==``:!1}function eD(e,t){let n=0;for(let r=0;r<t;r++)$E(e.childNodes[r])&&n++;return n}function tD(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function nD(e,t){let n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement(`br`)),e.replaceChild(n,t)}function rD(e){let t=!1,n=new Set([`DIV`,`P`,`SECTION`,`ARTICLE`,`BLOCKQUOTE`]);for(let r=e.childNodes.length-1;r>=0;r--){let i=e.childNodes[r];if(!(i instanceof HTMLElement)||i.dataset.chipTrigger!==void 0||i instanceof HTMLBRElement)continue;let a=i.tagName;if(n.has(a))nD(e,i),t=!0;else if(a===`FONT`||a===`B`||a===`I`||a===`U`||a===`STRONG`||a===`EM`||a===`A`||a===`SPAN`){let n=i.textContent??``;n?e.replaceChild(document.createTextNode(n),i):e.removeChild(i),t=!0}}return e.normalize(),t}function iD(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];BE(r)&&r.textContent&&n.push(r)}for(let e of n){let n=e.textContent??``;NE.lastIndex=0;let r=[],i;for(;(i=NE.exec(n))!==null;){let e=i[0];for(;e.length>0&&/[.;:!?]$/.test(e);)e=e.slice(0,-1);e.length>0&&r.push({url:e,index:i.index})}if(r.length===0)continue;let a=e.parentNode;if(!a)continue;let o=[];for(let{url:e,index:t}of r)try{let n=new URL(e);(n.protocol===`http:`||n.protocol===`https:`)&&o.push({url:e,href:n.href,index:t})}catch{}if(o.length===0)continue;t=!0;let s=document.createDocumentFragment(),c=0;for(let{url:e,href:t,index:r}of o){r>c&&s.appendChild(document.createTextNode(n.slice(c,r)));let i=document.createElement(`a`);i.href=t,i.target=`_blank`,i.rel=`noopener noreferrer`,i.dataset.url=`true`,i.className=`text-accent hover:text-accent-hover underline cursor-pointer`,i.textContent=e,s.appendChild(i),c=r+e.length}c<n.length&&s.appendChild(document.createTextNode(n.slice(c))),a.replaceChild(s,e)}return t}function aD(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];BE(r)&&r.textContent&&n.push(r)}for(let e of n){let n=e.textContent??``;PE.lastIndex=0;let r=[],i;for(;(i=PE.exec(n))!==null;)i[1]&&i[2]?r.push({fullMatch:i[0],marker:i[1],content:i[2],index:i.index,className:`font-bold italic`}):i[3]&&i[4]?r.push({fullMatch:i[0],marker:i[3],content:i[4],index:i.index,className:`font-bold`}):i[5]&&i[6]&&r.push({fullMatch:i[0],marker:i[5],content:i[6],index:i.index,className:`italic`});if(r.length===0)continue;t=!0;let a=e.parentNode;if(!a)continue;let o=document.createDocumentFragment(),s=0;for(let{fullMatch:e,marker:t,content:i,index:a,className:c}of r){a>s&&o.appendChild(document.createTextNode(n.slice(s,a)));let r=document.createElement(`span`);r.dataset.md=`true`;let l=document.createElement(`span`);l.className=`prompt-area-md-marker`,l.textContent=t;let u=document.createElement(`span`);u.className=c,u.textContent=i;let d=document.createElement(`span`);d.className=`prompt-area-md-marker`,d.textContent=t,r.appendChild(l),r.appendChild(u),r.appendChild(d),o.appendChild(r),s=a+e.length}s<n.length&&o.appendChild(document.createTextNode(n.slice(s))),a.replaceChild(o,e)}return t}function oD(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];BE(r)&&r.textContent?.includes(`•`)&&n.push(r)}for(let e of n){let n=e.textContent??``;FE.lastIndex=0;let r=[],i;for(;(i=FE.exec(n))!==null;)r.push(i.index+i[1].length+i[2].length);if(r.length===0)continue;t=!0;let a=e.parentNode;if(!a)continue;let o=document.createDocumentFragment(),s=0;for(let e of r){e>s&&o.appendChild(document.createTextNode(n.slice(s,e)));let t=document.createElement(`span`);t.dataset.md=`true`,t.className=`prompt-area-list-bullet`,t.textContent=`•`,o.appendChild(t),s=e+1}s<n.length&&o.appendChild(document.createTextNode(n.slice(s))),a.replaceChild(o,e)}return t}function sD(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];BE(r)&&n.push(r)}for(let e of n){let n=e.textContent??``;IE.lastIndex=0;let r=[],i;for(;(i=IE.exec(n))!==null;){let e=i.index+i[1].length;r.push({start:e,end:e+i[2].length})}if(r.length===0)continue;t=!0;let a=e.parentNode;if(!a)continue;let o=document.createDocumentFragment(),s=0;for(let{start:e,end:t}of r){e>s&&o.appendChild(document.createTextNode(n.slice(s,e)));let r=n.slice(e,t),i=Math.floor(r.length/2),a=document.createElement(`span`);a.dataset.md=`true`,a.className=`prompt-area-list-indent`,a.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${i})`,a.textContent=r,o.appendChild(a),s=t}s<n.length&&o.appendChild(document.createTextNode(n.slice(s))),a.replaceChild(o,e)}return t}function cD(e,t){t&&(sD(e),oD(e)),iD(e),t&&aD(e)}function lD(){let e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function uD(e){let t=lD();if(!t||!e.contains(t.startContainer))return null;let n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),hD(n)}function dD(e,t){let n=vD(e,t);if(!n)return null;let r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function fD(e){let t=e.getBoundingClientRect();if(t.height>0)return t;let n=e.startContainer;if(n.nodeType!==Node.ELEMENT_NODE)return null;let r=n.childNodes,i=[r[e.startOffset],r[e.startOffset-1]];for(let e of i){if(!e)continue;let t=document.createRange();t.selectNode(e);let n=t.getBoundingClientRect();if(n.height>0)return n}return null}function pD(e){let t=window.getSelection();if(!t||t.rangeCount===0)return;let n=t.getRangeAt(0);if(!e.contains(n.startContainer))return;let r=fD(n);if(!r)return;let i=e.getBoundingClientRect();r.bottom>i.bottom?e.scrollTop+=r.bottom-i.bottom:r.top<i.top&&(e.scrollTop-=i.top-r.top)}function mD(e,t){let n=window.getSelection();if(!n)return;let r=vD(e,t);if(r){let t=document.createRange();t.setStart(r.node,r.offset),t.collapse(!0),n.removeAllRanges(),n.addRange(t),pD(e);return}let i=document.createRange();i.selectNodeContents(e),i.collapse(!1),n.removeAllRanges(),n.addRange(i),pD(e)}function hD(e){let t=e.cloneContents(),n=0,r=e=>{if(e.nodeType===Node.TEXT_NODE)n+=(e.textContent??``).length;else if(RE(e))n+=XE(e);else if(LE(e)&&e.tagName===`BR`){if(e.dataset.sentinel)return;n+=1}else LE(e)&&e.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function gD(e){let t=lD();if(!t||!e.contains(t.startContainer))return null;let n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);let r=hD(n);if(t.collapsed)return{start:r,end:r};let i=document.createRange();return i.selectNodeContents(e),i.setEnd(t.endContainer,t.endOffset),{start:r,end:hD(i)}}function _D(e,t,n){let r=window.getSelection();if(!r)return;if(t===n){mD(e,t);return}let i=vD(e,t),a=vD(e,n);if(!i||!a)return;let o=document.createRange();o.setStart(i.node,i.offset),o.setEnd(a.node,a.offset),r.removeAllRanges(),r.addRange(o)}function vD(e,t){let n=t;for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];if(r.nodeType===Node.TEXT_NODE){let e=(r.textContent??``).length;if(n<=e)return{node:r,offset:n};n-=e}else if(RE(r)){let i=XE(r);if(n<=i)return{node:e,offset:t+1};n-=i}else if(zE(r)){if(r.dataset.sentinel)continue;if(n<=1)return{node:e,offset:t+1};--n}else if(LE(r)){let e=(r.textContent??``).length;if(n<=e){let e=vD(r,n);if(e)return e}n-=e}}return{node:e,offset:e.childNodes.length}}function yD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function bD(e,t){let n=e=>{e.nodeType===Node.TEXT_NODE?t.onText(e.textContent??``):RE(e)?t.onChip(e):LE(e)&&e.tagName===`BR`?t.onBreak():e.childNodes.forEach(n)};e.childNodes.forEach(n)}function xD(e){let t=``;return bD(e,{onText:e=>{t+=e},onChip:e=>{t+=(YE(e)??GE(e)??``)+(qE(e)??``)},onBreak:()=>{t+=`
|
|
27
|
+
`}}),t}function SD(e){let t=[];return bD(e,{onText:e=>{e&&t.push({type:`text`,text:e})},onChip:e=>{let n=ZE(e);n&&t.push(n)},onBreak:()=>{t.push({type:`text`,text:`
|
|
28
|
+
`})}}),t}function CD(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!yD(e))return null;if(e.type===`text`&&typeof e.text==`string`)n.push({type:`text`,text:e.text});else if(e.type===`chip`&&typeof e.trigger==`string`&&typeof e.value==`string`&&typeof e.displayText==`string`){let t={type:`chip`,trigger:e.trigger,value:e.value,displayText:e.displayText,...typeof e.sigil==`string`?{sigil:e.sigil}:{},...e.data===void 0?{}:{data:e.data},...e.autoResolved?{autoResolved:!0}:{}};n.push(t)}else return null}return n}catch{return null}}function wD(e,t,n){let r=lD();if(!r)return[...e,...t];let i=document.createRange();i.selectNodeContents(n),i.setEnd(r.startContainer,r.startOffset);let a=hD(i),o=[],s=0,c=!1,l=()=>{c||=(o.push(...t),!0)};for(let t of e){if(t.type===`chip`){let e=ZT(t).length;s>=a&&l(),o.push(t),s+=e;continue}let e=s+t.text.length;if(e<=a)o.push(t);else if(s>=a)l(),o.push(t);else{let e=a-s,n=t.text.slice(0,e),r=t.text.slice(e);n&&o.push({type:`text`,text:n}),l(),r&&o.push({type:`text`,text:r})}s=e}return l(),hE(o)}function TD(e,t){let n=RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,`i`).exec(e);return n?n[1].trim().toLowerCase():``}function ED(e){if(e===`bold`||e===`bolder`)return!0;let t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function DD(e){let t=e.tagName,n=e.getAttribute(`style`)??``,r=TD(n,`font-weight`),i=r?ED(r):t===`B`||t===`STRONG`,a=TD(n,`font-style`),o=a?a===`italic`||a===`oblique`:t===`I`||t===`EM`,s=TD(n,`text-decoration`),c=t===`S`||t===`DEL`||t===`STRIKE`||s.includes(`line-through`);return{prefix:(c?`~~`:``)+(i?`**`:``)+(o?`*`:``),suffix:(o?`*`:``)+(i?`**`:``)+(c?`~~`:``)}}function OD(e){return e.replace(/\s+/g,` `)}function kD(e){return e.replace(/\*/g,`\\*`)}function AD(e){let t=e.querySelector(`code`),n=`${e.className} ${t?.className??``}`,r=/(?:language|lang)-([\w-]+)/.exec(n);return r?r[1]:e.getAttribute(`lang`)??t?.getAttribute(`lang`)??``}function jD(e){return`\n\n\`\`\`${AD(e)}\n${(e.textContent??``).replace(/\n$/,``)}\n\`\`\`\n\n`}function MD(e){let t=e.textContent??``;return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function ND(e){return/^(https?:|mailto:)/i.test(e)}function PD(e,t){let n=e.getAttribute(`href`)??``,r=zD(e,t).trim();return ND(n)?!r||r===n?n:`[${r}](${n})`:r}function FD(e){let t=e.getAttribute(`src`)??``;return!t||!ND(t)?``:``}function ID(e,t){return`\n\n${zD(e,t).trim().split(`
|
|
29
|
+
`).map(e=>e?`> ${e}`:`>`).join(`
|
|
30
|
+
`)}\n\n`}function LD(e,t){let n=e.tagName===`OL`,r=Number.parseInt(e.getAttribute(`start`)??``,10),i=Number.isNaN(r)?1:r,a=` `.repeat(t),o=[];for(let r of Array.from(e.childNodes)){if(!LE(r)||r.tagName!==`LI`)continue;let e=n?`${i}. `:`- `;i++;let s=``,c=``;for(let e of Array.from(r.childNodes))LE(e)&&(e.tagName===`UL`||e.tagName===`OL`)?c+=`\n${LD(e,t+1)}`:s+=BD(e,t);o.push(`${a}${e}${s.trim()}${c}`)}return o.join(`
|
|
31
|
+
`)}function RD(e,t){let n=Array.from(e.querySelectorAll(`tr`));if(n.length===0)return``;let r=n.map(e=>Array.from(e.children).filter(e=>e.tagName===`TD`||e.tagName===`TH`).map(e=>zD(e,t).replace(/\n+/g,` `).replace(/\|/g,`\\|`).trim())),i=r[0],a=i.map(()=>`---`),o=e=>`| ${e.join(` | `)} |`;return[o(i),o(a),...r.slice(1).map(o)].join(`
|
|
32
|
+
`)}function zD(e,t){let n=``;return e.childNodes.forEach(e=>{n+=BD(e,t)}),n}function BD(e,t){if(BE(e))return kD(OD(e.textContent??``));if(!LE(e))return``;let n=e.tagName;switch(n){case`SCRIPT`:case`STYLE`:case`NOSCRIPT`:case`HEAD`:case`TITLE`:return``;case`BR`:return`
|
|
33
|
+
`;case`HR`:return`
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
`;case`H1`:case`H2`:case`H3`:case`H4`:case`H5`:case`H6`:return`\n\n${`#`.repeat(Number(n[1]))} ${zD(e,t).trim()}\n\n`;case`P`:return`\n\n${zD(e,t).trim()}\n\n`;case`DIV`:return`\n${zD(e,t).trim()}\n`;case`BLOCKQUOTE`:return ID(e,t);case`UL`:case`OL`:return`\n\n${LD(e,t)}\n\n`;case`LI`:return`${zD(e,t).trim()}\n`;case`PRE`:return jD(e);case`CODE`:return MD(e);case`A`:return PD(e,t);case`IMG`:return FD(e);case`TABLE`:return`\n\n${RD(e,t)}\n\n`;default:{let{prefix:n,suffix:r}=DD(e);return n+zD(e,t)+r}}}function VD(e){return e.replace(/[ \t]+\n/g,`
|
|
38
|
+
`).replace(/\n[ \t]*\n[ \t\n]*/g,`
|
|
39
|
+
|
|
40
|
+
`).trim()}function HD(e){if(!e)return``;let t=new DOMParser().parseFromString(e,`text/html`);return t.body?VD(zD(t.body,0)):``}var UD=100;function WD(e){let{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:i,runTriggerDetection:a,dismissTrigger:o,triggers:s,markdownEnabled:c,normalizeBullets:l,onPaste:u,onUndo:d,onRedo:f,onChipAdd:p,onImagePaste:m,onRawPaste:h}=e,g=(0,v.useRef)(!1),_=(0,v.useRef)({undoStack:[],redoStack:[]}),y=(0,v.useCallback)(e=>{let t=_.current;t.undoStack.push(e),t.undoStack.length>UD&&t.undoStack.shift(),t.redoStack=[]},[]),b=(0,v.useCallback)(()=>{_.current={undoStack:[],redoStack:[]}},[]),x=(0,v.useCallback)(e=>{if(h?.(e),e.defaultPrevented)return;e.preventDefault();let o=t.current;if(!o)return;let d=Array.from(e.clipboardData.files).find(e=>e.type.startsWith(`image/`))??Array.from(e.clipboardData.items).find(e=>e.type.startsWith(`image/`))?.getAsFile()??null;if(d){m?.(d);return}let f=n();y(f);let g=e.clipboardData.getData(`text/prompt-area-segments`);if(g){let e=CD(g);if(e&&e.length>0){let t=lD();if(!t)return;t.deleteContents();let s=wD(n(),e,o);r(s),i(s),u?.({segments:s,source:`internal`});for(let t of e)t.type===`chip`&&p?.(t);a();return}}let _=``;if(c){if(_=e.clipboardData.getData(`text/markdown`),_)_=_.replace(/\\([()])/g,`$1`);else{let t=e.clipboardData.getData(`text/html`);if(t)try{_=HD(t)}catch{_=``}}}if(_||=e.clipboardData.getData(`text/plain`),!_)return;c&&l&&(_=DE(_,!0)),c&&kE(_)&&(_=AE(_).text);let v=lD();if(!v)return;v.deleteContents();let b=_.split(`
|
|
41
|
+
`),x=document.createDocumentFragment();for(let e=0;e<b.length;e++)b[e]&&x.appendChild(document.createTextNode(b[e])),e<b.length-1&&x.appendChild(document.createElement(`br`));v.insertNode(x),v.collapse(!1);let S=window.getSelection();S?.removeAllRanges(),S?.addRange(v),rD(o);let C=n(),w=lE(C,s);if(w!==C){r(w),i(w);for(let e of w)e.type===`chip`&&!C.some(t=>t.type===`chip`&&t.trigger===e.trigger&&t.value===e.value&&t.displayText===e.displayText)&&p?.(e)}else r(C);u?.({segments:w,source:`external`}),a()},[t,n,r,y,a,i,s,c,l,u,p,m,h]),S=(0,v.useCallback)(e=>{e.preventDefault();let t=lD();if(!t)return;let n=t.cloneContents(),r=xD(n);e.clipboardData.setData(`text/plain`,r);let i=SD(n);if(i.some(e=>e.type===`chip`)){let t=WE(i);t&&e.clipboardData.setData(`text/prompt-area-segments`,t)}},[]),C=(0,v.useCallback)(e=>{S(e);let i=lD();if(!i)return;let o=n();y(o),i.deleteContents();let s=t.current;s&&rD(s);let c=n();r(c),a()},[S,t,n,r,y,a]),w=(0,v.useCallback)(e=>{e.preventDefault()},[]),T=(0,v.useCallback)(e=>{e.preventDefault()},[]),E=(0,v.useCallback)(()=>{g.current=!0},[]),D=(0,v.useCallback)(()=>{g.current=!1,a()},[a]),O=(0,v.useCallback)(()=>{setTimeout(()=>{let e=t.current;if(!e)return;let n=document.activeElement;n&&e.parentElement?.contains(n)||o()},150)},[t,o]),k=(0,v.useCallback)(e=>{if(!(e.metaKey||e.ctrlKey)||e.key!==`z`)return!1;e.preventDefault();let t=_.current;if(e.shiftKey){if(t.redoStack.length===0)return!0;let e=t.redoStack.pop();if(!e)return!0;let a=n();t.undoStack.push(a),r(e),i(e),f?.(e)}else{if(t.undoStack.length===0)return!0;let e=t.undoStack.pop();if(!e)return!0;let a=n();t.redoStack.push(a),r(e),i(e),d?.(e)}return!0},[n,r,i,d,f]);return(0,v.useMemo)(()=>({handlePaste:x,handleCopy:S,handleCut:C,handleDrop:w,handleDragOver:T,handleCompositionStart:E,handleCompositionEnd:D,handleBlur:O,handleKeyDownForUndoRedo:k,pushUndo:y,resetUndoHistory:b,isComposing:g}),[x,S,C,w,T,E,D,O,k,y,b])}function GD({editorRef:e,triggers:t,markdownEnabled:n,submitOnEnter:r,onSubmit:i,onEscape:a,onChange:o,onChipAdd:s,onChipDelete:c,readSegmentsFromDOM:l,renderSegmentsToDOM:u,runTriggerDetection:d,dismissTrigger:f,buildInsertChip:p,selectSuggestionInternal:m,activeTrigger:h,suggestions:g,suggestionsLoading:_,suggestionsError:y,selectedSuggestionIndex:b,setSelectedSuggestionIndex:x,pushUndo:S,handleKeyDownForUndoRedo:C,lastRenderedValue:w,undoTimer:T,undoBaseState:E}){let D=(0,v.useCallback)((e,t)=>{let n=l(),r=QE(e,t);if(r===-1)return!1;let i=eD(e,r),a=n[i],s=sE(n,i);return o(s),u(s),a?.type===`chip`&&c?.(a),!0},[l,o,u,c]),O=(0,v.useCallback)((e,t)=>{let n=l(),r=QE(e,t);if(r===-1)return!1;let i=eD(e,r),a=n[i],s=cE(n,i);if(!s)return!1;let d=0;for(let e=0;e<i;e++){let t=n[e];t.type===`text`?d+=t.text.length:d+=ZT(t).length}return d+=s.revertedText.length,o(s.segments),u(s.segments),mD(e,d),a?.type===`chip`&&c?.(a),!0},[l,o,u,c]),k=(0,v.useCallback)(()=>{let t=e.current;if(!t)return!1;let n=lD();if(!n||!n.collapsed)return!1;let r=n.startContainer,i=n.startOffset;if(r===t&&i>0){let e=t.childNodes[i-1];if(e&&RE(e))return VE(e)?O(t,e):D(t,e)}if(r.nodeType===Node.TEXT_NODE&&i===0){let e=tD(t,r);if(!e)return!1;let n=e.previousSibling;for(;n&&n.nodeType===Node.TEXT_NODE&&n.textContent===``;)n=n.previousSibling;if(n&&RE(n))return VE(n)?O(t,n):D(t,n)}return!1},[D,O]),A=(0,v.useCallback)(()=>{let t=e.current;if(!t)return!1;let n=lD();if(!n||!n.collapsed)return!1;let r=n.startContainer,i=n.startOffset;if(r===t&&i<t.childNodes.length){let e=t.childNodes[i];if(e&&RE(e))return D(t,e)}if(r.nodeType===Node.TEXT_NODE&&i===(r.textContent??``).length){let e=tD(t,r);if(!e)return!1;let n=e.nextSibling;for(;n&&n.nodeType===Node.TEXT_NODE&&n.textContent===``;)n=n.nextSibling;if(n&&RE(n))return D(t,n)}return!1},[D]),j=(0,v.useCallback)(t=>{let n=l(),r=t.query,i={value:r,label:r},a={value:r,displayText:(t.config.onSelect?.(i)??r)||r,autoResolved:!0},c=aE(n,t,a);o(c.segments),u(c.segments),s?.({type:`chip`,trigger:t.config.char,...a});let d=e.current;d&&mD(d,c.cursorOffset),f()},[l,o,u,f,s]);return(0,v.useCallback)(s=>{let c=(e,t)=>{let{segments:r,cursorOffset:i}=t;if(n){let e=ME(r);r=e.segments,i=jE(i,e.edits)}w.current=r,o(r),u(r),mD(e,i)},v=e=>{if(!n)return!1;let t=l(),r=uD(e);if(r===null||!_E(QT(t),r))return!1;let i=yE(t,r);return i&&c(e,i),!0};if((s.metaKey||s.ctrlKey)&&s.key===`z`&&E.current&&(T.current&&=(clearTimeout(T.current),null),S(E.current),E.current=null),C(s))return;if(n&&(s.metaKey||s.ctrlKey)&&!s.shiftKey&&(s.key===`b`||s.key===`i`)){s.preventDefault();let t=e.current;if(!t)return;let n=gD(t);if(!n||n.start===n.end)return;let r=s.key===`b`?`**`:`*`,i=l();S(i);let a=fE(i,n.start,n.end,r);if(!a)return;w.current=a.segments,o(a.segments),u(a.segments),_D(t,a.selectionStart,a.selectionEnd);return}if(!s.metaKey&&!s.ctrlKey&&!s.altKey&&!s.nativeEvent.isComposing&&s.key.length===1){let n=t.find(e=>e.mode===`launch`&&e.char===s.key),r=e.current;if(n?.onActivate&&r){let e=uD(r);if(e!==null){let t=l(),r=QT(t);if(rE(r,e,n.position)){s.preventDefault(),n.onActivate({text:r,cursorPosition:e,insertChip:p(dE(t,e,e,n.char),{config:n,startOffset:e,query:``})});return}}}}if(h&&h.config.mode===`dropdown`&&(g.length>0||_||y!==null||h.config.emptyMessage)){if(s.key===`ArrowDown`){s.preventDefault(),g.length>0&&x(e=>Math.min(e+1,g.length-1));return}if(s.key===`ArrowUp`){s.preventDefault(),g.length>0&&x(e=>Math.max(e-1,0));return}if(s.key===`Enter`||s.key===`Tab`){s.preventDefault();let e=g[b];e&&m(e);return}if(s.key===`Escape`){s.preventDefault(),f();return}}if(s.key===` `&&h&&h.config.resolveOnSpace&&h.query.trim().length>0){s.preventDefault(),j(h);return}if(n&&s.key===`Tab`&&!h){let t=e.current;if(t){let e=l(),n=QT(e),r=uD(t);if(r!==null&&_E(n,r)){s.preventDefault();let n=s.shiftKey?SE(e,r):xE(e,r);n&&c(t,n);return}}}let D=e=>{let t=gD(e);if(!t)return;let n=l();S(n);let r=dE(n,t.start,t.end,`
|
|
42
|
+
`);c(e,{segments:r,cursorOffset:t.start+1})};if(s.key===`Enter`&&s.shiftKey&&!s.nativeEvent.isComposing){s.preventDefault();let t=e.current;t&&!v(t)&&D(t);return}if(s.key===`Enter`&&!s.shiftKey&&!s.nativeEvent.isComposing){if(s.preventDefault(),r){i?.(l());return}let t=e.current;t&&!v(t)&&D(t);return}if(s.key===`Escape`&&a){a();return}if((s.key===`Backspace`||s.key===`Delete`)&&!s.nativeEvent.isComposing){let t=e.current;if(t){let e=gD(t);if(e&&e.start!==e.end){s.preventDefault();let n=l();S(n),c(t,{segments:dE(n,e.start,e.end,``),cursorOffset:e.start}),d();return}}}if(s.key===`Backspace`){let t=e.current;if(t){let e=l(),r=uD(t);if(n&&r!==null){let n=CE(e,r);if(n){s.preventDefault(),c(t,n),d();return}}}if(k()){s.preventDefault(),d();return}}if(s.key===`Delete`&&A()){s.preventDefault(),d();return}},[h,g,_,y,b,i,r,a,l,o,u,n,f,k,A,j,d,m,S,C,t,p])}function KD({editorRef:e,triggers:t,disabled:n,onChange:r,renderSegmentsToDOM:i,onChipClick:a,onChipAdd:o,onChipDelete:s,onLinkClick:c,setActiveTrigger:l,setSelectedSuggestionIndex:u,setTriggerRect:d,runSearch:f,activeTrigger:p,suggestions:m}){let h=(0,v.useRef)(null),g=(0,v.useRef)(null),_=(0,v.useRef)(null),y=(0,v.useCallback)(r=>{let i=r.target;if(!(i instanceof Node))return;let o=e.current;if(!o)return;let s=i;for(;s&&s!==o;){if(HE(s)){if(r.metaKey||r.ctrlKey){r.preventDefault(),c?.(s.href),window.open(s.href,`_blank`,`noopener,noreferrer`);return}break}if(RE(s)){let e=s.getBoundingClientRect(),i=document.createElement(`span`);i.className=`prompt-area-chip-ripple`;let c=Math.max(e.width,e.height);i.style.width=`${c}px`,i.style.height=`${c}px`,i.style.left=`${r.clientX-e.left-c/2}px`,i.style.top=`${r.clientY-e.top-c/2}px`,s.appendChild(i),i.addEventListener(`animationend`,()=>i.remove());let p=ZE(s);if(p){let r=t.find(e=>e.char===p.trigger),i=_.current===s;if(_.current=null,!n&&!i&&r?.reopenOnChipClick&&r.mode===`dropdown`&&r.onSearch){let t=QE(o,s);h.current={chip:p,segIndex:eD(o,t)},g.current=s,l({config:r,startOffset:0,query:``}),u(0),d(e),f(``,r)}a?.(p)}return}s=s.parentNode}},[a,c,t,f,n]),b=(0,v.useCallback)(t=>{let n=t.target,r=e.current;if(!r||!(n instanceof Node)){_.current=null;return}let i=n;for(;i&&i!==r;){if(RE(i)){_.current=g.current===i?i:null;return}i=i.parentNode}_.current=null},[]),x=(0,v.useCallback)(()=>{h.current=null,g.current=null},[]),S=(0,v.useCallback)((t,a,c,l)=>{let u=h.current;if(!u)return!1;let d=e.current;if(d&&!n){let e=t[u.segIndex],n=e?.type===`chip`&&e.trigger===u.chip.trigger&&e.value===u.chip.value?u.segIndex:(()=>{let e=[];return t.forEach((t,n)=>{t.type===`chip`&&t.trigger===u.chip.trigger&&t.value===u.chip.value&&e.push(n)}),e.length===1?e[0]:-1})(),f=n===-1?void 0:t[n];if(f?.type===`chip`){let e={type:`chip`,trigger:c,...a},u=t.map((t,r)=>r===n?e:t),p=u[n+1],m=!p||p.type!==`text`||p.text.length===0;m&&(u=[...u.slice(0,n+1),{type:`text`,text:` `},...u.slice(n+1)]),l(t),r(u),i(u),(f.value!==e.value||f.displayText!==e.displayText||WE(f.data)!==WE(e.data))&&(s?.(f),o?.(e)),mD(d,QT(u.slice(0,n+1)).length+ +!!m)}}return!0},[n,r,i,o,s]);return(0,v.useEffect)(()=>{let e=h.current;if(!e||!p?.config.reopenOnChipClick)return;let t=m.findIndex(t=>t.value===e.chip.value);t>0&&u(t)},[m,p]),(0,v.useMemo)(()=>({handleClick:y,handleMouseDown:b,clear:x,trySelectEditingChip:S}),[y,b,x,S])}function qD(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=(0,v.useRef)(0),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useCallback)(()=>{s.current?.abort(),c.current&&clearTimeout(c.current),t([]),r(!1),a(null)},[]),u=(0,v.useCallback)((e,n)=>{if(!n.onSearch)return;s.current?.abort(),c.current&&clearTimeout(c.current),r(!0),a(null),o.current++;let i=o.current,l=new AbortController;s.current=l;let{onSearch:u,onSearchError:d,searchDebounceMs:f}=n,p=()=>{let n=u(e,{signal:l.signal});n instanceof Promise?n.then(e=>{l.signal.aborted||o.current!==i||(t(e),r(!1))},e=>{l.signal.aborted||o.current!==i||e instanceof DOMException&&e.name===`AbortError`||(a(e instanceof Error?e.message:`Search failed`),r(!1),d?.(e))}):(t(n),r(!1))};f&&f>0&&e.length>0?c.current=setTimeout(p,f):p()},[]);return(0,v.useEffect)(()=>()=>{s.current?.abort(),c.current&&clearTimeout(c.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:i,search:u,reset:l}}var JD=300,YD=[];function XD({value:e,onChange:t,triggers:n=YD,disabled:r=!1,onSubmit:i,onEscape:a,onChipClick:o,onChipAdd:s,onChipDelete:c,onLinkClick:l,onPaste:u,onRawPaste:d,onUndo:f,onRedo:p,onImagePaste:m,markdown:h=!0,normalizeBullets:g=!0,submitOnEnter:_=!0,maxLength:y}){let b=(0,v.useRef)(null),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)(0),[T,E]=(0,v.useState)(null),{suggestions:D,suggestionsLoading:O,suggestionsError:k,search:A,reset:j}=qD(),M=(0,v.useRef)(!1),N=(0,v.useRef)([]),P=(0,v.useRef)(null),F=(0,v.useRef)(null),I=(0,v.useCallback)(()=>{let e=b.current;if(!e)return[];let t=[],n=!1,r=!1;for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(a.nodeType===Node.TEXT_NODE){let e=a.textContent??``;e&&(t.push({type:`text`,text:e}),n=!0)}else if(RE(a)){let e=ZE(a);e&&(t.push(e),n=!0)}else if(zE(a)){if(a.dataset.sentinel){r=!0;continue}t.push({type:`text`,text:`
|
|
43
|
+
`})}else if(LE(a)){let e=a.textContent??``;e&&(t.push({type:`text`,text:e}),n=!0)}}return!n&&!r?[]:t},[]),L=(0,v.useCallback)(e=>{let t=b.current;if(!t)return;M.current=!0;let r=uD(t);for(;t.firstChild;)t.removeChild(t.firstChild);for(let r of e)if(r.type===`text`){let e=r.text.split(`
|
|
44
|
+
`);for(let n=0;n<e.length;n++)e[n]&&t.appendChild(document.createTextNode(e[n])),n<e.length-1&&t.appendChild(document.createElement(`br`))}else{let e=document.createElement(`span`);if(e.contentEditable=`false`,e.dataset.chipTrigger=r.trigger,e.dataset.chipValue=r.value,e.dataset.chipDisplay=r.displayText,r.sigil!==void 0&&(e.dataset.chipSigil=r.sigil),r.data!==void 0){let t=WE(r.data);t&&(e.dataset.chipData=t)}r.autoResolved&&(e.dataset.chipAutoResolved=`true`);let i=n.find(e=>e.char===r.trigger),a=i?.chipStyle??`pill`;e.dataset.chipStyle=a,e.className=W(`prompt-area-chip`,a===`inline`&&`prompt-area-chip--inline`,i?.chipClassName),e.textContent=ZT(r),e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`-1`),t.appendChild(e)}if(t.lastChild&&zE(t.lastChild)){let e=document.createElement(`br`);e.dataset.sentinel=`true`,t.appendChild(e)}cD(t,h),r!==null&&mD(t,r),N.current=e,M.current=!1},[n,h]),R=KD({editorRef:b,triggers:n,disabled:r,onChange:t,renderSegmentsToDOM:L,onChipClick:o,onChipAdd:s,onChipDelete:c,onLinkClick:l,setActiveTrigger:S,setSelectedSuggestionIndex:w,setTriggerRect:E,runSearch:A,activeTrigger:x,suggestions:D}),z=(0,v.useCallback)((e,n)=>r=>{let i=aE(e,n,{value:r.value,displayText:r.displayText,data:r.data});t(i.segments),L(i.segments),s?.({type:`chip`,trigger:n.config.char,value:r.value,displayText:r.displayText,...r.data===void 0?{}:{data:r.data}});let a=b.current;a&&mD(a,i.cursorOffset)},[t,L,s]),ee=(0,v.useCallback)(()=>{let e=b.current;if(!e)return;let t=I(),r=QT(t),i=uD(e);if(i===null)return;let a=iE(r,i,n);if(R.clear(),a){S(a),w(0);let n=dD(e,a.startOffset);if(n){let e=n.getBoundingClientRect();(e.height>0||e.left>0||e.top>0)&&E(e)}a.config.mode===`dropdown`&&a.config.onSearch&&A(a.query,a.config),a.config.mode===`callback`&&a.config.onActivate&&a.config.onActivate({text:r,cursorPosition:i,insertChip:z(t,a)})}else S(null),j()},[n,I,z,j,A,R]),B=(0,v.useCallback)(()=>{R.clear(),S(null),w(0),j()},[j,R]),V=WD({editorRef:b,readSegmentsFromDOM:I,onChange:t,renderSegmentsToDOM:L,runTriggerDetection:ee,dismissTrigger:B,triggers:n,markdownEnabled:h,normalizeBullets:g,onPaste:u,onRawPaste:d,onUndo:f,onRedo:p,onChipAdd:s,onImagePaste:m});(0,v.useLayoutEffect)(()=>{if(!M.current&&!pE(e,N.current)){if(h&&g){let n=OE(e,!0);if(n!==e){t(n);return}}if(mE(I(),e)){N.current=e;return}L(e)}},[e,I,L,h,g,t]);let te=(0,v.useRef)(h);(0,v.useLayoutEffect)(()=>{if(te.current===h)return;te.current=h;let n=g?OE(e,h):e;n===e?L(e):t(n)},[h,g,L,e,t]),(0,v.useEffect)(()=>()=>{P.current&&clearTimeout(P.current)},[]);let ne=(0,v.useCallback)(()=>{if(M.current)return;if(V.isComposing.current){let e=I();N.current=e,t(e);return}let e=b.current,n=e?uD(e):null;e&&rD(e);let r=I();if(y!=null&&e&&QT(r).length>y){let n=uD(e),i=eE(r,y);N.current=i,t(i),L(i),mD(e,n==null?y:Math.min(n,y)),ee();return}if(h&&g&&e&&n!==null){let i=vE(r,n);if(i){N.current=i.segments,t(i.segments),L(i.segments),mD(e,i.cursorOffset),ee();return}}let i=r,a=null;if(h&&n!==null&&kE(QT(r))){let e=ME(r);e.edits.length>0&&(i=e.segments,a=jE(n,e.edits))}F.current||=N.current,N.current=i,t(i),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{F.current&&=(V.pushUndo(F.current),null),P.current=null},JD),e&&(a===null?(cD(e,h),n!==null&&mD(e,n)):(L(i),mD(e,a))),ee()},[t,I,ee,L,h,g,y,V]),H=(0,v.useCallback)(e=>{if(!x)return;let n=I(),r=x.config.insertAsText?.(e);if(r!==void 0){let e=oE(n,x,r);V.pushUndo(n),t(e.segments),L(e.segments);let i=b.current;i&&mD(i,e.cursorOffset),B(),setTimeout(()=>{b.current?.focus()},0);return}let i=x.config.onSelect?.(e)??e.label,a=x.config.chipOptions?.(e),o={value:e.value,displayText:i||e.label,...a?.sigil===void 0?{}:{sigil:a.sigil},data:e.data};if(R.trySelectEditingChip(n,o,x.config.char,V.pushUndo)){B(),setTimeout(()=>{b.current?.focus()},0);return}let c=aE(n,x,o,a?.trailingText);t(c.segments),L(c.segments),s?.({type:`chip`,trigger:x.config.char,...o});let l=b.current;l&&mD(l,c.cursorOffset),B(),setTimeout(()=>{b.current?.focus()},0)},[x,I,t,L,B,s,V,R]),re=H,ie=GD({editorRef:b,triggers:n,markdownEnabled:h,submitOnEnter:_,onSubmit:i,onEscape:a,onChange:t,onChipAdd:s,onChipDelete:c,readSegmentsFromDOM:I,renderSegmentsToDOM:L,runTriggerDetection:ee,dismissTrigger:B,buildInsertChip:z,selectSuggestionInternal:H,activeTrigger:x,suggestions:D,suggestionsLoading:O,suggestionsError:k,selectedSuggestionIndex:C,setSelectedSuggestionIndex:w,pushUndo:V.pushUndo,handleKeyDownForUndoRedo:V.handleKeyDownForUndoRedo,lastRenderedValue:N,undoTimer:P,undoBaseState:F}),ae=(0,v.useMemo)(()=>({focus:()=>b.current?.focus(),blur:()=>b.current?.blur(),insertChip:e=>{let n=I(),r={type:`chip`,...e},i=[...n,r,{type:`text`,text:` `}];t(i),L(i),s?.(r)},getPlainText:()=>QT(I()),clear:()=>{t([]);let e=b.current;if(e)for(;e.firstChild;)e.removeChild(e.firstChild);V.resetUndoHistory(),P.current&&=(clearTimeout(P.current),null),F.current=null},setText:e=>{V.pushUndo(I());let n=$T(e);t(n),L(n);let r=b.current;r&&mD(r,e.length)},appendText:e=>{let n=I();V.pushUndo(n);let r=n[n.length-1],i=r?.type===`text`?[...n.slice(0,-1),{type:`text`,text:r.text+e}]:[...n,{type:`text`,text:e}];t(i),L(i);let a=b.current;a&&mD(a,QT(i).length)},getCursorPosition:()=>{let e=b.current;return e?uD(e):null},setCursorPosition:e=>{let t=b.current;t&&mD(t,e)},setCursorToEnd:()=>{let e=b.current;e&&mD(e,QT(I()).length)},getSelection:()=>{let e=b.current;return e?gD(e):null},setSelection:(e,t)=>{let n=b.current;n&&_D(n,e,t)}}),[I,t,L,s,V]),oe=(0,v.useMemo)(()=>({onPaste:V.handlePaste,onCopy:V.handleCopy,onCut:V.handleCut,onDrop:V.handleDrop,onDragOver:V.handleDragOver,onCompositionStart:V.handleCompositionStart,onCompositionEnd:V.handleCompositionEnd,onBlur:V.handleBlur}),[V.handlePaste,V.handleCopy,V.handleCut,V.handleDrop,V.handleDragOver,V.handleCompositionStart,V.handleCompositionEnd,V.handleBlur]);return{editorRef:b,activeTrigger:x,suggestions:D,suggestionsLoading:O,suggestionsError:k,selectedSuggestionIndex:C,handleInput:ne,handleKeyDown:ie,handleClick:R.handleClick,handleMouseDown:R.handleMouseDown,selectSuggestion:re,dismissTrigger:B,handle:ae,triggerRect:T,eventHandlers:oe}}var ZD=240;function QD({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:i,onSelect:a,onDismiss:o,triggerRect:s,triggerChar:c}){let l=(0,v.useRef)(null),u=(0,v.useRef)(null);if((0,v.useEffect)(()=>{u.current?.scrollIntoView({block:`nearest`})},[i]),(0,v.useEffect)(()=>{let e=e=>{let t=e.target;l.current&&t instanceof Node&&!l.current.contains(t)&&o()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),!s||e.length===0&&!t&&!n&&!r)return null;let d=Math.min(320,window.innerWidth-16),f=Math.min(s.left,window.innerWidth-d-8),p=window.innerHeight-s.bottom,m=p<ZD&&s.top>p,h={position:`fixed`,left:`${Math.max(8,f)}px`,zIndex:50,maxWidth:`${d}px`,maxHeight:`${ZD}px`,...m?{bottom:`${window.innerHeight-s.top+4}px`}:{top:`${s.bottom+4}px`}};return(0,U.jsx)(`div`,{ref:l,className:W(`min-w-[200px] overflow-y-auto`,`bg-surface rounded-xl border p-2 shadow-md`,`animate-in fade-in-0 zoom-in-95`),style:h,role:`listbox`,"aria-label":`${c} suggestions`,children:t?(0,U.jsx)(`div`,{role:`option`,"aria-selected":!1,className:`text-muted-foreground px-3 py-2 text-sm`,children:`Loading suggestions...`}):n?(0,U.jsx)(`div`,{role:`option`,"aria-selected":!1,className:`text-destructive px-3 py-2 text-sm`,children:n}):e.length===0&&r?(0,U.jsx)(`div`,{role:`option`,"aria-selected":!1,className:`text-muted-foreground px-3 py-2 text-sm`,children:r}):e.map((e,t)=>(0,U.jsxs)(`button`,{ref:t===i?u:void 0,type:`button`,role:`option`,"aria-selected":t===i,className:W(`text-foreground flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left text-sm`,`hover:bg-surface-hover cursor-pointer transition-colors`,t===i&&`bg-surface-hover`),onMouseDown:t=>{t.preventDefault(),a(e)},children:[e.icon&&(0,U.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e.icon}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`truncate font-medium`,children:e.label}),e.description&&(0,U.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:e.description})]})]},e.value))})}function $D({texts:e,interval:t=3e3}){let[n,r]=(0,v.useState)(0);return(0,v.useEffect)(()=>{if(e.length<=1)return;let n=setInterval(()=>{r(t=>(t+1)%e.length)},t);return()=>clearInterval(n)},[e.length,t]),(0,U.jsx)(`div`,{className:`pointer-events-none absolute top-0 left-0 overflow-hidden select-none`,style:{color:`var(--prompt-area-placeholder, var(--muted-foreground))`},"aria-hidden":`true`,children:(0,U.jsx)(`div`,{className:`animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out`,children:e[n]},n)})}function eO({onClick:e,label:t,className:n}){return(0,U.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},className:W(`absolute top-0.5 right-0.5 grid h-3.5 w-3.5 cursor-pointer place-items-center`,`rounded-full bg-black/60 text-white hover:bg-black/80 dark:bg-white/60 dark:text-black dark:hover:bg-white/80`,`transition-colors`,n),"aria-label":t,children:(0,U.jsxs)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,U.jsx)(`line`,{x1:`2.75`,y1:`2.75`,x2:`7.25`,y2:`7.25`}),(0,U.jsx)(`line`,{x1:`7.25`,y1:`2.75`,x2:`2.75`,y2:`7.25`})]})})}function tO({images:e,onRemove:t,onClick:n,className:r}){return e.length===0?null:(0,U.jsx)(`div`,{className:W(`flex flex-wrap gap-2`,r),role:`list`,"aria-label":`Attached images`,children:e.map(e=>(0,U.jsxs)(`div`,{role:`listitem`,className:W(`border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border`,n&&`cursor-pointer`),onClick:()=>n?.(e),children:[(0,U.jsx)(`img`,{src:e.url,alt:e.alt??`Attached image`,className:`h-full w-full object-cover`}),e.loading&&(0,U.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent`})}),t&&(0,U.jsx)(eO,{onClick:()=>t(e),label:`Remove ${e.alt??`image`}`})]},e.id))})}function nO({className:e,children:t}){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:e,children:t})}var rO=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,U.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`})]});function iO({className:e}){return(0,U.jsx)(nO,{className:e,children:rO})}function aO({className:e}){return(0,U.jsxs)(nO,{className:e,children:[rO,(0,U.jsx)(`path`,{d:`M10 9H8`}),(0,U.jsx)(`path`,{d:`M16 13H8`}),(0,U.jsx)(`path`,{d:`M16 17H8`})]})}function oO({className:e}){return(0,U.jsxs)(nO,{className:e,children:[rO,(0,U.jsx)(`path`,{d:`M8 13h2`}),(0,U.jsx)(`path`,{d:`M14 13h2`}),(0,U.jsx)(`path`,{d:`M8 17h2`}),(0,U.jsx)(`path`,{d:`M14 17h2`})]})}function sO({className:e}){return(0,U.jsxs)(nO,{className:e,children:[rO,(0,U.jsx)(`path`,{d:`M10 12.5 8 15l2 2.5`}),(0,U.jsx)(`path`,{d:`m14 12.5 2 2.5-2 2.5`})]})}function cO({className:e}){return(0,U.jsxs)(nO,{className:e,children:[(0,U.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}),(0,U.jsx)(`circle`,{cx:`9`,cy:`9`,r:`2`}),(0,U.jsx)(`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`})]})}var lO=3;function uO(e){return e?e===`application/pdf`?`pdf`:e.includes(`spreadsheet`)||e===`text/csv`?`spreadsheet`:e.startsWith(`text/`)||e.includes(`javascript`)||e.includes(`json`)||e.includes(`xml`)?`code`:e.startsWith(`image/`)?`image`:`default`:`default`}var dO={pdf:aO,spreadsheet:oO,code:sO,image:cO,default:iO};function fO(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(1)} GB`}function pO(e){let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function mO({file:e,compact:t,onRemove:n,onClick:r}){let i=[pO(e.name),e.size==null?null:fO(e.size)].filter(Boolean).join(` · `);return(0,U.jsxs)(`div`,{role:`listitem`,className:W(`border-border relative flex flex-shrink-0 items-center gap-2 overflow-hidden rounded-lg border transition-colors`,`hover:bg-surface-hover`,t?`h-10 w-36 px-2`:`h-14 w-48 px-3`,r&&`cursor-pointer`),onClick:()=>r?.(e),children:[(()=>{let n=dO[uO(e.type)];return(0,U.jsx)(n,{className:W(`text-muted-foreground flex-shrink-0`,t?`h-4 w-4`:`h-5 w-5`)})})(),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:W(`truncate font-medium`,t?`text-xs`:`text-sm`),title:e.name,children:e.name}),!t&&i&&(0,U.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:i})]}),e.loading&&(0,U.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent`})}),n&&(0,U.jsx)(eO,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function hO({files:e,onRemove:t,onClick:n,className:r}){let[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(null),s=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;t instanceof Node&&o.current&&!o.current.contains(t)&&!s.current?.contains(t)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]),e.length===0)return null;let c=e.length>lO,l=c,u=e.length-lO,d=e.slice(0,lO);return(0,U.jsxs)(`div`,{className:W(`relative`,r),children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,role:`list`,"aria-label":`Attached files`,children:[(c?d:e).map(e=>(0,U.jsx)(mO,{file:e,compact:l,onRemove:t,onClick:n},e.id)),c&&(0,U.jsx)(`div`,{role:`listitem`,children:(0,U.jsx)(`button`,{ref:s,type:`button`,onClick:()=>a(e=>!e),className:W(`border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors`,l?`h-10 px-3 text-xs`:`h-14 px-4 text-sm`),children:i?`Show less`:`+${u} more`})})]}),i&&(0,U.jsx)(`div`,{ref:o,className:W(`bg-surface border-border absolute bottom-full left-0 z-10 mb-2 max-h-48 overflow-y-auto rounded-lg border p-2 shadow-lg`),children:(0,U.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`list`,"aria-label":`More attached files`,children:e.slice(lO).map(e=>(0,U.jsx)(mO,{file:e,compact:l,onRemove:t,onClick:n},e.id))})})]})}function gO({value:e,onChange:t,triggers:n,placeholder:r,className:i,disabled:a=!1,markdown:o,normalizeBullets:s,onSubmit:c,onEscape:l,onChipClick:u,onChipAdd:d,onChipDelete:f,onLinkClick:p,onPaste:m,onUndo:h,onRedo:g,minHeight:_=80,maxHeight:y,autoFocus:b=!1,autoGrow:x=!1,"aria-label":S,"data-test-id":C,images:w=[],imagePosition:T=`above`,onImagePaste:E,onImageRemove:D,onImageClick:O,files:k=[],filePosition:A=`above`,onFileRemove:j,onFileClick:M,onKeyDown:N,onBlur:P,onRawPaste:F,submitOnEnter:I,spellCheck:L,maxLength:R,"aria-describedby":z,ref:ee}){let{editorRef:B,activeTrigger:V,suggestions:te,suggestionsLoading:ne,suggestionsError:H,selectedSuggestionIndex:re,handleInput:ie,handleKeyDown:ae,handleClick:oe,handleMouseDown:se,selectSuggestion:ce,dismissTrigger:le,handle:ue,triggerRect:de,eventHandlers:fe}=XD({value:e,onChange:t,triggers:n,disabled:a,onSubmit:c,onEscape:l,onChipClick:u,onChipAdd:d,onChipDelete:f,onLinkClick:p,onPaste:m,onRawPaste:F,onUndo:h,onRedo:g,onImagePaste:E,markdown:o,normalizeBullets:s,submitOnEnter:I,maxLength:R});(0,v.useImperativeHandle)(ee,()=>ue,[ue]),(0,v.useEffect)(()=>{b&&B.current?.focus()},[b,B]);let[pe,me]=(0,v.useState)(!1),[he,ge]=(0,v.useState)(void 0),_e=(0,v.useCallback)(()=>{let e=B.current;if(!e)return;e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${t}px`,ge(t)},[B]),ve=(0,v.useCallback)(()=>{x&&(me(!0),_e())},[x,_e]),ye=(0,v.useCallback)(()=>{fe.onBlur(),x&&setTimeout(()=>{let e=B.current;if(!e)return;let t=document.activeElement;t&&e.parentElement?.contains(t)||(me(!1),ge(void 0))},150)},[fe,x,B]),be=(0,v.useCallback)(()=>{ie(),x&&pe&&_e()},[ie,x,pe,_e]);(0,v.useEffect)(()=>{x&&pe&&requestAnimationFrame(()=>_e())},[e,x,pe,_e]);let[xe,Se]=(0,v.useState)(!1),Ce=(0,v.useRef)(null);(0,v.useEffect)(()=>x?(Ce.current=setTimeout(()=>{if(pe){Se(!1);return}let e=B.current;e&&Se(e.scrollHeight>e.clientHeight)},pe?0:160),()=>{Ce.current!==null&&clearTimeout(Ce.current)}):void 0,[x,pe,e,B]);let we=(0,v.useMemo)(()=>{if(!x){let e={minHeight:`${_}px`};return y&&(e.maxHeight=`${y}px`,e.overflowY=`auto`),e}return{height:pe&&he?`${he}px`:`${_}px`,minHeight:`${_}px`,maxHeight:y?`${y}px`:`70dvh`,overflowY:pe?`auto`:`hidden`,transition:`height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)`}},[x,_,y,pe,he]),Te=(0,v.useCallback)(e=>{N?.(e),!e.defaultPrevented&&ae(e)},[N,ae]),Ee=(0,v.useCallback)(e=>{P?.(e),ye()},[P,ye]),De=e.length===0||e.length===1&&e[0].type===`text`&&e[0].text===``,Oe=w.length>0?(0,U.jsx)(tO,{images:w,onRemove:D,onClick:O,className:T===`above`?`pb-2`:`pt-2`}):null,ke=k.length>0?(0,U.jsx)(hO,{files:k,onRemove:j,onClick:M,className:A===`above`?`pb-2`:`pt-2`}):null;return(0,U.jsxs)(`div`,{className:W(`prompt-area-container relative text-sm leading-relaxed`,i),children:[T===`above`&&Oe,A===`above`&&ke,(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`div`,{ref:B,contentEditable:!a,suppressContentEditableWarning:!0,role:`textbox`,"aria-label":S??`Text input`,"aria-multiline":`true`,"aria-disabled":a||void 0,"aria-describedby":z,"data-test-id":C,spellCheck:L,className:W(`prompt-area-editor`,`w-full min-w-0 break-words whitespace-pre-wrap outline-none`,a&&`cursor-not-allowed opacity-50`),style:we,onFocus:ve,onInput:x?be:ie,onKeyDown:Te,onMouseDown:se,onClick:oe,onPaste:fe.onPaste,onCopy:fe.onCopy,onCut:fe.onCut,onDrop:fe.onDrop,onDragOver:fe.onDragOver,onCompositionStart:fe.onCompositionStart,onCompositionEnd:fe.onCompositionEnd,onBlur:Ee}),x&&xe&&!pe&&(0,U.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-auto absolute right-0 bottom-0 left-0 cursor-pointer`,style:{height:`32px`},onClick:()=>B.current?.focus(),children:(0,U.jsx)(`div`,{className:`h-full w-full`,style:{background:`linear-gradient(to bottom, transparent, color-mix(in srgb, var(--prompt-area-surface, var(--background)) 80%, transparent), var(--prompt-area-surface, var(--background)))`}})}),De&&r&&(Array.isArray(r)?(0,U.jsx)($D,{texts:r}):(0,U.jsx)(`div`,{className:`pointer-events-none absolute top-0 left-0 select-none`,style:{color:`var(--prompt-area-placeholder, var(--muted-foreground))`},"aria-hidden":`true`,children:r}))]}),A===`below`&&ke,T===`below`&&Oe,V&&V.config.mode===`dropdown`&&(0,U.jsx)(QD,{suggestions:te,loading:ne,error:H,emptyMessage:V.config.emptyMessage,selectedIndex:re,onSelect:ce,onDismiss:le,triggerRect:de,triggerChar:V.config.char})]})}function _O(e={}){let{initialValue:t=[]}=e,[n,r]=(0,v.useState)(t),i=(0,v.useRef)(null),a=(0,v.useMemo)(()=>QT(n),[n]),o=(0,v.useMemo)(()=>n.length===0||n.every(e=>e.type===`text`&&e.text.trim()===``),[n]),s=(0,v.useMemo)(()=>n.some(e=>e.type===`chip`),[n]),c=(0,v.useMemo)(()=>n.filter(e=>e.type===`chip`),[n]);return{bind:(0,v.useMemo)(()=>({ref:i,value:n,onChange:r}),[n]),plainText:a,isEmpty:o,hasChips:s,chips:c,clear:(0,v.useCallback)(()=>{i.current?i.current.clear():r([])},[]),focus:(0,v.useCallback)(()=>i.current?.focus(),[]),blur:(0,v.useCallback)(()=>i.current?.blur(),[]),insertChip:(0,v.useCallback)(e=>i.current?.insertChip(e),[])}}function vO(e={}){let{char:t=`@`,...n}=e;return{char:t,position:`any`,mode:`dropdown`,chipStyle:`pill`,accessibilityLabel:`mention`,...n}}function yO(e={}){let{char:t=`/`,position:n=`any`,...r}=e;return{char:t,position:n,mode:`dropdown`,chipStyle:`inline`,accessibilityLabel:`command`,...r}}function bO(e={}){let{char:t=`#`,...n}=e;return{char:t,position:`any`,mode:`dropdown`,chipStyle:`pill`,resolveOnSpace:!0,accessibilityLabel:`tag`,...n}}function xO(e){let{char:t,...n}=e;return{char:t,position:`start`,mode:`launch`,...n}}var SO=[`attention`,`working`,`idle`,`ended`],CO={attention:`Needs attention`,working:`Working`,idle:`Idle`,ended:`Ended`};function wO(e){return e.pendingPermissionCount>0||e.status===`awaiting_approval`?`attention`:e.status===`failed`||e.status===`closed`?`ended`:e.status===`running`||e.status===`starting`||TO(e).length>0?`working`:`idle`}function TO(e){return(e.subagents??[]).filter(e=>e.status===`running`)}function EO(e,t){if(t===`none`)return[];let n=e.subagents??[];return t===`all`?[...n]:n.filter(e=>e.status!==`done`)}function DO(e){return e.isAgent===!0||(e.agentType?.trim()??``)!==``}function OO(e){let t=e.agentType?.trim(),n=e.description?.trim();return t&&n?`${t} · ${n}`:t||n||`Sub-agent`}var kO={search:``,gateways:[],adapters:[],states:[],projects:[],scoped:!0,groupBy:`state`,sortBy:`recent`,subagents:`active`};function AO(e){return[...new Set(e.map(e=>e.adapter))].sort()}function jO(e){let t=new Map;for(let n of e)t.set(NO(n),PO(n));return[...t].map(([e,t])=>({key:e,label:t})).sort((e,t)=>e.label.toLowerCase().localeCompare(t.label.toLowerCase()))}function MO(e){return e.title??e.id.slice(0,8)}function NO(e){return`${e.hostId}:${BO(e.info.project?.root??e.info.cwd)}`}function PO(e){return e.info.project?.shortcode||FO(e)}function FO(e){let t=e.info.project?.name;if(t)return t;let n=BO(e.info.cwd);return n.slice(n.lastIndexOf(`/`)+1)||`No project`}function IO(e){let t=e.info.project?.root;if(t===void 0||!e.info.cwd)return;let n=BO(t),r=BO(e.info.cwd);if(r!==n&&r.startsWith(`${n}/`))return r.slice(n.length+1)||void 0}function LO(e){return typeof e.meta?.jobId==`string`}function RO(e,t){return(e.shells??[]).filter(e=>e.status===`running`?t-e.startedAt>=Rk:e.endedAt===void 0||typeof e.exitCode!=`number`||e.exitCode===0?!1:e.endedAt-e.startedAt>=3e3&&t-e.endedAt<6e4)}function zO(e,t){return!t||MO(e.info).toLowerCase().includes(t)||e.info.cwd.toLowerCase().includes(t)||(e.info.project?.name.toLowerCase().includes(t)??!1)||(e.info.project?.shortcode?.toLowerCase().includes(t)??!1)||e.hostName.toLowerCase().includes(t)||e.adapter.toLowerCase().includes(t)||e.info.id.startsWith(t)}function BO(e){return e.replace(/\\/g,`/`).replace(/\/+$/,``)}function VO(e,t){let n=BO(e),r=BO(t);return r===n||r.startsWith(`${n}/`)}function HO(e,t){return t.roots.some(t=>(t.hostId?t.hostId.toLowerCase()===e.hostId.toLowerCase():e.local)&&VO(t.path,e.info.cwd))}function UO(e,t){return e.scoped&&t!==void 0}function WO(e,t,n){let r=t.search.trim().toLowerCase(),i=UO(t,n)?n:void 0;return e.filter(e=>(t.gateways.length===0||t.gateways.includes(e.hostId))&&(t.adapters.length===0||t.adapters.includes(e.adapter))&&(t.states.length===0||t.states.includes(e.state))&&(!t.projects?.length||t.projects.includes(NO(e)))&&(!i||HO(e,i))&&zO(e,r))}function GO(e,t){return t===`gateway`?e.hostId:t===`adapter`?e.adapter:t===`project`?NO(e):e.state}function KO(e,t){return t===`gateway`?e.hostName:t===`adapter`?e.adapter:t===`project`?PO(e):CO[e.state]}function qO(e,t){return t===`state`?String(SO.indexOf(e.state)):KO(e,t).toLowerCase()}function JO(e,t){return(t.info.lastActivityAt??t.info.createdAt)-(e.info.lastActivityAt??e.info.createdAt)}function Dee(e,t,n){return n===`recent`?JO(e,t):n===`name`?MO(e.info).localeCompare(MO(t.info),void 0,{sensitivity:`base`})||JO(e,t):qO(e,n).localeCompare(qO(t,n))||JO(e,t)}function Oee(e,t){let n=[...e].sort((e,n)=>Dee(e,n,t.sortBy));if(t.groupBy===`none`)return n.length?[{key:`all`,rows:n}]:[];let r=t.groupBy,i=new Map;for(let e of n){let t=GO(e,r),n=i.get(t);n?n.rows.push(e):i.set(t,{key:t,label:KO(e,r),rank:qO(e,r),rows:[e]})}return[...i.values()].sort((e,t)=>e.rank.localeCompare(t.rank))}function kee(e,t,n,r){if(n>=r)return;let i=[];t&&UO(e,t)&&i.push(t.label);let a=+!!e.gateways.length+ +!!e.adapters.length+ +!!e.states.length+ +!!e.projects?.length;return a>0&&i.push(`${a} filter${a===1?``:`s`}`),e.search.trim()&&i.push(`search`),{shown:n,total:r,causes:i}}function Aee(e){return e.search.trim().length>0||e.gateways.length>0||e.adapters.length>0||e.states.length>0||(e.projects?.length??0)>0}function YO(e){return{...kO,scoped:!1,groupBy:e.groupBy,sortBy:e.sortBy,subagents:e.subagents}}function jee(e){if(typeof e!=`object`||!e)return;let t=e,n=t.status;if(n!==`pending`&&n!==`in_progress`&&n!==`completed`)return;let r=typeof t.content==`string`?t.content.trim():``;if(r===``)return;let i=typeof t.activeForm==`string`?t.activeForm.trim():``;return{status:n,text:n===`in_progress`&&i!==``?i:r}}function Mee(e){let t=e?.todos;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=jee(e);if(t===void 0)return;n.push(t)}return n}function Nee(e){switch(e){case`in_progress`:return`running`;case`completed`:return`done`;default:return`pending`}}function Pee(e){let t=(e.checklist??[]).map((e,t)=>({key:`checklist:${t}`,label:e.text,source:`checklist`,state:Nee(e.status)})),n=(e.subagents??[]).filter(e=>!DO(e)).map(e=>({key:`spawn:${e.toolUseId}`,label:e.description?.trim()||`Task`,source:`spawn`,state:e.status,detail:e.toolCount>0?String(e.toolCount):void 0,toolUseId:e.toolUseId}));return[...t,...n]}function XO(e){let t=0,n=0,r=0;for(let i of e)i.state===`done`?t+=1:i.state===`running`?n+=1:i.state===`failed`&&(r+=1);return{total:e.length,done:t,running:n,failed:r}}function Fee(e){return e.total===0?void 0:`${e.done}/${e.total}`}function Iee(e,t){return t?[...e]:e.filter(e=>e.state!==`done`)}var ZO=`2026-09-19`,QO=`List rates as of ${ZO}. A subscription is a flat fee, so this is what the same tokens would have cost on the pay-as-you-go API, not a bill.`,Lee=.005,$O=1e6,Ree=864e5,ek=[`input`,`output`,`cacheWrite5m`,`cacheWrite1h`,`cacheRead`];function tk(e,t,n){return{input:e,output:t,cacheWrite5m:e*1.25,cacheWrite1h:e*2,cacheRead:n??e*.1}}function nk(e,t,n){return{input:e,output:t,cacheWrite5m:e,cacheWrite1h:e,cacheRead:n}}var rk={"claude-fable-5-1":tk(10,50,.25),"claude-fable-5":tk(10,50),"claude-mythos-5-1":tk(10,50,.25),"claude-mythos-5":tk(10,50),"claude-opus-5":tk(5,25),"claude-opus-4-8":tk(5,25),"claude-opus-4-7":tk(5,25),"claude-opus-4-6":tk(5,25),"claude-opus-4-5":tk(5,25),"claude-sonnet-5":tk(2,10),"claude-sonnet-4-6":tk(3,15),"claude-sonnet-4-5":tk(3,15),"claude-haiku-4-5":tk(1,5),"gpt-6-astra":nk(10,50,1),"gpt-5.6-sol":nk(4,20,.4),"gpt-5.6-terra":nk(2,12,.2),"gpt-5.6-luna":nk(.2,1.2,.02),"gpt-5.5":nk(5,30,.5),"gpt-5.4":nk(2.5,15,.25),"gpt-5.2":nk(1.75,14,.175),"gpt-5.1":nk(1.25,10,.125),"gpt-5":nk(1.25,10,.125)},ik=rk;function ak(e){if(typeof e!=`object`||!e)return;let t=e,n={input:0,output:0,cacheWrite5m:0,cacheWrite1h:0,cacheRead:0};for(let e of ek){let r=t[e];if(typeof r!=`number`||!Number.isFinite(r)||r<0)return;n[e]=r}return n}function ok(e,t=rk){let n={},r=[];if(typeof e==`object`&&e)for(let[t,i]of Object.entries(e)){let e=ak(i),a=uk(t);if(!e||a===``){r.push(t);continue}n[a]=e}return{pricing:{...t,...n},overrides:n,dropped:r}}function sk(){return ik}function ck(e,t=ZO){let n=Date.parse(t);return Number.isFinite(n)?Math.floor((e-n)/Ree):0}function lk(e,t=ZO){let n=ck(e,t);if(!(n<=90))return`This rate table is ${n} days old, so check the vendor's current list prices before you trust the total.`}function uk(e){let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1)).toLowerCase().replace(/\[[^\]]*\]$/,``).replace(/^(?:[a-z]+\.)*anthropic\./,``).replace(/[@-]\d{8}$/,``).replace(/-v\d+:\d+$/,``)}function dk(e,t=sk()){return e?t[uk(e)]:void 0}function fk(e){return e.input+e.output+e.cacheWrite5m+e.cacheWrite1h+e.cacheRead}function pk(e){return Object.entries(e).filter(([,e])=>e.costBasis===`unknown`).map(([e])=>uk(e))}function mk(e){return{input:0,output:0,cacheWrite:0,cacheRead:0,total:0,unpriced:!0,unpricedTokens:e,unpricedShare:+(e>0)}}function hk(e,t,n=sk()){let r=dk(t,n);if(!r)return mk(fk(e));let i=e.input/$O*r.input,a=e.output/$O*r.output,o=e.cacheWrite5m/$O*r.cacheWrite5m+e.cacheWrite1h/$O*r.cacheWrite1h,s=e.cacheRead/$O*r.cacheRead;return{input:i,output:a,cacheWrite:o,cacheRead:s,total:i+a+o+s,unpriced:!1,unpricedTokens:0,unpricedShare:0}}function gk(e,t=sk()){let n={input:0,output:0,cacheWrite:0,cacheRead:0,total:0,unpriced:!1,unpricedTokens:0,unpricedShare:0},r=Object.entries(e),i=!1,a=0;for(let[e,o]of r){a+=fk(o);let r=hk(o,e,t);if(r.unpriced){n.unpricedTokens+=r.unpricedTokens;continue}i=!0,n.input+=r.input,n.output+=r.output,n.cacheWrite+=r.cacheWrite,n.cacheRead+=r.cacheRead,n.total+=r.total}return n.unpriced=!i&&r.length>0,n.unpricedShare=a>0?n.unpricedTokens/a:0,n}var _k=new Set([`.`,`,`,`;`,`:`,`!`,`?`,`)`,`]`,`}`,`"`,`'`]),vk=/^[\p{L}\p{N}][\p{L}\p{N}\-_]*$/u;function yk(e,t){return(e??``).normalize(`NFKC`).replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-+|-+$/g,``).slice(0,64).replace(/^-+|-+$/g,``)||t.slice(0,8)}function bk(e){return e.normalize(`NFKC`).toLowerCase().replace(/[_\s]+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``)}function xk(e){return e.length>0&&e.length<=64&&vk.test(e)}var Sk={fs_read:`Reading a file`,fs_write:`Writing a file`,fs_list:`Listing files`,eval_script:`Running a script`,web_fetch:`Fetching a web page`,web_search:`Searching the web`,deliver_file:`Delivering a file`,download:`Downloading a file`,CodexCommand:`Running a command`,CodexFileChange:`Editing a file`,CodexWebSearch:`Searching the web`,CodexImageGeneration:`Generating an image`,CodexImageView:`Viewing an image`,peers_list:`Listing peer sessions`,peers_peek:`Peeking at a peer session`,peers_send:`Messaging a peer session`,mcp__workerdeck__peers_list:`Listing peer sessions`,mcp__workerdeck__peers_peek:`Peeking at a peer session`,mcp__workerdeck__peers_send:`Messaging a peer session`};function Ck(e,t){return wk(t?.[e]??Sk[e],e)}function wk(e,t){if(typeof e!=`string`)return;let n=[...e].map(e=>e<` `||e===``?` `:e).join(``).replace(/\s+/g,` `).trim();if(n===``||n===t)return;let r=[...n];return r.length>64?r.slice(0,63).join(``)+`…`:n}var Tk=[`peers_send`,`mcp__workerdeck__peers_send`];function Ek(e){return Tk.includes(e)}function Dk(e,t){let n={};for(let[t,r]of Object.entries(e.rateLimits??{}))n[t]={info:r,updatedAt:e.updatedAt??0};for(let[e,r]of Object.entries(t??{}))n[e]=r;return n}var Ok=9e5;function kk(e,t){return e.inferredReset||e.updatedAt===void 0?!1:t-e.updatedAt>Ok}function Ak(e){let t=Object.entries(e??{}).filter(([,e])=>e.info.utilization!==void 0).map(([e,t])=>({key:e,info:t.info,updatedAt:t.updatedAt,inferredReset:t.inferredReset})),n=[`five_hour`,`seven_day`].flatMap(e=>t.filter(t=>t.key===e)),r=t.filter(e=>e.key.startsWith(`seven_day_`)).sort((e,t)=>e.key.localeCompare(t.key));return[...n,...r]}function jk(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))t[n]=r.info;return t}var Mk=2592e6,Nk=6e4;function Pk(e,t){return`${e}:${t}`}var Fk=class{#e;#t;constructor(e){this.#e=e,this.#t={...e.read()}}get(e,t){return this.#t[Pk(e,t)]}all(){return this.#t}mark(e,t,n,r=Date.now()){let i=Pk(e,t),a=this.#t[i],o={itemCount:Math.max(a?.itemCount??0,n.itemCount??0),activity:Math.max(a?.activity??0,n.activity??0),prose:n.prose===void 0?a?.prose:Math.max(a?.prose??0,n.prose),turns:Math.max(a?.turns??0,n.turns??0),seenAt:r};return a&&a.itemCount===o.itemCount&&a.activity===o.activity&&a.prose===o.prose&&a.turns===o.turns&&o.seenAt-a.seenAt<Nk?!1:(this.#t[i]=o,this.#e.write(this.#n(r)),!0)}forget(e,t){let n=Pk(e,t);n in this.#t&&(delete this.#t[n],this.#e.write(this.#t))}#n(e){let t=e-Mk;for(let[e,n]of Object.entries(this.#t))n.seenAt<t&&delete this.#t[e];return this.#t}};function Ik(e,t){return e?t.proseCount===void 0?t.activityCount===void 0?Math.max(0,(t.turns??0)-e.turns):Math.max(0,t.activityCount-e.activity):Math.max(0,t.proseCount-(e.prose??t.proseCount)):0}function Lk(e){return(Array.isArray(e.questions)?e.questions:[]).flatMap(e=>{let t=e;if(typeof t.question!=`string`||!Array.isArray(t.options))return[];let n=t.options.filter(e=>typeof e?.label==`string`);return n.length===0?[]:[{question:t.question,header:typeof t.header==`string`?t.header:``,options:n,multiSelect:t.multiSelect===!0}]})}var Rk=3e3,zk={claude:{interactiveApprovals:!0,permissionModes:[`default`,`acceptEdits`,`bypassPermissions`,`plan`,`dontAsk`,`auto`],defaultPermissionMode:`default`,resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!0,sessionMcpServers:!0,slashCommands:!0,clearContext:!0,skillsList:!1,settingSources:!0,budgets:!0,attachments:[`image`,`pdf`,`text`],reasoningEfforts:[`low`,`medium`,`high`,`xhigh`,`max`],vfs:!1,hostCwd:!0,systemInstructions:!0,streaming:`token`},codex:{interactiveApprovals:!0,permissionModes:[`default`,`acceptEdits`,`bypassPermissions`,`auto`],defaultPermissionMode:`default`,resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,clearContext:!0,skillsList:!0,settingSources:!1,budgets:!1,attachments:[`image`,`text`],reasoningEfforts:[`minimal`,`low`,`medium`,`high`,`xhigh`],vfs:!1,hostCwd:!0,systemInstructions:!0,streaming:`token`},provider:{interactiveApprovals:!1,permissionModes:[`default`,`bypassPermissions`,`dontAsk`],defaultPermissionMode:`default`,resume:!1,resumeBackfill:!1,listSessions:!1,contextUsage:!1,rateLimits:!1,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,clearContext:!0,skillsList:!1,settingSources:!1,budgets:!1,attachments:[`image`,`pdf`,`text`],vfs:!0,hostCwd:!1,systemInstructions:!0,streaming:`token`}};function Bk(e){let t=/^Delivered to (.+) \(([^()]+)\);/.exec(e);if(t)return{sessionId:t[2],name:t[1]};let n=/^Delivered to ([^()\s]+);/.exec(e);return n?{sessionId:n[1]}:void 0}var Vk={status:`starting`,capabilities:zk.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},Hk=`streaming`,Uk=`streaming-thinking`,Wk=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/,Gk=/<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>/g,Kk=`<local-command-caveat>`,qk=/^\[\.\.\. more output \.\.\.\]$/,Jk=/^\[(exit -?\d+|killed|timed out|ended|failed to start)[^\]]*\]$/;function Yk(e,t){let n=(Wk.exec(t.trim())?.[2]??t).split(`
|
|
45
|
+
`);n[0]?.startsWith(`$ `)&&n.shift(),e.status===`exited`&&n.length>0&&Jk.test(n[n.length-1])&&n.pop();let r=!1;return{text:n.filter(e=>!qk.test(e)||(r=!0,!1)).join(`
|
|
46
|
+
`).trimEnd(),truncated:r}}function Xk(e,t,n,r){let i=Yk(t,n);return{kind:`shell`,id:e,shell:t,text:i.text,truncated:i.truncated,...r?.expanded!==void 0&&{expanded:r.expanded}}}function Zk(e,t){return e.find(e=>e.kind===`shell`&&e.shell.id===t)}var Qk=/<command-name>([\s\S]*?)<\/command-name>/,$k=/<command-args>([\s\S]*?)<\/command-args>/;function eA(e){return oA(e).some(e=>e.type===`text`&&e.text.trimStart().startsWith(Kk))}function tA(e){return e==null?Hk:`${Hk}:${e}`}function nA(e){return e==null?Uk:`${Uk}:${e}`}function rA(e){return e.kind===`assistant_text`&&e.id.startsWith(Hk)||e.kind===`thinking`&&e.id.startsWith(Uk)}function iA(e){return e===void 0?``:typeof e==`string`?e:e.map(e=>typeof e.text==`string`?e.text:``).filter(Boolean).join(`
|
|
47
|
+
`)}function aA(e,t){if(!Array.isArray(e))return;let n=e.flatMap(e=>e.type===`image_ref`?[{partIndex:Number(e.part_index),mediaType:String(e.media_type??`application/octet-stream`),bytes:Number(e.bytes??0),sourceSeq:t}]:[]);return n.length>0?n:void 0}function oA(e){return typeof e==`string`?[{type:`text`,text:e}]:e}function sA(e){if(e.type===`text`)return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}function cA(e){let t=Qk.exec(e)?.[1]?.trim();if(!t)return;let n=$k.exec(e)?.[1]?.trim();return n?`${t} ${n}`:t}function lA(e,t){let n=e.findIndex(e=>e.id===t.id&&e.kind===t.kind);if(n===-1)return[...e,t];let r=[...e];return r[n]=t,r}function uA(e,t){let n=t.engine??e.engine;return{...e,status:e.lastSeq===0?t.status:e.status,model:e.model??t.model,permissionMode:e.permissionMode??t.permissionMode,cwd:e.cwd??t.cwd,sdkSessionId:e.sdkSessionId??t.sdkSessionId,engine:n,capabilities:t.capabilities??zk[n??`claude`],totalCostUsd:e.totalCostUsd||(t.totalCostUsd??0),costUsd:e.costUsd??t.costUsd,usageByModel:e.usageByModel??t.usageByModel,session:t}}function dA(e,t,n){let r=!1,i=e.items.map(e=>e.kind!==`tool_call`||e.id!==t||!e.result?.truncated?e:(r=!0,{...e,result:{text:n,isError:e.result.isError,...e.result.images&&{images:e.result.images}}}));return r?{...e,items:i}:e}function fA(e,t,n){let r=Zk(e.items,t);if(!r)return e;let i=n===void 0?{...r,missing:!0}:{...r,shell:n,missing:void 0};return{...e,items:e.items.map(e=>e===r?i:e)}}function pA(e,t,n){let r=Zk(e.items,t);return r?{...e,items:e.items.map(e=>e===r?{...r,expanded:n,missing:void 0}:e)}:e}function mA(e,t){if(t.seq<=e.lastSeq)return e;let n={...e,lastSeq:t.seq};switch(t.type){case`system_init`:return{...n,model:t.model,cwd:t.cwd,sdkSessionId:t.sdkSessionId,permissionMode:t.permissionMode};case`status_changed`:return{...n,status:t.status,statusDetail:t.detail};case`capabilities`:return{...n,models:t.models,commands:t.commands,defaultModel:t.defaultModel??n.defaultModel};case`skills`:return{...n,skills:t.skills};case`checklist`:return{...n,checklist:t.items.length>0?t.items:void 0};case`tool_titles`:return{...n,toolTitles:{...n.toolTitles,...t.titles}};case`file_produced`:return{...n,producedFiles:{...n.producedFiles,[t.path]:{fileId:t.fileId,...t.mediaType?{mediaType:t.mediaType}:{},...t.bytes===void 0?{}:{bytes:t.bytes}}}};case`model_changed`:return t.model===void 0?n:{...n,model:t.model};case`permission_mode_changed`:return{...n,permissionMode:t.mode};case`context_usage`:return{...n,contextUsage:t.usage};case`rate_limit`:{let e=t.info.rateLimitType;return e?{...n,rateLimits:{...n.rateLimits,[e]:t.info},rateLimitsUpdatedAt:t.ts}:n}case`plan_info`:return{...n,subscriptionType:t.subscriptionType};case`conversation_reset`:return{...n,items:[],contextUsage:void 0,checklist:void 0,sdkSessionId:t.sdkSessionId??n.sdkSessionId};case`context_compacted`:return{...n,items:lA(n.items,{kind:`compaction`,id:t.uuid,parentToolUseId:t.parentToolUseId??null,pending:t.pending,trigger:t.trigger,preTokens:t.preTokens,postTokens:t.postTokens,error:t.error})};case`user_message`:{let e=n.items;for(let n of oA(t.message.content))if(n.type===`tool_result`){let r=n,i=r.is_error===!0;e=e.map(e=>e.kind===`tool_call`&&e.id===r.tool_use_id?{...e,status:i?`failed`:`settled`,result:{text:iA(r.content),isError:i,...r.truncated&&{truncated:!0,totalChars:r.total_chars,sourceSeq:t.seq},...aA(r.content,t.seq)&&{images:aA(r.content,t.seq)}},...t.patch&&{patch:t.patch}}:e)}else if(n.type===`text`){let r=n.text,i=t.uuid??`user-${t.seq}`,a=Wk.exec(r.trim());if(t.shell){let n=e.find(e=>e.kind===`shell`&&e.id===i);e=lA(e,Xk(i,t.shell,r,n))}else if(a)e=lA(e,{kind:`notice`,id:i,level:a[1]===`stderr`?`error`:`info`,text:a[2].trim()});else if(r.trimStart().startsWith(Kk)){let t=0;for(let n of r.matchAll(Gk))e=lA(e,{kind:`notice`,id:`${i}#${t++}`,level:n[1]===`stderr`?`error`:`info`,text:n[2].trim()})}else(!t.synthetic||eA(t.message.content))&&(e=lA(e,{kind:`user`,id:t.uuid??`user-${t.seq}`,text:cA(r)??r,attachments:t.attachments,...t.origin&&{origin:t.origin},...t.parentToolUseId!=null&&{parentToolUseId:t.parentToolUseId}}))}return{...n,items:e}}case`assistant_message`:{let e=tA(t.parentToolUseId),r=nA(t.parentToolUseId),i=n.items.find(e=>e.kind===`thinking`&&e.id===r)?.text??``,a=n.items.filter(t=>(t.kind!==`assistant_text`||t.id!==e)&&(t.kind!==`thinking`||t.id!==r));return oA(t.message.content).forEach((e,n)=>{let r=`${t.uuid}-${n}`;if(e.type===`text`)a=lA(a,{kind:`assistant_text`,id:r,text:e.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(e.type===`thinking`){let n=e.thinking||i;if(i=``,n.trim()===``)return;a=lA(a,{kind:`thinking`,id:r,text:n,parentToolUseId:t.parentToolUseId})}else if(e.type===`tool_use`){let n=e;a=lA(a,{kind:`tool_call`,id:n.id,name:n.name,input:n.input,parentToolUseId:t.parentToolUseId,status:`running`,ts:t.ts})}}),{...n,items:a}}case`stream_delta`:{let e=t.event;if(e.type!==`content_block_delta`)return n;if(e.delta?.type===`text_delta`){let r=tA(t.parentToolUseId),i={kind:`assistant_text`,id:r,text:(n.items.find(e=>e.kind===`assistant_text`&&e.id===r)?.text??``)+(e.delta.text??``),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:lA(n.items,i)}}if(e.delta?.type===`thinking_delta`){let r=nA(t.parentToolUseId),i=(n.items.find(e=>e.kind===`thinking`&&e.id===r)?.text??``)+(e.delta.thinking??``);if(i.trim()===``)return n;let a={kind:`thinking`,id:r,text:i,parentToolUseId:t.parentToolUseId};return{...n,items:lA(n.items,a)}}return n}case`turn_result`:return{...n,totalCostUsd:t.totalCostUsd,costUsd:t.costUsd??n.costUsd,usageByModel:t.usageByModel??n.usageByModel,items:[...n.items.map(e=>{if(!rA(e))return e;let n=`parentToolUseId`in e&&e.parentToolUseId?`-${e.parentToolUseId}`:``;return e.kind===`assistant_text`?{...e,id:`text-${t.seq}${n}`,streaming:!1}:{...e,id:`thinking-${t.seq}${n}`}}),{kind:`turn_result`,id:`turn-${t.seq}`,subtype:t.subtype,isError:t.isError,durationMs:t.durationMs,totalCostUsd:t.totalCostUsd,costUsd:t.costUsd,errors:t.errors}]};case`permission_requested`:return{...n,pendingApprovals:[...n.pendingApprovals,t.request]};case`permission_resolved`:return{...n,pendingApprovals:n.pendingApprovals.filter(e=>e.id!==t.requestId)};case`execution_dispatched`:return{...n,items:n.items.map(e=>e.kind===`tool_call`&&e.id===t.executionId?{...e,status:t.deferred?`deferred`:`pending`,executionId:t.executionId,backend:t.backend}:e)};case`execution_result`:return{...n,items:n.items.map(e=>e.kind===`tool_call`&&e.id===t.executionId?{...e,status:`settled`,executionId:t.executionId,result:{text:sA(t.output),isError:!1},logs:t.logs??e.logs}:e)};case`execution_failed`:return{...n,items:n.items.map(e=>e.kind===`tool_call`&&e.id===t.executionId?{...e,status:`failed`,executionId:t.executionId,result:{text:`${t.reason}: ${t.error}`,isError:!0},logs:t.logs??e.logs}:e)};case`file_delivered`:return{...n,items:[...n.items,{kind:`file_delivered`,id:`file-${t.seq}`,path:t.path,bytes:t.bytes,description:t.description}]};case`session_error`:return{...n,items:[...n.items,{kind:`notice`,id:`err-${t.seq}`,level:`error`,text:t.message}]};case`session_closed`:return{...n,items:[...n.items,{kind:`notice`,id:`closed-${t.seq}`,level:`info`,text:`Session closed (${t.reason})`}]};default:return n}}var hA=5,gA=new Map;function _A(e,t){return`${e.identityKey}\u0000${t}`}function vA(e){return gA.get(e)}function yA(e,t){if(gA.delete(e),gA.set(e,t),gA.size>hA){let e=gA.keys().next().value;e!==void 0&&gA.delete(e)}}function bA(e){gA.delete(e)}function xA(e,t){return`${e}:${t}`}function SA(e){let t=xA(e.resyncSeq,e.key),n=e.cacheEnabled&&!e.skipCache?e.warm:void 0,r=e.seededFor!==t,i=r?n??Vk:e.current;return{held:i,seed:r,seedToken:t,...i.lastSeq>0?{afterSeq:i.lastSeq}:{}}}function CA(e){return e.cacheEnabled&&!e.skipCache&&e.parting.lastSeq>0&&e.parting.session!==void 0}function wA(e,t){return t.type===`transcript_seed`?t.state:t.type===`transcript_hydrate_result`?dA(e,t.toolUseId,t.text):t.type===`transcript_hydrate_shell`?fA(e,t.shellId,t.shell):t.type===`transcript_hydrate_shell_output`?pA(e,t.shellId,t.text):t.type===`attached`?uA(e,t.session):mA(e,t)}var TA=3;function EA(e){return e.replayingFrom===0&&e.session.lastSeq>0?e.session.lastSeq:void 0}function DA(e,t){return e.replayingFrom===0||t.lastSeq===0?!1:e.session.lastSeq<t.lastSeq||t.session!==void 0&&e.session.createdAt!==t.session.createdAt}var OA=1500;function kA(e,t,n){let[r,i]=(0,v.useReducer)(wA,void 0,()=>(n?.cacheTranscript!==!1&&t!==void 0?vA(_A(e,t)):void 0)??Vk),[a,o]=(0,v.useState)(`reconnecting`),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(rk),[p,m]=(0,v.useState)(),[h,g]=(0,v.useState)(0),[_,y]=(0,v.useState)(),b=(0,v.useRef)(null),x=(0,v.useRef)(n);x.current=n;let S=(0,v.useRef)(r);S.current=r;let C=(0,v.useRef)(xA(0,t===void 0?``:_A(e,t))),w=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!t)return;let n=x.current?.cacheTranscript!==!1,r=_A(e,t),a=SA({resyncSeq:h,key:r,seededFor:C.current,current:S.current,cacheEnabled:n,skipCache:w.current,warm:vA(r)});w.current=!1,a.seed&&(i({type:`transcript_seed`,state:a.held}),C.current=a.seedToken);let s=e.attach(t,{truncateResults:!0,imageRefs:!0,...a.afterSeq===void 0?{}:{afterSeq:a.afterSeq}});b.current=s,y(s);let l=s.on(`event`,e=>i(e)),d=s.on(`attached`,e=>{if(DA(e,S.current)){l(),bA(r),w.current=!0,g(e=>e+1);return}i(e),m(EA(e)),c(e.protocolVersion===1?void 0:e.protocolVersion),u(e.shell===!0),f(ok(e.pricingOverrides).pricing)}),p=s.on(`connectionChange`,e=>o(e?`live`:`reconnecting`)),_=s.on(`reconnectAttempt`,e=>o(e>=TA?`offline`:`reconnecting`)),v=s.on(`protocolError`,e=>{x.current?.onProtocolError?.(e)});return()=>{l(),d(),p(),_(),v(),s.detach(),b.current=null,y(void 0),o(`reconnecting`),c(void 0),u(!1),m(void 0);let e=S.current;CA({cacheEnabled:n,skipCache:w.current,parting:e})&&yA(r,e)}},[e,t,h]),(0,v.useEffect)(()=>{if(p===void 0)return;let e=setTimeout(()=>m(void 0),OA);return()=>clearTimeout(e)},[p]),(0,v.useEffect)(()=>{p!==void 0&&r.lastSeq>=p&&m(void 0)},[p,r.lastSeq]);let T=AA(e,t,r),E=a===`live`,D=p!==void 0&&r.lastSeq<p,O=(0,v.useCallback)(()=>b.current?.reconnectNow(),[]),k=(0,v.useCallback)(async n=>{if(!t)return!1;let r=S.current.items.find(e=>e.kind===`tool_call`&&e.id===n),a=r?.kind===`tool_call`?r.result:void 0;if(!a?.truncated||a.sourceSeq===void 0)return!1;try{let r=await e.toolResult(t,a.sourceSeq,n);return i({type:`transcript_hydrate_result`,toolUseId:n,text:iA(r.content)}),!0}catch{return!1}},[e,t]),A=(0,v.useRef)(new Set);(0,v.useEffect)(()=>{A.current=new Set},[t]);let j=(0,v.useCallback)(async n=>{if(!t)return!1;try{let r=await e.shellOutput(t,n,{view:`text`});return i({type:`transcript_hydrate_shell_output`,shellId:n,text:r}),!0}catch{return i({type:`transcript_hydrate_shell`,shellId:n,shell:void 0}),!1}},[e,t]),M=(0,v.useCallback)(async n=>{if(!t||A.current.has(n))return!1;A.current.add(n);try{let r=await e.getShell(t,n);return i({type:`transcript_hydrate_shell`,shellId:n,shell:r}),!0}catch{return i({type:`transcript_hydrate_shell`,shellId:n,shell:void 0}),!1}},[e,t]),N=(0,v.useCallback)(async n=>{if(!t)return!1;try{let r=await e.killShell(t,n);return i({type:`transcript_hydrate_shell`,shellId:n,shell:r}),!0}catch{return!1}},[e,t]);return(0,v.useMemo)(()=>({state:r,connected:E,connection:a,replaying:D,protocolMismatch:s,shell:l,pricing:d,models:T,effectiveModel:r.model??r.defaultModel,handle:_,send:(e,t)=>b.current?.send(e,t),approve:(e,t)=>b.current?.approve(e,t),deny:(e,t,n)=>b.current?.deny(e,t,n),interrupt:()=>b.current?.interrupt(),clearContext:()=>b.current?.clearContext(),runShell:e=>b.current?.runShell(e),setPermissionMode:e=>b.current?.setPermissionMode(e),setModel:e=>b.current?.setModel(e),closeSession:()=>b.current?.closeSession(),reconnectNow:O,loadFullResult:k,loadShellOutput:j,verifyShell:M,killShell:N}),[r,E,a,D,s,l,d,T,_,O,k,j,M,N])}function AA(e,t,n){let[r,i]=(0,v.useState)([]),a=n.session?.profile,o=n.models,s=!!o?.length;return(0,v.useEffect)(()=>i([]),[t]),(0,v.useEffect)(()=>{if(!a||s)return;let t=!1;return e.listProfiles().then(e=>{t||i(e.profiles.find(e=>e.name===a)?.models??[])}).catch(()=>{}),()=>{t=!0}},[e,a,s]),s?o:r}var jA=new Map;function MA(e,t){return`${e.identityKey}\u0000${t}`}function NA(e){return jA.get(e)}function PA(e,t){t!==void 0&&jA.set(e,t)}var FA=`workerdeck.drafts.v1`,IA=20,LA;function RA(){try{return globalThis.localStorage}catch{return}}function zA(){if(LA)return LA;LA={};let e=RA()?.getItem(FA);if(e)try{let t=JSON.parse(e);for(let[e,n]of Object.entries(t))typeof n?.text==`string`&&typeof n.savedAt==`number`&&(LA[e]=n)}catch{}return LA}function BA(e){let t=Object.entries(e);if(t.length>IA){t.sort((e,t)=>t[1].savedAt-e[1].savedAt);for(let[n]of t.slice(IA))delete e[n]}try{RA()?.setItem(FA,JSON.stringify(e))}catch{}}function VA(e,t){return`${e.identityKey}\u0000${t}`}function HA(e){return zA()[e]?.text??``}function UA(e,t,n=Date.now()){let r=zA();if(t.trim()===``){if(r[e]===void 0)return;delete r[e]}else r[e]={text:t,savedAt:n};BA(r)}var WA=new Set([`application/json`,`application/xml`,`application/yaml`,`application/x-yaml`,`application/toml`,`application/javascript`,`application/typescript`,`application/x-sh`,`application/sql`]),GA=1568;function KA(e){let t=e.split(`;`)[0].trim().toLowerCase();if(t.startsWith(`image/`))return`image`;if(t===`application/pdf`)return`pdf`;if(t.startsWith(`text/`)||WA.has(t))return`text`}function qA(e,t,{capabilities:n,engine:r}){let[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(),c=(0,v.useRef)(0),l=(0,v.useRef)(new Map),u=(0,v.useRef)([]);u.current=i.flatMap(e=>e.previewUrl?[e.previewUrl]:[]);let d=n.attachments;(0,v.useEffect)(()=>()=>{for(let e of u.current)URL.revokeObjectURL(e)},[]);let f=(0,v.useCallback)((e,t)=>{a(n=>n.map(n=>n.key===e?{...n,...t}:n))},[]),p=(0,v.useCallback)((n,r)=>{t&&(f(n,{status:`uploading`,error:void 0}),(async()=>{try{let i=await XA(r),a=await e.uploadAttachment(t,{name:r.name,mediaType:i.mediaType,data:i.body});f(n,{status:`ready`,id:a.id,bytes:a.bytes??r.size})}catch(e){f(n,{status:`failed`,error:e instanceof Error?e.message:`Upload failed`})}})())},[e,f,t]),m=(0,v.useCallback)(e=>{let t=[],n=[];for(let i of e){let e=i.type||`application/octet-stream`,a=KA(e);if(a&&!d.includes(a)){s(`The ${r??`claude`} engine does not take ${a} attachments.`);continue}let o=`att-${++c.current}`;t.push({key:o,name:i.name,mediaType:e,bytes:i.size,previewUrl:a===`image`?URL.createObjectURL(i):void 0,status:`uploading`}),n.push({key:o,file:i})}if(t.length!==0){a(e=>[...e,...t]),l.current=new Map([...l.current,...n.map(({key:e,file:t})=>[e,t])]);for(let{key:e,file:t}of n)p(e,t)}},[d,r,p]),h=(0,v.useCallback)(e=>{a(t=>{for(let n of t)e.includes(n.key)&&n.previewUrl&&URL.revokeObjectURL(n.previewUrl);return t.filter(t=>!e.includes(t.key))});for(let t of e)l.current.delete(t)},[]),g=(0,v.useCallback)(e=>h([e]),[h]),_=(0,v.useCallback)(()=>{a(e=>{for(let t of e)t.previewUrl&&URL.revokeObjectURL(t.previewUrl);return[]}),l.current.clear()},[]),y=(0,v.useCallback)(e=>{let t=l.current.get(e);t&&p(e,t)},[p]);return(0,v.useMemo)(()=>({items:i,readyIds:i.flatMap(e=>e.id?[e.id]:[]),uploading:i.some(e=>e.status===`uploading`),hasFailure:i.some(e=>e.status===`failed`),accept:JA(d),disabled:d.length===0||!t,add:m,retry:y,remove:g,clear:_,error:o,dismissError:()=>s(void 0)}),[i,d,t,m,y,g,_,o])}function JA(e){if(e.length===0)return``;let t=[];return e.includes(`image`)&&t.push(`image/*`),e.includes(`pdf`)&&t.push(`application/pdf`),e.includes(`text`)&&t.push(`text/*`,`.md`,`.json`,`.yaml`,`.yml`,`.toml`),e.length===3?``:t.join(`,`)}var YA=globalThis;async function XA(e){let t=e.type||`application/octet-stream`,{createImageBitmap:n,document:r}=YA;if(!n||!r||!t.startsWith(`image/`)||t===`image/gif`)return{body:e,mediaType:t};try{let i=await n(e),a=Math.max(i.width,i.height);if(a<=GA)return i.close(),{body:e,mediaType:t};let o=GA/a,s=r.createElement(`canvas`);s.width=Math.round(i.width*o),s.height=Math.round(i.height*o);let c=s.getContext(`2d`);if(!c)return i.close(),{body:e,mediaType:t};c.drawImage(i,0,0,s.width,s.height),i.close();let l=await new Promise(e=>s.toBlob(e,`image/jpeg`,.85));return l?{body:l,mediaType:`image/jpeg`}:{body:e,mediaType:t}}catch{return{body:e,mediaType:t}}}var ZA=/^[A-Za-z0-9\-_.:]+$/,QA=_k;function $A(e,t){let n=[],r=t?.skills?.length?new Set(t.skills):void 0,i=t?.sessions?.length?new Set(t.sessions):void 0,a=/\S+/g,o;for(;(o=a.exec(e))!==null;){let t=o[0],a=t[0]===`@`?`file`:t[0]===`/`?`command`:t[0]===`$`&&r?`skill`:t[0]===`#`&&i?`session`:void 0;if(!a)continue;let s=o.index+t.length;for(;s>o.index&&QA.has(e[s-1]);)s--;let c=e.slice(o.index+1,s);c&&(a!==`command`||ZA.test(c))&&(a!==`skill`||r.has(c))&&(a!==`session`||xk(c)&&i.has(bk(c)))&&n.push({kind:a,start:o.index,end:s,text:e.slice(o.index,s)})}return n}var ej=class{#e=new Map;on(e,t){let n=this.#e.get(e);return n||(n=new Set,this.#e.set(e,n)),n.add(t),()=>n.delete(t)}emit(e,t){let n=this.#e.get(e);if(n)for(let e of n)try{e(t)}catch{}}};function tj(e){return Math.min(500*2**e,1e4)}var nj=class{sessionId;#e;#t;#n;#r=new ej;#i;#a=!1;#o=0;#s=[];#c;constructor(e,t,n={}){this.#e=e,this.sessionId=t,this.#t={reconnect:!0,...n},this.#i=n.afterSeq??0,this.#c=setTimeout(()=>this.#u(),0)}get lastSeq(){return this.#i}on(e,t){return this.#r.on(e,t)}send(e,t){this.#l({type:`user_message`,text:e,attachmentIds:t?.length?t:void 0})}approve(e,t){this.#l({type:`permission_decision`,requestId:e,behavior:`allow`,updatedInput:t})}deny(e,t,n){this.#l({type:`permission_decision`,requestId:e,behavior:`deny`,message:t,interrupt:n})}interrupt(){this.#l({type:`interrupt`})}runShell(e){this.#l({type:`shell_command`,command:e})}attachShell(e,t){this.#l({type:`shell_attach`,shellId:e,cols:t.cols,rows:t.rows})}writeShell(e,t){this.#l({type:`shell_input`,shellId:e,data:t})}resizeShell(e,t){this.#l({type:`shell_resize`,shellId:e,cols:t.cols,rows:t.rows})}detachShell(e){this.#l({type:`shell_detach`,shellId:e})}clearContext(){this.#l({type:`clear_context`})}setPermissionMode(e){this.#l({type:`set_permission_mode`,mode:e})}setModel(e){this.#l({type:`set_model`,model:e})}sendToolCallResult(e,t,n){this.#l({type:`tool_call_result`,executionId:e,output:t,logs:n})}sendToolCallError(e,t,n,r){this.#l({type:`tool_call_error`,executionId:e,reason:t,error:n,logs:r})}closeSession(){this.#l({type:`close`}),this.detach()}reconnectNow(){this.#a||this.#n&&this.#n.readyState===1||(clearTimeout(this.#c),this.#o=0,this.#u())}detach(){this.#a=!0,clearTimeout(this.#c),this.#n?.close(),this.#n=void 0}#l(e){let t=JSON.stringify(e);this.#n&&this.#n.readyState===1?this.#n.send(t):this.#s.push(t)}#u(){if(this.#a)return;let e=this.#e.openSocket(this.sessionId,this.#i,this.#t.truncateResults,this.#t.imageRefs);this.#n=e,e.onopen=()=>{this.#o=0,this.#r.emit(`connectionChange`,!0);for(let t of this.#s.splice(0))e.send(t)},e.onmessage=e=>{let t=JSON.parse(String(e.data));if(t.type===`attached`)this.#r.emit(`attached`,t);else if(t.type===`event`){if(t.event.seq<=this.#i)return;this.#i=t.event.seq,this.#r.emit(`event`,t.event)}else t.type===`tool_call_request`?this.#r.emit(`toolCallRequest`,t):t.type===`tool_call_canceled`?this.#r.emit(`toolCallCanceled`,{executionId:t.executionId,reason:t.reason}):t.type===`shell_attached`?this.#r.emit(`shellAttached`,{shellId:t.shellId,shell:t.shell,cols:t.cols,rows:t.rows,scrollback:t.scrollback}):t.type===`shell_output`?this.#r.emit(`shellOutput`,{shellId:t.shellId,data:t.data}):t.type===`shell_detached`?this.#r.emit(`shellDetached`,{shellId:t.shellId,reason:t.reason}):t.type===`protocol_error`&&this.#r.emit(`protocolError`,t.message)},e.onclose=()=>{if(this.#r.emit(`connectionChange`,!1),this.#a||!this.#t.reconnect)return;let e=tj(this.#o++);this.#r.emit(`reconnectAttempt`,this.#o),this.#c=setTimeout(()=>this.#u(),e)},e.onerror=()=>{}}},rj=class{#e;#t;#n;#r=new ej;#i=!1;#a=0;#o;constructor(e,t={}){this.#e=e,this.#t=t.reconnect??!0,this.#o=setTimeout(()=>this.#s(),0)}on(e,t){return this.#r.on(e,t)}detach(){this.#i=!0,clearTimeout(this.#o),this.#n?.close(),this.#n=void 0}#s(){if(this.#i)return;let e=this.#e.openQueueSocket();this.#n=e,e.onopen=()=>{this.#a=0,this.#r.emit(`connectionChange`,!0)},e.onmessage=e=>{let t=JSON.parse(String(e.data));t.type===`queue_attached`?(this.#r.emit(`attached`,t.stats),this.#r.emit(`stats`,t.stats)):t.type===`job_event`?this.#r.emit(`event`,t.event):t.type===`queue_stats`&&this.#r.emit(`stats`,t.stats)},e.onclose=()=>{if(this.#r.emit(`connectionChange`,!1),this.#i||!this.#t)return;let e=tj(this.#a++);this.#o=setTimeout(()=>this.#s(),e)},e.onerror=()=>{}}};function ij(e){let t=e.baseUrl.trim();for(;t.endsWith(`/`);)t=t.slice(0,-1);if(t!==``){t.includes(`://`)||(t=`http://`+t),t.endsWith(`/v1`)||(t+=`/v1`);try{new URL(t)}catch{return}return t}}function aj(e){let t=ij(e);if(!t)return!1;try{let{hostname:e}=new URL(t);return e===`127.0.0.1`||e===`localhost`||e===`::1`||e===`[::1]`}catch{return!1}}function oj(e){let{baseUrl:t,key:n}=e;if(n===``)return{};let r=t.replace(/^http/,`ws`),i=e=>`${e}${e.includes(`?`)?`&`:`?`}key=${encodeURIComponent(n)}`;return{headers:{authorization:`Bearer ${n}`},buildWsUrl:(e,t)=>i(`${r}/sessions/${encodeURIComponent(e)}/ws?afterSeq=${t}`),buildQueueWsUrl:()=>i(`${r}/queue/ws`)}}var sj=class extends Error{status;constructor(e,t){super(e),this.name=`WorkerDeckError`,this.status=t}},cj=class{#e;#t;#n;constructor(e){this.#e=e,this.#t=e.fetchImpl??fetch.bind(globalThis),this.#n=e.WebSocketImpl??WebSocket}get identityKey(){let e=Object.entries(this.#e.headers??{}).map(([e,t])=>[e.toLowerCase(),t]);return e.sort(([e],[t])=>e<t?-1:+(e>t)),JSON.stringify([this.#e.baseUrl,e])}async createSession(e){return(await this.#i(`POST`,`/sessions`,e)).session}async listSessions(){return(await this.#i(`GET`,`/sessions`)).sessions}async getSession(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}`)).session}async updateSession(e,t){return(await this.#i(`PATCH`,`/sessions/${encodeURIComponent(e)}`,t)).session}async deleteSession(e){return(await this.#i(`DELETE`,`/sessions/${encodeURIComponent(e)}`)).session}async listSessionFiles(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/files`)).files}async fetchSessionFile(e,t){return await(await this.#r(this.sessionFileUrl(e,t),{headers:this.#e.headers},`GET file failed`)).text()}async uploadAttachment(e,t){let n=`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/attachments?name=${encodeURIComponent(t.name)}`;return(await(await this.#r(n,{method:`POST`,headers:{...this.#e.headers,"content-type":t.mediaType},body:t.data},`upload failed`)).json()).attachment}attachmentUrl(e,t){return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}`}producedFileUrl(e,t){return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/produced/${encodeURIComponent(t)}`}async readProducedFile(e,t){return await(await this.#r(this.producedFileUrl(e,t),{headers:{...this.#e.headers}},`produced file request failed`)).blob()}projectIconUrl(e){return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/project/icon`}async projectIcon(e){return await(await this.#r(this.projectIconUrl(e),{headers:{...this.#e.headers}},`project icon request failed`)).blob()}async listMcpServers(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/mcp`)).servers}async mcpServerAction(e,t,n){return(await this.#i(`POST`,`/sessions/${encodeURIComponent(e)}/mcp/${encodeURIComponent(t)}`,{action:n})).servers}sessionFileUrl(e,t){let n=t.split(`/`).filter(Boolean).map(encodeURIComponent).join(`/`);return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/files/${n}`}async resolvePermission(e,t,n){await this.#i(`POST`,`/sessions/${encodeURIComponent(e)}/permissions/${encodeURIComponent(t)}`,n)}async submitExecutionResult(e,t){return await this.#i(`POST`,`/executions/${encodeURIComponent(e)}/result`,t)}async listProfiles(){return await this.#i(`GET`,`/profiles`)}async getProfile(e){return await this.#i(`GET`,`/profiles/${encodeURIComponent(e)}`)}async createProfile(e){return(await this.#i(`POST`,`/profiles`,e)).profile}async updateProfile(e,t){return(await this.#i(`PATCH`,`/profiles/${encodeURIComponent(e)}`,t)).profile}async deleteProfile(e){await this.#i(`DELETE`,`/profiles/${encodeURIComponent(e)}`)}async listSdkSessions(e){let t=new URLSearchParams;e?.dir&&t.set(`dir`,e.dir),e?.limit!==void 0&&t.set(`limit`,String(e.limit)),e?.offset!==void 0&&t.set(`offset`,String(e.offset)),e?.profile&&t.set(`profile`,e.profile);let n=t.size>0?`?${t.toString()}`:``;return(await this.#i(`GET`,`/sdk-sessions${n}`)).sdkSessions}async listHostRoots(){return await this.#i(`GET`,`/fs/roots`)}async meta(){return await this.#i(`GET`,`/meta`)}async listHostDir(e){let t=`?path=${encodeURIComponent(e)}`;return await this.#i(`GET`,`/fs/list${t}`)}async findHostFiles(e,t=``,n){let r=new URLSearchParams({path:e,q:t});return n!==void 0&&r.set(`limit`,String(n)),await this.#i(`GET`,`/fs/find?${r.toString()}`)}async readHostFile(e){let t=`?path=${encodeURIComponent(e)}`;return await this.#i(`GET`,`/fs/read${t}`)}async writeHostFile(e){return await this.#i(`PUT`,`/fs/write`,e)}async createJob(e){return(await this.#i(`POST`,`/jobs`,e)).job}async listJobs(){return(await this.#i(`GET`,`/jobs`)).jobs}async getJob(e){return(await this.#i(`GET`,`/jobs/${encodeURIComponent(e)}`)).job}async cancelJob(e){return(await this.#i(`DELETE`,`/jobs/${encodeURIComponent(e)}`)).job}async queueStats(){return(await this.#i(`GET`,`/queue`)).stats}async listShells(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/shells`)).shells}async getShell(e,t){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/shells/${encodeURIComponent(t)}`)).shell}async shellOutput(e,t,n){let r=new URLSearchParams;n?.view&&r.set(`view`,n.view),n?.tail!==void 0&&r.set(`tail`,String(n.tail));let i=r.size>0?`?${r.toString()}`:``,a=`/sessions/${encodeURIComponent(e)}/shells/${encodeURIComponent(t)}/output${i}`;return await(await this.#r(`${this.#e.baseUrl}${a}`,{headers:{...this.#e.headers}},`shell output request failed`)).text()}async killShell(e,t){return(await this.#i(`POST`,`/sessions/${encodeURIComponent(e)}/shells/${encodeURIComponent(t)}/kill`)).shell}attach(e,t){return new nj(this,e,t)}attachQueue(e){return new rj(this,e)}openSocket(e,t,n=!1,r=!1){let i=`afterSeq=${t}`+(n?`&truncateResults=1`:``)+(r?`&imageRefs=1`:``),a=this.#e.buildWsUrl?.(e,t,n,r)??`${this.#e.baseUrl.replace(/^http/,`ws`)}/sessions/${encodeURIComponent(e)}/ws?${i}`;return new this.#n(a)}async toolResult(e,t,n,r){return await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/events/${t}/result?toolUseId=${encodeURIComponent(n)}`+(r?.imageRefs?`&imageRefs=1`:``))}async toolResultImage(e,t,n,r){let i=`/sessions/${encodeURIComponent(e)}/events/${t}/result?toolUseId=${encodeURIComponent(n)}&part=${r}`;return await(await this.#r(`${this.#e.baseUrl}${i}`,{headers:{...this.#e.headers}},`image part request failed`)).blob()}openQueueSocket(){let e=this.#e.buildQueueWsUrl?.()??`${this.#e.baseUrl.replace(/^http/,`ws`)}/queue/ws`;return new this.#n(e)}async#r(e,t,n){let r=await this.#t(e,t);if(!r.ok)throw new sj((await r.json().catch(()=>({}))).error??`${n} with ${r.status}`,r.status);return r}async#i(e,t,n){let r=await this.#t(`${this.#e.baseUrl}${t}`,{method:e,headers:{...n===void 0?{}:{"content-type":`application/json`},...this.#e.headers},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>({}));if(!r.ok)throw new sj(i.error??`${e} ${t} failed with ${r.status}`,r.status);return i}};function lj(){let e=(0,v.useRef)(!0);return(0,v.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function uj(e){return e instanceof sj&&e.status===404}function dj(e,t,n){let r=[],i=t.get(e);if(!i)return r;let a=[{entries:i.entries,index:0,depth:0}];for(;a.length>0;){let e=a[a.length-1],i=e.entries[e.index];if(i===void 0){a.pop();continue}e.index+=1;let o=e.depth;if(i.type!==`dir`){r.push({entry:i,depth:o});continue}let s=n.has(i.path),c=t.get(i.path);r.push({entry:i,depth:o,expanded:s,loading:s&&!c,truncated:s?c?.truncated:void 0}),s&&c&&a.push({entries:c.entries,index:0,depth:o+1})}return r}function fj(e,t){let n=e.endsWith(`/`)?e.slice(0,-1):e;if(t===n||!t.startsWith(`${n}/`))return[];let r=t.slice(n.length+1).split(`/`),i=[],a=n;for(let e of r.slice(0,-1))a=`${a}/${e}`,i.push(a);return i}function pj(e,t){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(t);(0,v.useEffect)(()=>{i.current!==t&&(i.current=t,r(!1))},[t]);let a=(0,v.useCallback)(async(i,a)=>{if(!t||n)return[];try{let n=await e.findHostFiles(t,i,a?.limit??8);return a?.signal?.aborted?[]:n.matches}catch(e){return uj(e)&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function mj(e){let[t,n]=(0,v.useState)({available:!1,canWrite:!1});return(0,v.useEffect)(()=>{let t=!1;return e.listHostRoots().then(e=>{t||n({available:!0,canWrite:e.canWrite})}).catch(()=>{t||n({available:!1,canWrite:!1})}),()=>{t=!0}},[e]),t}function hj(e,t){let[n,r]=(0,v.useState)(()=>new Map),[i,a]=(0,v.useState)(()=>new Set),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(),u=(0,v.useRef)(t);(0,v.useEffect)(()=>{u.current!==t&&(u.current=t,r(new Map),a(new Set),s(!1),l(void 0))},[t]);let d=lj(),f=(0,v.useRef)(new Set),p=(0,v.useCallback)((t,{force:n=!1}={})=>{o||(n||!f.current.has(t))&&(f.current.add(t),e.listHostDir(t).then(e=>{d.current&&r(n=>{let r=new Map(n);return r.set(t,{entries:e.entries,truncated:e.truncated}),r})}).catch(e=>{if(d.current){if(f.current.delete(t),uj(e)){s(!0);return}l(e instanceof Error?e.message:`Could not read that directory`)}}))},[e,o]);(0,v.useEffect)(()=>{t&&p(t)},[t,p]);let m=(0,v.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),p(e)},[p]),h=(0,v.useCallback)(e=>{if(!t)return;let n=fj(t,e);if(n.length!==0){for(let e of n)p(e);a(e=>{let t=new Set(e);for(let e of n)t.add(e);return t})}},[t,p]),g=(0,v.useCallback)(e=>{let n=e??t;n&&(l(void 0),p(n,{force:!0}))},[t,p]),_=(0,v.useMemo)(()=>t?dj(t,n,i):[],[t,n,i]);return{available:!!t&&!o,root:t,rows:_,loading:!!t&&!o&&!n.has(t)&&!c,error:c,toggle:m,reveal:h,refresh:g}}var gj={available:!1,peers:[],names:[]},_j=2e4;function vj(e,t,n=!0){let[r,i]=(0,v.useState)(void 0),[a,o]=(0,v.useState)(!1),s=lj();return(0,v.useEffect)(()=>{if(!n||a)return;let t,r=()=>{e.listSessions().then(e=>{s.current&&i(e)}).catch(e=>{s.current&&uj(e)&&o(!0)}).finally(()=>{s.current&&(t=setTimeout(r,_j))})};return r(),()=>{t&&clearTimeout(t)}},[e,n,a]),(0,v.useMemo)(()=>{if(!n||a||!r)return gj;let e=r.filter(e=>e.id!==t).sort((e,t)=>(t.lastActivityAt??t.createdAt)-(e.lastActivityAt??e.createdAt)).map(e=>({id:e.id,slug:yk(e.title,e.id),label:MO(e),engine:e.engine,status:e.status,cwd:e.cwd,project:e.project?.name,lastActivityAt:e.lastActivityAt}));return{available:e.length>0,peers:e,names:e.map(e=>bk(e.slug))}},[n,t,r,a])}var yj=new Map,bj=new Set,xj=new Set;function Sj(e,t){let[n,r]=(0,v.useState)(()=>Object.fromEntries(yj));return(0,v.useEffect)(()=>{let n=!0;for(let i of e){let e=i.info.project?.icon;if(e?.type!==`image`)continue;let{hash:a}=e;if(yj.has(a)||bj.has(a)||xj.has(a))continue;let o=t(i.hostId);o&&(bj.add(a),o.projectIcon(i.info.id).then(e=>{yj.set(a,URL.createObjectURL(e)),n&&r(Object.fromEntries(yj))}).catch(()=>{xj.add(a)}).finally(()=>bj.delete(a)))}return()=>{n=!1}},[e,t]),n}function Cj(e,t){let n=t?VA(e,t):void 0;return{initialText:(0,v.useMemo)(()=>n?HA(n):``,[n]),save:(0,v.useCallback)(e=>{n&&UA(n,e)},[n]),clear:(0,v.useCallback)(()=>{n&&UA(n,``)},[n])}}function wj(e,t,n={}){let{intervalMs:r=6e4,enabled:i=!0}=n,a=t?MA(e,t):void 0,[o,s]=(0,v.useState)(()=>a?NA(a):void 0),[c,l]=(0,v.useState)(void 0),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(0),m=(0,v.useCallback)(()=>p(e=>e+1),[]);(0,v.useEffect)(()=>{s(a?NA(a):void 0),l(void 0)},[a]);let h=lj();return(0,v.useEffect)(()=>{if(!t||!i||u)return;let n=!1,o=()=>{globalThis.document?.hidden||e.listProfiles().then(e=>{if(n||!h.current)return;let r=e.profiles.find(e=>e.name===t),i=r?.usage;a&&PA(a,i),s(i),l(r?.spend)}).catch(e=>{!n&&h.current&&uj(e)&&d(!0)})};o();let c=setInterval(o,r);return()=>{n=!0,clearInterval(c)}},[e,t,i,u,r,f,a]),{usage:o,spend:c,refresh:m}}function Tj(e,t){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(!!t),[o,s]=(0,v.useState)();return(0,v.useEffect)(()=>{if(!t){r(void 0),a(!1),s(void 0);return}let n=!1;return a(!0),s(void 0),r(void 0),e.getSession(t).then(e=>{n||(r(e),a(!1))}).catch(e=>{n||(s(e instanceof Error?e.message:`Session not found`),a(!1))}),()=>{n=!0}},[e,t]),{info:n,loading:i,error:o}}function Ej(e){return e.draft!==void 0&&e.draft!==e.content}function Dj(e){return e.draft??e.content??``}var Oj={files:[]};function kj(e,t){switch(t.type){case`open`:{if(e.files.some(e=>e.path===t.path))return e.activePath===t.path?e:{...e,activePath:t.path};let n={path:t.path,name:jj(t.path),status:`loading`};return{files:[...e.files,n],activePath:t.path}}case`close`:{let n=e.files.findIndex(e=>e.path===t.path);if(n===-1)return e;let r=e.files.filter(e=>e.path!==t.path);return e.activePath===t.path?{files:r,activePath:(r[n]??r[n-1])?.path}:{...e,files:r}}case`closeAll`:return Oj;case`activate`:return e.files.some(e=>e.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case`loaded`:return Aj(e,t.path,()=>({path:t.path,name:jj(t.path),status:t.encoding===`utf8`?`ready`:`binary`,content:t.encoding===`utf8`?t.content:void 0,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt}));case`failed`:return Aj(e,t.path,e=>({...e,status:`error`,error:t.error}));case`edit`:return Aj(e,t.path,e=>e.status===`ready`?{...e,draft:t.content}:e);case`revert`:return Aj(e,t.path,e=>({...e,draft:void 0,saveError:void 0,conflict:!1}));case`saveStart`:return Aj(e,t.path,e=>({...e,saving:!0,saveError:void 0,conflict:!1}));case`saved`:return Aj(e,t.path,e=>({...e,saving:!1,saveError:void 0,conflict:!1,content:t.content,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt,draft:e.draft===t.content?void 0:e.draft}));case`saveFailed`:return Aj(e,t.path,e=>({...e,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case`dismissConflict`:return Aj(e,t.path,e=>({...e,conflict:!1,saveError:void 0}))}}function Aj(e,t,n){let r=e.files.findIndex(e=>e.path===t);if(r===-1)return e;let i=e.files[r],a=n(i);if(a===i)return e;let o=e.files.slice();return o[r]=a,{...e,files:o}}function jj(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;return t.slice(t.lastIndexOf(`/`)+1)||t||e}function Mj(e){let[t,n]=(0,v.useReducer)(kj,Oj),r=(0,v.useRef)(new Set),i=(0,v.useRef)(!0);(0,v.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);let a=(0,v.useRef)(t);(0,v.useEffect)(()=>{a.current=t},[t]);let o=t.files.filter(e=>e.status===`loading`).map(e=>e.path).join(`
|
|
48
|
+
`),s=(0,v.useCallback)(t=>e.readHostFile(t).then(e=>{if(i.current)return n({type:`loaded`,path:t,content:e.content,encoding:e.encoding,bytes:e.bytes,hash:e.hash,modifiedAt:e.modifiedAt}),e}),[e]);(0,v.useEffect)(()=>{for(let e of o?o.split(`
|
|
49
|
+
`):[])r.current.has(e)||(r.current.add(e),s(e).catch(t=>{i.current&&n({type:`failed`,path:e,error:t instanceof Error?t.message:`Could not read that file`})}))},[s,o]);let c=(0,v.useCallback)(e=>n({type:`open`,path:e}),[]),l=(0,v.useCallback)(e=>{r.current.delete(e),n({type:`close`,path:e})},[]),u=(0,v.useCallback)(()=>{r.current.clear(),n({type:`closeAll`})},[]),d=(0,v.useCallback)(e=>n({type:`activate`,path:e}),[]),f=(0,v.useCallback)((e,t)=>n({type:`edit`,path:e,content:t}),[]),p=(0,v.useCallback)(e=>n({type:`revert`,path:e}),[]),m=(0,v.useCallback)(e=>n({type:`dismissConflict`,path:e}),[]),h=(0,v.useCallback)(e=>{r.current.add(e),s(e).catch(t=>{i.current&&n({type:`failed`,path:e,error:t instanceof Error?t.message:`Could not re-read that file`})})},[s]),g=(0,v.useCallback)(async(t,r,a)=>{try{let o=await e.writeHostFile({path:t,content:r,expectedHash:a});if(!i.current)return;n({type:`saved`,path:t,content:r,bytes:o.bytes,hash:o.hash,modifiedAt:o.modifiedAt})}catch(e){if(!i.current)return;let r=e instanceof sj&&e.status===409;n({type:`saveFailed`,path:t,conflict:r,error:r?`This file changed on disk since you opened it.`:e instanceof Error?e.message:`Could not save that file`})}},[e]),_=(0,v.useCallback)(async e=>{let t=a.current.files.find(t=>t.path===e);t&&!t.saving&&Ej(t)&&(n({type:`saveStart`,path:e}),await g(e,Dj(t),t.hash))},[g]),y=(0,v.useCallback)(async t=>{let r=a.current.files.find(e=>e.path===t);if(!r||r.saving)return;let o=Dj(r);n({type:`saveStart`,path:t});try{let n=await e.readHostFile(t);if(!i.current)return;await g(t,o,n.hash)}catch(e){if(!i.current)return;n({type:`saveFailed`,path:t,error:e instanceof Error?e.message:`Could not save that file`})}},[e,g]),b=(0,v.useMemo)(()=>t.files.find(e=>e.path===t.activePath),[t.files,t.activePath]),x=(0,v.useMemo)(()=>t.files.some(Ej),[t.files]);return{...t,active:b,hasUnsaved:x,open:c,close:l,closeAll:u,activate:d,edit:f,save:_,revert:p,reload:h,overwrite:y,dismissConflict:m}}var Nj=`modulepreload`,Pj=function(e){return`/`+e},Fj={},Ij=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Pj(t,n),t=s(t),t in Fj)return;Fj[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Nj,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function Lj(e,t={}){let n=new Map,r,i=!1,a=e=>t.onExecution?.(e),o=(t,n,r,i)=>{e.sendToolCallError(t.executionId,n,r),a({executionId:t.executionId,toolName:t.toolName,status:`failed`,reason:n,startedAt:i,endedAt:Date.now()})},s=async(t,r)=>{let s=Date.now(),c=new AbortController;n.set(t.executionId,c),a({executionId:t.executionId,toolName:t.toolName,status:`running`,startedAt:s});try{let o=await r(t.input,{executionId:t.executionId,signal:c.signal});if(i||!n.has(t.executionId))return;`error`in o?(e.sendToolCallError(t.executionId,o.reason??`client_error`,o.error),a({executionId:t.executionId,toolName:t.toolName,status:`failed`,reason:o.reason??`client_error`,startedAt:s,endedAt:Date.now()})):(e.sendToolCallResult(t.executionId,{type:`json`,value:o.value}),a({executionId:t.executionId,toolName:t.toolName,status:`settled`,startedAt:s,endedAt:Date.now()}))}catch(e){if(i||!n.has(t.executionId))return;o(t,`host_error`,e instanceof Error?e.message:String(e),s)}finally{n.delete(t.executionId)}},c=async c=>{let l=Date.now(),u=t.clientTools?.[c.toolName];if(u)return s(c,u);if(!(t.tools??[`eval_script`]).includes(c.toolName)){o(c,`unsupported_tool`,`this client does not execute '${c.toolName}'`,l);return}let d=c.input?.script;if(typeof d!=`string`){o(c,`invalid_input`,"expected a string `script` input",l);return}let f=new AbortController;n.set(c.executionId,f),a({executionId:c.executionId,toolName:c.toolName,status:`running`,startedAt:l});try{let o=await Ij(()=>import(`./src-BcRpl0IM.js`),[]),s=o.createVfs(c.vfsSeed),u=Math.min(c.limits?.timeoutMs??1/0,t.timeoutMs??5e3),p=Math.min(c.limits?.memoryLimitBytes??1/0,t.memoryLimitBytes??67108864),m=t.execute?await t.execute({script:d,vfs:s,timeoutMs:u,memoryLimitBytes:p,signal:f.signal}):await(async()=>(r??=(t.loadEngine??Rj)(),o.runScript(await r,{script:d,vfs:s,timeoutMs:u,memoryLimitBytes:p,signal:f.signal,fetchText:t.fetchText})))();if(i||!n.has(c.executionId))return;let h=m.logs.map(e=>`[${e.level}] ${e.text}`);m.ok?(e.sendToolCallResult(c.executionId,{type:`json`,value:m.value},h),a({executionId:c.executionId,toolName:c.toolName,status:`settled`,startedAt:l,endedAt:Date.now()})):(e.sendToolCallError(c.executionId,m.reason,m.error,h),a({executionId:c.executionId,toolName:c.toolName,status:`failed`,reason:m.reason,startedAt:l,endedAt:Date.now()}))}catch(e){if(i||!n.has(c.executionId))return;o(c,`host_error`,e instanceof Error?e.message:String(e),l)}finally{n.delete(c.executionId)}},l=e.on(`toolCallRequest`,e=>void c(e)),u=e.on(`toolCallCanceled`,({executionId:e,reason:t})=>{let r=n.get(e);r&&(r.abort(),n.delete(e),a({executionId:e,toolName:``,status:`canceled`,reason:t,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{i=!0,l(),u();for(let e of n.values())e.abort();n.clear()}}}async function Rj(){let[e,t]=await Promise.all([Ij(()=>import(`./src-BcRpl0IM.js`),[]),Ij(()=>import(`./dist-BYhO38VS.js`),[])]);return e.loadEngine(t)}function zj(e,t={}){let[n,r]=(0,v.useState)([]),i=(0,v.useRef)(t);return i.current=t,(0,v.useEffect)(()=>{if(!e||t.enabled===!1)return;let n=Lj(e,{get tools(){let e=i.current.tools,t=i.current.clientTools;if(!t)return e;let n=Object.keys(t);return e?[...new Set([...e,...n])]:n},get clientTools(){return i.current.clientTools},get timeoutMs(){return i.current.timeoutMs},get memoryLimitBytes(){return i.current.memoryLimitBytes},get loadEngine(){return i.current.loadEngine},get execute(){return i.current.execute},get fetchText(){return i.current.fetchText},onExecution:e=>{i.current.onExecution?.(e);let t=i.current.historyLimit??50;r(n=>[...n.filter(t=>t.executionId!==e.executionId),e].slice(-t))}});return()=>n.dispose()},[e,t.enabled]),{executions:n}}function Bj(e,t){let n=Math.max(0,Math.min(t,e.items.length)),r=e.items.slice(n),i=new Map,a=0,o=0,s=0,c=0,l=0;for(let e of r)switch(e.kind){case`turn_result`:a+=1,e.isError&&(l+=1);break;case`assistant_text`:o+=1;break;case`tool_call`:s+=1,i.set(e.name,(i.get(e.name)??0)+1),(e.status===`failed`||e.result?.isError)&&(l+=1);break;case`file_delivered`:c+=1;break;case`notice`:e.level===`error`&&(l+=1)}let u=[...i.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e])=>e),d=e.pendingApprovals?.length??0;return{turns:a,replies:o,tools:s,toolNames:u,files:c,errors:l,pending:d,any:a+o+s+c+l+d>0}}function Vj(e){if(!e.any)return;let t=[];if(e.turns>0?t.push(Hj(e.turns,`turn`)):e.replies>0&&t.push(Hj(e.replies,`reply`,`replies`)),e.tools>0){let n=e.toolNames.slice(0,3).join(`, `),r=e.toolNames.length-3;t.push(`${Hj(e.tools,`tool call`)}${n?` (${n}${r>0?`, +${r}`:``})`:``}`)}return e.files>0&&t.push(Hj(e.files,`file`)),e.errors>0&&t.push(Hj(e.errors,`error`)),e.pending>0&&t.push(`${Hj(e.pending,`approval`)} waiting`),t.join(` · `)}function Hj(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function Uj(e,t,n){let[r,i]=(0,v.useState)(`idle`),[a,o]=(0,v.useState)(void 0),[s,c]=(0,v.useState)(void 0),l=(0,v.useRef)(n);l.current=n;let u=(0,v.useRef)({cols:80,rows:24}),d=(0,v.useRef)(!1);(0,v.useEffect)(()=>{d.current=!1,i(`idle`),o(void 0),c(void 0)},[e,t]),(0,v.useEffect)(()=>{if(!e||t===void 0)return;let n=e.on(`shellAttached`,e=>{if(e.shellId!==t)return;u.current={cols:e.cols,rows:e.rows},o(e.shell),c(void 0),i(`attached`);let n={shell:e.shell,cols:e.cols,rows:e.rows,scrollback:e.scrollback};l.current.onAttached?l.current.onAttached(n):e.scrollback&&l.current.onData(e.scrollback)}),r=e.on(`shellOutput`,e=>{e.shellId===t&&l.current.onData(e.data)}),a=e.on(`shellDetached`,e=>{e.shellId===t&&(d.current=!1,c(e.reason),i(`detached`),l.current.onEnded?.(e.reason))}),s=e.on(`connectionChange`,n=>{d.current&&(n?(i(`attaching`),e.attachShell(t,u.current)):i(e=>e===`attached`?`attaching`:e))});return()=>{n(),r(),a(),s(),d.current&&(d.current=!1,e.detachShell(t))}},[e,t]);let f=(0,v.useCallback)(n=>{e&&t!==void 0&&(u.current=n,d.current=!0,c(void 0),i(`attaching`),e.attachShell(t,n))},[e,t]),p=(0,v.useCallback)(n=>{e&&t!==void 0&&e.writeShell(t,n)},[e,t]),m=(0,v.useCallback)(n=>{(n.cols!==u.current.cols||n.rows!==u.current.rows)&&(u.current=n,e&&t!==void 0&&d.current&&e.resizeShell(t,n))},[e,t]),h=(0,v.useCallback)(()=>{e&&t!==void 0&&d.current&&e.detachShell(t),d.current=!1,i(`idle`)},[e,t]);return(0,v.useMemo)(()=>({status:r,shell:a,reason:s,attach:f,write:p,resize:m,detach:h}),[r,a,s,f,p,m,h])}var Wj={command:0,client:1,skill:2};function Gj(e){return e.replace(/\s*\(MCP\)$/i,``)}function Kj(e){return`$${e.name}`}function qj(e){let t=Kj(e),n=(e.defaultPrompt??``).split(t).join(` `).replace(/\s+/g,` `).trim();return n?` ${n} `:` `}function Jj(e){return Kj(e)+qj(e)}function Yj(e){let t=[],n=new Set;for(let r of e.commands??[]){let e=Gj(r.name);if(!n.has(e)){n.add(e);for(let e of r.aliases??[])n.add(Gj(e));t.push({kind:`command`,name:e,description:r.description,argumentHint:r.argumentHint,aliases:r.aliases})}}for(let r of e.clientCommands??[])n.has(r.name)||t.push({kind:`client`,name:r.name,description:r.description,argumentHint:r.argumentHint,command:r});for(let n of e.skills??[])t.push({kind:`skill`,name:n.name,label:n.displayName??n.name,description:n.shortDescription??n.description,enabled:n.enabled,scope:n.scope,skill:n});return t}function Xj(e){return e.kind===`skill`?[e.name,e.label,...e.name.split(/[-:_]/)]:[e.name,...e.kind===`command`?e.aliases??[]:[],...e.name.split(`:`)]}function Zj(e,t){let n=e.toLowerCase(),r=t.map(e=>e.toLowerCase());return r.some(e=>e.startsWith(n))?2:+!!r.some(e=>e.includes(n))}function Qj(e,t){let n=[];return t.forEach((t,r)=>{if(t.kind===`skill`&&!t.enabled)return;let i=Zj(e,Xj(t));i>0&&n.push({score:i,index:r,row:t})}),n.sort((e,t)=>t.score-e.score||Wj[e.row.kind]-Wj[t.row.kind]||e.index-t.index),n.map(({row:e})=>e)}function $j(e,t){let n=e.trim();if(!n)return[...t];let r=[];return t.forEach((e,t)=>{let i=Zj(n,[e.slug,e.label,...e.slug.split(`-`)]);i>0&&r.push({score:i,index:t,peer:e})}),r.sort((e,t)=>t.score-e.score||e.index-t.index),r.map(({peer:e})=>e)}function eM(e,t){let n=/^\/([\w:-]+)[ \t]*([\s\S]*)$/.exec(e.trim());if(!n)return;let r=t.find(e=>e.name===n[1]);return r?{command:r,args:n[2].trim()}:void 0}function tM(e){return e.map(e=>e.kind===`skill`?{kind:e.kind,name:e.name,label:e.label,description:e.description,scope:e.scope,enabled:e.enabled,insertText:Jj(e.skill)}:{kind:e.kind,name:e.name,label:`/${e.name}`,description:e.description,enabled:!0,insertText:`/${e.name} `})}var nM=(0,v.createContext)(`cards`);function rM({value:e,children:t}){return(0,U.jsx)(nM.Provider,{value:e,children:t})}function iM(){return(0,v.useContext)(nM)}var aM=(0,v.createContext)(`comfortable`);function oM({value:e,children:t}){return(0,U.jsx)(aM.Provider,{value:e,children:t})}var sM={terminal:{comfortable:{className:`term-row-gap`,px:18},compact:{className:`term-row-gap`,px:18}},cards:{comfortable:{className:`pt-4`,px:16},compact:{className:`pt-2`,px:8}}},cM=`context compacted · earlier turns summarised to fit the window`;function lM(e){return e.error?`context compaction failed · ${e.error}`:e.pending?`compacting context · summarising earlier turns to fit the window`:[cM,e.preTokens===void 0?void 0:e.postTokens===void 0?`from ${fM(e.preTokens)}`:`${fM(e.preTokens)} → ${fM(e.postTokens)}`,e.trigger===`auto`?`automatic`:void 0].filter(Boolean).join(` · `)}function uM(e){return e===void 0||Number.isNaN(e)?`-`:e===0?`$0.00`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function dM(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function fM(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function pM(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function mM(e,t=Date.now()){let n=e-t;if(n<=0)return`now`;let r=Math.ceil(n/6e4);if(r<1)return`<1m`;if(r<60)return`${r}m`;let i=Math.floor(r/1440);return i>=1?`${i}d ${Math.floor(r%1440/60)}h`:`${Math.floor(r/60)}h ${r%60}m`}function hM(e,t=Date.now()){if(!e)return`-`;let n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function gM(e){if(e===`five_hour`)return`5-hour session`;if(e===`seven_day`)return`Weekly`;if(e===`seven_day_oauth_apps`)return`Weekly · apps`;let t=e=>e.replace(/\b\w/g,e=>e.toUpperCase());return e.startsWith(`seven_day_`)?`Weekly · ${t(e.slice(10).replaceAll(`_`,` `))}`:t(e.replaceAll(`_`,` `))}function _M(e){if(e===`five_hour`)return 18e3;if(e.startsWith(`seven_day`))return 604800}function vM(e,t=Date.now()){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n} sec${n===1?``:`s`} ago`;if(n<3600){let e=Math.floor(n/60);return`${e} min${e===1?``:`s`} ago`}let r=Math.floor(n/3600);return`${r} hour${r===1?``:`s`} ago`}function yM(e,t=80){if(e==null)return``;if(typeof e==`object`){let n=e,r=n.command??n.file_path??n.path??n.url??n.pattern??n.query??n.description;if(typeof r==`string`)return r.length>t?r.slice(0,t-1)+`…`:r}let n=JSON.stringify(e)??``;return n.length>t?n.slice(0,t-1)+`…`:n}var bM={gpt:{name:`GPT`,joiner:`-`},deepseek:{name:`DeepSeek`},glm:{name:`GLM`},qwen:{name:`Qwen`},kimi:{name:`Kimi`},llama:{name:`Llama`},mistral:{name:`Mistral`},grok:{name:`Grok`}};function xM(e){if(!e)return;let t=(e.split(`[`)[0]??e).toLowerCase().split(`-`).filter(Boolean);t[0]===`claude`&&t.shift();let n=t.shift();if(!n)return e;let r=bM[n],i=r?.name??(/^o\d+$/.test(n)?n:`${n.charAt(0).toUpperCase()}${n.slice(1)}`),a=[],o=[];for(let e of t)/^\d{8}$/.test(e)||(/^\d+(\.\d+)?$/.test(e)?a.push(e):o.push(`${e.charAt(0).toUpperCase()}${e.slice(1)}`));return[a.length>0?`${i}${r?.joiner??` `}${a.join(`.`)}`:i,...o].join(` `)}function SM(e){switch(e){case`Bash`:case`BashOutput`:case`KillShell`:return QS;case`Read`:return sy;case`Write`:return MS;case`Edit`:case`MultiEdit`:case`NotebookEdit`:return fx;case`Glob`:return vy;case`Grep`:return oS;case`WebFetch`:return hv;case`WebSearch`:return Ry;case`Task`:case`Agent`:return mC;case`TodoWrite`:case`TaskCreate`:case`TaskUpdate`:case`TaskGet`:case`TaskList`:return AS;case`Skill`:return ES;case`AskUserQuestion`:return Ab;case`CodexCommand`:return QS;case`CodexFileChange`:return aee;case`CodexWebSearch`:return Ry;case`CodexImageGeneration`:case`CodexImageView`:return Qy;default:return e.startsWith(`mcp__`)?Ax:TC}}function CM(e){return e===`Bash`||e===`CodexCommand`}function wM(e){switch(e){case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:case`Update`:case`CodexFileChange`:return!0;default:return!1}}var TM=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`],EM=new Set,DM,OM=`⠿`;function kM(e){return TM[Math.floor(e/90)%TM.length]}function AM(){let e=kM(Date.now());if(e!==OM){OM=e;for(let e of EM)e()}}function jM(e){return EM.add(e),DM===void 0&&(OM=kM(Date.now()),DM=setInterval(AM,90)),()=>{EM.delete(e),EM.size===0&&DM!==void 0&&(clearInterval(DM),DM=void 0)}}function MM(){return NM}function NM(){}function PM(){return OM}function FM(){return`⠿`}function IM(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`);if(!e)return;t(e.matches);let n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function LM(e){let t=IM(),n=e&&!t;return(0,v.useSyncExternalStore)(n?jM:MM,n?PM:FM,FM)}var RM=(0,v.createContext)(void 0),zM=(0,v.createContext)(void 0);function BM({names:e,children:t}){return(0,U.jsx)(RM.Provider,{value:e,children:t})}function VM({names:e,children:t}){return(0,U.jsx)(zM.Provider,{value:e,children:t})}function HM({text:e,className:t}){let n=$A(e,{skills:(0,v.useContext)(RM),sessions:(0,v.useContext)(zM)});if(n.length===0)return(0,U.jsx)(`span`,{className:t,children:e});let r=[],i=0;for(let[t,a]of n.entries())a.start>i&&r.push(e.slice(i,a.start)),r.push((0,U.jsx)(`span`,{className:W(`font-mono`,a.kind===`file`?`text-accent`:`text-info`),children:a.text},`${a.start}-${t}`)),i=a.end;return i<e.length&&r.push(e.slice(i)),(0,U.jsx)(`span`,{className:t,children:r.map((e,t)=>(0,U.jsx)(v.Fragment,{children:e},t))})}var UM=`output expired or not tracked by this gateway`;function WM(e){return e.label||e.command.split(`
|
|
50
|
+
`)[0]||``}function GM(e){return`#${e.ordinal} ${WM(e)}`}function KM(e){return WM(e.shell)}function qM(e){return YM(e.shell)}function JM(e){return e.status===`exited`&&e.exitCode!==0}function YM(e){if(e.status===`running`)return`running`;if(typeof e.exitCode==`number`)return e.exitCode===0?`exit 0`:`exit ${e.exitCode}`;switch(e.endReason){case`killed`:return`killed`;case`timeout`:return`timed out`;case`server_stopped`:return`killed: the gateway stopped`;case`server_restarted`:return`ended: the gateway restarted, the process may still be running`;case`spawn_failed`:return`failed to start`;default:return`ended`}}function XM(e){return JM(e.shell)}function ZM(e){return`${KM(e)} · ${qM(e)}`}function QM(e,t){let n=t&&e.expanded!==void 0?e.expanded:e.text;if(n===``)return[];let r=n.split(`
|
|
51
|
+
`);if(!t)return r;let i=[],a=0;for(let e of r){if(i.length>0&&a+e.length>1e5)break;i.push(e),a+=e.length+1}return i}function $M(e,t,n){if(e.missing)return UM;if(!t)return e.truncated?`… more output - expand to fetch it`:void 0;let r=e.expanded===void 0?void 0:e.expanded.split(`
|
|
52
|
+
`).length;if(r!==void 0&&r>n)return`… +${(r-n).toLocaleString()} lines not shown`;if(e.expanded===void 0&&e.truncated)return`… fetching the full output`}var eN={hover:!0,actions:!0},tN=(0,v.createContext)(eN);function nN(){return(0,v.useContext)(tN)}function rN(e){return e===!1?{hover:!1,actions:!1}:e===!0||e===void 0?eN:{...eN,...e}}function iN({value:e,children:t}){return(0,U.jsx)(tN.Provider,{value:e,children:t})}function aN({actions:e,children:t,className:n}){let{actions:r}=nN();return r?(0,U.jsxs)(`div`,{className:W(`term-hoverable`,n),children:[t,(0,U.jsx)(`div`,{className:`term-actions`,children:e})]}):(0,U.jsx)(U.Fragment,{children:t})}var oN=(0,v.createContext)(void 0);function sN({value:e,children:t}){return(0,U.jsx)(oN.Provider,{value:e,children:t})}function cN({id:e}){let t=(0,v.useContext)(oN);if(!t)return null;let n=t.has(e),r=n?`Remove bookmark`:`Bookmark`;return(0,U.jsx)(`button`,{type:`button`,className:`term-action`,title:r,"aria-label":r,"aria-pressed":n,onClick:n=>{n.stopPropagation(),t.toggle(e)},children:n?`★`:`☆`})}function lN({onOpen:e,label:t=`Open sub-agent`}){return(0,U.jsx)(`button`,{type:`button`,className:`term-action`,title:t,"aria-label":t,onClick:t=>{t.stopPropagation(),e()},children:`⤢`})}function uN({onOpen:e,label:t=`Open terminal`}){return(0,U.jsx)(`button`,{type:`button`,className:`term-action`,title:t,"aria-label":t,"data-tone":`magenta`,onClick:t=>{t.stopPropagation(),e()},children:`⤢`})}function dN({onKill:e,label:t=`Kill this shell`}){return(0,U.jsx)(`button`,{type:`button`,className:`term-action`,title:t,"aria-label":t,"data-tone":`red`,onClick:t=>{t.stopPropagation(),e()},children:`✕`})}function fN({text:e,label:t=`Copy`}){let[n,r]=(0,v.useState)(!1);return(0,U.jsx)(`button`,{type:`button`,className:`term-action`,title:t,"aria-label":t,onClick:t=>{t.stopPropagation(),HT(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),1200))})},children:n?`✓`:`⧉`})}function pN({glyph:e,glyphTone:t,tone:n,bold:r,indent:i,columns:a,className:o,children:s,style:c,...l}){return(0,U.jsxs)(`div`,{className:W(`term-row`,o),"data-indent":i?String(i):void 0,"data-tone":n,"data-weight":r?`bold`:void 0,style:a===void 0?c:{...c,"--term-cell":`${a}ch`},...l,children:[(0,U.jsx)(`span`,{className:`term-gutter`,"data-tone":t,"aria-hidden":!0,children:e??` `}),(0,U.jsx)(`div`,{className:`term-body`,children:s})]})}function mN(){return(0,U.jsx)(`div`,{className:`term-blank`,"aria-hidden":!0})}function hN({className:e,...t}){return(0,U.jsx)(`div`,{className:W(`term-band`,e),...t})}function gN({tone:e,bold:t,className:n,...r}){return(0,U.jsx)(`span`,{"data-tone":e,"data-weight":t?`bold`:void 0,className:n,...r})}function _N(e){return e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`}function vN(e){let t=e.oldStart,n=e.newStart,r=[];for(let i of e.lines){let e=_N(i),a=i.slice(1);e===`add`?r.push({kind:e,number:n++,text:a}):e===`remove`?r.push({kind:e,number:t++,text:a}):(r.push({kind:e,number:n,text:a}),t++,n++)}return r}var yN={context:` `,add:`+`,remove:`-`};function bN(e){let t=e,n=typeof t?.old_string==`string`?t.old_string:void 0,r=typeof t?.new_string==`string`?t.new_string:void 0;if(n===void 0&&r===void 0)return;let i=[...n?n.split(`
|
|
53
|
+
`).map(e=>`-${e}`):[],...r?r.split(`
|
|
54
|
+
`).map(e=>`+${e}`):[]];if(i.length!==0)return{...typeof t?.file_path==`string`&&{path:t.file_path},hunks:[{oldStart:0,oldLines:0,newStart:0,newLines:0,lines:i}]}}function xN({patch:e}){let t=e.hunks.map(vN),n=e.hunks.some(e=>e.newStart>0),r=n?String(Math.max(...t.flat().map(e=>e.number),1)).length:0,i=n?r+3:2;return(0,U.jsxs)(`div`,{className:`term-diff`,children:[t.map((e,t)=>(0,U.jsxs)(`div`,{children:[t>0?(0,U.jsx)(pN,{columns:i,glyph:` `.repeat(r)+` ⋮`,tone:`faint`}):null,e.map((e,t)=>(0,U.jsx)(pN,{columns:i,"data-diff":e.kind,glyph:n?`${String(e.number).padStart(r)} ${yN[e.kind]}`:yN[e.kind],children:e.text||` `},t))]},t)),e.truncated?(0,U.jsx)(pN,{columns:i,tone:`faint`,children:`… diff truncated`}):null]})}var SN=(function(e){if(e==null)return DN;if(typeof e==`function`)return EN(e);if(typeof e==`object`)return Array.isArray(e)?CN(e):wN(e);if(typeof e==`string`)return TN(e);throw Error(`Expected function, string, or object as test`)});function CN(e){let t=[],n=-1;for(;++n<e.length;)t[n]=SN(e[n]);return EN(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function wN(e){let t=e;return EN(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function TN(e){return EN(t);function t(t){return t&&t.type===e}}function EN(e){return t;function t(t,n,r){return!!(ON(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function DN(){return!0}function ON(e){return typeof e==`object`&&!!e&&`type`in e}function kN(e){return e}var AN=[],jN=`skip`;function MN(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=SN(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+kN(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=AN,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=NN(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function NN(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?AN:[e]}function PN(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),MN(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var FN={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function IN({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=FN.indicator,imageBlockPolicy:c=FN.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=KN(e,t,n,r,i,a,o,s,c);HN(l),PN(l,u)}}function LN(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function RN(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var zN=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),BN=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function VN(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=LN(e,n);if(!o||BN.has(o.protocol)||!(zN.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=RN(e);return o&&t.some(e=>{let t=LN(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function HN(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)HN(t)}}var UN=Symbol(`node-seen`);function WN(e,t,n){return t===FN.remove?{type:`remove`}:t===FN.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function GN(e,t,n){if(t===FN.remove)return{type:`remove`};if(t===FN.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var KN=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[UN])return!0;if(u.tagName===`a`){let n=VN(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[UN]=!0,PN(u,l),f&&typeof d==`number`){let e=WN(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[jN,d];f.children[d]=e.element}return jN}return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=VN(u.properties.src,n,e,r,!0,i);if(t===null){if(u[UN]=!0,PN(u,l),f&&typeof d==`number`){let e=GN(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[jN,d];f.children[d]=e.element}return jN}return u.properties.src=t,!0}return!0};return l},{defineProperty:qN}=Object,JN=typeof self==`object`?self:globalThis,YN=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new JN[e](t)},XN=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?qN(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof JN[e]==`function`?YN(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(YN(a,o),i)};return r},ZN=e=>XN(new Map,e)(0),QN=``,{toString:$N}={},{keys:zee,is:eP}=Object,tP=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=$N.call(e).slice(8,-1);switch(n){case`Array`:return[1,QN];case`Object`:return[2,QN];case`Date`:return[3,QN];case`RegExp`:return[4,QN];case`Map`:return[5,QN];case`Set`:return[6,QN];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},nP=([e,t])=>e===0&&(t===`function`||t===`symbol`),rP=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=tP(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&eP(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of zee(o))(e||!nP(tP(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?QN:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(nP(tP(n))||nP(tP(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!nP(tP(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},iP=(e,{json:t,lossy:n}={})=>{let r=[];return rP(!(t||n),!!t,new Map,r)(e),r},aP=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ZN(iP(e,t)):structuredClone(e):(e,t)=>ZN(iP(e,t)),oP=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};oP.prototype.normal={},oP.prototype.property={},oP.prototype.space=void 0;function sP(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new oP(n,r,t)}function cP(e){return e.toLowerCase()}var lP=class{constructor(e,t){this.attribute=t,this.property=e}};lP.prototype.attribute=``,lP.prototype.booleanish=!1,lP.prototype.boolean=!1,lP.prototype.commaOrSpaceSeparated=!1,lP.prototype.commaSeparated=!1,lP.prototype.defined=!1,lP.prototype.mustUseProperty=!1,lP.prototype.number=!1,lP.prototype.overloadedBoolean=!1,lP.prototype.property=``,lP.prototype.spaceSeparated=!1,lP.prototype.space=void 0;var uP=s({boolean:()=>fP,booleanish:()=>pP,commaOrSpaceSeparated:()=>vP,commaSeparated:()=>_P,number:()=>hP,overloadedBoolean:()=>mP,spaceSeparated:()=>gP}),dP=0,fP=yP(),pP=yP(),mP=yP(),hP=yP(),gP=yP(),_P=yP(),vP=yP();function yP(){return 2**++dP}var bP=Object.keys(uP),xP=class extends lP{constructor(e,t,n,r){let i=-1;if(super(e,t),SP(this,`space`,r),typeof n==`number`)for(;++i<bP.length;){let e=bP[i];SP(this,bP[i],(n&uP[e])===uP[e])}}};xP.prototype.defined=!0;function SP(e,t,n){n&&(e[t]=n)}function CP(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new xP(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[cP(r)]=r,n[cP(a.attribute)]=r}return new oP(t,n,e.space)}var wP=CP({properties:{ariaActiveDescendant:null,ariaAtomic:pP,ariaAutoComplete:null,ariaBusy:pP,ariaChecked:pP,ariaColCount:hP,ariaColIndex:hP,ariaColSpan:hP,ariaControls:gP,ariaCurrent:null,ariaDescribedBy:gP,ariaDetails:null,ariaDisabled:pP,ariaDropEffect:gP,ariaErrorMessage:null,ariaExpanded:pP,ariaFlowTo:gP,ariaGrabbed:pP,ariaHasPopup:null,ariaHidden:pP,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gP,ariaLevel:hP,ariaLive:null,ariaModal:pP,ariaMultiLine:pP,ariaMultiSelectable:pP,ariaOrientation:null,ariaOwns:gP,ariaPlaceholder:null,ariaPosInSet:hP,ariaPressed:pP,ariaReadOnly:pP,ariaRelevant:null,ariaRequired:pP,ariaRoleDescription:gP,ariaRowCount:hP,ariaRowIndex:hP,ariaRowSpan:hP,ariaSelected:pP,ariaSetSize:hP,ariaSort:null,ariaValueMax:hP,ariaValueMin:hP,ariaValueNow:hP,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function TP(e,t){return t in e?e[t]:t}function EP(e,t){return TP(e,t.toLowerCase())}var DP=CP({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:_P,acceptCharset:gP,accessKey:gP,action:null,allow:null,allowFullScreen:fP,allowPaymentRequest:fP,allowUserMedia:fP,alpha:fP,alt:null,as:null,async:fP,autoCapitalize:null,autoComplete:gP,autoFocus:fP,autoPlay:fP,blocking:gP,capture:null,charSet:null,checked:fP,cite:null,className:gP,closedBy:null,colorSpace:null,cols:hP,colSpan:hP,command:null,commandFor:null,content:null,contentEditable:pP,controls:fP,controlsList:gP,coords:hP|_P,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fP,defer:fP,dir:null,dirName:null,disabled:fP,download:mP,draggable:pP,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fP,formTarget:null,headers:gP,height:hP,hidden:mP,high:hP,href:null,hrefLang:null,htmlFor:gP,httpEquiv:gP,id:null,imageSizes:null,imageSrcSet:null,inert:fP,inputMode:null,integrity:null,is:null,isMap:fP,itemId:null,itemProp:gP,itemRef:gP,itemScope:fP,itemType:gP,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fP,low:hP,manifest:null,max:null,maxLength:hP,media:null,method:null,min:null,minLength:hP,multiple:fP,muted:fP,name:null,nonce:null,noModule:fP,noValidate:fP,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:fP,optimum:hP,pattern:null,ping:gP,placeholder:null,playsInline:fP,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fP,referrerPolicy:null,rel:gP,required:fP,reversed:fP,rows:hP,rowSpan:hP,sandbox:gP,scope:null,scoped:fP,seamless:fP,selected:fP,shadowRootClonable:fP,shadowRootCustomElementRegistry:fP,shadowRootDelegatesFocus:fP,shadowRootMode:null,shadowRootSerializable:fP,shape:null,size:hP,sizes:null,slot:null,span:hP,spellCheck:pP,src:null,srcDoc:null,srcLang:null,srcSet:null,start:hP,step:null,style:null,tabIndex:hP,target:null,title:null,translate:null,type:null,typeMustMatch:fP,useMap:null,value:pP,width:hP,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gP,axis:null,background:null,bgColor:null,border:hP,borderColor:null,bottomMargin:hP,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fP,declare:fP,event:null,face:null,frame:null,frameBorder:null,hSpace:hP,leftMargin:hP,link:null,longDesc:null,lowSrc:null,marginHeight:hP,marginWidth:hP,noResize:fP,noHref:fP,noShade:fP,noWrap:fP,object:null,profile:null,prompt:null,rev:null,rightMargin:hP,rules:null,scheme:null,scrolling:pP,standby:null,summary:null,text:null,topMargin:hP,valueType:null,version:null,vAlign:null,vLink:null,vSpace:hP,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:fP,disablePictureInPicture:fP,disableRemotePlayback:fP,exportParts:_P,part:gP,prefix:null,property:null,results:hP,security:null,unselectable:null},space:`html`,transform:EP}),OP=CP({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:vP,accentHeight:hP,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:hP,amplitude:hP,arabicForm:null,ascent:hP,attributeName:null,attributeType:null,azimuth:hP,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:hP,by:null,calcMode:null,capHeight:hP,className:gP,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:hP,diffuseConstant:hP,direction:null,display:null,dur:null,divisor:hP,dominantBaseline:null,download:fP,dx:null,dy:null,edgeMode:null,editable:null,elevation:hP,enableBackground:null,end:null,event:null,exponent:hP,externalResourcesRequired:null,fill:null,fillOpacity:hP,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:_P,g2:_P,glyphName:_P,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:hP,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:hP,horizOriginX:hP,horizOriginY:hP,id:null,ideographic:hP,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:hP,k:hP,k1:hP,k2:hP,k3:hP,k4:hP,kernelMatrix:vP,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:hP,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:hP,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:hP,overlineThickness:hP,paintOrder:null,panose1:null,path:null,pathLength:hP,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gP,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:hP,pointsAtY:hP,pointsAtZ:hP,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vP,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vP,rev:vP,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vP,requiredFeatures:vP,requiredFonts:vP,requiredFormats:vP,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:hP,specularExponent:hP,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:hP,strikethroughThickness:hP,string:null,stroke:null,strokeDashArray:vP,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:hP,strokeOpacity:hP,strokeWidth:null,style:null,surfaceScale:hP,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vP,tabIndex:hP,tableValues:null,target:null,targetX:hP,targetY:hP,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vP,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:hP,underlineThickness:hP,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:hP,values:null,vAlphabetic:hP,vMathematical:hP,vectorEffect:null,vHanging:hP,vIdeographic:hP,version:null,vertAdvY:hP,vertOriginX:hP,vertOriginY:hP,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:hP,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:TP}),kP=CP({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),AP=CP({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:EP}),jP=CP({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),MP={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`},NP=/[A-Z]/g,PP=/-[a-z]/g,FP=/^data[-\w.:]+$/i;function IP(e,t){let n=cP(t),r=t,i=lP;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&FP.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(PP,RP);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!PP.test(e)){let n=e.replace(NP,LP);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=xP}return new i(r,t)}function LP(e){return`-`+e.toLowerCase()}function RP(e){return e.charAt(1).toUpperCase()}var zP=sP([wP,DP,kP,AP,jP],`html`),BP=sP([wP,OP,kP,AP,jP],`svg`);function VP(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function HP(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var UP=/[#.]/g;function WP(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){UP.lastIndex=i;let e=UP.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function GP(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function KP(e){return e.join(` `).trim()}function qP(e,t,n){let r=n?$P(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=WP(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,JP(i))a.unshift(i);else for(let[t,n]of Object.entries(i))YP(e,o.properties,t,n)}for(let e of a)XP(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function JP(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function YP(e,t,n,r){let i=IP(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?GP(r):i.commaSeparated?VP(r):i.commaOrSpaceSeparated?GP(VP(r).join(` `)):ZP(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?QP(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(ZP(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function XP(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)XP(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?XP(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function ZP(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||cP(n)===cP(t)))return!0}return n}function QP(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function $P(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var eF=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),tF=qP(zP,`div`),nF=qP(BP,`g`,eF);function rF(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=iF(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=iF(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function iF(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
55
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var aF={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},oF={}.hasOwnProperty,sF=Object.prototype;function cF(e,t){let n=t||{};return lF({file:n.file||void 0,location:!1,schema:n.space===`svg`?BP:zP,verbose:n.verbose||!1},e)}function lF(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},fF(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:uF(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=rF(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},fF(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},fF(e,r,n),n}default:return n=dF(e,t),n}}function uF(e,t){let n=-1,r=[];for(;++n<t.length;){let i=lF(e,t[n]);r.push(i)}return r}function dF(e,t){let n=e.schema;e.schema=t.namespaceURI===aF.svg?BP:zP;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;oF.call(sF,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?nF:tF)(t.tagName,i,uF(e,t.childNodes));if(fF(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&mF(r.startTag),o=r&&r.endTag&&mF(r.endTag),s=lF(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function fF(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=pF(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function pF(e,t,n){let r=mF(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)oF.call(n.attrs,i)&&(r[IP(e.schema,i).property]=mF(n.attrs[i]));n.startTag;let a=mF(n.startTag),o=n.endTag?mF(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function mF(e){let t=hF({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=hF({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function hF(e){return e.line&&e.column?e:void 0}var gF={}.hasOwnProperty;function _F(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&gF.call(t,e)){let n=String(t[e]);i=gF.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var vF={},yF={}.hasOwnProperty,bF=_F(`type`,{handlers:{root:SF,element:DF,text:TF,comment:EF,doctype:wF}});function xF(e,t){let n=(t||vF).space;return bF(e,n===`svg`?BP:zP)}function SF(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=kF(e.children,n,t),AF(e,n),n}function CF(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=kF(e.children,n,t),AF(e,n),n}function wF(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return AF(e,t),t}function TF(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return AF(e,t),t}function EF(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return AF(e,t),t}function DF(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=BP);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&yF.call(e.properties,a)){let t=OF(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:aF[o],childNodes:[],parentNode:null};return s.childNodes=kF(e.children,s,r),AF(e,s),e.tagName===`template`&&e.content&&(s.content=CF(e.content,r)),s}function OF(e,t,n){let r=IP(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?HP(n):KP(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=aF[r.space]}return i}function kF(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=bF(e[r],n);a.parentNode=t,i.push(a)}return i}function AF(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var jF=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],MF=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),K;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(K||={});var NF={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function PF(e){return e>=55296&&e<=57343}function FF(e){return e>=56320&&e<=57343}function IF(e,t){return(e-55296)*1024+9216+t}function LF(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function RF(e){return e>=64976&&e<=65007||MF.has(e)}var q;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(q||={});var zF=65536,BF=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=zF,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(FF(t))return this.pos++,this._addGap(),IF(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,K.EOF;return this._err(q.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,K.EOF;let n=this.html.charCodeAt(t);return n===K.CARRIAGE_RETURN?K.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,K.EOF;let e=this.html.charCodeAt(this.pos);return e===K.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,K.LINE_FEED):e===K.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,PF(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===K.LINE_FEED||e===K.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){LF(e)?this._err(q.controlCharacterInInputStream):RF(e)&&this._err(q.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},VF;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(VF||={});function HF(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var UF=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),WF=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function GF(e){return e>=55296&&e<=57343||e>1114111?65533:WF.get(e)??e}var KF;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(KF||={});var qF=32,JF;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(JF||={});function YF(e){return e>=KF.ZERO&&e<=KF.NINE}function XF(e){return e>=KF.UPPER_A&&e<=KF.UPPER_F||e>=KF.LOWER_A&&e<=KF.LOWER_F}function ZF(e){return e>=KF.UPPER_A&&e<=KF.UPPER_Z||e>=KF.LOWER_A&&e<=KF.LOWER_Z||YF(e)}function QF(e){return e===KF.EQUALS||ZF(e)}var $F;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})($F||={});var eI;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(eI||={});var tI=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=$F.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=eI.Strict}startEntity(e){this.decodeMode=e,this.state=$F.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case $F.EntityStart:return e.charCodeAt(t)===KF.NUM?(this.state=$F.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=$F.NamedEntity,this.stateNamedEntity(e,t));case $F.NumericStart:return this.stateNumericStart(e,t);case $F.NumericDecimal:return this.stateNumericDecimal(e,t);case $F.NumericHex:return this.stateNumericHex(e,t);case $F.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|qF)===KF.LOWER_X?(this.state=$F.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=$F.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(YF(r)||XF(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(YF(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===KF.SEMI)this.consumed+=1;else if(this.decodeMode===eI.Strict)return 0;return this.emitCodePoint(GF(this.result),this.consumed),this.errors&&(e!==KF.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&JF.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=nI(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===eI.Attribute&&(i===0||QF(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&JF.VALUE_LENGTH)>>14,i!==0){if(a===KF.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==eI.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&JF.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~JF.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case $F.NamedEntity:return this.result!==0&&(this.decodeMode!==eI.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $F.NumericDecimal:return this.emitNumericEntity(0,2);case $F.NumericHex:return this.emitNumericEntity(0,3);case $F.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $F.EntityStart:return 0}}};function nI(e,t,n,r){let i=(t&JF.BRANCH_LENGTH)>>7,a=t&JF.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var J;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(J||={});var rI;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(rI||={});var iI;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(iI||={});var Y;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(Y||={});var X;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(X||={});var aI=new Map([[Y.A,X.A],[Y.ADDRESS,X.ADDRESS],[Y.ANNOTATION_XML,X.ANNOTATION_XML],[Y.APPLET,X.APPLET],[Y.AREA,X.AREA],[Y.ARTICLE,X.ARTICLE],[Y.ASIDE,X.ASIDE],[Y.B,X.B],[Y.BASE,X.BASE],[Y.BASEFONT,X.BASEFONT],[Y.BGSOUND,X.BGSOUND],[Y.BIG,X.BIG],[Y.BLOCKQUOTE,X.BLOCKQUOTE],[Y.BODY,X.BODY],[Y.BR,X.BR],[Y.BUTTON,X.BUTTON],[Y.CAPTION,X.CAPTION],[Y.CENTER,X.CENTER],[Y.CODE,X.CODE],[Y.COL,X.COL],[Y.COLGROUP,X.COLGROUP],[Y.DD,X.DD],[Y.DESC,X.DESC],[Y.DETAILS,X.DETAILS],[Y.DIALOG,X.DIALOG],[Y.DIR,X.DIR],[Y.DIV,X.DIV],[Y.DL,X.DL],[Y.DT,X.DT],[Y.EM,X.EM],[Y.EMBED,X.EMBED],[Y.FIELDSET,X.FIELDSET],[Y.FIGCAPTION,X.FIGCAPTION],[Y.FIGURE,X.FIGURE],[Y.FONT,X.FONT],[Y.FOOTER,X.FOOTER],[Y.FOREIGN_OBJECT,X.FOREIGN_OBJECT],[Y.FORM,X.FORM],[Y.FRAME,X.FRAME],[Y.FRAMESET,X.FRAMESET],[Y.H1,X.H1],[Y.H2,X.H2],[Y.H3,X.H3],[Y.H4,X.H4],[Y.H5,X.H5],[Y.H6,X.H6],[Y.HEAD,X.HEAD],[Y.HEADER,X.HEADER],[Y.HGROUP,X.HGROUP],[Y.HR,X.HR],[Y.HTML,X.HTML],[Y.I,X.I],[Y.IMG,X.IMG],[Y.IMAGE,X.IMAGE],[Y.INPUT,X.INPUT],[Y.IFRAME,X.IFRAME],[Y.KEYGEN,X.KEYGEN],[Y.LABEL,X.LABEL],[Y.LI,X.LI],[Y.LINK,X.LINK],[Y.LISTING,X.LISTING],[Y.MAIN,X.MAIN],[Y.MALIGNMARK,X.MALIGNMARK],[Y.MARQUEE,X.MARQUEE],[Y.MATH,X.MATH],[Y.MENU,X.MENU],[Y.META,X.META],[Y.MGLYPH,X.MGLYPH],[Y.MI,X.MI],[Y.MO,X.MO],[Y.MN,X.MN],[Y.MS,X.MS],[Y.MTEXT,X.MTEXT],[Y.NAV,X.NAV],[Y.NOBR,X.NOBR],[Y.NOFRAMES,X.NOFRAMES],[Y.NOEMBED,X.NOEMBED],[Y.NOSCRIPT,X.NOSCRIPT],[Y.OBJECT,X.OBJECT],[Y.OL,X.OL],[Y.OPTGROUP,X.OPTGROUP],[Y.OPTION,X.OPTION],[Y.P,X.P],[Y.PARAM,X.PARAM],[Y.PLAINTEXT,X.PLAINTEXT],[Y.PRE,X.PRE],[Y.RB,X.RB],[Y.RP,X.RP],[Y.RT,X.RT],[Y.RTC,X.RTC],[Y.RUBY,X.RUBY],[Y.S,X.S],[Y.SCRIPT,X.SCRIPT],[Y.SEARCH,X.SEARCH],[Y.SECTION,X.SECTION],[Y.SELECT,X.SELECT],[Y.SOURCE,X.SOURCE],[Y.SMALL,X.SMALL],[Y.SPAN,X.SPAN],[Y.STRIKE,X.STRIKE],[Y.STRONG,X.STRONG],[Y.STYLE,X.STYLE],[Y.SUB,X.SUB],[Y.SUMMARY,X.SUMMARY],[Y.SUP,X.SUP],[Y.TABLE,X.TABLE],[Y.TBODY,X.TBODY],[Y.TEMPLATE,X.TEMPLATE],[Y.TEXTAREA,X.TEXTAREA],[Y.TFOOT,X.TFOOT],[Y.TD,X.TD],[Y.TH,X.TH],[Y.THEAD,X.THEAD],[Y.TITLE,X.TITLE],[Y.TR,X.TR],[Y.TRACK,X.TRACK],[Y.TT,X.TT],[Y.U,X.U],[Y.UL,X.UL],[Y.SVG,X.SVG],[Y.VAR,X.VAR],[Y.WBR,X.WBR],[Y.XMP,X.XMP]]);function oI(e){return aI.get(e)??X.UNKNOWN}var Z=X,sI={[J.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[J.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[J.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[J.XLINK]:new Set,[J.XML]:new Set,[J.XMLNS]:new Set},cI=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]);Y.STYLE,Y.SCRIPT,Y.XMP,Y.IFRAME,Y.NOEMBED,Y.NOFRAMES,Y.PLAINTEXT;var Q;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(Q||={});var lI={DATA:Q.DATA,RCDATA:Q.RCDATA,RAWTEXT:Q.RAWTEXT,SCRIPT_DATA:Q.SCRIPT_DATA,PLAINTEXT:Q.PLAINTEXT,CDATA_SECTION:Q.CDATA_SECTION};function uI(e){return e>=K.DIGIT_0&&e<=K.DIGIT_9}function dI(e){return e>=K.LATIN_CAPITAL_A&&e<=K.LATIN_CAPITAL_Z}function fI(e){return e>=K.LATIN_SMALL_A&&e<=K.LATIN_SMALL_Z}function pI(e){return fI(e)||dI(e)}function mI(e){return pI(e)||uI(e)}function hI(e){return e+32}function gI(e){return e===K.SPACE||e===K.LINE_FEED||e===K.TABULATION||e===K.FORM_FEED}function _I(e){return gI(e)||e===K.SOLIDUS||e===K.GREATER_THAN_SIGN}function vI(e){return e===K.NULL?q.nullCharacterReference:e>1114111?q.characterReferenceOutsideUnicodeRange:PF(e)?q.surrogateCharacterReference:RF(e)?q.noncharacterCharacterReference:LF(e)||e===K.CARRIAGE_RETURN?q.controlCharacterReference:null}var yI=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=Q.DATA,this.returnState=Q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new BF(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new tI(UF,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(q.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(q.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=vI(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:VF.START_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:VF.END_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:VF.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:VF.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(HF(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(q.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=oI(e.tagName),e.type===VF.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(q.endTagWithAttributes),e.selfClosing&&this._err(q.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case VF.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case VF.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case VF.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:VF.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=gI(e)?VF.WHITESPACE_CHARACTER:e===K.NULL?VF.NULL_CHARACTER:VF.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(VF.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?eI.Attribute:eI.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Q.DATA:this._stateData(e);break;case Q.RCDATA:this._stateRcdata(e);break;case Q.RAWTEXT:this._stateRawtext(e);break;case Q.SCRIPT_DATA:this._stateScriptData(e);break;case Q.PLAINTEXT:this._statePlaintext(e);break;case Q.TAG_OPEN:this._stateTagOpen(e);break;case Q.END_TAG_OPEN:this._stateEndTagOpen(e);break;case Q.TAG_NAME:this._stateTagName(e);break;case Q.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case Q.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case Q.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case Q.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case Q.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case Q.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case Q.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case Q.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case Q.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case Q.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case Q.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case Q.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case Q.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case Q.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case Q.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case Q.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case Q.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case Q.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case Q.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case Q.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case Q.BOGUS_COMMENT:this._stateBogusComment(e);break;case Q.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case Q.COMMENT_START:this._stateCommentStart(e);break;case Q.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case Q.COMMENT:this._stateComment(e);break;case Q.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case Q.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case Q.COMMENT_END:this._stateCommentEnd(e);break;case Q.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case Q.DOCTYPE:this._stateDoctype(e);break;case Q.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case Q.DOCTYPE_NAME:this._stateDoctypeName(e);break;case Q.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case Q.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case Q.CDATA_SECTION:this._stateCdataSection(e);break;case Q.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case Q.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case Q.CHARACTER_REFERENCE:this._stateCharacterReference();break;case Q.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case K.LESS_THAN_SIGN:this.state=Q.TAG_OPEN;break;case K.AMPERSAND:this._startCharacterReference();break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitCodePoint(e);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case K.AMPERSAND:this._startCharacterReference();break;case K.LESS_THAN_SIGN:this.state=Q.RCDATA_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case K.LESS_THAN_SIGN:this.state=Q.RAWTEXT_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(pI(e))this._createStartTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case K.EXCLAMATION_MARK:this.state=Q.MARKUP_DECLARATION_OPEN;break;case K.SOLIDUS:this.state=Q.END_TAG_OPEN;break;case K.QUESTION_MARK:this._err(q.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e);break;case K.EOF:this._err(q.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(q.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=Q.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(pI(e))this._createEndTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case K.GREATER_THAN_SIGN:this._err(q.missingEndTagName),this.state=Q.DATA;break;case K.EOF:this._err(q.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(q.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case K.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case K.NULL:this._err(q.unexpectedNullCharacter),t.tagName+=`�`;break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(dI(e)?hI(e):e)}}_stateRcdataLessThanSign(e){e===K.SOLIDUS?this.state=Q.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){pI(e)?(this.state=Q.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Q.BEFORE_ATTRIBUTE_NAME,!1;case K.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Q.SELF_CLOSING_START_TAG,!1;case K.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Q.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===K.SOLIDUS?this.state=Q.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){pI(e)?(this.state=Q.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case K.SOLIDUS:this.state=Q.SCRIPT_DATA_END_TAG_OPEN;break;case K.EXCLAMATION_MARK:this.state=Q.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){pI(e)?(this.state=Q.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===K.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===K.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case K.HYPHEN_MINUS:this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case K.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===K.SOLIDUS?this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:pI(e)?(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){pI(e)?(this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(NF.SCRIPT,!1)&&_I(this.preprocessor.peek(NF.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<NF.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case K.HYPHEN_MINUS:this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case K.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===K.SOLIDUS?(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(NF.SCRIPT,!1)&&_I(this.preprocessor.peek(NF.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<NF.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.SOLIDUS:case K.GREATER_THAN_SIGN:case K.EOF:this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case K.EQUALS_SIGN:this._err(q.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=Q.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:case K.SOLIDUS:case K.GREATER_THAN_SIGN:case K.EOF:this._leaveAttrName(),this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case K.EQUALS_SIGN:this._leaveAttrName(),this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case K.QUOTATION_MARK:case K.APOSTROPHE:case K.LESS_THAN_SIGN:this._err(q.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(dI(e)?hI(e):e)}}_stateAfterAttributeName(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case K.EQUALS_SIGN:this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:this.state=Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case K.APOSTROPHE:this.state=Q.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingAttributeValue),this.state=Q.DATA,this.emitCurrentTagToken();break;default:this.state=Q.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case K.QUOTATION_MARK:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case K.AMPERSAND:this._startCharacterReference();break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case K.APOSTROPHE:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case K.AMPERSAND:this._startCharacterReference();break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case K.AMPERSAND:this._startCharacterReference();break;case K.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case K.QUOTATION_MARK:case K.APOSTROPHE:case K.LESS_THAN_SIGN:case K.EQUALS_SIGN:case K.GRAVE_ACCENT:this._err(q.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case K.SOLIDUS:this._leaveAttrValue(),this.state=Q.SELF_CLOSING_START_TAG;break;case K.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this._err(q.missingWhitespaceBetweenAttributes),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case K.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=Q.DATA,this.emitCurrentTagToken();break}case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this._err(q.unexpectedSolidusInTag),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case K.NULL:this._err(q.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(NF.DASH_DASH,!0)?(this._createCommentToken(NF.DASH_DASH.length+1),this.state=Q.COMMENT_START):this._consumeSequenceIfMatch(NF.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(NF.DOCTYPE.length+1),this.state=Q.DOCTYPE):this._consumeSequenceIfMatch(NF.CDATA_START,!0)?this.inForeignNode?this.state=Q.CDATA_SECTION:(this._err(q.cdataInHtmlContent),this._createCommentToken(NF.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=Q.BOGUS_COMMENT):this._ensureHibernation()||(this._err(q.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_START_DASH;break;case K.GREATER_THAN_SIGN:{this._err(q.abruptClosingOfEmptyComment),this.state=Q.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case K.GREATER_THAN_SIGN:this._err(q.abruptClosingOfEmptyComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_END_DASH;break;case K.LESS_THAN_SIGN:t.data+=`<`,this.state=Q.COMMENT_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.data+=`�`;break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case K.EXCLAMATION_MARK:t.data+=`!`,this.state=Q.COMMENT_LESS_THAN_SIGN_BANG;break;case K.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===K.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Q.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===K.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Q.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==K.GREATER_THAN_SIGN&&e!==K.EOF&&this._err(q.nestedComment),this.state=Q.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EXCLAMATION_MARK:this.state=Q.COMMENT_END_BANG;break;case K.HYPHEN_MINUS:t.data+=`-`;break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:t.data+=`--!`,this.state=Q.COMMENT_END_DASH;break;case K.GREATER_THAN_SIGN:this._err(q.incorrectlyClosedComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=Q.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_NAME;break;case K.GREATER_THAN_SIGN:this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case K.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(q.missingWhitespaceBeforeDoctypeName),this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(dI(e))this._createDoctypeToken(String.fromCharCode(hI(e))),this.state=Q.DOCTYPE_NAME;else switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.NULL:this._err(q.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=Q.DOCTYPE_NAME;break;case K.GREATER_THAN_SIGN:{this._err(q.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Q.DATA;break}case K.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Q.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.AFTER_DOCTYPE_NAME;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.NULL:this._err(q.unexpectedNullCharacter),t.name+=`�`;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(dI(e)?hI(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(NF.PUBLIC,!1)?this.state=Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(NF.SYSTEM,!1)?this.state=Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(q.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case K.QUOTATION_MARK:this._err(q.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:this._err(q.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case K.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.publicId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case K.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.publicId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.QUOTATION_MARK:this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case K.QUOTATION_MARK:this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case K.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.systemId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case K.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.systemId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case K.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.NULL:this._err(q.unexpectedNullCharacter);break;case K.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case K.RIGHT_SQUARE_BRACKET:this.state=Q.CDATA_SECTION_BRACKET;break;case K.EOF:this._err(q.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===K.RIGHT_SQUARE_BRACKET?this.state=Q.CDATA_SECTION_END:(this._emitChars(`]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case K.GREATER_THAN_SIGN:this.state=Q.DATA;break;case K.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(K.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&mI(this.preprocessor.peek(1))?Q.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){mI(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===K.SEMICOLON&&this._err(q.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},bI=new Set([X.DD,X.DT,X.LI,X.OPTGROUP,X.OPTION,X.P,X.RB,X.RP,X.RT,X.RTC]),xI=new Set([...bI,X.CAPTION,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]),SI=new Set([X.APPLET,X.CAPTION,X.HTML,X.MARQUEE,X.OBJECT,X.TABLE,X.TD,X.TEMPLATE,X.TH]),CI=new Set([...SI,X.OL,X.UL]),wI=new Set([...SI,X.BUTTON]),TI=new Set([X.ANNOTATION_XML,X.MI,X.MN,X.MO,X.MS,X.MTEXT]),EI=new Set([X.DESC,X.FOREIGN_OBJECT,X.TITLE]),DI=new Set([X.TR,X.TEMPLATE,X.HTML]),OI=new Set([X.TBODY,X.TFOOT,X.THEAD,X.TEMPLATE,X.HTML]),kI=new Set([X.TABLE,X.TEMPLATE,X.HTML]),AI=new Set([X.TD,X.TH]),jI=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=X.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===X.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===J.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==J.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(cI,J.HTML)}popUntilTableCellPopped(){this.popUntilPopped(AI,J.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(kI,J.HTML)}clearBackToTableBodyContext(){this.clearBackTo(OI,J.HTML)}clearBackToTableRowContext(){this.clearBackTo(DI,J.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===X.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===X.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case J.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case J.SVG:if(EI.has(r))return!1;break;case J.MATHML:if(TI.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,SI)}hasInListItemScope(e){return this.hasInDynamicScope(e,CI)}hasInButtonScope(e){return this.hasInDynamicScope(e,wI)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case J.HTML:if(cI.has(t))return!0;if(SI.has(t))return!1;break;case J.SVG:if(EI.has(t))return!1;break;case J.MATHML:if(TI.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===J.HTML)switch(this.tagIDs[e]){case X.TBODY:case X.THEAD:case X.TFOOT:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.OPTION:case X.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&bI.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&xI.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&xI.has(this.currentTagId);)this.pop()}},MI=3,NI;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(NI||={});var PI={type:NI.Marker},FI=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===NI.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<MI)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<MI)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=MI&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(PI)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:NI.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:NI.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(PI);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===NI.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===NI.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===NI.Element&&t.element===e)}},II={createDocument(){return{nodeName:`#document`,mode:iI.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};II.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(II.isTextNode(n)){n.value+=t;return}}II.appendChild(e,II.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&II.isTextNode(r)?r.value+=t:II.insertBefore(e,II.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},LI=`html`,RI=`about:legacy-compat`,zI=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,BI=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),VI=[...BI,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],HI=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),UI=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],WI=[...UI,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function GI(e,t){return t.some(t=>e.startsWith(t))}function KI(e){return e.name===LI&&e.publicId===null&&(e.systemId===null||e.systemId===RI)}function qI(e){if(e.name!==LI)return iI.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===zI)return iI.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),HI.has(n))return iI.QUIRKS;let e=t===null?VI:BI;if(GI(n,e))return iI.QUIRKS;if(e=t===null?UI:WI,GI(n,e))return iI.LIMITED_QUIRKS}return iI.NO_QUIRKS}var JI={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},YI=`definitionurl`,XI=`definitionURL`,ZI=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),QI=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:J.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:J.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:J.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:J.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:J.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:J.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:J.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:J.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:J.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:J.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:J.XMLNS}]]),$I=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),eL=new Set([X.B,X.BIG,X.BLOCKQUOTE,X.BODY,X.BR,X.CENTER,X.CODE,X.DD,X.DIV,X.DL,X.DT,X.EM,X.EMBED,X.H1,X.H2,X.H3,X.H4,X.H5,X.H6,X.HEAD,X.HR,X.I,X.IMG,X.LI,X.LISTING,X.MENU,X.META,X.NOBR,X.OL,X.P,X.PRE,X.RUBY,X.S,X.SMALL,X.SPAN,X.STRONG,X.STRIKE,X.SUB,X.SUP,X.TABLE,X.TT,X.U,X.UL,X.VAR]);function tL(e){let t=e.tagID;return t===X.FONT&&e.attrs.some(({name:e})=>e===rI.COLOR||e===rI.SIZE||e===rI.FACE)||eL.has(t)}function nL(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===YI){e.attrs[t].name=XI;break}}function rL(e){for(let t=0;t<e.attrs.length;t++){let n=ZI.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function iL(e){for(let t=0;t<e.attrs.length;t++){let n=QI.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function aL(e){let t=$I.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=oI(e.tagName))}function Bee(e,t){return t===J.MATHML&&(e===X.MI||e===X.MO||e===X.MN||e===X.MS||e===X.MTEXT)}function Vee(e,t,n){if(t===J.MATHML&&e===X.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===rI.ENCODING){let t=n[e].value.toLowerCase();return t===JI.TEXT_HTML||t===JI.APPLICATION_XML}}return t===J.SVG&&(e===X.FOREIGN_OBJECT||e===X.DESC||e===X.TITLE)}function Hee(e,t,n,r){return(!r||r===J.HTML)&&Vee(e,t,n)||(!r||r===J.MATHML)&&Bee(e,t)}var Uee=`hidden`,Wee=8,Gee=3,$;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})($||={});var Kee={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},oL=new Set([X.TABLE,X.TBODY,X.TFOOT,X.THEAD,X.TR]),sL={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:II,onParseError:null},cL=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=$.INITIAL,this.originalInsertionMode=$.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...sL,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new yI(this.options,this),this.activeFormattingElements=new FI(this.treeAdapter),this.fragmentContextID=n?oI(this.treeAdapter.getTagName(n)):X.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new jI(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...sL,...t};e??=n.treeAdapter.createElement(Y.TEMPLATE,J.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,J.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===X.TEMPLATE&&i.tmplInsertionModeStack.unshift($.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??Kee,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===J.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,J.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=$.TEXT}switchToPlaintextParsing(){this.insertionMode=$.TEXT,this.originalInsertionMode=$.IN_BODY,this.tokenizer.state=lI.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Y.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===J.HTML)switch(this.fragmentContextID){case X.TITLE:case X.TEXTAREA:this.tokenizer.state=lI.RCDATA;break;case X.STYLE:case X.XMP:case X.IFRAME:case X.NOEMBED:case X.NOFRAMES:case X.NOSCRIPT:this.tokenizer.state=lI.RAWTEXT;break;case X.SCRIPT:this.tokenizer.state=lI.SCRIPT_DATA;break;case X.PLAINTEXT:this.tokenizer.state=lI.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,J.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,J.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(Y.HTML,J.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,X.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===VF.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===X.SVG&&this.treeAdapter.getTagName(t)===Y.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===J.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===X.MGLYPH||e.tagID===X.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,J.HTML)}_processToken(e){switch(e.type){case VF.CHARACTER:this.onCharacter(e);break;case VF.NULL_CHARACTER:this.onNullCharacter(e);break;case VF.COMMENT:this.onComment(e);break;case VF.DOCTYPE:this.onDoctype(e);break;case VF.START_TAG:this._processStartTag(e);break;case VF.END_TAG:this.onEndTag(e);break;case VF.EOF:this.onEof(e);break;case VF.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return Hee(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===NI.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=$.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(X.P),this.openElements.popUntilTagNamePopped(X.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case X.TR:this.insertionMode=$.IN_ROW;return;case X.TBODY:case X.THEAD:case X.TFOOT:this.insertionMode=$.IN_TABLE_BODY;return;case X.CAPTION:this.insertionMode=$.IN_CAPTION;return;case X.COLGROUP:this.insertionMode=$.IN_COLUMN_GROUP;return;case X.TABLE:this.insertionMode=$.IN_TABLE;return;case X.BODY:this.insertionMode=$.IN_BODY;return;case X.FRAMESET:this.insertionMode=$.IN_FRAMESET;return;case X.SELECT:this._resetInsertionModeForSelect(e);return;case X.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case X.HTML:this.insertionMode=this.headElement?$.AFTER_HEAD:$.BEFORE_HEAD;return;case X.TD:case X.TH:if(e>0){this.insertionMode=$.IN_CELL;return}break;case X.HEAD:if(e>0){this.insertionMode=$.IN_HEAD;return}}this.insertionMode=$.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===X.TEMPLATE)break;if(e===X.TABLE){this.insertionMode=$.IN_SELECT_IN_TABLE;return}}this.insertionMode=$.IN_SELECT}_isElementCausesFosterParenting(e){return oL.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case X.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===J.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case X.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return sI[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){kR(this,e);return}switch(this.insertionMode){case $.INITIAL:fL(this,e);break;case $.BEFORE_HTML:pL(this,e);break;case $.BEFORE_HEAD:mL(this,e);break;case $.IN_HEAD:_L(this,e);break;case $.IN_HEAD_NO_SCRIPT:vL(this,e);break;case $.AFTER_HEAD:yL(this,e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:SL(this,e);break;case $.TEXT:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:RL(this,e);break;case $.IN_TABLE_TEXT:ZL(this,e);break;case $.IN_COLUMN_GROUP:iR(this,e);break;case $.AFTER_BODY:bR(this,e);break;case $.AFTER_AFTER_BODY:ER(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){OR(this,e);return}switch(this.insertionMode){case $.INITIAL:fL(this,e);break;case $.BEFORE_HTML:pL(this,e);break;case $.BEFORE_HEAD:mL(this,e);break;case $.IN_HEAD:_L(this,e);break;case $.IN_HEAD_NO_SCRIPT:vL(this,e);break;case $.AFTER_HEAD:yL(this,e);break;case $.TEXT:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:RL(this,e);break;case $.IN_COLUMN_GROUP:iR(this,e);break;case $.AFTER_BODY:bR(this,e);break;case $.AFTER_AFTER_BODY:ER(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){uL(this,e);return}switch(this.insertionMode){case $.INITIAL:case $.BEFORE_HTML:case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_TEMPLATE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:uL(this,e);break;case $.IN_TABLE_TEXT:QL(this,e);break;case $.AFTER_BODY:$ee(this,e);break;case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:ete(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case $.INITIAL:tte(this,e);break;case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:this._err(e,q.misplacedDoctype);break;case $.IN_TABLE_TEXT:QL(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,q.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?jR(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:fL(this,e);break;case $.BEFORE_HTML:nte(this,e);break;case $.BEFORE_HEAD:ite(this,e);break;case $.IN_HEAD:hL(this,e);break;case $.IN_HEAD_NO_SCRIPT:ste(this,e);break;case $.AFTER_HEAD:lte(this,e);break;case $.IN_BODY:DL(this,e);break;case $.IN_TABLE:qL(this,e);break;case $.IN_TABLE_TEXT:QL(this,e);break;case $.IN_CAPTION:eR(this,e);break;case $.IN_COLUMN_GROUP:nR(this,e);break;case $.IN_TABLE_BODY:aR(this,e);break;case $.IN_ROW:sR(this,e);break;case $.IN_CELL:lR(this,e);break;case $.IN_SELECT:dR(this,e);break;case $.IN_SELECT_IN_TABLE:pR(this,e);break;case $.IN_TEMPLATE:hR(this,e);break;case $.AFTER_BODY:vR(this,e);break;case $.IN_FRAMESET:xR(this,e);break;case $.AFTER_FRAMESET:CR(this,e);break;case $.AFTER_AFTER_BODY:TR(this,e);break;case $.AFTER_AFTER_FRAMESET:DR(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?MR(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:fL(this,e);break;case $.BEFORE_HTML:rte(this,e);break;case $.BEFORE_HEAD:ate(this,e);break;case $.IN_HEAD:ote(this,e);break;case $.IN_HEAD_NO_SCRIPT:cte(this,e);break;case $.AFTER_HEAD:ute(this,e);break;case $.IN_BODY:PL(this,e);break;case $.TEXT:IL(this,e);break;case $.IN_TABLE:JL(this,e);break;case $.IN_TABLE_TEXT:QL(this,e);break;case $.IN_CAPTION:tR(this,e);break;case $.IN_COLUMN_GROUP:rR(this,e);break;case $.IN_TABLE_BODY:oR(this,e);break;case $.IN_ROW:cR(this,e);break;case $.IN_CELL:uR(this,e);break;case $.IN_SELECT:fR(this,e);break;case $.IN_SELECT_IN_TABLE:mR(this,e);break;case $.IN_TEMPLATE:gR(this,e);break;case $.AFTER_BODY:yR(this,e);break;case $.IN_FRAMESET:SR(this,e);break;case $.AFTER_FRAMESET:wR(this,e);break;case $.AFTER_AFTER_BODY:ER(this,e)}}onEof(e){switch(this.insertionMode){case $.INITIAL:fL(this,e);break;case $.BEFORE_HTML:pL(this,e);break;case $.BEFORE_HEAD:mL(this,e);break;case $.IN_HEAD:_L(this,e);break;case $.IN_HEAD_NO_SCRIPT:vL(this,e);break;case $.AFTER_HEAD:yL(this,e);break;case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:FL(this,e);break;case $.TEXT:LL(this,e);break;case $.IN_TABLE_TEXT:QL(this,e);break;case $.IN_TEMPLATE:_R(this,e);break;case $.AFTER_BODY:case $.IN_FRAMESET:case $.AFTER_FRAMESET:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:dL(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===K.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.TEXT:case $.IN_COLUMN_GROUP:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:this._insertCharacters(e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:case $.AFTER_BODY:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:xL(this,e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:RL(this,e);break;case $.IN_TABLE_TEXT:XL(this,e)}}};function qee(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):NL(e,t),n}function Jee(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Yee(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=Gee;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Xee(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Xee(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function Zee(e,t,n){let r=oI(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===X.TEMPLATE&&i===J.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Qee(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function lL(e,t){for(let n=0;n<Wee;n++){let n=qee(e,t);if(!n)break;let r=Jee(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=Yee(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&Zee(e,a,i),Qee(e,r,n)}}function uL(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function $ee(e,t){e._appendCommentNode(t,e.openElements.items[0])}function ete(e,t){e._appendCommentNode(t,e.document)}function dL(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function tte(e,t){e._setDocumentType(t);let n=t.forceQuirks?iI.QUIRKS:qI(t);KI(t)||e._err(t,q.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=$.BEFORE_HTML}function fL(e,t){e._err(t,q.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,iI.QUIRKS),e.insertionMode=$.BEFORE_HTML,e._processToken(t)}function nte(e,t){t.tagID===X.HTML?(e._insertElement(t,J.HTML),e.insertionMode=$.BEFORE_HEAD):pL(e,t)}function rte(e,t){let n=t.tagID;(n===X.HTML||n===X.HEAD||n===X.BODY||n===X.BR)&&pL(e,t)}function pL(e,t){e._insertFakeRootElement(),e.insertionMode=$.BEFORE_HEAD,e._processToken(t)}function ite(e,t){switch(t.tagID){case X.HTML:DL(e,t);break;case X.HEAD:e._insertElement(t,J.HTML),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD;break;default:mL(e,t)}}function ate(e,t){let n=t.tagID;n===X.HEAD||n===X.BODY||n===X.HTML||n===X.BR?mL(e,t):e._err(t,q.endTagWithoutMatchingOpenElement)}function mL(e,t){e._insertFakeElement(Y.HEAD,X.HEAD),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD,e._processToken(t)}function hL(e,t){switch(t.tagID){case X.HTML:DL(e,t);break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TITLE:e._switchToTextParsing(t,lI.RCDATA);break;case X.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,lI.RAWTEXT):(e._insertElement(t,J.HTML),e.insertionMode=$.IN_HEAD_NO_SCRIPT);break;case X.NOFRAMES:case X.STYLE:e._switchToTextParsing(t,lI.RAWTEXT);break;case X.SCRIPT:e._switchToTextParsing(t,lI.SCRIPT_DATA);break;case X.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=$.IN_TEMPLATE,e.tmplInsertionModeStack.unshift($.IN_TEMPLATE);break;case X.HEAD:e._err(t,q.misplacedStartTagForHeadElement);break;default:_L(e,t)}}function ote(e,t){switch(t.tagID){case X.HEAD:e.openElements.pop(),e.insertionMode=$.AFTER_HEAD;break;case X.BODY:case X.BR:case X.HTML:_L(e,t);break;case X.TEMPLATE:gL(e,t);break;default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function gL(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==X.TEMPLATE&&e._err(t,q.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,q.endTagWithoutMatchingOpenElement)}function _L(e,t){e.openElements.pop(),e.insertionMode=$.AFTER_HEAD,e._processToken(t)}function ste(e,t){switch(t.tagID){case X.HTML:DL(e,t);break;case X.BASEFONT:case X.BGSOUND:case X.HEAD:case X.LINK:case X.META:case X.NOFRAMES:case X.STYLE:hL(e,t);break;case X.NOSCRIPT:e._err(t,q.nestedNoscriptInHead);break;default:vL(e,t)}}function cte(e,t){switch(t.tagID){case X.NOSCRIPT:e.openElements.pop(),e.insertionMode=$.IN_HEAD;break;case X.BR:vL(e,t);break;default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function vL(e,t){let n=t.type===VF.EOF?q.openElementsLeftAfterEof:q.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=$.IN_HEAD,e._processToken(t)}function lte(e,t){switch(t.tagID){case X.HTML:DL(e,t);break;case X.BODY:e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_BODY;break;case X.FRAMESET:e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET;break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:e._err(t,q.abandonedHeadElementChild),e.openElements.push(e.headElement,X.HEAD),hL(e,t),e.openElements.remove(e.headElement);break;case X.HEAD:e._err(t,q.misplacedStartTagForHeadElement);break;default:yL(e,t)}}function ute(e,t){switch(t.tagID){case X.BODY:case X.HTML:case X.BR:yL(e,t);break;case X.TEMPLATE:gL(e,t);break;default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function yL(e,t){e._insertFakeElement(Y.BODY,X.BODY),e.insertionMode=$.IN_BODY,bL(e,t)}function bL(e,t){switch(t.type){case VF.CHARACTER:SL(e,t);break;case VF.WHITESPACE_CHARACTER:xL(e,t);break;case VF.COMMENT:uL(e,t);break;case VF.START_TAG:DL(e,t);break;case VF.END_TAG:PL(e,t);break;case VF.EOF:FL(e,t)}}function xL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function SL(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function dte(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function fte(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function pte(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET)}function mte(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function hte(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&cI.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,J.HTML)}function gte(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function _te(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),n||(e.formElement=e.openElements.current))}function vte(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===X.LI&&r===X.LI||(n===X.DD||n===X.DT)&&(r===X.DD||r===X.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==X.ADDRESS&&r!==X.DIV&&r!==X.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function yte(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.tokenizer.state=lI.PLAINTEXT}function bte(e,t){e.openElements.hasInScope(X.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1}function xte(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Y.A);n&&(lL(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ste(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Cte(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(X.NOBR)&&(lL(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function wte(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Tte(e,t){e.treeAdapter.getDocumentMode(e.document)!==iI.QUIRKS&&e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_TABLE}function CL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function wL(e){let t=HF(e,rI.TYPE);return t!=null&&t.toLowerCase()===Uee}function Ete(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),wL(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Dte(e,t){e._appendElement(t,J.HTML),t.ackSelfClosing=!0}function Ote(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function kte(e,t){t.tagName=Y.IMG,t.tagID=X.IMG,CL(e,t)}function Ate(e,t){e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.tokenizer.state=lI.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=$.TEXT}function jte(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,lI.RAWTEXT)}function Mte(e,t){e.framesetOk=!1,e._switchToTextParsing(t,lI.RAWTEXT)}function TL(e,t){e._switchToTextParsing(t,lI.RAWTEXT)}function Nte(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===$.IN_TABLE||e.insertionMode===$.IN_CAPTION||e.insertionMode===$.IN_TABLE_BODY||e.insertionMode===$.IN_ROW||e.insertionMode===$.IN_CELL?$.IN_SELECT_IN_TABLE:$.IN_SELECT}function Pte(e,t){e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function Fte(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,J.HTML)}function Ite(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(X.RTC),e._insertElement(t,J.HTML)}function Lte(e,t){e._reconstructActiveFormattingElements(),nL(t),iL(t),t.selfClosing?e._appendElement(t,J.MATHML):e._insertElement(t,J.MATHML),t.ackSelfClosing=!0}function Rte(e,t){e._reconstructActiveFormattingElements(),rL(t),iL(t),t.selfClosing?e._appendElement(t,J.SVG):e._insertElement(t,J.SVG),t.ackSelfClosing=!0}function EL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function DL(e,t){switch(t.tagID){case X.I:case X.S:case X.B:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.SMALL:case X.STRIKE:case X.STRONG:Ste(e,t);break;case X.A:xte(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:hte(e,t);break;case X.P:case X.DL:case X.OL:case X.UL:case X.DIV:case X.DIR:case X.NAV:case X.MAIN:case X.MENU:case X.ASIDE:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.DETAILS:case X.ADDRESS:case X.ARTICLE:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:mte(e,t);break;case X.LI:case X.DD:case X.DT:vte(e,t);break;case X.BR:case X.IMG:case X.WBR:case X.AREA:case X.EMBED:case X.KEYGEN:CL(e,t);break;case X.HR:Ote(e,t);break;case X.RB:case X.RTC:Fte(e,t);break;case X.RT:case X.RP:Ite(e,t);break;case X.PRE:case X.LISTING:gte(e,t);break;case X.XMP:jte(e,t);break;case X.SVG:Rte(e,t);break;case X.HTML:dte(e,t);break;case X.BASE:case X.LINK:case X.META:case X.STYLE:case X.TITLE:case X.SCRIPT:case X.BGSOUND:case X.BASEFONT:case X.TEMPLATE:hL(e,t);break;case X.BODY:fte(e,t);break;case X.FORM:_te(e,t);break;case X.NOBR:Cte(e,t);break;case X.MATH:Lte(e,t);break;case X.TABLE:Tte(e,t);break;case X.INPUT:Ete(e,t);break;case X.PARAM:case X.TRACK:case X.SOURCE:Dte(e,t);break;case X.IMAGE:kte(e,t);break;case X.BUTTON:bte(e,t);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:wte(e,t);break;case X.IFRAME:Mte(e,t);break;case X.SELECT:Nte(e,t);break;case X.OPTION:case X.OPTGROUP:Pte(e,t);break;case X.NOEMBED:case X.NOFRAMES:TL(e,t);break;case X.FRAMESET:pte(e,t);break;case X.TEXTAREA:Ate(e,t);break;case X.NOSCRIPT:e.options.scriptingEnabled?TL(e,t):EL(e,t);break;case X.PLAINTEXT:yte(e,t);break;case X.COL:case X.TH:case X.TD:case X.TR:case X.HEAD:case X.FRAME:case X.TBODY:case X.TFOOT:case X.THEAD:case X.CAPTION:case X.COLGROUP:break;default:EL(e,t)}}function zte(e,t){if(e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Bte(e,t){e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,yR(e,t))}function Vte(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Hte(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(X.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(X.FORM):n&&e.openElements.remove(n))}function Ute(e){e.openElements.hasInButtonScope(X.P)||e._insertFakeElement(Y.P,X.P),e._closePElement()}function OL(e){e.openElements.hasInListItemScope(X.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(X.LI),e.openElements.popUntilTagNamePopped(X.LI))}function kL(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function AL(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function jL(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function ML(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Y.BR,X.BR),e.openElements.pop(),e.framesetOk=!1}function NL(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==X.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function PL(e,t){switch(t.tagID){case X.A:case X.B:case X.I:case X.S:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.NOBR:case X.SMALL:case X.STRIKE:case X.STRONG:lL(e,t);break;case X.P:Ute(e);break;case X.DL:case X.UL:case X.OL:case X.DIR:case X.DIV:case X.NAV:case X.PRE:case X.MAIN:case X.MENU:case X.ASIDE:case X.BUTTON:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.ADDRESS:case X.ARTICLE:case X.DETAILS:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.LISTING:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:Vte(e,t);break;case X.LI:OL(e);break;case X.DD:case X.DT:kL(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:AL(e);break;case X.BR:ML(e);break;case X.BODY:zte(e,t);break;case X.HTML:Bte(e,t);break;case X.FORM:Hte(e);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:jL(e,t);break;case X.TEMPLATE:gL(e,t);break;default:NL(e,t)}}function FL(e,t){e.tmplInsertionModeStack.length>0?_R(e,t):dL(e,t)}function IL(e,t){var n;t.tagID===X.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function LL(e,t){e._err(t,q.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function RL(e,t){if(e.openElements.currentTagId!==void 0&&oL.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=$.IN_TABLE_TEXT,t.type){case VF.CHARACTER:ZL(e,t);break;case VF.WHITESPACE_CHARACTER:XL(e,t)}else YL(e,t)}function zL(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CAPTION}function BL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_COLUMN_GROUP}function VL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.COLGROUP,X.COLGROUP),e.insertionMode=$.IN_COLUMN_GROUP,nR(e,t)}function HL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_TABLE_BODY}function UL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.TBODY,X.TBODY),e.insertionMode=$.IN_TABLE_BODY,aR(e,t)}function WL(e,t){e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function GL(e,t){wL(t)?e._appendElement(t,J.HTML):YL(e,t),t.ackSelfClosing=!0}function KL(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,J.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function qL(e,t){switch(t.tagID){case X.TD:case X.TH:case X.TR:UL(e,t);break;case X.STYLE:case X.SCRIPT:case X.TEMPLATE:hL(e,t);break;case X.COL:VL(e,t);break;case X.FORM:KL(e,t);break;case X.TABLE:WL(e,t);break;case X.TBODY:case X.TFOOT:case X.THEAD:HL(e,t);break;case X.INPUT:GL(e,t);break;case X.CAPTION:zL(e,t);break;case X.COLGROUP:BL(e,t);break;default:YL(e,t)}}function JL(e,t){switch(t.tagID){case X.TABLE:e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode());break;case X.TEMPLATE:gL(e,t);break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:YL(e,t)}}function YL(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,bL(e,t),e.fosterParentingEnabled=n}function XL(e,t){e.pendingCharacterTokens.push(t)}function ZL(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function QL(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)YL(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var $L=new Set([X.CAPTION,X.COL,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]);function eR(e,t){let n=t.tagID;$L.has(n)?e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,qL(e,t)):DL(e,t)}function tR(e,t){let n=t.tagID;switch(n){case X.CAPTION:case X.TABLE:e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,n===X.TABLE&&JL(e,t));break;case X.BODY:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:PL(e,t)}}function nR(e,t){switch(t.tagID){case X.HTML:DL(e,t);break;case X.COL:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TEMPLATE:hL(e,t);break;default:iR(e,t)}}function rR(e,t){switch(t.tagID){case X.COLGROUP:e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TEMPLATE:gL(e,t);break;case X.COL:break;default:iR(e,t)}}function iR(e,t){e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE,e._processToken(t))}function aR(e,t){switch(t.tagID){case X.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_ROW;break;case X.TH:case X.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Y.TR,X.TR),e.insertionMode=$.IN_ROW,sR(e,t);break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,qL(e,t));break;default:qL(e,t)}}function oR(e,t){let n=t.tagID;switch(t.tagID){case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,JL(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:case X.TR:break;default:JL(e,t)}}function sR(e,t){switch(t.tagID){case X.TH:case X.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CELL,e.activeFormattingElements.insertMarker();break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,aR(e,t));break;default:qL(e,t)}}function cR(e,t){switch(t.tagID){case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY);break;case X.TABLE:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,oR(e,t));break;case X.TBODY:case X.TFOOT:case X.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(X.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,oR(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:break;default:JL(e,t)}}function lR(e,t){let n=t.tagID;$L.has(n)?(e.openElements.hasInTableScope(X.TD)||e.openElements.hasInTableScope(X.TH))&&(e._closeTableCell(),sR(e,t)):DL(e,t)}function uR(e,t){let n=t.tagID;switch(n){case X.TD:case X.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_ROW);break;case X.TABLE:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),cR(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:break;default:PL(e,t)}}function dR(e,t){switch(t.tagID){case X.HTML:DL(e,t);break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.OPTGROUP:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.HR:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.INPUT:case X.KEYGEN:case X.TEXTAREA:case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),t.tagID!==X.SELECT&&e._processStartTag(t));break;case X.SCRIPT:case X.TEMPLATE:hL(e,t)}}function fR(e,t){switch(t.tagID){case X.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===X.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===X.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop();break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop();break;case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode());break;case X.TEMPLATE:gL(e,t)}}function pR(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e._processStartTag(t)):dR(e,t)}function mR(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e.onEndTag(t)):fR(e,t)}function hR(e,t){switch(t.tagID){case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:hL(e,t);break;case X.CAPTION:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.tmplInsertionModeStack[0]=$.IN_TABLE,e.insertionMode=$.IN_TABLE,qL(e,t);break;case X.COL:e.tmplInsertionModeStack[0]=$.IN_COLUMN_GROUP,e.insertionMode=$.IN_COLUMN_GROUP,nR(e,t);break;case X.TR:e.tmplInsertionModeStack[0]=$.IN_TABLE_BODY,e.insertionMode=$.IN_TABLE_BODY,aR(e,t);break;case X.TD:case X.TH:e.tmplInsertionModeStack[0]=$.IN_ROW,e.insertionMode=$.IN_ROW,sR(e,t);break;default:e.tmplInsertionModeStack[0]=$.IN_BODY,e.insertionMode=$.IN_BODY,DL(e,t)}}function gR(e,t){t.tagID===X.TEMPLATE&&gL(e,t)}function _R(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):dL(e,t)}function vR(e,t){t.tagID===X.HTML?DL(e,t):bR(e,t)}function yR(e,t){if(t.tagID===X.HTML){if(e.fragmentContext||(e.insertionMode=$.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===X.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else bR(e,t)}function bR(e,t){e.insertionMode=$.IN_BODY,bL(e,t)}function xR(e,t){switch(t.tagID){case X.HTML:DL(e,t);break;case X.FRAMESET:e._insertElement(t,J.HTML);break;case X.FRAME:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.NOFRAMES:hL(e,t)}}function SR(e,t){t.tagID===X.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==X.FRAMESET&&(e.insertionMode=$.AFTER_FRAMESET))}function CR(e,t){switch(t.tagID){case X.HTML:DL(e,t);break;case X.NOFRAMES:hL(e,t)}}function wR(e,t){t.tagID===X.HTML&&(e.insertionMode=$.AFTER_AFTER_FRAMESET)}function TR(e,t){t.tagID===X.HTML?DL(e,t):ER(e,t)}function ER(e,t){e.insertionMode=$.IN_BODY,bL(e,t)}function DR(e,t){switch(t.tagID){case X.HTML:DL(e,t);break;case X.NOFRAMES:hL(e,t)}}function OR(e,t){t.chars=`�`,e._insertCharacters(t)}function kR(e,t){e._insertCharacters(t),e.framesetOk=!1}function AR(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==J.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function jR(e,t){if(tL(t))AR(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===J.MATHML?nL(t):r===J.SVG&&(aL(t),rL(t)),iL(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function MR(e,t){if(t.tagID===X.P||t.tagID===X.BR){AR(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===J.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}Y.AREA,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BR,Y.COL,Y.EMBED,Y.FRAME,Y.HR,Y.IMG,Y.INPUT,Y.KEYGEN,Y.LINK,Y.META,Y.PARAM,Y.SOURCE,Y.TRACK,Y.WBR;var NR=FR(`end`),PR=FR(`start`);function FR(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function IR(e){let t=PR(e),n=NR(e);if(t&&n)return{start:t,end:n}}var LR=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,RR=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),zR={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function BR(e,t){let n=ez(e),r=_F(`type`,{handlers:{root:HR,element:UR,text:WR,comment:qR,doctype:GR,raw:JR},unknown:YR}),i={parser:n?new cL(zR):cL.getFragmentParser(void 0,zR),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),XR(i,PR());let a=cF(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&PN(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function VR(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function HR(e,t){VR(e.children,t)}function UR(e,t){QR(e,t),VR(e.children,t),$R(e,t)}function WR(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:VF.CHARACTER,chars:e.value,location:tz(e)};XR(t,PR(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function GR(e,t){let n={type:VF.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:tz(e)};XR(t,PR(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function KR(e,t){t.stitches=!0;let n=nz(e);`children`in e&&`children`in n&&(n.children=BR({type:`root`,children:e.children},t.options).children),qR({type:`comment`,value:{stitch:n}},t)}function qR(e,t){let n=e.value,r={type:VF.COMMENT,data:n,location:tz(e)};XR(t,PR(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function JR(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,ZR(t,PR(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(LR,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function YR(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))KR(n,t);else{let e=``;throw RR.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function XR(e,t){ZR(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=lI.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function ZR(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function QR(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===lI.PLAINTEXT)return;XR(t,PR(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:aF.html;i===aF.html&&n===`svg`&&(i=aF.svg);let a=xF({...e,children:[]},{space:i===aF.svg?`svg`:`html`}),o={type:VF.START_TAG,tagName:n,tagID:oI(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:tz(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function $R(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&jF.includes(n)||t.parser.tokenizer.state===lI.PLAINTEXT)return;XR(t,NR(e));let r={type:VF.END_TAG,tagName:n,tagID:oI(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:tz(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===lI.RCDATA||t.parser.tokenizer.state===lI.RAWTEXT||t.parser.tokenizer.state===lI.SCRIPT_DATA)&&(t.parser.tokenizer.state=lI.DATA)}function ez(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function tz(e){let t=PR(e)||{line:void 0,column:void 0,offset:void 0},n=NR(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function nz(e){return`children`in e?aP({...e,children:[]}):aP(e)}function rz(e){return function(t,n){return BR(t,{...e,file:n})}}var iz=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],az={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...iz,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...iz],h2:[[`className`,`sr-only`]],img:[...iz,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...iz,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...iz],table:[...iz],ul:[...iz,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},oz={}.hasOwnProperty;function sz(e,t){let n={type:`root`,children:[]},r=cz({schema:t?{...az,...t}:az,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function cz(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return lz(e,n);case`doctype`:return uz(e,n);case`element`:return dz(e,n);case`root`:return fz(e,n);case`text`:return pz(e,n)}}}function lz(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return bz(r,t),r}}function uz(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return bz(e,t),e}}function dz(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=mz(e,t.children),i=hz(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&oz.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return bz(o,t),o}function fz(e,t){let n={type:`root`,children:mz(e,t.children)};return bz(n,t),n}function pz(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return bz(n,t),n}function mz(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=cz(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function hz(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&oz.call(r,n)?r[n]:void 0,o=r&&oz.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(oz.call(s,l)){let t=s[l],n=gz(e,xz(a,l),l,t);n??=gz(e,xz(o,l),l,t),n!=null&&(c[l]=n)}if(i&&oz.call(i,n)){let e=i[n];for(l in e)oz.call(e,l)&&!oz.call(c,l)&&(c[l]=e[l])}return c}function gz(e,t,n,r){return t?Array.isArray(r)?_z(e,t,n,r):vz(e,t,n,r):void 0}function _z(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=vz(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function vz(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&yz(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function yz(e,t,n){let r=e.schema.protocols&&oz.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function bz(e,t){let n=IR(t);t.data&&(e.data=aP(t.data)),n&&(e.position=n)}function xz(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function Sz(e){return function(t){return sz(t,e)}}function Cz(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var wz=Iz(/[A-Za-z]/),Tz=Iz(/[\dA-Za-z]/),Ez=Iz(/[#-'*+\--9=?A-Z^-~]/);function Dz(e){return e!==null&&(e<32||e===127)}var Oz=Iz(/\d/),kz=Iz(/[\dA-Fa-f]/),Az=Iz(/[!-/:-@[-`{-~]/);function jz(e){return e!==null&&e<-2}function Mz(e){return e!==null&&(e<0||e===32)}function Nz(e){return e===-2||e===-1||e===32}var Pz=Iz(/\p{P}|\p{S}/u),Fz=Iz(/\s/);function Iz(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Lz(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Rz(e,t,n){let r=SN((n||{}).ignore||[]),i=zz(t),a=-1;for(;++a<i.length;)MN(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function zz(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Bz(e[0]),Vz(e[1])])}return t}function Bz(e){return typeof e==`string`?new RegExp(Lz(e),`g`):e}function Vz(e){return typeof e==`function`?e:function(){return e}}var Hz=`phrasing`,Uz=[`autolink`,`link`,`image`,`label`];function Wz(){return{transforms:[Qz],enter:{literalAutolink:Kz,literalAutolinkEmail:qz,literalAutolinkHttp:qz,literalAutolinkWww:qz},exit:{literalAutolink:Zz,literalAutolinkEmail:Xz,literalAutolinkHttp:Jz,literalAutolinkWww:Yz}}}function Gz(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Hz,notInConstruct:Uz},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Hz,notInConstruct:Uz},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Hz,notInConstruct:Uz}]}}function Kz(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function qz(e){this.config.enter.autolinkProtocol.call(this,e)}function Jz(e){this.config.exit.autolinkProtocol.call(this,e)}function Yz(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Xz(e){this.config.exit.autolinkEmail.call(this,e)}function Zz(e){this.exit(e)}function Qz(e){Rz(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$z],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,eB]],{ignore:[`link`,`linkReference`]})}function $z(e,t,n,r,i){let a=``;if(!rB(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!tB(n)))return!1;let o=nB(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function eB(e,t,n,r){return!rB(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function tB(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function nB(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Cz(e,`(`),a=Cz(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function rB(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Fz(n)||Pz(n))&&(!t||n!==47)}function iB(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}mB.peek=pB;function aB(){this.buffer()}function oB(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function sB(){this.buffer()}function cB(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function lB(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=iB(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uB(e){this.exit(e)}function dB(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=iB(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fB(e){this.exit(e)}function pB(){return`[`}function mB(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function hB(){return{enter:{gfmFootnoteCallString:aB,gfmFootnoteCall:oB,gfmFootnoteDefinitionLabelString:sB,gfmFootnoteDefinition:cB},exit:{gfmFootnoteCallString:lB,gfmFootnoteCall:uB,gfmFootnoteDefinitionLabelString:dB,gfmFootnoteDefinition:fB}}}function gB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:mB},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
56
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?vB:_B))),s(),o}}function _B(e,t,n){return t===0?e:vB(e,t,n)}function vB(e,t,n){return(n?``:` `)+e}var yB=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];wB.peek=TB;function bB(){return{canContainEols:[`delete`],enter:{strikethrough:SB},exit:{strikethrough:CB}}}function xB(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:yB}],handlers:{delete:wB}}}function SB(e){this.enter({type:`delete`,children:[]},e)}function CB(e){this.exit(e)}function wB(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function TB(){return`~`}function EB(e){return e.length}function DB(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||EB,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=OB(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=kB(r[d]);else{let e=kB(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
57
|
+
`)}function OB(e){return e==null?``:String(e)}function kB(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function AB(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),jB);return i(),o}function jB(e,t,n){return`>`+(n?``:` `)+e}function MB(e,t){return NB(e,t.inConstruct,!0)&&!NB(e,t.notInConstruct,!1)}function NB(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function PB(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
58
|
+
`&&MB(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
59
|
+
`}function FB(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function IB(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^ \r\n]/.test(e.value)||/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function LB(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function RB(e,t,n,r){let i=LB(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(IB(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,zB);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(FB(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
60
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
61
|
+
`),a&&(u+=s.move(a+`
|
|
62
|
+
`)),u+=s.move(c),l(),u}function zB(e,t,n){return(n?``:` `)+e}function BB(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function VB(e,t,n,r){let i=BB(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
63
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function HB(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function UB(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function WB(e){if(e===null||Mz(e)||Fz(e))return 1;if(Pz(e))return 2}function GB(e,t,n){let r=WB(e),i=WB(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}KB.peek=qB;function KB(e,t,n,r){let i=HB(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=GB(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=UB(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=GB(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+UB(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function qB(e,t,n){return n.options.emphasis||`*`}var JB={};function YB(e,t){let n=t||JB;return XB(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function XB(e,t,n){if(QB(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return ZB(e.children,t,n)}return Array.isArray(e)?ZB(e,t,n):``}function ZB(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=XB(e[i],t,n);return r.join(``)}function QB(e){return!!(e&&typeof e==`object`)}function $B(e,t){let n=!1;return PN(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&YB(e)&&(t.options.setext||n))}function eV(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if($B(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
64
|
+
`,after:`
|
|
65
|
+
`});return r(),t(),o+`
|
|
66
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
67
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
68
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=UB(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}tV.peek=nV;function tV(e){return e.value||``}function nV(){return`<`}rV.peek=iV;function rV(e,t,n,r){let i=BB(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function iV(){return`!`}aV.peek=oV;function aV(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function oV(){return`!`}sV.peek=cV;function sV(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function cV(){return"`"}function lV(e,t){let n=YB(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][a-z+.-]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}uV.peek=dV;function uV(e,t,n,r){let i=BB(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(lV(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function dV(e,t,n){return lV(e,n)?`<`:`[`}fV.peek=pV;function fV(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function pV(){return`[`}function mV(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function hV(e){let t=mV(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gV(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function _V(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vV(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?gV(n):mV(n),s=e.ordered?o===`.`?`)`:`.`:hV(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),_V(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function yV(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function bV(e,t,n,r){let i=yV(n),a=n.bulletCurrent||mV(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function xV(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var SV=SN([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function CV(e,t,n,r){return(e.children.some(function(e){return SV(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wV(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}TV.peek=EV;function TV(e,t,n,r){let i=wV(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=GB(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=UB(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=GB(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+UB(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function EV(e,t,n){return n.options.strong||`*`}function DV(e,t,n,r){return n.safe(e.value,r)}function OV(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function kV(e,t,n){let r=(_V(n)+(n.options.ruleSpaces?` `:``)).repeat(OV(n));return n.options.ruleSpaces?r.slice(0,-1):r}var AV={blockquote:AB,break:PB,code:RB,definition:VB,emphasis:KB,hardBreak:PB,heading:eV,html:tV,image:rV,imageReference:aV,inlineCode:sV,link:uV,linkReference:fV,list:vV,listItem:bV,paragraph:xV,root:CV,strong:TV,text:DV,thematicBreak:kV},jV=document.createElement(`i`);function MV(e){let t=`&`+e+`;`;jV.innerHTML=t;let n=jV.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function NV(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var PV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FV(e){return e.replace(PV,IV)}function IV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return NV(n.slice(t?2:1),t?16:10)}return MV(n)||e}function LV(){return{enter:{table:RV,tableData:HV,tableHeader:HV,tableRow:BV},exit:{codeText:UV,table:zV,tableData:VV,tableHeader:VV,tableRow:VV}}}function RV(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function zV(e){this.exit(e),this.data.inTable=void 0}function BV(e){this.enter({type:`tableRow`,children:[]},e)}function VV(e){this.exit(e)}function HV(e){this.enter({type:`tableCell`,children:[]},e)}function UV(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,WV));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function WV(e,t){return t===`|`?t:e}function GV(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
69
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
70
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return DB(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=AV.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function KV(){return{exit:{taskListCheckValueChecked:JV,taskListCheckValueUnchecked:JV,paragraph:YV}}}function qV(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:XV}}}function JV(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function YV(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function XV(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=AV.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function ZV(){return[Wz(),hB(),bB(),LV(),KV()]}function QV(e){return{extensions:[Gz(),gB(e),xB(),GV(e),qV()]}}function $V(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function eH(e,t){return e.length>0?($V(e,e.length,0,t),e):t}var tH={}.hasOwnProperty;function nH(e){let t={},n=-1;for(;++n<e.length;)rH(t,e[n]);return t}function rH(e,t){let n;for(n in t){let r=(tH.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){tH.call(r,a)||(r[a]=[]);let e=i[a];iH(r[a],Array.isArray(e)?e:e?[e]:[])}}}function iH(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);$V(e,0,0,r)}var aH={tokenize:yH,partial:!0},oH={tokenize:bH,partial:!0},sH={tokenize:xH,partial:!0},cH={tokenize:SH,partial:!0},lH={tokenize:CH,partial:!0},uH={name:`wwwAutolink`,tokenize:_H,previous:wH},dH={name:`protocolAutolink`,tokenize:vH,previous:TH},fH={name:`emailAutolink`,tokenize:gH,previous:EH},pH={};function mH(){return{text:pH}}for(var hH=48;hH<123;)pH[hH]=fH,hH++,hH===58?hH=65:hH===91&&(hH=97);pH[43]=fH,pH[45]=fH,pH[46]=fH,pH[95]=fH,pH[72]=[fH,dH],pH[104]=[fH,dH],pH[87]=[fH,uH],pH[119]=[fH,uH];function gH(e,t,n){let r=this,i,a;return o;function o(t){return!DH(t)||!EH.call(r,r.previous)||OH(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return DH(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(lH,u,l)(t):t===45||t===95||Tz(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&wz(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function _H(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!wH.call(r,r.previous)||OH(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(aH,e.attempt(oH,e.attempt(sH,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function vH(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&TH.call(r,r.previous)&&!OH(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(wz(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Dz(t)||Mz(t)||Fz(t)||Pz(t)?n(t):e.attempt(oH,e.attempt(sH,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function yH(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function bH(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(cH,c,s)(t):t===null||Mz(t)||Fz(t)||t!==45&&Pz(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function xH(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(cH,t,a)(o):o===null||Mz(o)||Fz(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function SH(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Mz(o)||Fz(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Mz(e)||Fz(e)?t(e):r(e)}function a(e){return wz(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):wz(t)?(e.consume(t),o):n(t)}}function CH(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Tz(e)?n(e):t(e)}}function wH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Mz(e)}function TH(e){return!wz(e)}function EH(e){return!(e===47||DH(e))}function DH(e){return e===43||e===45||e===46||e===95||Tz(e)}function OH(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function kH(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Tz(e.charCodeAt(n+1))&&Tz(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function AH(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var jH={name:`attention`,resolveAll:MH,tokenize:NH};function MH(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};PH(d,-c),PH(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=eH(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=eH(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=eH(l,AH(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=eH(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=eH(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,$V(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function NH(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=WB(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=WB(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function PH(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var FH={name:`autolink`,tokenize:IH};function IH(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return wz(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Tz(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Tz(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Dz(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ez(t)?(e.consume(t),l):n(t)}function u(e){return Tz(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Tz(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function LH(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Nz(r)?(e.enter(n),s(r)):t(r)}function s(r){return Nz(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var RH={partial:!0,tokenize:zH};function zH(e,t,n){return r;function r(t){return Nz(t)?LH(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||jz(e)?t(e):n(e)}}var BH={continuation:{tokenize:HH},exit:UH,name:`blockQuote`,tokenize:VH};function VH(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Nz(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function HH(e,t,n){let r=this;return i;function i(t){return Nz(t)?LH(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(BH,t,n)(r)}}function UH(e){e.exit(`blockQuote`)}var WH={name:`characterEscape`,tokenize:GH};function GH(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Az(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var KH={name:`characterReference`,tokenize:qH};function qH(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Tz,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=kz,u):(e.enter(`characterReferenceValue`),a=7,o=Oz,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Tz&&!MV(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var JH={partial:!0,tokenize:ZH},YH={concrete:!0,name:`codeFenced`,tokenize:XH};function XH(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Nz(t)?LH(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||jz(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(JH,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||jz(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Nz(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),LH(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||jz(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||jz(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Nz(t)?LH(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||jz(t)?e.check(JH,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||jz(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Nz(t)?LH(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Nz(t)?LH(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||jz(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function ZH(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var QH={name:`codeIndented`,tokenize:eU},$H={partial:!0,tokenize:tU};function eU(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),LH(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):jz(t)?e.attempt($H,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||jz(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function tU(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):jz(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):LH(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):jz(e)?i(e):n(e)}}var nU={name:`codeText`,previous:iU,resolve:rU,tokenize:aU};function rU(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function iU(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function aU(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):jz(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||jz(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var oU=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&sU(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),sU(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sU(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);sU(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);sU(this.left,t.reverse())}}}};function sU(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function cU(e){let t={},n=-1,r,i,a,o,s,c,l,u=new oU(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,lU(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return $V(e,0,1/0,u.slice(0)),!l}function lU(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var uU={resolve:fU,tokenize:pU},dU={partial:!0,tokenize:mU};function fU(e){return cU(e),e}function pU(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):jz(t)?e.check(dU,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function mU(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),LH(e,a,`linePrefix`)}function a(i){if(i===null||jz(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function hU(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Dz(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||jz(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Mz(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Dz(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function gU(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):jz(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||jz(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Nz(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function _U(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):jz(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),LH(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||jz(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function vU(e,t){let n;return r;function r(i){return jz(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Nz(i)?LH(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var yU={name:`definition`,tokenize:xU},bU={partial:!0,tokenize:SU};function xU(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return gU.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=iB(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Mz(t)?vU(e,l)(t):l(t)}function l(t){return hU(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(bU,d,d)(t)}function d(t){return Nz(t)?LH(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||jz(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function SU(e,t,n){return r;function r(t){return Mz(t)?vU(e,i)(t):n(t)}function i(t){return _U(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Nz(t)?LH(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||jz(e)?t(e):n(e)}}var CU={name:`hardBreakEscape`,tokenize:wU};function wU(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return jz(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var TU={name:`headingAtx`,resolve:EU,tokenize:DU};function EU(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},$V(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function DU(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Mz(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||jz(n)?(e.exit(`atxHeading`),t(n)):Nz(n)?LH(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Mz(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var OU=`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`.split(`.`),kU=[`pre`,`script`,`style`,`textarea`],AU={concrete:!0,name:`htmlFlow`,resolveTo:NU,tokenize:PU},jU={partial:!0,tokenize:IU},MU={partial:!0,tokenize:FU};function NU(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function PU(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):wz(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):wz(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return wz(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Mz(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&kU.includes(l)?(i=1,r.interrupt?t(s):O(s)):OU.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Tz(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Nz(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||wz(t)?(e.consume(t),b):Nz(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Tz(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Nz(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Nz(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||jz(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Mz(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Nz(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||jz(t)?O(t):Nz(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):jz(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(jU,R,k)(t)):t===null||jz(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(MU,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||jz(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return kU.includes(n)?(e.consume(t),L):O(t)}return wz(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||jz(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function FU(e,t,n){let r=this;return i;function i(t){return jz(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function IU(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(RH,t,n)}}var LU={name:`htmlText`,tokenize:RU};function RU(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):wz(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):wz(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):jz(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):jz(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):jz(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):jz(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return wz(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Tz(t)?(e.consume(t),S):C(t)}function C(t){return jz(t)?(o=C,N(t)):Nz(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Tz(t)?(e.consume(t),w):t===47||t===62||Mz(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||wz(t)?(e.consume(t),E):jz(t)?(o=T,N(t)):Nz(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Tz(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):jz(t)?(o=D,N(t)):Nz(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):jz(t)?(o=O,N(t)):Nz(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):jz(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Mz(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Mz(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return Nz(t)?LH(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var zU={name:`labelEnd`,resolveAll:UU,resolveTo:WU,tokenize:GU},BU={tokenize:KU},VU={tokenize:qU},HU={tokenize:JU};function UU(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&$V(e,0,e.length,n),e}function WU(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=eH(s,e.slice(a+1,a+r+3)),s=eH(s,[[`enter`,u,t]]),s=eH(s,AH(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=eH(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=eH(s,e.slice(o+1)),s=eH(s,[[`exit`,c,t]]),$V(e,a,e.length,s),e}function GU(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(iB(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(BU,u,o?u:d)(t):t===91?e.attempt(VU,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(HU,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function KU(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Mz(t)?vU(e,a)(t):a(t)}function a(t){return t===41?u(t):hU(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Mz(t)?vU(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?_U(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Mz(t)?vU(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function qU(e,t,n){let r=this;return i;function i(t){return gU.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(iB(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function JU(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var YU={name:`labelStartImage`,resolveAll:zU.resolveAll,tokenize:XU};function XU(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var ZU={name:`labelStartLink`,resolveAll:zU.resolveAll,tokenize:QU};function QU(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var $U={name:`lineEnding`,tokenize:eW};function eW(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),LH(e,t,`linePrefix`)}}var tW={name:`thematicBreak`,tokenize:nW};function nW(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||jz(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Nz(t)?LH(e,s,`whitespace`)(t):s(t))}}var rW={continuation:{tokenize:sW},exit:lW,name:`list`,tokenize:oW},iW={partial:!0,tokenize:uW},aW={partial:!0,tokenize:cW};function oW(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Oz(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(tW,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Oz(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(RH,r.interrupt?n:u,e.attempt(iW,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Nz(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function sW(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(RH,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,LH(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Nz(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(aW,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,LH(e,e.attempt(rW,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function cW(e,t,n){let r=this;return LH(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function lW(e){e.exit(this.containerState.type)}function uW(e,t,n){let r=this;return LH(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Nz(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var dW={name:`setextUnderline`,resolveTo:fW,tokenize:pW};function fW(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function pW(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Nz(t)?LH(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||jz(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var mW={tokenize:SW,partial:!0};function hW(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:yW,continuation:{tokenize:bW},exit:xW}},text:{91:{name:`gfmFootnoteCall`,tokenize:vW},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:gW,resolveTo:_W}}}}function gW(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=iB(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function _W(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function vW(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Mz(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(iB(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Mz(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function yW(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Mz(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=iB(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Mz(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),LH(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function bW(e,t,n){return e.check(RH,t,e.attempt(mW,t,n))}function xW(e){e.exit(`gfmFootnoteDefinition`)}function SW(e,t,n){let r=this;return LH(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function CW(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&$V(o,o.length,0,AH(s,e.slice(r+1,n),t)),$V(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),$V(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=WB(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=WB(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var wW=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){TW(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function TW(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function EW(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function DW(){return{flow:{null:{name:`table`,tokenize:OW,resolveAll:kW}}}}function OW(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):jz(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Nz(t)?LH(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Mz(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Nz(t)?LH(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Nz(t)?LH(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||jz(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Nz(t)?LH(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||jz(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||jz(n)?(e.exit(`tableRow`),t(n)):Nz(n)?LH(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Mz(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function kW(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new wW;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(jW(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=AW(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=AW(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=AW(f,t,o,i,n,d)):(o[0]=o[1],d=AW(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&jW(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=EW(t.events,n))}return e}function AW(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},MW(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=MW(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=MW(t.events,n[2]),a=MW(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},MW(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function jW(e,t,n,r,i){let a=[],o=MW(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function MW(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var NW={name:`tasklistCheck`,tokenize:FW};function PW(){return{text:{91:NW}}}function FW(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Mz(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return jz(r)?t(r):Nz(r)?e.check({tokenize:IW},t,n)(r):n(r)}}function IW(e,t,n){return LH(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function LW(e){return nH([mH(),hW(),CW(e),DW(),PW()])}var RW={};function zW(e){let t=this,n=e||RW,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(LW(n)),a.push(ZV()),o.push(QV(n))}var BW=Object.defineProperty,VW=Object.defineProperties,HW=Object.getOwnPropertyDescriptors,UW=Object.getOwnPropertySymbols,WW=Object.prototype.hasOwnProperty,GW=Object.prototype.propertyIsEnumerable,KW=(e,t,n)=>t in e?BW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qW=(e,t)=>{for(var n in t||={})WW.call(t,n)&&KW(e,n,t[n]);if(UW)for(var n of UW(t))GW.call(t,n)&&KW(e,n,t[n]);return e},JW=(e,t)=>VW(e,HW(t)),YW=e=>{let t=new Uint8Array(e.length+1),n=!1,r=!1,i=0;for(;i<e.length;){if(e[i]===`\\`&&i+1<e.length&&e[i+1]==="`"){let e=n||r?1:0;t[i+1]=e,t[i+2]=e,i+=2;continue}if(e.substring(i,i+3)==="```"){r=!r;let a=n||r?1:0,o=Math.min(i+3,e.length);for(let e=i+1;e<=o;e+=1)t[e]=a;i=o;continue}!r&&e[i]==="`"&&(n=!n),t[i+1]=n||r?1:0,i+=1}return t},XW=null,ZW=(e,t)=>{let n=XW;return(n===null||n.text!==e)&&(n={text:e,lookup:YW(e)},XW=n),n.lookup[Math.min(t,e.length)]===1},QW=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},$W=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]===`\\`&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!QW(e,n)&&(t+=1)}return t},eG=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]===`\\`&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`"){if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}}return!1},tG=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,nG=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(tG,(t,n,r,i)=>ZW(e,i)?t:`${n}\\>${r}`),rG=/(\*\*)([^*]*\*?)$/,iG=/(__)([^_]*?)$/,aG=/(\*\*\*)([^*]*?)$/,oG=/(\*)([^*]*?)$/,sG=/(_)([^_]*?)$/,cG=/(`)([^`]*?)$/,lG=/(~~)([^~]*?)$/,uG=/^[\s_~*`]*$/,dG=/^[\s]*[-*+][\s]+$/,fG=/[\p{L}\p{N}_]/u,pG=/^```[^`\n]*```?$/,mG=/^\*{4,}$/,hG=/(__)([^_]+)_$/,gG=/(~~)([^~]+)~$/,_G=/~~/g,vG=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95||fG.test(e)},yG=(e,t)=>{let n=1;for(let r=t-1;r>=0;--r)if(e[r]===`]`)n+=1;else if(e[r]===`[`&&(--n,n===0))return r;return-1},bG=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]===`[`)n+=1;else if(e[r]===`]`&&(--n,n===0))return r;return-1},xG=e=>e===`inlineLatex`||e===`blockLatex`,SG=(e,t)=>t===`[`&&e===`none`?`blockLatex`:t===`]`&&e===`blockLatex`?`none`:t===`(`&&e===`none`?`inlineLatex`:t===`)`&&e===`inlineLatex`?`none`:null,CG=(e,t)=>t?e===`blockDollar`?`none`:`blockDollar`:e===`blockDollar`?e:e===`inlineDollar`?`none`:`inlineDollar`,wG=(e,t)=>{let n=`none`;for(let r=0;r<e.length&&r<t;r+=1){if(e[r]===`\\`&&e[r+1]===`$`){r+=1;continue}if(e[r]===`\\`){let t=SG(n,e[r+1]);if(t!==null){n=t,r+=1;continue}}if(e[r]===`$`&&!xG(n)){let t=e[r+1]===`$`;n=CG(n,t),t&&(r+=1)}}return n!==`none`},TG=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===`)`)return!0;if(e[n]===`
|
|
71
|
+
`)return!1}return!1},EG=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`)`)return!1;if(e[n]===`(`)return n>0&&e[n-1]===`]`&&TG(e,t);if(e[n]===`
|
|
72
|
+
`)return!1}return!1},DG=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`>`)return!1;if(e[n]===`<`){let t=n+1<e.length?e[n+1]:``;return t>=`a`&&t<=`z`||t>=`A`&&t<=`Z`||t===`/`}if(e[n]===`
|
|
73
|
+
`)return!1}return!1},OG=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;--n)if(e[n]===`
|
|
74
|
+
`){r=n+1;break}let i=e.length;for(let n=t;n<e.length;n+=1)if(e[n]===`
|
|
75
|
+
`){i=n;break}let a=e.substring(r,i),o=0,s=!1;for(let e of a)if(e===n)o+=1;else if(e!==` `&&e!==` `){s=!0;break}return o>=3&&!s},kG=e=>e.includes(`$`)||e.includes(`\\(`)||e.includes(`\\[`),AG=(e,t,n,r)=>n===`\\`||kG(e)&&wG(e,t)?!0:n!==`*`&&r===`*`?(t<e.length-2?e[t+2]:``)!==`*`:n===`*`||(!n||n===` `||n===` `||n===`
|
|
76
|
+
`)&&(!r||r===` `||r===` `||r===`
|
|
77
|
+
`),jG=e=>e===` `||e===` `||e===`
|
|
78
|
+
`,MG=(e,t)=>!!(e&&t&&vG(e)&&vG(t)),NG=(e,t,n,r)=>{let i=MG(e,t),a=!!t&&!jG(t),o=!!e&&!jG(e);return i&&n%2==0&&!r?{count:!1}:o&&n%2==1||a?{count:!0,inWordAsteriskChain:i}:{count:!1}},PG=e=>{let t=0,n=!1,r=!1,i=e.length;for(let a=0;a<i;a+=1){if(e[a]==="`"&&a+2<i&&e[a+1]==="`"&&e[a+2]==="`"){n=!n,a+=2;continue}if(n)continue;if(e[a]!==`*`){vG(e[a])||(r=!1);continue}let o=a>0?e[a-1]:``,s=a<i-1?e[a+1]:``;if(AG(e,a,o,s))continue;let c=NG(o,s,t,r);c.count&&(t+=1,r=c.inWordAsteriskChain)}return t},FG=(e,t,n,r)=>!!(n===`\\`||kG(e)&&wG(e,t)||EG(e,t)||DG(e,t)||n===`_`||r===`_`||n&&r&&vG(n)&&vG(r)),IG=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!==`_`)continue;let a=i>0?e[i-1]:``,o=i<r-1?e[i+1]:``;FG(e,i,a,o)||(t+=1)}return t},LG=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]===`*`?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},RG=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`*`&&r+1<e.length&&e[r+1]===`*`&&(t+=1,r+=1)}return t},zG=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`_`&&r+1<e.length&&e[r+1]===`_`&&(t+=1,r+=1)}return t},BG=(e,t,n)=>{if(!t||uG.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
79
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return dG.test(a)&&t.includes(`
|
|
80
|
+
`)?!0:OG(e,n,`*`)},VG=e=>{let t=e.match(rG);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return ZW(e,r)||eG(e,r)||BG(e,n,r)?e:RG(e)%2==1?n.endsWith(`*`)?`${e}*`:`${e}**`:e},HG=(e,t,n)=>{if(!t||uG.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
81
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return dG.test(a)&&t.includes(`
|
|
82
|
+
`)?!0:OG(e,n,`_`)},UG=e=>{let t=e.match(iG);if(!t){let t=e.match(hG);if(t){let n=e.lastIndexOf(t[1]);if(!(ZW(e,n)||eG(e,n))&&zG(e)%2==1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return ZW(e,r)||eG(e,r)||HG(e,n,r)?e:zG(e)%2==1?`${e}__`:e},WG=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`*`&&e[n-1]!==`*`&&e[n+1]!==`*`&&e[n-1]!==`\\`&&!wG(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``,i=!t||jG(t),a=!r||jG(r);if(i&&a||t&&r&&vG(t)&&vG(r)||a)continue;return n}}return-1},GG=e=>{if(!e.match(oG))return e;let t=WG(e);if(t===-1||ZW(e,t)||eG(e,t))return e;let n=e.substring(t+1);return!n||uG.test(n)?e:PG(e)%2==1?`${e}*`:e},KG=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`_`&&e[n-1]!==`_`&&e[n+1]!==`_`&&e[n-1]!==`\\`&&!wG(e,n)&&!EG(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``;if(t&&r&&vG(t)&&vG(r))continue;return n}}return-1},qG=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
83
|
+
`;)--t;return t<e.length?`${e.slice(0,t)}_${e.slice(t)}`:`${e}_`},JG=e=>{if(!e.endsWith(`**`))return null;let t=e.slice(0,-2);if(RG(t)%2!=1)return null;let n=t.indexOf(`**`),r=KG(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},YG=e=>{if(!e.match(sG))return e;let t=KG(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||uG.test(n)||ZW(e,t)||eG(e,t))return e;if(IG(e)%2==1){let t=JG(e);return t===null?qG(e):t}return e},XG=e=>{let t=RG(e),n=PG(e);return t%2==0&&n%2==0},ZG=(e,t,n)=>!t||uG.test(t)||ZW(e,n)||eG(e,n)?!0:OG(e,n,`*`),QG=e=>{if(mG.test(e))return e;let t=e.match(aG);if(!t)return e;let n=t[2];return ZG(e,n,e.lastIndexOf(t[1]))?e:LG(e)%2==1?XG(e)?e:`${e}***`:e},$G=/<[a-zA-Z/][^>]*$/,eK=e=>{let t=e.match($G);return!t||t.index===void 0||ZW(e,t.index)?e:e.substring(0,t.index).trimEnd()},tK=e=>!e.match(pG)||e.includes(`
|
|
84
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,nK=e=>(e.match(/```/g)||[]).length%2==1,rK=e=>{let t=tK(e);if(t!==null)return t;let n=e.match(cG);if(n&&!nK(e)){let t=n[2];if(!t||uG.test(t))return e;if($W(e)%2==1)return`${e}\``}return e},iK=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",aK=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!iK(e,r)&&(n=!n),!n&&e[r]===`$`&&e[r+1]===`$`&&(t+=1,r+=1);return t},oK=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]===`\\`){r+=1;continue}if(e[r]==="`"&&!iK(e,r)){n=!n;continue}!n&&e[r]===`$`&&(r+1<e.length&&e[r+1]===`$`?r+=1:t+=1)}return t},sK=e=>{if(e.endsWith(`$`)&&!e.endsWith(`$$`))return`${e}$`;let t=e.indexOf(`$$`);return t!==-1&&e.indexOf(`
|
|
85
|
+
`,t)!==-1&&!e.endsWith(`
|
|
86
|
+
`)?`${e}
|
|
87
|
+
$$`:`${e}$$`},cK=e=>aK(e)%2==0?e:sK(e),lK=e=>oK(e)%2==1?`${e}$`:e,uK=(e,t,n)=>{if(e.substring(t+2).includes(`)`))return null;let r=yG(e,t);if(r===-1||ZW(e,r))return null;let i=r>0&&e[r-1]===`!`,a=i?r-1:r,o=e.substring(0,a);if(i)return o;let s=e.substring(r+1,t);return n===`text-only`?`${o}${s}`:`${o}[${s}](streamdown:incomplete-link)`},dK=(e,t)=>{for(let n=0;n<t;n++)if(e[n]===`[`&&!ZW(e,n)){if(n>0&&e[n-1]===`!`)continue;let t=bG(e,n);if(t===-1)return n;if(t+1<e.length&&e[t+1]===`(`){let r=e.indexOf(`)`,t+2);r!==-1&&(n=r)}}return t},fK=(e,t,n)=>{let r=t>0&&e[t-1]===`!`,i=r?t-1:t;if(!e.substring(t+1).includes(`]`)){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=dK(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}if(bG(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=dK(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}return null},pK=(e,t=`protocol`)=>{let n=e.lastIndexOf(`](`);if(n!==-1&&!ZW(e,n)){let r=uK(e,n,t);if(r!==null)return r}for(let n=e.length-1;n>=0;--n)if(e[n]===`[`&&!ZW(e,n)){let r=fK(e,n,t);if(r!==null)return r}return e},mK=/^-{1,2}$/,hK=/^[\s]*-{1,2}[\s]+$/,gK=/^={1,2}$/,_K=/^[\s]*={1,2}[\s]+$/,vK=e=>{if(!e||typeof e!=`string`)return e;let t=e.lastIndexOf(`
|
|
88
|
+
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(mK.test(i)&&!n.match(hK)){let t=r.split(`
|
|
89
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}if(gK.test(i)&&!n.match(_K)){let t=r.split(`
|
|
90
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}return e},yK=/([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu,bK=e=>!e||typeof e!=`string`||!e.includes(`~`)?e:e.replace(yK,(t,n,r)=>ZW(e,r+n.length)?t:`${n}\\~`),xK=e=>{let t=e.match(lG);if(t){let n=t[2];if(!n||uG.test(n))return e;let r=e.lastIndexOf(t[1]);if(ZW(e,r)||eG(e,r))return e;if(e.match(_G)?.length%2==1)return`${e}~~`}else{let t=e.match(gG);if(t){let n=e.lastIndexOf(t[0].slice(0,2));if(ZW(e,n)||eG(e,n))return e;if(e.match(_G)?.length%2==1)return`${e}~`}}return e},SK=e=>e!==!1,CK=e=>e===!0,wK={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},TK=[{handler:{name:`singleTilde`,handle:bK,priority:wK.SINGLE_TILDE},optionKey:`singleTilde`},{handler:{name:`comparisonOperators`,handle:nG,priority:wK.COMPARISON_OPERATORS},optionKey:`comparisonOperators`},{handler:{name:`htmlTags`,handle:eK,priority:wK.HTML_TAGS},optionKey:`htmlTags`},{handler:{name:`setextHeadings`,handle:vK,priority:wK.SETEXT_HEADINGS},optionKey:`setextHeadings`},{handler:{name:`links`,handle:pK,priority:wK.LINKS},optionKey:`links`,earlyReturn:e=>e.endsWith(`](streamdown:incomplete-link)`)},{handler:{name:`boldItalic`,handle:QG,priority:wK.BOLD_ITALIC},optionKey:`boldItalic`},{handler:{name:`bold`,handle:VG,priority:wK.BOLD},optionKey:`bold`},{handler:{name:`italicDoubleUnderscore`,handle:UG,priority:wK.ITALIC_DOUBLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`italicSingleAsterisk`,handle:GG,priority:wK.ITALIC_SINGLE_ASTERISK},optionKey:`italic`},{handler:{name:`italicSingleUnderscore`,handle:YG,priority:wK.ITALIC_SINGLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`inlineCode`,handle:rK,priority:wK.INLINE_CODE},optionKey:`inlineCode`},{handler:{name:`strikethrough`,handle:xK,priority:wK.STRIKETHROUGH},optionKey:`strikethrough`},{handler:{name:`katex`,handle:cK,priority:wK.KATEX},optionKey:`katex`},{handler:{name:`inlineKatex`,handle:lK,priority:wK.INLINE_KATEX},optionKey:`inlineKatex`}],EK=e=>{let t=e?.linkMode??`protocol`;return TK.filter(({handler:t,optionKey:n})=>t.name===`links`?SK(e?.links)||SK(e?.images):t.name===`inlineKatex`?CK(e?.inlineKatex):SK(e?.[n])).map(({handler:e,earlyReturn:n})=>e.name===`links`?{handler:JW(qW({},e),{handle:e=>pK(e,t)}),earlyReturn:t===`protocol`?n:void 0}:{handler:e,earlyReturn:n})},DK=(e,t)=>{if(!e||typeof e!=`string`)return e;let n=e.endsWith(` `)&&!e.endsWith(` `)?e.slice(0,-1):e,r=EK(t),i=(t?.handlers??[]).map(e=>({handler:JW(qW({},e),{priority:e.priority??wK.DEFAULT}),earlyReturn:void 0})),a=[...r,...i].sort((e,t)=>(e.handler.priority??0)-(t.handler.priority??0));for(let{handler:e,earlyReturn:t}of a)if(n=e.handle(n),t!=null&&t(n))return n;return n},OK=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kK=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AK={};function jK(e,t){return((t||AK).jsx?kK:OK).test(e)}var MK=/[ \t\n\f\r]/g;function NK(e){return typeof e==`object`?e.type===`text`&&PK(e.value):PK(e)}function PK(e){return e.replace(MK,``)===``}var FK=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
91
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),IK=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(FK());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),LK=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),RK=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(IK()),r=LK();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));function zK(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?VK(e.position):`start`in e||`end`in e?VK(e):`line`in e||`column`in e?BK(e):``}function BK(e){return HK(e&&e.line)+`:`+HK(e&&e.column)}function VK(e){return BK(e&&e.start)+`-`+BK(e&&e.end)}function HK(e){return e&&typeof e==`number`?e:1}var UK=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=zK(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};UK.prototype.file=``,UK.prototype.name=``,UK.prototype.reason=``,UK.prototype.message=``,UK.prototype.stack=``,UK.prototype.column=void 0,UK.prototype.line=void 0,UK.prototype.ancestors=void 0,UK.prototype.cause=void 0,UK.prototype.fatal=void 0,UK.prototype.place=void 0,UK.prototype.ruleId=void 0,UK.prototype.source=void 0;var WK=l(RK(),1),GK={}.hasOwnProperty,KK=new Map,qK=/[A-Z]/g,JK=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),YK=new Set([`td`,`th`]),XK=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function ZK(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=cq(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=sq(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?BP:zP,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=QK(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function QK(e,t,n){if(t.type===`element`)return $K(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return eq(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return nq(e,t,n);if(t.type===`mdxjsEsm`)return tq(e,t);if(t.type===`root`)return rq(e,t,n);if(t.type===`text`)return iq(e,t)}function $K(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=BP,e.schema=i),e.ancestors.push(t);let a=mq(e,t.tagName,!1),o=lq(e,t),s=dq(e,t);return JK.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!NK(e)})),aq(e,o,a,t),oq(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function eq(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}hq(e,t.position)}function tq(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hq(e,t.position)}function nq(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=BP,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:mq(e,t.name,!0),o=uq(e,t),s=dq(e,t);return aq(e,o,a,t),oq(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rq(e,t,n){let r={};return oq(r,dq(e,t)),e.create(t,e.Fragment,r,n)}function iq(e,t){return t.value}function aq(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function oq(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function sq(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function cq(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=PR(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function lq(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&GK.call(t.properties,i)){let a=fq(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&YK.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function uq(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else hq(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else hq(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function dq(e,t){let n=[],r=-1,i=e.passKeys?new Map:KK;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=QK(e,a,o);s!==void 0&&n.push(s)}return n}function fq(e,t,n){let r=IP(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?HP(n):KP(n)),r.property===`style`){let t=typeof n==`object`?n:pq(e,String(n));return e.stylePropertyNameCase===`css`&&(t=gq(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?MP[r.property]||r.property:r.attribute,n]}}function pq(e,t){try{return(0,WK.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new UK("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=XK+`#cannot-parse-style-attribute`,r}}function mq(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=jK(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=jK(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return GK.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);hq(e)}function hq(e,t){let n=new UK("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=XK+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function gq(e){let t={},n;for(n in e)GK.call(e,n)&&(t[_q(n)]=e[n]);return t}function _q(e){let t=e.replace(qK,vq);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function vq(e){return`-`+e.toLowerCase()}var yq={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`]},bq={tokenize:xq};function xq(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),LH(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return jz(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Sq={tokenize:wq},Cq={tokenize:Tq};function wq(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return $V(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Cq,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Cq,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return jz(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;$V(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Tq(e,t,n){return LH(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var Eq={tokenize:Dq};function Dq(e){let t=this,n=e.attempt(RH,r,e.attempt(this.parser.constructs.flowInitial,i,LH(e,e.attempt(this.parser.constructs.flow,i,e.attempt(uU,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Oq={resolveAll:Mq()},kq=jq(`string`),Aq=jq(`text`);function jq(e){return{resolveAll:Mq(e===`text`?Nq:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Mq(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Nq(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Pq=s({attentionMarkers:()=>Hq,contentInitial:()=>Iq,disable:()=>Uq,document:()=>Fq,flow:()=>Rq,flowInitial:()=>Lq,insideSpan:()=>Vq,string:()=>zq,text:()=>Bq}),Fq={42:rW,43:rW,45:rW,48:rW,49:rW,50:rW,51:rW,52:rW,53:rW,54:rW,55:rW,56:rW,57:rW,62:BH},Iq={91:yU},Lq={[-2]:QH,[-1]:QH,32:QH},Rq={35:TU,42:tW,45:[dW,tW],60:AU,61:dW,95:tW,96:YH,126:YH},zq={38:KH,92:WH},Bq={[-5]:$U,[-4]:$U,[-3]:$U,33:YU,38:KH,42:jH,60:[FH,LU],91:ZU,92:[CU,WH],93:zU,95:jH,96:nU},Vq={null:[jH,Oq]},Hq={null:[42,95]},Uq={null:[]};function Wq(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=eH(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=AH(a,l.events,l),l.events):[]}function f(e,t){return Kq(p(e),t)}function p(e){return Gq(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){jz(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&$V(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Gq(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Kq(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
92
|
+
`;break;case-3:o=`\r
|
|
93
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function qq(e){let t={constructs:nH([Pq,...(e||{}).extensions||[]]),content:n(bq),defined:[],document:n(Sq),flow:n(Eq),lazy:{},string:n(kq),text:n(Aq)};return t;function n(e){return n;function n(n){return Wq(t,e,n)}}}function Jq(e){for(;!cU(e););return e}var Yq=/[\0\t\n\r]/g;function Xq(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Yq.lastIndex=u,c=Yq.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Zq={}.hasOwnProperty;function Qq(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),$q(n)(Jq(qq(n).document().write(Xq()(e,t,!0))))}function $q(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(fe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ce),blockQuote:a(re),characterEscape:T,characterReference:T,codeFenced:a(ie),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ie,o),codeText:a(ae,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(oe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(se),hardBreakEscape:a(le),hardBreakTrailing:a(le),htmlFlow:a(ue,o),htmlFlowData:T,htmlText:a(ue,o),htmlTextData:T,image:a(de),label:o,link:a(fe),listItem:a(me),listItemValue:f,listOrdered:a(pe,d),listUnordered:a(pe),paragraph:a(he),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ce),strong:a(ge),thematicBreak:a(ve)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:H,autolinkProtocol:ne,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:B,characterReferenceMarkerNumeric:B,characterReferenceValue:V,characterReference:te,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ee,resourceDestinationString:I,resourceTitleString:L,resource:R,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};tJ(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Zq.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||rJ).call(a,void 0,e[0])}for(r.position={start:eJ(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:eJ(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:eJ(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||rJ).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+zK({start:e.start,end:e.end})+`): it’s not open`);n.position.end=eJ(e.end)}function u(){return YB(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iB(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=_e(),n.position={start:eJ(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=eJ(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=eJ(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=FV(t),n.identifier=iB(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType=`collapsed`}function ee(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iB(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function B(e){this.data.characterReferenceType=e.type}function V(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=NV(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=MV(t);let i=this.stack[this.stack.length-1];i.value+=r}function te(e){let t=this.stack.pop();t.position.end=eJ(e.end)}function ne(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function H(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function re(){return{type:`blockquote`,children:[]}}function ie(){return{type:`code`,lang:null,meta:null,value:``}}function ae(){return{type:`inlineCode`,value:``}}function oe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function se(){return{type:`emphasis`,children:[]}}function ce(){return{type:`heading`,depth:0,children:[]}}function le(){return{type:`break`}}function ue(){return{type:`html`,value:``}}function de(){return{type:`image`,title:null,url:``,alt:null}}function fe(){return{type:`link`,title:null,url:``,children:[]}}function pe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function me(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function he(){return{type:`paragraph`,children:[]}}function ge(){return{type:`strong`,children:[]}}function _e(){return{type:`text`,value:``}}function ve(){return{type:`thematicBreak`}}}function eJ(e){return{line:e.line,column:e.column,offset:e.offset}}function tJ(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?tJ(e,r):nJ(e,r)}}function nJ(e,t){let n;for(n in t)if(Zq.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function rJ(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+zK({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zK({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+zK({start:t.start,end:t.end})+`) is still open`)}function iJ(e){let t=this;t.parser=n;function n(n){return Qq(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function aJ(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function oJ(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
94
|
+
`}]}function sJ(e,t){let n=t.value?t.value+`
|
|
95
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function cJ(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lJ(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uJ(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=kH(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function dJ(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fJ(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function pJ(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function mJ(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pJ(e,t);let i={src:kH(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function hJ(e,t){let n={src:kH(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function gJ(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function _J(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pJ(e,t);let i={href:kH(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function vJ(e,t){let n={href:kH(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function yJ(e,t,n){let r=e.all(t),i=n?bJ(n):xJ(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
96
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
97
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function bJ(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=xJ(n[r])}return t}function xJ(e){return e.spread??e.children.length>1}function SJ(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function CJ(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wJ(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function TJ(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EJ(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=PR(t.children[1]),o=NR(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function DJ(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function OJ(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var kJ=9,AJ=32;function jJ(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(MJ(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(MJ(t.slice(i),i>0,!1)),a.join(``)}function MJ(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===kJ||t===AJ;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===kJ||t===AJ;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function NJ(e,t){let n={type:`text`,value:jJ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function PJ(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var FJ={blockquote:aJ,break:oJ,code:sJ,delete:cJ,emphasis:lJ,footnoteReference:uJ,heading:dJ,html:fJ,imageReference:mJ,image:hJ,inlineCode:gJ,linkReference:_J,link:vJ,listItem:yJ,list:SJ,paragraph:CJ,root:wJ,strong:TJ,table:EJ,tableCell:OJ,tableRow:DJ,text:NJ,thematicBreak:PJ,toml:IJ,yaml:IJ,definition:IJ,footnoteDefinition:IJ};function IJ(){}function LJ(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function RJ(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function zJ(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||LJ,r=e.options.footnoteBackLabel||RJ,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=kH(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...aP(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
98
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
99
|
+
`}]}}var BJ={}.hasOwnProperty,VJ={};function HJ(e,t){let n=t||VJ,r=new Map,i=new Map,a={all:s,applyData:WJ,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...FJ,...n.handlers},one:o,options:n,patch:UJ,wrap:KJ};return PN(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(BJ.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=aP(n);return r.children=a.all(e),r}return aP(e)}return(a.options.unknownHandler||GJ)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=qJ(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=qJ(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function UJ(e,t){e.position&&(t.position=IR(e))}function WJ(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,aP(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function GJ(e,t){let n=t.data||{},r=`value`in t&&!(BJ.call(n,`hProperties`)||BJ.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KJ(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
100
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
101
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
102
|
+
`}),n}function qJ(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function JJ(e,t){let n=HJ(e,t),r=n.one(e,void 0),i=zJ(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
103
|
+
`},i)),a}function YJ(e,t){return e&&`run`in e?async function(n,r){let i=JJ(n,{file:r,...t});await e.run(i,r)}:function(n,r){return JJ(n,{file:r,...e||t})}}function XJ(e){if(e)throw e}var ZJ=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function QJ(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $J(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?eY(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function eY(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var tY={basename:nY,dirname:rY,extname:iY,join:aY,sep:`/`};function nY(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);cY(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function rY(e){if(cY(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function iY(e){cY(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function aY(...e){let t=-1,n;for(;++t<e.length;)cY(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:oY(n)}function oY(e){cY(e);let t=e.codePointAt(0)===47,n=sY(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function sY(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function cY(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var lY={cwd:uY};function uY(){return`/`}function dY(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function fY(e){if(typeof e==`string`)e=new URL(e);else if(!dY(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return pY(e)}function pY(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var mY=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],hY=class{constructor(e){let t;t=e?dY(e)?{path:e}:typeof e==`string`||yY(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:lY.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<mY.length;){let e=mY[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)mY.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?tY.basename(this.path):void 0}set basename(e){_Y(e,`basename`),gY(e,`basename`),this.path=tY.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?tY.dirname(this.path):void 0}set dirname(e){vY(this.basename,`dirname`),this.path=tY.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?tY.extname(this.path):void 0}set extname(e){if(gY(e,`extname`),vY(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=tY.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){dY(e)&&(e=fY(e)),_Y(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?tY.basename(this.path,this.extname):void 0}set stem(e){_Y(e,`stem`),gY(e,`stem`),this.path=tY.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new UK(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function gY(e,t){if(e&&e.includes(tY.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+tY.sep+"`")}function _Y(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function vY(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function yY(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var bY=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),xY=l(ZJ(),1),SY={}.hasOwnProperty,CY=new class e extends bY{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=$J()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,xY.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(EY(`data`,this.frozen),this.namespace[e]=t,this):SY.call(this.namespace,e)&&this.namespace[e]||void 0:e?(EY(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=kY(e),n=this.parser||this.Parser;return wY(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),wY(`process`,this.parser||this.Parser),TY(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=kY(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);jY(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),wY(`processSync`,this.parser||this.Parser),TY(`processSync`,this.compiler||this.Compiler),this.process(e,r),OY(`processSync`,`process`,t),n;function r(e,r){t=!0,XJ(e),n=r}}run(e,t,n){DY(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=kY(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),OY(`runSync`,`run`,n),r;function i(e,t){XJ(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=kY(t),r=this.compiler||this.Compiler;return TY(`stringify`,r),DY(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(EY(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,xY.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];QJ(o)&&QJ(r)&&(r=(0,xY.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function wY(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function TY(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function EY(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function DY(e){if(!QJ(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function OY(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function kY(e){return AY(e)?e:new hY(e)}function AY(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function jY(e){return typeof e==`string`||MY(e)}function MY(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function NY(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var PY=NY();function FY(e){PY=e}var IY={exec:()=>null};function LY(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(zY.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var RY=(()=>{try{return!0}catch{return!1}})(),zY={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},BY=/^(?:[ \t]*(?:\n|$))+/,VY=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,HY=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,UY=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,WY=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,GY=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,KY=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,qY=LY(KY).replace(/bull/g,GY).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),JY=LY(KY).replace(/bull/g,GY).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),YY=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XY=/^[^\n]+/,ZY=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,QY=LY(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ZY).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$Y=LY(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,GY).getRegex(),eX=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,tX=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,nX=LY(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,tX).replace(`tag`,eX).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rX=LY(YY).replace(`hr`,UY).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,eX).getRegex(),iX={blockquote:LY(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,rX).getRegex(),code:VY,def:QY,fences:HY,heading:WY,hr:UY,html:nX,lheading:qY,list:$Y,newline:BY,paragraph:rX,table:IY,text:XY},aX=LY(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,UY).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,eX).getRegex(),oX={...iX,lheading:JY,table:aX,paragraph:LY(YY).replace(`hr`,UY).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,aX).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,eX).getRegex()},sX={...iX,html:LY(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,tX).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:IY,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:LY(YY).replace(`hr`,UY).replace(`heading`,` *#{1,6} *[^
|
|
104
|
+
]`).replace(`lheading`,qY).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},cX=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lX=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uX=/^( {2,}|\\)\n(?!\s*$)/,dX=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fX=/[\p{P}\p{S}]/u,pX=/[\s\p{P}\p{S}]/u,mX=/[^\s\p{P}\p{S}]/u,hX=LY(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,pX).getRegex(),gX=/(?!~)[\p{P}\p{S}]/u,_X=/(?!~)[\s\p{P}\p{S}]/u,vX=/(?:[^\s\p{P}\p{S}]|~)/u,yX=LY(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,RY?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),bX=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,xX=LY(bX,`u`).replace(/punct/g,fX).getRegex(),SX=LY(bX,`u`).replace(/punct/g,gX).getRegex(),CX=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,wX=LY(CX,`gu`).replace(/notPunctSpace/g,mX).replace(/punctSpace/g,pX).replace(/punct/g,fX).getRegex(),TX=LY(CX,`gu`).replace(/notPunctSpace/g,vX).replace(/punctSpace/g,_X).replace(/punct/g,gX).getRegex(),EX=LY(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,mX).replace(/punctSpace/g,pX).replace(/punct/g,fX).getRegex(),DX=LY(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,fX).getRegex(),OX=LY(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,mX).replace(/punctSpace/g,pX).replace(/punct/g,fX).getRegex(),kX=LY(/\\(punct)/,`gu`).replace(/punct/g,fX).getRegex(),AX=LY(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),jX=LY(tX).replace(`(?:-->|$)`,`-->`).getRegex(),MX=LY(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,jX).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),NX=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,PX=LY(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,NX).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),FX=LY(/^!?\[(label)\]\[(ref)\]/).replace(`label`,NX).replace(`ref`,ZY).getRegex(),IX=LY(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ZY).getRegex(),LX=LY(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,FX).replace(`nolink`,IX).getRegex(),RX=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zX={_backpedal:IY,anyPunctuation:kX,autolink:AX,blockSkip:yX,br:uX,code:lX,del:IY,delLDelim:IY,delRDelim:IY,emStrongLDelim:xX,emStrongRDelimAst:wX,emStrongRDelimUnd:EX,escape:cX,link:PX,nolink:IX,punctuation:hX,reflink:FX,reflinkSearch:LX,tag:MX,text:dX,url:IY},BX={...zX,link:LY(/^!?\[(label)\]\((.*?)\)/).replace(`label`,NX).getRegex(),reflink:LY(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,NX).getRegex()},VX={...zX,emStrongRDelimAst:TX,emStrongLDelim:SX,delLDelim:DX,delRDelim:OX,url:LY(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,RX).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:LY(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,RX).getRegex()},HX={...VX,br:LY(uX).replace(`{2,}`,`*`).getRegex(),text:LY(VX.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},UX={normal:iX,gfm:oX,pedantic:sX},WX={normal:zX,gfm:VX,breaks:HX,pedantic:BX},GX={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},KX=e=>GX[e];function qX(e,t){if(t){if(zY.escapeTest.test(e))return e.replace(zY.escapeReplace,KX)}else if(zY.escapeTestNoEncode.test(e))return e.replace(zY.escapeReplaceNoEncode,KX);return e}function JX(e){try{e=encodeURI(e).replace(zY.percentDecode,`%`)}catch{return null}return e}function YX(e,t){let n=e.replace(zY.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(zY.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(zY.slashPipe,`|`);return n}function XX(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ZX(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function QX(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function $X(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function eZ(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
105
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
106
|
+
`)}var tZ=class{options;rules;lexer;constructor(e){this.options=e||PY}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:XX(e,`
|
|
107
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=eZ(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=XX(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:XX(t[0],`
|
|
108
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=XX(t[0],`
|
|
109
|
+
`).split(`
|
|
110
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
111
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
112
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
113
|
+
${s}`:s,r=r?`${r}
|
|
114
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
115
|
+
`+e.join(`
|
|
116
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
117
|
+
`+e.join(`
|
|
118
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
119
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=QX(t[2].split(`
|
|
120
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
121
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
122
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
123
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
124
|
+
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
125
|
+
`+l}u=!l.trim(),r+=p+`
|
|
126
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=YX(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
127
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(YX(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
128
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=XX(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=ZX(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),$X(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return $X(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},nZ=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||PY,this.options.tokenizer=this.options.tokenizer||new tZ,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:zY,block:UX.normal,inline:WX.normal};this.options.pedantic?(t.block=UX.pedantic,t.inline=WX.pedantic):this.options.gfm&&(t.block=UX.gfm,t.inline=this.options.breaks?WX.breaks:WX.gfm),this.tokenizer.rules=t}static get rules(){return{block:UX,inline:WX}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(zY.carriageReturn,`
|
|
129
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(zY.tabCharGlobal,` `).replace(zY.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
130
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
131
|
+
`)?``:`
|
|
132
|
+
`)+r.raw,n.text+=`
|
|
133
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
134
|
+
`)?``:`
|
|
135
|
+
`)+r.raw,n.text+=`
|
|
136
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
137
|
+
`)?``:`
|
|
138
|
+
`)+r.raw,a.text+=`
|
|
139
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
140
|
+
`)?``:`
|
|
141
|
+
`)+r.raw,n.text+=`
|
|
142
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},rZ=class{options;parser;constructor(e){this.options=e||PY}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(zY.notSpaceStart)?.[0],i=e.replace(zY.endingNewline,``)+`
|
|
143
|
+
`;return r?`<pre><code class="language-`+qX(r)+`">`+(n?i:qX(i,!0))+`</code></pre>
|
|
144
|
+
`:`<pre><code>`+(n?i:qX(i,!0))+`</code></pre>
|
|
145
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
146
|
+
${this.parser.parse(e)}</blockquote>
|
|
147
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
148
|
+
`}hr(e){return`<hr>
|
|
149
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
150
|
+
`+r+`</`+i+`>
|
|
151
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
152
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
153
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
154
|
+
<thead>
|
|
155
|
+
`+t+`</thead>
|
|
156
|
+
`+r+`</table>
|
|
157
|
+
`}tablerow({text:e}){return`<tr>
|
|
158
|
+
${e}</tr>
|
|
159
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
160
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${qX(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=JX(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+qX(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=JX(e);if(i===null)return qX(n);e=i;let a=`<img src="${e}" alt="${qX(n)}"`;return t&&(a+=` title="${qX(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:qX(e.text)}},iZ=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},aZ=class e{options;renderer;textRenderer;constructor(e){this.options=e||PY,this.options.renderer=this.options.renderer||new rZ,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new iZ}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},oZ=class{options;block;constructor(e){this.options=e||PY}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?nZ.lex:nZ.lexInline}provideParser(e=this.block){return e?aZ.parse:aZ.parseInline}},sZ=new class{defaults=NY();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=aZ;Renderer=rZ;TextRenderer=iZ;Lexer=nZ;Tokenizer=tZ;Hooks=oZ;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new rZ(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new tZ(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new oZ;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=oZ.passThroughHooks.has(n)?e=>{if(this.defaults.async&&oZ.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return nZ.lex(e,t??this.defaults)}parser(e,t){return aZ.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?nZ.lex:nZ.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?aZ.parse:aZ.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?nZ.lex:nZ.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?aZ.parse:aZ.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
161
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+qX(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function cZ(e,t){return sZ.parse(e,t)}cZ.options=cZ.setOptions=function(e){return sZ.setOptions(e),cZ.defaults=sZ.defaults,FY(cZ.defaults),cZ},cZ.getDefaults=NY,cZ.defaults=PY,cZ.use=function(...e){return sZ.use(...e),cZ.defaults=sZ.defaults,FY(cZ.defaults),cZ},cZ.walkTokens=function(e,t){return sZ.walkTokens(e,t)},cZ.parseInline=sZ.parseInline,cZ.Parser=aZ,cZ.parser=aZ.parse,cZ.Renderer=rZ,cZ.TextRenderer=iZ,cZ.Lexer=nZ,cZ.lexer=nZ.lex,cZ.Tokenizer=tZ,cZ.Hooks=oZ,cZ.parse=cZ,cZ.options,cZ.setOptions,cZ.use,cZ.walkTokens,cZ.parseInline,aZ.parse,nZ.lex;var lZ=300,uZ=`300px`,dZ=500;function fZ(e={}){let{immediate:t=!1,debounceDelay:n=lZ,rootMargin:r=uZ,idleTimeout:i=dZ}=e,[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=(0,v.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,v.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,v.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,v.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var pZ=320,mZ=4,hZ=()=>typeof performance>`u`?Date.now():performance.now();function gZ(e){let t=e?.now??hZ,n=e?.maxBacklogMs??pZ,r=0,i=0;return{now:t,beginPass(e){i=Math.min(Math.max(r,e),e+n)},mark(){return i},rewind(e){i=e},take(e,t,r){if(e<=0)return{baseDelay:0,step:Math.max(0,t)};let a=Math.max(0,t),o=a===0?0:Math.min(a,mZ),s=Math.max(i,r),c=r+n,l=s+Math.max(0,e-1)*a,u=a;if(l>c&&e>1){if(s<c){let t=c-s;u=Math.max(o,t/(e-1))}else u=o}let d=Math.max(0,Math.round(s-r));return i=s+e*u,{baseDelay:d,step:u}},commitPass(){r=i}}}var _Z=/\s/,vZ=/^\s+$/,yZ=new Set([`pre`,`svg`,`math`,`annotation`]),bZ=new Set([`img`,`hr`]),xZ=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,SZ=e=>e.some(e=>xZ(e)&&yZ.has(e.tagName)),CZ=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(xZ(n)&&n.tagName===`li`)return n}},wZ=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate-marker`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},TZ=new Set([`ul`,`ol`,`li`]),EZ=e=>{for(let t of e.children)if(xZ(t)){if(t.tagName===`input`)return t;if(TZ.has(t.tagName))continue;let e=EZ(t);if(e)return e}},DZ=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},OZ=(e,t,n,r)=>{let i=EZ(e);i&&DZ(i,t,n,r)},kZ=(e,t,n,r,i,a)=>{if(SZ(t))return;let o=r.prevContentLength,s=i.count;i.count+=1;let c=o>0&&s<o,l=c?0:a.baseDelay+i.newIndex++*a.step;DZ(e,n,c?0:n.duration,l)},AZ=e=>{var t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(xZ(r)){if((t=r.properties)!=null&&t[`data-sd-animated`])break;r.properties={...r.properties,"data-sd-animated":!0}}}},jZ=e=>{let t=[],n=``,r=!1;for(let i of e){let e=_Z.test(i);if(e!==r&&n){if(e){n+=i,r=!0;continue}t.push(n),n=``}n+=i,r=e}return n&&t.push(n),t},MZ=e=>{let t=[],n=``;for(let r of e)_Z.test(r)?t.length>0&&!vZ.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&=(t.push(n),``),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},NZ=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${Math.round(a)}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},PZ=(e,t)=>!(e>0&&t<e),FZ=e=>xZ(e)&&bZ.has(e.tagName),IZ=(e,t,n)=>{let r=0,i=0;return MN(e,e=>e.type===`text`||FZ(e),(e,a)=>{if(SZ(a))return jN;if(FZ(e)){PZ(n,i)&&(r+=1),i+=1;return}let o=e.value;if(!o.trim()){i+=o.length;return}let s=t.sep===`char`?MZ(o):jZ(o);for(let e of s){let t=i;i+=e.length,!vZ.test(e)&&PZ(n,t)&&(r+=1)}}),r},LZ=(e,t,n,r,i,a)=>{var o;let s=t.at(-1);if(!(s&&`children`in s))return;if(SZ(t))return jN;let c=s,l=c.children.indexOf(e);if(l===-1)return;let u=e.value;if(!u.trim()){i.count+=u.length;return}let d=n.sep===`char`?MZ(u):jZ(u),f=r.prevContentLength,p=!1,m=CZ(t),h=!(!m||(o=m.properties)!=null&&o[`data-sd-animate-marker`]),g=!1,_=d.map(e=>{let t=i.count;if(i.count+=e.length,vZ.test(e))return{type:`text`,value:e};let r=f>0&&t<f,o=r?0:a.baseDelay+i.newIndex++*a.step;if(p=!0,m&&h&&!g){let e=r?0:n.duration;wZ(m,e,o,n.easing),OZ(m,n,e,o),g=!0}return NZ(e,n.animation,n.duration,n.easing,r,o)});return p&&AZ(t),c.children.splice(l,1,..._),l+_.length},RZ=0;function zZ(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40,timeline:e?.timeline},n={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},r=RZ++,i=()=>e=>{let r={count:0,newIndex:0};n.prevContentLength=n.committedCharCount;let i=t.timeline,a=i?.now()??hZ();i&&(n.pendingMark===null?n.pendingMark=i.mark():i.rewind(n.pendingMark));let o=i?i.take(IZ(e,t,n.prevContentLength),t.stagger,a):{baseDelay:0,step:t.stagger};MN(e,e=>e.type===`text`||FZ(e),(e,i)=>{if(e.type===`text`)return LZ(e,i,t,n,r,o);kZ(e,i,t,n,r,o)}),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.committedCharCount=e,n.prevContentLength=e},getLastRenderCharCount(){return n.lastRenderCharCount},commit(){n.committedCharCount=n.lastRenderCharCount,n.pendingMark=null}}}zZ();var BZ=(0,v.createContext)(!1),VZ=()=>(0,v.useContext)(BZ),HZ=(...e)=>oo(Si(e)),UZ=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},WZ=e=>e?(...t)=>UZ(e,oo(Si(t))):HZ,GZ=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},KZ=(0,v.createContext)(HZ),qZ=()=>(0,v.useContext)(KZ),JZ=8,YZ=e=>{if(e!==void 0&&e!==0&&e!==1/0){if(typeof e==`number`)return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(e!==`0`&&e!==`none`&&e!==`Infinity`)return e}},XZ=(e,t,n)=>{let r=(0,v.useRef)(null),i=(0,v.useRef)(!0),a=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{let e=r.current;if(!(e&&t))return;let n=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<JZ;i.current=t};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[t]),(0,v.useEffect)(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),(0,v.useEffect)(()=>{let n=r.current;n&&t&&e&&i.current&&n.scrollTo({top:n.scrollHeight,behavior:`instant`})},[e,t,n]),r},ZZ=HZ(`block`),QZ=HZ(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),$Z=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},eQ=(0,v.memo)(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...s})=>{let c=qZ(),{isAnimating:l}=(0,v.useContext)(L1),u=YZ(i),d=XZ(l,!!u,t),f=(0,v.useMemo)(()=>c(QZ),[c]),p=(0,v.useMemo)(()=>c(ZZ),[c]),m=(0,v.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,$Z(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,U.jsx)(`div`,{className:c(r,u?`overflow-y-auto`:null,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,ref:d,style:u?{maxHeight:u}:void 0,...s,children:(0,U.jsx)(`pre`,{className:c(r,`bg-[var(--sdm-bg,inherit)]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]`),style:m,children:(0,U.jsx)(`code`,{className:o?c(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:o&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((e,t)=>(0,U.jsx)(`span`,{className:o?f:p,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
162
|
+
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,U.jsx)(`span`,{className:c(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})}),tQ=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=qZ();return(0,U.jsx)(`div`,{className:a(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i})},nQ=(0,v.createContext)({code:``}),rQ=()=>(0,v.useContext)(nQ),iQ=({language:e})=>{let t=qZ();return(0,U.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,U.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},aQ=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
163
|
+
`;)t--;return e.slice(0,t)},oQ=(0,v.lazy)(()=>Ij(()=>import(`./highlighted-body-KPVGNVTW-eviACFLs.js`).then(e=>({default:e.HighlightedCodeBlockBody})),[])),sQ=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=qZ(),{codeBlockMaxHeight:l}=(0,v.useContext)(L1),u=(0,v.useMemo)(()=>aQ(e),[e]),d=(0,v.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
|
|
164
|
+
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[u]);return(0,U.jsx)(nQ.Provider,{value:{code:e},children:(0,U.jsxs)(tQ,{dir:`ltr`,isIncomplete:i,language:t,children:[(0,U.jsx)(iQ,{language:t}),r?(0,U.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,U.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,U.jsx)(v.Suspense,{fallback:(0,U.jsx)(eQ,{className:n,language:t,lineNumbers:o,maxHeight:l,result:d,startLine:a,...s}),children:(0,U.jsx)(oQ,{className:n,code:u,language:t,lineNumbers:o,maxHeight:l,raw:d,startLine:a,...s})})]})})},cQ={CheckIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,U.jsxs)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,U.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,U.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,U.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,U.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},lQ=(0,v.createContext)(cQ),uQ=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])},dQ=({icons:e,children:t})=>{let n=(0,v.useRef)(e),r=(0,v.useRef)(e?{...cQ,...e}:cQ);uQ(n.current,e)||(n.current=e,r.current=e?{...cQ,...e}:cQ);let i=r.current;return(0,U.jsx)(lQ.Provider,{value:i,children:t})},fQ=()=>(0,v.useContext)(lQ),pQ={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,resetView:`Reset zoom and pan`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},mQ=(0,v.createContext)(pQ),hQ=()=>(0,v.useContext)(mQ),gQ=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=qZ(),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(0),{code:d}=rQ(),{isAnimating:f}=(0,v.useContext)(L1),p=hQ(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,v.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=fQ(),_=c?g.CheckIcon:g.CopyIcon;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{"aria-label":p.copyCode,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,U.jsx)(_,{"aria-hidden":`true`,size:14})}),c&&(0,U.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:p.copied})]})},_Q=(e,t,n)=>{if(typeof e==`boolean`)return n;let r=e[t];if(typeof r!=`object`)return n;let i=r.download;return typeof i==`object`&&i.filename||n},vQ={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},yQ=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=qZ(),{code:c}=rQ(),{isAnimating:l,controls:u}=(0,v.useContext)(L1),d=hQ(),f=fQ(),p=a??c,m=n&&n in vQ?vQ[n]:`txt`,h=`${_Q(u,`code`,`file`)}.${m}`;return(0,U.jsx)(`button`,{"aria-label":d.downloadFile,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{GZ(h,p,`text/plain`),e?.()}catch(e){t?.(e)}},title:d.downloadFile,type:`button`,...o,children:r??(0,U.jsx)(f.DownloadIcon,{size:14})})},bQ=()=>{let{Loader2Icon:e}=fQ(),t=qZ();return(0,U.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,U.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,U.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,U.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},xQ=/\.[^/.]+$/,SQ=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:s=!0,...c})=>{let{DownloadIcon:l}=fQ(),u=qZ(),d=(0,v.useRef)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),g=hQ(),_=c.width!=null||c.height!=null,y=(f||_)&&!m&&o&&s,b=m&&!_;(0,v.useEffect)(()=>{let e=d.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;p(t),h(!t)}},[]);let x=(0,v.useCallback)(e=>{p(!0),h(!1),i?.(e)},[i]),S=(0,v.useCallback)(e=>{p(!1),h(!0),a?.(e)},[a]),C=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(xQ,``)}.${i}`}GZ(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,U.jsxs)(`div`,{className:u(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,U.jsx)(`img`,{alt:r,className:u(`max-w-full rounded-lg`,b&&`hidden`,t),"data-streamdown":`image`,onError:S,onLoad:x,ref:d,src:n,...c}),b&&(0,U.jsx)(`span`,{className:u(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:g.imageNotAvailable}),o&&(0,U.jsx)(`div`,{className:u(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`),"data-streamdown":`image-overlay`}),y&&(0,U.jsx)(`button`,{className:u(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:C,title:g.downloadImage,type:`button`,children:(0,U.jsx)(l,{size:14})})]}):null},CQ=0,wQ=()=>{CQ+=1,CQ===1&&(document.body.style.overflow=`hidden`)},TQ=()=>{CQ=Math.max(0,CQ-1),CQ===0&&(document.body.style.overflow=``)},EQ=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=fQ(),c=qZ(),[l,u]=(0,v.useState)(!1),d=hQ(),f=(0,v.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,v.useCallback)(()=>{r(),n()},[r,n]);if((0,v.useEffect)(()=>{if(t){wQ();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),TQ()}}},[t,n]),!t||typeof document>`u`)return null;let m=(0,U.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,U.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,U.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,U.jsx)(s,{size:16})}),(0,U.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,U.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,U.jsx)(o,{size:20}),(0,U.jsx)(`span`,{children:d.openExternalLink})]}),(0,U.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,U.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,U.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,U.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i,{size:14}),(0,U.jsx)(`span`,{children:d.copied})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(a,{size:14}),(0,U.jsx)(`span`,{children:d.copyLink})]})}),(0,U.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,U.jsx)(o,{size:14}),(0,U.jsx)(`span`,{children:d.openLink})]})]})]})});return(0,Ed.createPortal)(m,document.body)},DQ=(0,v.createContext)(null),OQ=()=>(0,v.useContext)(DQ),kQ=()=>OQ()?.code??null,AQ=()=>OQ()?.mermaid??null,jQ=e=>{var t;let n=OQ();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},MQ=e=>{if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return e;let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);return t?new XMLSerializer().serializeToString(t):e},NQ=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),PQ=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=qZ(),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),{isAnimating:u,controls:d}=(0,v.useContext)(L1),f=fQ(),p=AQ(),m=hQ(),h=_Q(d,`mermaid`,`diagram`),g=async t=>{try{if(t===`mmd`){GZ(`${h}.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!p){a?.(Error(`Mermaid plugin not available`));return}let n=p.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}let u=MQ(l);if(t===`svg`){GZ(`${h}.svg`,u,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){let e=await NQ(u);GZ(`${h}.png`,e,`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,v.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,U.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,U.jsx)(`button`,{"aria-label":m.downloadDiagram,className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:m.downloadDiagram,type:`button`,children:t??(0,U.jsx)(f.DownloadIcon,{"aria-hidden":`true`,size:14})}),s?(0,U.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{"aria-label":m.downloadDiagramAsSvg,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`svg`),title:m.downloadDiagramAsSvg,type:`button`,children:m.mermaidFormatSvg}),(0,U.jsx)(`button`,{"aria-label":m.downloadDiagramAsPng,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`png`),title:m.downloadDiagramAsPng,type:`button`,children:m.mermaidFormatPng}),(0,U.jsx)(`button`,{"aria-label":m.downloadDiagramAsMmd,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`mmd`),title:m.downloadDiagramAsMmd,type:`button`,children:m.mermaidFormatMmd})]}):null]})},FQ=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=fQ(),c=qZ(),[l,u]=(0,v.useState)(!1),{isAnimating:d,controls:f}=(0,v.useContext)(L1),p=hQ(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.panZoom!==!1})(),h=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.download!==!1})(),g=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.copy!==!1})(),_=()=>{u(!l)};return(0,v.useEffect)(()=>{if(l){wQ();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),TQ()}}},[l]),(0,v.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:_,title:p.viewFullscreen,type:`button`,...a,"aria-label":p.viewFullscreen,children:(0,U.jsx)(o,{"aria-hidden":`true`,size:14})}),l?(0,Ed.createPortal)((0,U.jsxs)(`div`,{"aria-label":p.viewFullscreen,"aria-modal":`true`,className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),"data-streamdown":`mermaid-fullscreen`,onClick:_,onKeyDown:e=>{e.key===`Escape`&&_()},role:`dialog`,children:[(0,U.jsxs)(`div`,{className:c(`absolute top-4 right-4 z-10 flex items-center gap-1`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[h?(0,U.jsx)(PQ,{chart:e,config:t}):null,g?(0,U.jsx)(gQ,{code:e}):null,(0,U.jsx)(`button`,{"aria-label":p.exitFullscreen,className:c(`rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:_,title:p.exitFullscreen,type:`button`,children:(0,U.jsx)(s,{"aria-hidden":`true`,size:20})})]}),(0,U.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,U.jsx)(V1,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})};function IQ(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent??``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e;return t.tagName===`BR`?`
|
|
165
|
+
`:Array.from(t.childNodes).map(IQ).join(``)}var LQ=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(IQ(e).trim());let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(IQ(e).trim());n.push(t)}return{headers:t,rows:n}},RQ=e=>{if(typeof e!=`object`)return`,`;let t=e.table;return typeof t==`object`?t.csvSeparator??`,`:`,`},zQ=(e,t=`,`)=>{let n;n=t===`auto`?Intl.NumberFormat().format(1.1).includes(`,`)?`;`:`,`:t;let{headers:r,rows:i}=e,a=e=>{let t=!1;for(let r of e)if(r===n||r===`"`||r===`
|
|
166
|
+
`||r===`\r`){t=!0;break}return t?`"${e.replace(/"/g,`""`)}"`:e},o=r.length>0?i.length+1:i.length,s=Array(o),c=0;r.length>0&&(s[c]=r.map(a).join(n),c+=1);for(let e of i)s[c]=e.map(a).join(n),c+=1;return s.join(`
|
|
167
|
+
`)},BQ=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
168
|
+
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
169
|
+
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
170
|
+
`)},VQ=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`||n===`
|
|
171
|
+
`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):t===`
|
|
172
|
+
`?n.push(`<br>`):n.push(t);return n.join(``)},HQ=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0,a=t.map(e=>VQ(e));r[i]=`| ${a.join(` | `)} |`,i+=1;let o=Array(t.length);for(let e=0;e<t.length;e+=1)o[e]=`---`;r[i]=`| ${o.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?VQ(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else{let t=e.map(e=>VQ(e));r[i]=`| ${t.join(` | `)} |`,i+=1}return r.join(`
|
|
173
|
+
`)},UQ=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=qZ(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(null),d=(0,v.useRef)(0),{isAnimating:f,controls:p}=(0,v.useContext)(L1),m=hQ(),h=RQ(p),g=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=LQ(t),o=``;o=e===`csv`?zQ(a,h):e===`tsv`?BQ(a):HQ(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,v.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let _=fQ(),y=c?_.CheckIcon:_.CopyIcon;return(0,U.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,U.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:m.copyTable,type:`button`,children:e??(0,U.jsx)(y,{height:14,width:14})}),o?(0,U.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`md`),title:m.copyTableAsMarkdown,type:`button`,children:m.tableFormatMarkdown}),(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`csv`),title:m.copyTableAsCsv,type:`button`,children:m.tableFormatCsv}),(0,U.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`tsv`),title:m.copyTableAsTsv,type:`button`,children:m.tableFormatTsv})]}):null]})},WQ=({children:e,className:t,onDownload:n,onError:r})=>{let i=qZ(),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),{isAnimating:c,controls:l}=(0,v.useContext)(L1),u=hQ(),d=fQ(),f=RQ(l),p=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=LQ(t),a=e===`csv`?zQ(i,f):HQ(i),c=e===`csv`?`csv`:`md`;GZ(`${_Q(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,v.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,U.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,U.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,U.jsx)(d.DownloadIcon,{size:14})}),a?(0,U.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,U.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,U.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},GQ=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=fQ(),o=qZ(),[s,c]=(0,v.useState)(!1),{isAnimating:l}=(0,v.useContext)(L1),u=hQ(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,v.useEffect)(()=>{if(s){wQ();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),TQ()}}},[s]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,U.jsx)(i,{size:14})}),s?(0,Ed.createPortal)((0,U.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,U.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,U.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,U.jsx)(UQ,{}):null,r?(0,U.jsx)(WQ,{}):null,(0,U.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,U.jsx)(a,{size:20})})]}),(0,U.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,U.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},KQ=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=qZ(),{isAnimating:l}=(0,v.useContext)(L1),u=YZ(n),d=XZ(l,!!u,e),f=r&&i,p=r&&a,m=r&&o,h=f||p||m;return(0,U.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[h?(0,U.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[f?(0,U.jsx)(UQ,{}):null,p?(0,U.jsx)(WQ,{}):null,m?(0,U.jsx)(GQ,{showCopy:f,showDownload:p,children:e}):null]}):null,(0,U.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:d,style:u?{maxHeight:u}:void 0,children:(0,U.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},qQ=/startLine=(\d+)/,JQ=/\bnoLineNumbers\b/,YQ=(0,v.lazy)(()=>Ij(()=>import(`./mermaid-HWGCJPDP-BRHSVJqI.js`).then(e=>({default:e.Mermaid})),[])),XQ=/language-([^\s]+)/,ZQ=`node`;function QQ(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==ZQ&&!Object.is(r[e],i[e]))return!1;return!0}function $Q(e,t){return e?.properties?.metastring===t?.properties?.metastring}var e$=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,t$=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},n$=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},r$=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},i$=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},a$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>QQ(e,t));a$.displayName=`MarkdownOl`;var o$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>QQ(e,t));o$.displayName=`MarkdownLi`;var s$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>QQ(e,t));s$.displayName=`MarkdownUl`;var c$=(0,v.memo)(({className:e,node:t,...n})=>{let r=qZ();return(0,U.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>QQ(e,t));c$.displayName=`MarkdownHr`;var l$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>QQ(e,t));l$.displayName=`MarkdownStrong`;var u$=(0,v.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=qZ(),{linkSafety:o}=(0,v.useContext)(L1),[s,c]=(0,v.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,v.useCallback)(async e=>{if(o!=null&&o.enabled&&n&&!l){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,v.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,v.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,U.jsx)(EQ,{...p})]}):(0,U.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>QQ(e,t));u$.displayName=`MarkdownA`;var d$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>QQ(e,t));d$.displayName=`MarkdownH1`;var f$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>QQ(e,t));f$.displayName=`MarkdownH2`;var p$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>QQ(e,t));p$.displayName=`MarkdownH3`;var m$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>QQ(e,t));m$.displayName=`MarkdownH4`;var h$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>QQ(e,t));h$.displayName=`MarkdownH5`;var g$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>QQ(e,t));g$.displayName=`MarkdownH6`;var _$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,v.useContext)(L1),o=e$(i,`table`),s=t$(i,`copy`),c=t$(i,`download`),l=t$(i,`fullscreen`);return(0,U.jsx)(KQ,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>QQ(e,t));_$.displayName=`MarkdownTable`;var v$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>QQ(e,t));v$.displayName=`MarkdownThead`;var y$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>QQ(e,t));y$.displayName=`MarkdownTbody`;var b$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>QQ(e,t));b$.displayName=`MarkdownTr`;var x$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>QQ(e,t));x$.displayName=`MarkdownTh`;var S$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>QQ(e,t));S$.displayName=`MarkdownTd`;var C$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>QQ(e,t));C$.displayName=`MarkdownBlockquote`;var w$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>QQ(e,t));w$.displayName=`MarkdownSup`;var T$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=qZ();return(0,U.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>QQ(e,t));T$.displayName=`MarkdownSub`;var E$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,v.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,v.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,v.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,v.isValidElement)(e))return e;if(e.type===a$){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,U.jsx)(`section`,{className:t,...r,children:i}):null}return(0,U.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>QQ(e,t));E$.displayName=`MarkdownSection`;var D$=(0,v.memo)(({node:e,className:t,children:n,...r})=>{let i=qZ(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,v.useContext)(L1),l=AQ(),u=VZ(),d=(t?.match(XQ))?.at(1)??``,f=jQ(d);if(a)return(0,U.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(qQ),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&JQ.test(p))&&c!==!1,y=``;if((0,v.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?y=n.props.children:typeof n==`string`&&(y=n),f){let e=f.component;return(0,U.jsx)(v.Suspense,{fallback:(0,U.jsx)(bQ,{}),children:(0,U.jsx)(e,{code:y,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=e$(s,`mermaid`),n=r$(s,`download`),r=r$(s,`copy`),a=r$(s,`fullscreen`),c=r$(s,`panZoom`),l=e&&(n||r||a);return(0,U.jsx)(v.Suspense,{fallback:(0,U.jsx)(bQ,{}),children:(0,U.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,U.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,U.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,U.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,U.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,U.jsx)(PQ,{chart:y,config:o?.config}):null,r?(0,U.jsx)(gQ,{code:y}):null,a?(0,U.jsx)(FQ,{chart:y,config:o?.config}):null]})}):null,(0,U.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,U.jsx)(YQ,{chart:y,config:o?.config,showControls:c})})]})})}let b=e$(s,`code`),x=n$(s,`download`),S=n$(s,`copy`),{"data-block":C,...w}=r;return(0,U.jsx)(sQ,{className:t,code:y,isIncomplete:u,language:d,lineNumbers:_,startLine:g,...w,children:b?(0,U.jsxs)(U.Fragment,{children:[x?(0,U.jsx)(yQ,{code:y,language:d}):null,S?(0,U.jsx)(gQ,{}):null]}):null})},(e,t)=>QQ(e,t)&&$Q(e.node,t.node));D$.displayName=`MarkdownCode`;var O$=(0,v.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,v.useContext)(L1),i=e$(r,`image`),a=i&&i$(r,`download`);return(0,U.jsx)(SQ,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>QQ(e,t));O$.displayName=`MarkdownImg`;var k$=(0,v.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,v.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,U.jsx)(U.Fragment,{children:e})}return(0,U.jsx)(`p`,{...n,children:e})},(e,t)=>QQ(e,t));k$.displayName=`MarkdownParagraph`;var A$={ol:a$,li:o$,ul:s$,hr:c$,strong:l$,a:u$,h1:d$,h2:f$,h3:p$,h4:m$,h5:h$,h6:g$,table:_$,thead:v$,tbody:y$,tr:b$,th:x$,td:S$,blockquote:C$,code:D$,img:O$,pre:({children:e})=>(0,v.isValidElement)(e)?(0,v.cloneElement)(e,{"data-block":`true`}):e,sup:w$,sub:T$,p:k$,section:E$},j$=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,M$=/\p{L}/u;function N$(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(j$.test(e)){n??=`rtl`,i+=1;continue}M$.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var P$=/^[ \t]{0,3}(`{3,}|~{3,})/,F$=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,I$=e=>{let t=e.split(`
|
|
174
|
+
`),n=null,r=0;for(let e of t){let t=P$.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},L$=e=>{let t=e.split(`
|
|
175
|
+
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&F$.test(t))return!0}return!1},R$=()=>e=>{PN(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},z$=[],B$={allowDangerousHtml:!0},V$=new WeakMap,H$=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=V$.get(e);n||(n=e.name,V$.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=V$.get(r);e||(e=r.name,V$.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},U$=e=>{let t=W$(e),n=e.children||``;return Z$(t.runSync(t.parse(n),n),e)},W$=e=>{let t=H$.get(e);if(t)return t;let n=K$(e);return H$.set(e,n),n},G$=e=>e.some(e=>Array.isArray(e)?e[0]===rz:e===rz),K$=e=>{let t=e.rehypePlugins||z$,n=e.remarkPlugins||z$,r=G$(t)?n:[...n,R$],i=e.remarkRehypeOptions?{...B$,...e.remarkRehypeOptions}:B$;return CY().use(iJ).use(r).use(YJ,i).use(t)},q$=e=>e,J$=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},Y$=(e,t)=>{for(let n in yq)if(Object.hasOwn(yq,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=yq[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},X$=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},Z$=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||q$;PN(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return J$(c,s,a,e.value),s;if(e.type===`element`&&(Y$(e,t),X$(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return ZK(e,{Fragment:U.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.jsxs,passKeys:!0,passNode:!0})},Q$=/\[\^[\w-]{1,200}\](?!:)/,$$=/\[\^[\w-]{1,200}\]:/,e1=/<([A-Za-z][\w:-]*)[\s>/]/,t1=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),n1=new Map,r1=new Map,i1=e=>{let t=e.toLowerCase(),n=n1.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return n1.set(t,r),r},a1=e=>{let t=e.toLowerCase(),n=r1.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return r1.set(t,r),r},o1=(e,t)=>{if(t1.has(t.toLowerCase()))return 0;let n=e.match(i1(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},s1=(e,t)=>{let n=e.match(a1(t));return n?n.length:0},c1=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},l1=e=>{let t=Q$.test(e),n=$$.test(e);if(t||n)return[e];let r=nZ.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=o1(t,e),o=s1(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(e1);if(e){let n=e[1];o1(t,n)>s1(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(c1(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},u1=/^\n*/,d1=/\n*$/,f1=/\n\n/g,p1=(e,t,n)=>t.includes(`
|
|
176
|
+
`)?`${e}${t.replace(f1,`
|
|
177
|
+
<!---->
|
|
178
|
+
`).replace(u1,`
|
|
179
|
+
|
|
180
|
+
`).replace(d1,`
|
|
181
|
+
|
|
182
|
+
`)}${n}
|
|
183
|
+
|
|
184
|
+
`:e+t+n,m1=(e,t)=>{let n=RegExp(`<(${t})(?=[\\s>/])([^>]*)>`,`gi`),r=``,i=0,a=n.exec(e);for(;a;){let t=a[0],o=a[1],s=a.index+t.length,c=e.slice(s);if(RegExp(`</${o}\\s*>`,`i`).test(c)){a=n.exec(e);continue}if(r+=e.slice(i,a.index),c.length===0){r+=t,i=s,a=n.exec(e);continue}if(c.startsWith(`
|
|
185
|
+
|
|
186
|
+
`)){let n=c.slice(2).replace(f1,`
|
|
187
|
+
<!---->
|
|
188
|
+
`);r+=`${t}
|
|
189
|
+
|
|
190
|
+
${n}`,i=e.length;break}if(!c.startsWith(`
|
|
191
|
+
`)){r+=t,i=s,a=n.exec(e);continue}let l=c.slice(1);if(l.trim().length===0){r+=t,i=s,a=n.exec(e);continue}let u=l.replace(f1,`
|
|
192
|
+
<!---->
|
|
193
|
+
`);r+=`${t}
|
|
194
|
+
|
|
195
|
+
${u}`,i=e.length;break}return i===0?e:r+e.slice(i)},h1=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>p1(t,n,r)),n=m1(n,e)}return n},g1=/([\\`*_~[\]|])/g,_1=e=>e.replace(g1,`\\$1`),v1=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>t+_1(n).replace(/\n\n/g,` `)+r)}return n},y1=new Set([`blockquote`,`dd`,`dt`,`figcaption`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`p`,`td`,`th`]),b1=new Set([`code`,`kbd`,`pre`,`samp`,`var`]);function x1(e){return e.children.map(e=>e.type===`text`?e.value:e.type===`element`&&!b1.has(e.tagName)?x1(e):``).join(``)}function S1(){return e=>{PN(e,`element`,e=>{if(b1.has(e.tagName)){e.properties??={},e.properties.dir=`ltr`;return}y1.has(e.tagName)&&(e.properties??={},typeof e.properties.dir!=`string`&&(e.properties.dir=N$(x1(e))))})}}var C1=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(C1).join(``):``,w1=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));PN(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=C1(e);e.children=t?[{type:`text`,value:t}]:[]}})},T1=()=>e=>{PN(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},E1=/^[ \t]*<[\w!/?-]/,D1=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,O1=e=>typeof e!=`string`||e.length===0||!E1.test(e)?e:e.replace(D1,`$1`),k1={...az,clobberPrefix:``,protocols:{...az.protocols,href:[...az.protocols?.href??[],`tel`,`streamdown`]},attributes:{...az.attributes,code:[...az.attributes?.code??[],`metastring`]}},A1={raw:rz,sanitize:[Sz,k1],harden:[IN,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},j1={gfm:[zW,{}],codeMeta:T1},M1=Object.values(A1),N1=Object.values(j1),P1={block:` ▋`,circle:` ●`},F1=[`github-light`,`github-dark`],I1={enabled:!0},L1=(0,v.createContext)({codeBlockMaxHeight:400,shikiTheme:F1,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:I1,tableMaxHeight:300}),R1=(0,v.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:o,...s})=>{(0,v.useLayoutEffect)(()=>{o?.commit()});let c=typeof e==`string`&&n?O1(e):e,l=(0,U.jsx)(U$,{...s,children:c});return(0,U.jsx)(BZ.Provider,{value:i,children:a?(0,U.jsx)(`div`,{dir:a,style:{display:`contents`},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return e.rehypePlugins===t.rehypePlugins&&e.remarkPlugins===t.remarkPlugins&&!!e.animatePlugin==!!t.animatePlugin});R1.displayName=`Block`;var z1=(0,v.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=M1,remarkPlugins:s=N1,className:c,shikiTheme:l,mermaid:u,codeBlockMaxHeight:d=400,controls:f=!0,isAnimating:p=!1,tableMaxHeight:m=300,animated:h,BlockComponent:g=R1,parseMarkdownIntoBlocksFn:_=l1,caret:y,plugins:b,remend:x,linkSafety:S=I1,lineNumbers:C=!0,allowedTags:w,literalTagContent:T,translations:E,icons:D,prefix:O,onAnimationStart:k,onAnimationEnd:A,...j})=>{let M=(0,v.useId)(),N=(0,v.useMemo)(()=>WZ(O),[O]),P=(0,v.useRef)(null),F=(0,v.useRef)(k),I=(0,v.useRef)(A);F.current=k,I.current=A,(0,v.useEffect)(()=>{var e,n,r;if(t===`static`)return;let i=P.current;if(P.current=p,i===null){p&&((e=F.current)==null||e.call(F));return}p&&!i?(n=F.current)==null||n.call(F):!p&&i&&((r=I.current)==null||r.call(I))},[p,t]);let L=(0,v.useMemo)(()=>w?Object.keys(w):[],[w]),R=(0,v.useMemo)(()=>{if(typeof e!=`string`)return``;let n=t===`streaming`&&r?DK(e,x):e;return T&&T.length>0&&(n=v1(n,T)),L.length>0&&(n=h1(n,L)),n},[e,t,r,x,L,T]),z=(0,v.useMemo)(()=>_(R),[R,_]),ee=(0,v.useMemo)(()=>n===`auto`?z.map(N$):void 0,[z,n]),B=(0,v.useMemo)(()=>z.map((e,t)=>`${M}-${t}`),[z.length,M]),V=(0,v.useMemo)(()=>h===!0?`true`:h?JSON.stringify(h):``,[h]),te=(0,v.useRef)(null),ne=(0,v.useRef)([]),H=(0,v.useRef)([]),re=(0,v.useRef)(null),ie=(0,v.useRef)(``);V?(ie.current===V?te.current||=gZ():(ie.current=V,te.current=gZ({maxBacklogMs:V===`true`?void 0:h.maxBacklogMs}),ne.current=[],H.current=[]),p&&te.current&&te.current.beginPass(te.current.now())):(te.current=null,ne.current=[],H.current=[],ie.current=``),(0,v.useLayoutEffect)(()=>{var e;p&&((e=te.current)==null||e.commitPass())});let ae=(0,v.useMemo)(()=>({codeBlockMaxHeight:d,shikiTheme:l??(b?.code)?.getThemes()??F1,controls:f,isAnimating:p,lineNumbers:C,mode:t,mermaid:u,linkSafety:S,tableMaxHeight:m}),[d,l,f,p,C,t,u,S,b?.code,m]),oe=(0,v.useMemo)(()=>E?JSON.stringify(E):``,[E]),se=(0,v.useMemo)(()=>({...pQ,...E}),[oe]),ce=(0,v.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...A$,...t};if(e){let t=n.code;n.code=n=>`data-block`in n?t?(0,v.createElement)(t,n):null:(0,v.createElement)(e,n)}return n},[a]),le=(0,v.useMemo)(()=>{let e=[];return b!=null&&b.cjk&&(e=[...e,...b.cjk.remarkPluginsBefore]),e=[...e,...s],b!=null&&b.cjk&&(e=[...e,...b.cjk.remarkPluginsAfter]),b!=null&&b.math&&(e=[...e,b.math.remarkPlugin]),e},[s,b?.math,b?.cjk]),ue=(0,v.useMemo)(()=>{let e=o;if(w&&Object.keys(w).length>0&&o===M1){let t={...k1,tagNames:[...k1.tagNames??[],...Object.keys(w)],attributes:{...k1.attributes,...w}};e=[A1.raw,[Sz,t],A1.harden]}return T&&T.length>0&&(e=[...e,[w1,T]]),b!=null&&b.math&&(e=[...e,b.math.rehypePlugin]),n===`auto`&&t===`static`&&(e=[...e,S1]),e},[o,b?.math,w,T,n,t]),de=(0,v.useMemo)(()=>{if(!p||z.length===0)return!1;let e=z.at(-1);return I$(e)||L$(e)},[p,z]),fe=(0,v.useMemo)(()=>y&&p&&!de?{"--streamdown-caret":`"${P1[y]}"`}:void 0,[y,p,de]),pe=e=>{let t=null;if(te.current&&p){if(!ne.current[e]){let{maxBacklogMs:t,...n}=V&&V!==`true`?h:{};ne.current[e]=zZ({...n,timeline:te.current})}t=ne.current[e]}re.current!==ue&&(H.current=[],re.current=ue),t&&!H.current[e]&&(H.current[e]=[...ue,t.rehypePlugin]);let n=t&&H.current[e]?H.current[e]:ue;return{blockAnimatePlugin:t,blockRehypePlugins:n}};return t===`static`?(0,U.jsx)(mQ.Provider,{value:se,children:(0,U.jsx)(DQ.Provider,{value:b??null,children:(0,U.jsx)(L1.Provider,{value:ae,children:(0,U.jsx)(dQ,{icons:D,children:(0,U.jsx)(KZ.Provider,{value:N,children:(0,U.jsx)(`div`,{className:N(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,c),dir:n===`auto`?void 0:n,children:(0,U.jsx)(U$,{components:ce,rehypePlugins:ue,remarkPlugins:le,...j,children:R})})})})})})}):(0,U.jsx)(mQ.Provider,{value:se,children:(0,U.jsx)(DQ.Provider,{value:b??null,children:(0,U.jsx)(L1.Provider,{value:ae,children:(0,U.jsx)(dQ,{icons:D,children:(0,U.jsx)(KZ.Provider,{value:N,children:(0,U.jsxs)(`div`,{className:N(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,y&&!de?`[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]`:null,c),style:fe,children:[z.length===0&&y&&p&&(0,U.jsx)(`span`,{}),z.map((e,t)=>{let a=t===z.length-1,o=p&&a&&I$(e),{blockAnimatePlugin:s,blockRehypePlugins:c}=pe(t);return(0,U.jsx)(g,{animatePlugin:s,components:ce,content:e,dir:ee?.[t]??(n===`auto`?void 0:n),index:t,isIncomplete:o,rehypePlugins:c,remarkPlugins:le,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...j},B[t])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);z1.displayName=`Streamdown`;var B1=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:l,ZoomOutIcon:u}=fQ(),d=qZ(),f=hQ(),p=(0,v.useRef)(null),m=(0,v.useRef)(null),[h,g]=(0,v.useState)(o),[_,y]=(0,v.useState)({x:0,y:0}),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)({x:0,y:0}),[w,T]=(0,v.useState)({x:0,y:0}),E=(0,v.useCallback)(e=>{g(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),D=(0,v.useCallback)(()=>{E(i)},[E,i]),O=(0,v.useCallback)(()=>{E(-i)},[E,i]),k=(0,v.useCallback)(()=>{g(o),y({x:0,y:0})},[o]),A=(0,v.useCallback)(e=>{e.preventDefault();let t=e.deltaY>0?-i:i;E(t)},[E,i]),j=(0,v.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;x(!0),C({x:e.clientX,y:e.clientY}),T(_);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[_]),M=(0,v.useCallback)(e=>{if(!b)return;e.preventDefault();let t=e.clientX-S.x,n=e.clientY-S.y;y({x:w.x+t,y:w.y+n})},[b,S,w]),N=(0,v.useCallback)(e=>{x(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,v.useEffect)(()=>{let e=p.current;if(e)return e.addEventListener(`wheel`,A,{passive:!1}),()=>{e.removeEventListener(`wheel`,A)}},[A]),(0,v.useEffect)(()=>{let e=m.current;if(e&&b)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,M,{passive:!1}),e.addEventListener(`pointerup`,N),e.addEventListener(`pointercancel`,N),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,M),e.removeEventListener(`pointerup`,N),e.removeEventListener(`pointercancel`,N)}},[b,M,N]),(0,U.jsxs)(`div`,{className:d(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:p,style:{cursor:b?`grabbing`:`grab`},children:[a?(0,U.jsxs)(`div`,{className:d(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,U.jsx)(`button`,{"aria-label":f.zoomIn,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:h>=r,onClick:D,title:f.zoomIn,type:`button`,children:(0,U.jsx)(l,{"aria-hidden":`true`,size:16})}),(0,U.jsx)(`button`,{"aria-label":f.zoomOut,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:h<=n,onClick:O,title:f.zoomOut,type:`button`,children:(0,U.jsx)(u,{"aria-hidden":`true`,size:16})}),(0,U.jsx)(`button`,{"aria-label":f.resetView,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`),onClick:k,title:f.resetView,type:`button`,children:(0,U.jsx)(c,{"aria-hidden":`true`,size:16})})]}):null,(0,U.jsx)(`div`,{className:d(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:j,ref:m,role:`application`,style:{transform:`translate(${_.x}px, ${_.y}px) scale(${h})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},V1=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=qZ(),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(0),{mermaid:g}=(0,v.useContext)(L1),_=AQ(),y=g?.errorComponent,{shouldRender:b,containerRef:x}=fZ({immediate:r});if((0,v.useEffect)(()=>{if(b){if(!_){s(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{s(null),l(!0);let t=_.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);d(a),p(a)}catch(e){if(!(f||u)){let t=e instanceof Error?e.message:`Failed to render Mermaid chart`;s(t)}}finally{l(!1)}})()}},[e,n,m,b,_]),!(b||u||f))return(0,U.jsx)(`div`,{className:a(`my-4 min-h-[200px]`,t),ref:x});if(c&&!u&&!f)return(0,U.jsx)(`div`,{className:a(`my-4 flex justify-center p-4`,t),ref:x,children:(0,U.jsxs)(`div`,{className:a(`flex items-center space-x-2 text-muted-foreground`),children:[(0,U.jsx)(`div`,{className:a(`h-4 w-4 animate-spin rounded-full border-current border-b-2`)}),(0,U.jsx)(`span`,{className:a(`text-sm`),children:`Loading diagram...`})]})});if(o&&!u&&!f)return y?(0,U.jsx)(`div`,{ref:x,children:(0,U.jsx)(y,{chart:e,error:o,retry:()=>h(e=>e+1)})}):(0,U.jsxs)(`div`,{className:a(`rounded-md bg-red-50 p-4`,t),ref:x,children:[(0,U.jsxs)(`p`,{className:a(`font-mono text-red-700 text-sm`),children:[`Mermaid Error: `,o]}),(0,U.jsxs)(`details`,{className:a(`mt-2`),children:[(0,U.jsx)(`summary`,{className:a(`cursor-pointer text-red-600 text-xs`),children:`Show Code`}),(0,U.jsx)(`pre`,{className:a(`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`),children:e})]})]});let S=u||f;return(0,U.jsx)(`div`,{className:a(`size-full`,t),"data-streamdown":`mermaid`,ref:x,children:(0,U.jsx)(B1,{className:a(r?`size-full overflow-hidden`:`overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,U.jsx)(`div`,{"aria-label":`Mermaid chart`,className:a(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:S},role:`img`})})})},H1=/^[a-zA-Z][a-zA-Z0-9+.-]*:/,U1=/^(.*?):(\d+)(?::\d+)?$/,W1=/^L(\d+)/;function G1(e,t){let n=e?.trim();if(!n||n.startsWith(`#`)||n.startsWith(`//`))return;let r=n;if(H1.test(r)){if(!r.startsWith(`file:`))return;try{r=decodeURIComponent(new URL(r).pathname)}catch{return}}let i,a=r.indexOf(`#`);a!==-1&&(i=K1(W1.exec(r.slice(a+1))?.[1]),r=r.slice(0,a));let o=U1.exec(r);if(o&&(r=o[1],i??=K1(o[2])),!r)return;let s=r.startsWith(`/`)?q1(r):t?q1(`${t}/${r}`):void 0;return s?{path:s,...i===void 0?{}:{line:i}}:void 0}function K1(e){let t=e===void 0?NaN:Number(e);return Number.isInteger(t)&&t>0?t:void 0}function q1(e){let t=[];for(let n of e.split(`/`))if(n!==``&&n!==`.`){if(n===`..`){t.pop();continue}t.push(n)}return`/${t.join(`/`)}`}var J1=(0,v.createContext)(void 0);function Y1({value:e,children:t}){return(0,U.jsx)(J1.Provider,{value:e,children:t})}function X1(){return(0,v.useContext)(J1)}function Z1(e){if(e==null||typeof e==`boolean`)return``;if(typeof e==`string`||typeof e==`number`)return String(e);if(Array.isArray(e))return e.map(Z1).join(``);let t=e;return t.props?Z1(t.props.children):``}function Q1(e){let t=(Array.isArray(e)?e.find(Boolean):e)?.props?.className;return/language-([\w-]+)/.exec(t??``)?.[1]}function $1({code:e,language:t}){return(0,U.jsx)(aN,{className:`term-block`,actions:(0,U.jsx)(fN,{text:e,label:`Copy code`}),children:(0,U.jsx)(hN,{className:`term-code`,"data-language":t,children:(0,U.jsx)(`pre`,{className:`term-pre`,children:e})})})}function e0(e){return function({children:t}){return(0,U.jsx)(`div`,{className:`term-block`,"data-tone":e,"data-weight":`bold`,children:t})}}function t0({href:e,children:t}){let n=X1(),r=n?G1(e,n.cwd):void 0;return r?(0,U.jsx)(`button`,{type:`button`,className:`term-link`,"data-tone":`blue`,title:r.line===void 0?r.path:`${r.path}:${r.line}`,onClick:e=>{e.stopPropagation(),n?.open(r.path,r.line)},children:t}):(0,U.jsx)(`a`,{className:`term-link`,"data-tone":`blue`,href:e,target:`_blank`,rel:`noreferrer`,children:t})}var n0={p:({children:e})=>(0,U.jsx)(`div`,{className:`term-block`,children:e}),h1:e0(`bright`),h2:e0(`bright`),h3:e0(`bright`),h4:e0(`fg`),h5:e0(`fg`),h6:e0(`fg`),ul:({children:e})=>(0,U.jsx)(`ul`,{className:`term-block term-list`,children:e}),ol:({children:e})=>(0,U.jsx)(`ol`,{className:`term-block term-list term-list-ordered`,children:e}),li:({children:e})=>(0,U.jsxs)(`li`,{className:`term-row term-li`,children:[(0,U.jsx)(`span`,{className:`term-gutter`,"aria-hidden":!0}),(0,U.jsx)(`div`,{className:`term-body`,children:e})]}),blockquote:({children:e})=>(0,U.jsx)(`blockquote`,{className:`term-block term-quote`,"data-tone":`dim`,children:e}),hr:()=>(0,U.jsx)(`div`,{className:`term-block term-rule`,"aria-hidden":!0}),pre:({children:e})=>(0,U.jsx)($1,{code:Z1(e),language:Q1(e)}),code:({children:e})=>(0,U.jsx)(`code`,{className:`term-inline-code`,"data-tone":`blue`,children:e}),strong:({children:e})=>(0,U.jsx)(`strong`,{"data-tone":`bright`,"data-weight":`bold`,children:e}),em:({children:e})=>(0,U.jsx)(`em`,{className:`term-em`,children:e}),a:({children:e,href:t})=>(0,U.jsx)(t0,{href:t,children:e}),table:({children:e})=>(0,U.jsx)(`div`,{className:`term-block term-table-wrap`,children:(0,U.jsx)(`table`,{className:`term-table`,children:e})}),thead:({children:e})=>(0,U.jsx)(`thead`,{className:`term-thead`,children:e}),tbody:({children:e})=>(0,U.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,U.jsx)(`tr`,{children:e}),th:({children:e})=>(0,U.jsx)(`th`,{"data-tone":`bright`,"data-weight":`bold`,children:e}),td:({children:e})=>(0,U.jsx)(`td`,{children:e})},r0=(0,v.memo)(function({children:e,streaming:t,className:n}){return(0,U.jsx)(z1,{mode:t?`streaming`:`static`,parseIncompleteMarkdown:t,controls:!1,components:n0,className:W(`term-md`,n),children:e})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className);function i0(e){return e.kind===`tool_call`&&Ek(e.name)}function a0(e){return e.name??e.sessionId.slice(0,8)}function o0(e){let t=new Map;for(let n of e){if(n.kind===`user`){n.origin?.name&&t.set(n.origin.sessionId,n.origin.name);continue}if(n.kind===`tool_call`&&Ek(n.name)&&n.result&&!n.result.isError){let e=Bk(n.result.text);e?.name&&t.set(e.sessionId,e.name)}}return t}function s0(e,t){let n=e.result&&!e.result.isError?Bk(e.result.text):void 0,r=e.input?.sessionId,i=n?.sessionId??(typeof r==`string`?r:void 0);return i===void 0?`peer`:n?.name??t?.get(i)??i.slice(0,8)}function c0(e){let t=e.input?.text;return typeof t==`string`?t:``}function l0(e){return e.replace(/\s+/g,` `).trim()}function u0(e,t){return i0(e)||i0(t)?!1:e.parentToolUseId===t.parentToolUseId}function d0(e){if(CM(e))return`shell`;let t=/^mcp__([^_]+(?:_[^_]+)*?)__/.exec(e);return t?.[1]?t[1].replace(/_/g,`-`):e.toLowerCase()}function f0(e){return e.length===1?{kind:`call`,item:e[0]}:{kind:`summary`,items:e}}function p0(e,t){let n=t?`Running `:`Ran `,r=t?`…`:``,i=e.length,a=new Map;for(let t of e){let e=d0(t.name);a.set(e,(a.get(e)??0)+1)}if(a.size===1&&a.has(`shell`))return`${n}${i} shell command${i===1?``:`s`}${r}`;let o=[...a.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>`${t} ${e}`).join(`, `);return`${n}${i} tool${i===1?``:`s`} · ${o}${r}`}function m0(e,t=80){return e.length>t?e.slice(0,t-1)+`…`:e}function h0(e){return typeof e==`string`&&e.trim()!==``?e.trim():void 0}function g0(e){return`${e.name}(${_0(e)})`}function _0(e){let t=e.input,n=h0(t?.description),r=h0(t?.subagent_type);return r&&n?`${r} · ${m0(n)}`:r??(n?m0(n):yM(e.input))}function v0(e){let t=e.input;return h0(t?.prompt)}function y0(e){return e.status===`running`||e.status===`pending`}function b0(e){return e.status===`failed`||e.result?.isError===!0}function x0(e){let t=e[e.length-1];return t!==void 0&&b0(t)}function S0(e,t){return y0(e)||t.some(e=>e.kind===`tool_call`&&y0(e))}function C0(e){return b0(e)}function w0(e,t){let n=S0(e,t),r=t.reduce((e,t)=>e+ +(t.kind===`tool_call`),0),i=g0(e);return r===0?n?`${i} · working…`:`${i} · done`:`${i} · ${r} tool${r===1?``:`s`}${n?`…`:``}`}var T0=(0,v.createContext)(new Map);function E0({items:e,children:t}){let n=(0,v.useMemo)(()=>o0(e),[e]);return(0,U.jsx)(T0.Provider,{value:n,children:t})}function D0(){return(0,v.useContext)(T0)}var O0=4;function k0({onPress:e,expanded:t,className:n,children:r}){let i=(0,v.useRef)(null);return(0,U.jsx)(`div`,{role:`button`,tabIndex:0,"aria-expanded":t,className:W(`term-press`,n),onPointerDown:e=>{i.current={x:e.clientX,y:e.clientY}},onClick:t=>{let n=i.current;if(i.current=null,n&&Math.abs(t.clientX-n.x)+Math.abs(t.clientY-n.y)>O0)return;let r=window.getSelection?.();r&&!r.isCollapsed&&r.containsNode(t.currentTarget,!0)||e({meta:t.metaKey,ctrl:t.ctrlKey,alt:t.altKey})},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e({meta:t.metaKey,ctrl:t.ctrlKey,alt:t.altKey}))},children:r})}function A0(e){let t=(0,v.useRef)(null),n=(0,v.useRef)(e);return(0,v.useEffect)(()=>{let r=e&&!n.current;if(n.current=e,!r)return;let i=t.current;if(!i)return;let a=requestAnimationFrame(()=>{let e=j0(i);if(!e)return;let t=i.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;if(t>=e.scrollTop)return;let n=Number.parseFloat(getComputedStyle(i).lineHeight)||0;e.scrollTop=Math.max(0,t-n)});return()=>cancelAnimationFrame(a)},[e]),t}function j0(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}function M0(e){return`image · ${pM(e.bytes)}`}var N0=`image unavailable`,P0=4,F0=400;function I0(e,t){let n=[],r=0,i=!1;for(let t of e.slice(0,P0)){if(n.length===0&&t.length>F0){n.push(`${t.slice(0,F0)}…`),r=F0,i=!0;break}if(n.length>0&&r+t.length>F0)break;n.push(t),r+=t.length+1}let a=e.join(`
|
|
196
|
+
`).length,o=t??a;if(i||t!==void 0&&o>a)return{shown:n,more:`… +${(o-r).toLocaleString()} chars`};let s=e.length-n.length;return{shown:n,more:s>0?`… +${s} line${s===1?``:`s`}`:void 0}}var L0=async()=>!1,R0=(0,v.createContext)(L0);function z0({value:e,children:t}){return(0,U.jsx)(R0.Provider,{value:e??L0,children:t})}function B0(){return(0,v.useContext)(R0)}var V0=(0,v.createContext)(void 0);function H0({value:e,children:t}){return(0,U.jsx)(V0.Provider,{value:e,children:t})}function U0(e){return Ck(e,(0,v.useContext)(V0))}var W0=async()=>void 0,G0=(0,v.createContext)(W0);function K0({value:e,children:t}){return(0,U.jsx)(G0.Provider,{value:e??W0,children:t})}function q0(){return(0,v.useContext)(G0)}var J0=150;function Y0(e){let t=q0(),[n,r]=(0,v.useState)({failed:!1}),{toolUseId:i,sourceSeq:a,partIndex:o,mediaType:s,bytes:c}=e;return(0,v.useEffect)(()=>{let e=!0;r({failed:!1});let n=setTimeout(()=>{t({toolUseId:i,sourceSeq:a,partIndex:o,mediaType:s,bytes:c}).then(t=>{e&&r({src:t,failed:t===void 0})}).catch(()=>{e&&r({failed:!0})})},J0);return()=>{e=!1,clearTimeout(n)}},[t,i,a,o,s,c]),n}var X0=67108864;function Z0(e,t){let n=(0,v.useRef)(new Map);return(0,v.useEffect)(()=>()=>{for(let e of n.current.values())e.url&&URL.revokeObjectURL(e.url);n.current.clear()},[]),(0,v.useCallback)(r=>{if(!t)return Promise.resolve(void 0);let i=`${t}:${r.sourceSeq}:${r.toolUseId}:${r.partIndex}`,a=n.current.get(i);if(a)return n.current.delete(i),n.current.set(i,a),a.pending;let o=e.toolResultImage(t,r.sourceSeq,r.toolUseId,r.partIndex).then(e=>{if(e.size===0)return;let t=URL.createObjectURL(e),r=n.current.get(i);return r?(r.url=t,r.bytes=e.size,Q0(n.current,i)):URL.revokeObjectURL(t),t}).catch(()=>void 0);return n.current.set(i,{pending:o,bytes:r.bytes}),o},[e,t])}function Q0(e,t){let n=0;for(let t of e.values())n+=t.bytes;for(let[r,i]of e){if(n<=X0)return;r!==t&&(i.url&&URL.revokeObjectURL(i.url),e.delete(r),n-=i.bytes)}}var $0=8,e2={pending:`☐`,in_progress:`◐`,completed:`☒`};function t2(e,t){if(e!==`TodoWrite`)return;let n=Mee(t);if(n===void 0||n.length===0)return;let r=n.reduce((e,t)=>e+ +(t.status===`completed`),0),i=n.slice(0,$0),a=n.length-i.length;return{summary:`${r}/${n.length} done`,shown:i,more:a>0?`… +${a} more`:void 0}}function n2(e){return`${e2[e.status]} ${e.text}`}var r2={loadOutput:async()=>!1,verify:async()=>!1,kill:async()=>!1},i2=(0,v.createContext)(r2);function a2({value:e,children:t}){return(0,U.jsx)(i2.Provider,{value:e??r2,children:t})}function o2(){return(0,v.useContext)(i2)}var s2=2e3;function c2(e,t){let n=[],r=0;for(let i of e){if(n.length>0&&r+i.length>t)break;n.push(i),r+=i.length+1}return n}function l2(e){let t=e.name?`${e.name} (${e.sessionId.slice(0,8)})`:e.sessionId.slice(0,8);return`message from ${e.engine?`${e.engine} session `:`session `}${t}`}function u2({glyph:e,who:t,body:n,tone:r=`peer`,clip:i}){let a=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(gN,{tone:r,bold:!0,children:t}),`: `,n]});return(0,U.jsx)(pN,{glyph:e,glyphTone:r,tone:r,children:i?(0,U.jsx)(`span`,{className:`term-clip-1`,children:a}):a})}function d2({item:e}){let[t,n]=(0,v.useState)(!1),r=D0(),i=A0(t),a=c0(e).split(`
|
|
197
|
+
`),o=e.status===`failed`||e.result?.isError===!0?`red`:`peer`;return(0,U.jsx)(aN,{actions:(0,U.jsx)(cN,{id:e.id}),children:(0,U.jsxs)(`div`,{ref:i,className:t?`term-open`:void 0,children:[(0,U.jsx)(k0,{onPress:()=>n(e=>!e),expanded:t,children:(0,U.jsx)(u2,{glyph:`↤`,who:s0(e,r),tone:o,clip:!t,body:t?a[0]||`\xA0`:l0(a.join(` `))})}),t?(0,U.jsxs)(`div`,{children:[a.slice(1).map((e,t)=>(0,U.jsx)(pN,{tone:o,children:e||`\xA0`},t)),e.result?(0,U.jsx)(pN,{tone:`faint`,children:l0(e.result.text)}):null]}):null]})})}function f2({item:e}){return(0,U.jsx)(aN,{actions:(0,U.jsx)(cN,{id:e.id}),children:(0,U.jsxs)(`div`,{className:`term-user`,"data-peer":e.origin?``:void 0,children:[e.attachments?.length?(0,U.jsx)(pN,{glyph:`❯`,glyphTone:`dim`,tone:`dim`,children:e.attachments.map(e=>e.name).join(`, `)}):null,e.text?e.text.split(`
|
|
198
|
+
`).map((t,n)=>e.origin&&n===0?(0,U.jsx)(u2,{glyph:`↦`,who:a0(e.origin),body:t?(0,U.jsx)(HM,{text:t}):`\xA0`},n):(0,U.jsx)(pN,{glyph:!e.origin&&n===0?`❯`:void 0,glyphTone:`dim`,tone:e.origin?`peer`:`fg`,children:t?(0,U.jsx)(HM,{text:t}):`\xA0`},n)):null]})})}function p2({item:e}){return(0,U.jsx)(aN,{actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(cN,{id:e.id}),e.streaming?null:(0,U.jsx)(fN,{text:e.text,label:`Copy message`})]}),children:(0,U.jsx)(pN,{glyph:`●`,glyphTone:`fg`,tone:`fg`,children:(0,U.jsx)(r0,{streaming:e.streaming,children:e.text})})})}function m2({item:e}){return(0,U.jsx)(pN,{glyph:`✻`,glyphTone:`dim`,tone:`dim`,children:(0,U.jsx)(`span`,{className:`term-em`,children:e.text})})}var h2={running:`blue`,pending:`blue`,deferred:`yellow`,settled:`dim`,failed:`red`};function g2({item:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),s=B0(),c=A0(t),l=e.status??(e.result===void 0?`running`:`settled`),u=l===`running`||l===`pending`,d=l===`failed`||e.result?.isError===!0,f=LM(u),p=e.result?.text??``,m=p.trimEnd().split(`
|
|
199
|
+
`),h=I0(m,e.result?.totalChars),g=t?r?m:c2(m,s2):h.shown,_=m.length-g.length,y=t&&!r&&_>0,b=e.result?.truncated===!0,x=b?(e.result?.totalChars??0)-p.length:0,S=d?`red`:l===`settled`&&wM(e.name)?`green`:h2[l]??`dim`,C=e.input?.command,w=typeof C==`string`?C:p,T=t2(e.name,e.input),E=U0(e.name);return(0,U.jsx)(`div`,{ref:c,className:t?`term-open`:void 0,children:(0,U.jsxs)(aN,{actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(cN,{id:e.id}),w?(0,U.jsx)(fN,{text:w,label:`Copy`}):null]}),children:[(0,U.jsx)(k0,{onPress:()=>n(e=>!e),expanded:t,children:(0,U.jsxs)(pN,{glyph:u?f:`●`,glyphTone:S,tone:`fg`,title:E?e.name:void 0,children:[(0,U.jsx)(gN,{bold:!0,tone:`bright`,className:u?`term-shimmer`:void 0,children:E??e.name}),(0,U.jsxs)(gN,{tone:`dim`,children:[`(`,T?T.summary:yM(e.input),`)`]}),E&&t?(0,U.jsxs)(gN,{tone:`faint`,children:[` · `,e.name]}):null,e.backend&&e.backend!==`server`?(0,U.jsxs)(gN,{tone:`faint`,children:[` · `,e.backend]}):null]})}),e.result?.images?.map(t=>(0,U.jsx)(y2,{toolUseId:e.id,image:t},t.partIndex)),e.patch&&!t?(0,U.jsx)(xN,{patch:e.patch}):T&&!t?(0,U.jsx)(v2,{preview:T}):p?(0,U.jsxs)(U.Fragment,{children:[g.map((e,t)=>(0,U.jsx)(pN,{indent:1,columns:3,glyph:t===0?`⎿`:void 0,tone:d?`red`:`dim`,children:e||`\xA0`},t)),t?y||b?(0,U.jsx)(pN,{indent:1,columns:3,tone:`faint`,children:a?(0,U.jsxs)(U.Fragment,{children:[`… fetching `,(e.result?.totalChars??0).toLocaleString(),` chars`]}):y||b?(0,U.jsx)(`button`,{type:`button`,className:`term-press term-link`,onClick:()=>{i(!0),b&&(o(!0),s(e.id).finally(()=>o(!1)))},children:b?`… +${x.toLocaleString()} chars - fetch the rest`:`… +${_} line${_===1?``:`s`} - show all ${p.length.toLocaleString()} chars`}):(0,U.jsxs)(U.Fragment,{children:[`… +`,_,` line`,_===1?``:`s`]})}):_>0?(0,U.jsxs)(pN,{indent:1,columns:3,tone:`faint`,children:[`… +`,_,` line`,_===1?``:`s`]}):null:h.more?(0,U.jsx)(pN,{indent:1,columns:3,tone:`faint`,children:h.more}):null]}):null]})})}var _2={pending:`dim`,in_progress:`blue`,completed:`faint`};function v2({preview:e}){return(0,U.jsxs)(U.Fragment,{children:[e.shown.map((e,t)=>(0,U.jsx)(pN,{indent:1,columns:3,glyph:t===0?`⎿`:void 0,tone:_2[e.status],children:n2(e)},t)),e.more?(0,U.jsx)(pN,{indent:1,columns:3,tone:`faint`,children:e.more}):null]})}function y2({toolUseId:e,image:t}){let{src:n,failed:r}=Y0({toolUseId:e,...t});return(0,U.jsx)(pN,{indent:1,columns:3,children:(0,U.jsx)(`div`,{className:`term-image`,"data-state":n?`loaded`:r?`failed`:`pending`,style:{height:`calc(var(--term-line) * 12)`},children:n?(0,U.jsx)(`img`,{src:n,alt:M0(t)}):(0,U.jsx)(gN,{tone:`faint`,children:r?N0:M0(t)})})})}function b2({items:e}){let[t,n]=(0,v.useState)(!1),r=A0(t),i=e.some(e=>{let t=e.status??(e.result===void 0?`running`:`settled`);return t===`running`||t===`pending`}),a=x0(e),o=LM(i);return(0,U.jsxs)(`div`,{ref:r,className:t?`term-open`:void 0,children:[(0,U.jsx)(k0,{onPress:()=>n(e=>!e),expanded:t,children:(0,U.jsx)(pN,{glyph:i?o:void 0,glyphTone:i?`mark`:void 0,tone:a?`red`:`dim`,children:i?(0,U.jsx)(`span`,{className:`term-shimmer`,children:p0(e,i)}):p0(e,i)})}),t?(0,U.jsx)(`div`,{children:e.map(e=>(0,U.jsx)(g2,{item:e},e.id))}):null]})}function x2({items:e}){let t=f0(e);return t.kind===`summary`?(0,U.jsx)(b2,{items:t.items}):i0(t.item)?(0,U.jsx)(d2,{item:t.item}):(0,U.jsx)(g2,{item:t.item})}function S2({item:e}){return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(pN,{tone:e.isError?`red`:`faint`,children:[e.isError?e.subtype:`done`,` · `,dM(e.durationMs),` · `,uM(e.costUsd??e.totalCostUsd)]}),e.errors?.map((e,t)=>(0,U.jsx)(pN,{tone:`red`,children:e},t))]})}function C2({item:e}){let t=e.error!==void 0;return(0,U.jsx)(pN,{glyph:e.pending?`⋯`:`≡`,glyphTone:t?`red`:`yellow`,tone:t?`red`:`faint`,children:lM(e)})}function w2({item:e}){let t=e.level===`error`;return(0,U.jsx)(pN,{glyph:`!`,glyphTone:t?`red`:`yellow`,tone:t?`red`:`dim`,children:e.text})}function T2({item:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),a=o2(),o=A0(t),s=e.shell.status===`running`,c=XM(e),l=c?`red`:s?`magenta`:`dim`,u=QM(e,t),d=$M(e,t,u.length),f=e.shell.id,p=a.verify;return(0,v.useEffect)(()=>{s&&p(f)},[s,f,p]),(0,U.jsx)(`div`,{ref:o,className:t?`term-open`:void 0,children:(0,U.jsxs)(aN,{actions:(0,U.jsxs)(U.Fragment,{children:[a.open?(0,U.jsx)(uN,{onOpen:()=>a.open?.(f)}):null,s?(0,U.jsx)(dN,{onKill:()=>void a.kill(f)}):null,(0,U.jsx)(cN,{id:e.id}),(0,U.jsx)(fN,{text:e.shell.command,label:`Copy command`})]}),children:[(0,U.jsx)(k0,{onPress:r=>{if((r.meta||r.ctrl)&&a.open){a.open(f);return}let o=!t;n(o),o&&e.truncated&&e.expanded===void 0&&!e.missing&&(i(!0),a.loadOutput(f).finally(()=>i(!1)))},expanded:t,children:(0,U.jsxs)(pN,{glyph:`$`,glyphTone:l,tone:`fg`,children:[(0,U.jsx)(gN,{bold:!0,tone:`bright`,children:KM(e)}),(0,U.jsxs)(gN,{tone:c?`red`:`faint`,children:[` · `,qM(e)]})]})}),u.map((e,t)=>(0,U.jsx)(pN,{tone:c?`red`:`dim`,children:e||` `},t)),d||r?(0,U.jsx)(pN,{tone:`faint`,children:r?`… fetching the full output`:d}):null]})})}function E2({item:e,href:t}){return(0,U.jsxs)(pN,{glyph:`⤓`,glyphTone:`blue`,tone:`dim`,children:[t?(0,U.jsx)(`a`,{className:`term-link`,"data-tone":`blue`,href:t,download:!0,children:e.path}):(0,U.jsx)(gN,{tone:`blue`,children:e.path}),(0,U.jsxs)(gN,{tone:`faint`,children:[` · `,pM(e.bytes)]}),e.description?(0,U.jsxs)(gN,{tone:`faint`,children:[` · `,e.description]}):null]})}function D2(e){let[t,n]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function O2({label:e,startedAt:t,tokens:n}){let r=LM(!0),i=D2(t!==void 0),a=[t===void 0?void 0:dM(i-t),n?`↓ ${(n/1e3).toFixed(1)}k tokens`:void 0].filter(Boolean);return(0,U.jsxs)(pN,{glyph:r,glyphTone:`mark`,tone:`mark`,children:[(0,U.jsx)(`span`,{className:`term-shimmer`,children:e}),a.length?(0,U.jsxs)(gN,{tone:`faint`,children:[` (`,a.join(` · `),`)`]}):null]})}function k2({fontSize:e,lineHeight:t,bleed:n,affordances:r,className:i,style:a,children:o,...s}){let c=rN(r);return(0,U.jsx)(`div`,{"data-terminal":``,"data-affordances":[c.hover&&`hover`,c.actions&&`actions`].filter(Boolean).join(` `)||void 0,className:W(`min-w-0`,i),style:{...e!==void 0&&{"--term-font-size":`${Math.round(e)}px`},...t!==void 0&&{"--term-line":`${Math.round(t)}px`},...n!==void 0&&{"--term-bleed":n},...a},...s,children:(0,U.jsx)(iN,{value:c,children:o})})}var A2=`Run a command on the host…`,j2=`$ shell mode · esc to exit`;function M2({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:i=`Message the agent…`,commands:a,skills:o,clientCommands:s,onSearchFiles:c,peers:l,onShellCommand:u,attachments:d,toolbar:f,layout:p=`stacked`,fontSize:m,lineHeight:h,affordances:g,draft:_,className:y,ref:b}){let x=p===`inline`,S=iM()===`terminal`,[C]=(0,v.useState)(()=>_?.initialText??``),{bind:w,plainText:T,isEmpty:E,clear:D,focus:O}=_O(C===``?void 0:{initialValue:$T(C)}),k=(0,v.useRef)(null),[A,j]=(0,v.useState)(!1),[M,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(!1);(0,v.useImperativeHandle)(b,()=>({insertText:e=>{let t=T.length>0&&!/\s$/.test(T)?` `:``;w.ref.current?.appendText(t+e),O()},focus:O}),[w.ref,T,O]);let I=(0,v.useMemo)(()=>{let e=[],t=Yj({commands:a,clientCommands:s,skills:o});if(t.length>0){let n=new Map(t.map(e=>[`${e.kind}:${e.name}`,e]));e.push(yO({onSearch:e=>Qj(e,t).map(e=>e.kind===`skill`?{value:e.name,label:e.label,description:e.description?`Skill · ${e.description}`:`Skill · inserts a message you can edit`,icon:(0,U.jsx)(ES,{className:`size-3.5 text-fg-3`}),data:`${e.kind}:${e.name}`}:{value:e.name,label:`/${e.name}${e.argumentHint?` ${e.argumentHint}`:``}`,description:e.description,icon:e.kind===`client`?(0,U.jsx)(SS,{className:`size-3.5 text-fg-3`}):void 0,data:`${e.kind}:${e.name}`}),insertAsText:e=>{let t=n.get(String(e.data));return t?.kind===`client`&&t.command.requiresArgs?`/${t.name} `:void 0},chipOptions:e=>{let t=n.get(String(e.data));return t?.kind===`skill`?{sigil:`$`,trailingText:qj(t.skill)}:void 0},onSelect:e=>e.value,chipClassName:`font-mono`}))}return c&&e.push(vO({searchDebounceMs:150,onSearch:async(e,t)=>(await c(e,t)).map(e=>({value:e.relative,label:e.relative,description:e.path})),onSelect:e=>e.value,chipStyle:`inline`,chipClassName:`font-mono`,emptyMessage:`No matching files`})),l?.length&&e.push(bO({accessibilityLabel:`session`,onSearch:e=>$j(e,l).map(e=>({value:e.slug,label:e.label,description:[e.engine,e.project,e.status].filter(Boolean).join(` · `),icon:(0,U.jsx)(gC,{className:`size-3.5 text-fg-3`})})),onSelect:e=>e.value,chipStyle:`inline`,chipClassName:`font-mono`,emptyMessage:`No matching sessions`})),u&&e.push(xO({char:`$`,accessibilityLabel:`shell mode`,onActivate:()=>N(!0)})),e.length>0?e:void 0},[a,o,s,c,l,u]),L=_?.save;(0,v.useEffect)(()=>{L?.(T)},[T,L]);let R=d?.items??[],z=!r&&(!E||R.length>0)&&!d?.uploading&&!d?.hasFailure,ee=()=>{if(z){if(M){let e=T.trim();if(e===``)return;u?.(e),N(!1),_?.clear(),D(),O();return}e(T.trim(),d?.readyIds??[]),d?.clear(),_?.clear(),D(),O()}},B=e=>{N(!1),e&&w.ref.current?.setText(`$${T}`),O()},V=[I?.some(e=>e.char===`/`)?{key:`/`,what:`commands and skills`}:void 0,c?{key:`@`,what:`mention a file`}:void 0,l?.length?{key:`#`,what:`refer to another session`}:void 0,u?{key:`$`,what:`run a shell command`}:void 0,{key:`?`,what:`this list, on an empty composer`}].filter(e=>e!==void 0),te=M?{onEscape:()=>B(!0),onKeyDown:e=>{e.key===`Backspace`&&E&&(e.preventDefault(),B(!1))}}:{onEscape:P?()=>F(!1):void 0,onKeyDown:e=>{if(e.key===`?`&&E&&!e.metaKey&&!e.ctrlKey){e.preventDefault(),F(!0);return}P&&F(!1)}},ne=P?(0,U.jsx)(U.Fragment,{children:V.map(e=>(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`kbd`,{className:`font-mono text-text`,children:e.key}),e.what]},e.key))}):null,H=P?(0,U.jsx)(`div`,{role:`note`,"aria-label":`Composer shortcuts`,className:`mx-auto mb-1 flex w-full max-w-[var(--wd-transcript-max-width)] flex-wrap items-center gap-x-3 gap-y-1 text-label text-fg-3`,children:ne}):null,re=e=>{e&&e.length>0&&d?.add(e)},ie=d&&!d.disabled?(0,U.jsx)(`input`,{ref:k,type:`file`,multiple:!0,accept:d.accept||void 0,className:`hidden`,onChange:e=>{re(e.target.files),e.target.value=``}}):null,ae=!!d&&!d.disabled,oe=ae?(0,U.jsxs)(U.Fragment,{children:[ie,(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,disabled:r,onClick:()=>k.current?.click(),children:(0,U.jsx)(cx,{className:`size-4`})})]}):null,se=M?(0,U.jsx)(N2,{gutter:!0,label:`Leave shell mode`,tone:`magenta`,onClick:()=>B(!1),children:`$`}):n?(0,U.jsx)(N2,{gutter:!0,label:`Interrupt`,tone:`yellow`,onClick:t,children:`✕`}):ae?(0,U.jsx)(N2,{gutter:!0,label:`Attach files`,disabled:r,onClick:()=>k.current?.click(),children:`+`}):(0,U.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`,"data-tone":`blue`,children:`❯`}),ce=S?(0,U.jsx)(N2,{label:`Send`,disabled:!z,onClick:ee,tone:z?`blue`:void 0,children:`↵`}):n&&!z?(0,U.jsx)(lo,{variant:`outline`,size:`icon-sm`,"aria-label":`Interrupt`,className:`rounded-full`,onClick:t,children:(0,U.jsx)(RS,{className:`size-3`})}):(0,U.jsx)(lo,{size:`icon-sm`,"aria-label":`Send`,className:`rounded-full`,disabled:!z,onClick:ee,children:(0,U.jsx)(h_,{className:`size-4`})}),le={onDragOver:e=>{d&&!d.disabled&&(e.preventDefault(),j(!0))},onDragLeave:()=>j(!1),onDrop:e=>{d&&!d.disabled&&(e.preventDefault(),j(!1),re(e.dataTransfer.files))}},ue=d?.error?(0,U.jsxs)(`div`,{className:W(`mx-auto mt-1 flex w-full max-w-[var(--wd-transcript-max-width)] items-center gap-2 text-label text-danger`),children:[(0,U.jsx)(oC,{className:`size-3 shrink-0`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1`,children:d.error}),(0,U.jsx)(`button`,{type:`button`,onClick:d.dismissError,"aria-label":`Dismiss`,className:`shrink-0 opacity-70 hover:opacity-100`,children:(0,U.jsx)(DC,{className:`size-3`})})]}):null;if(S){let e=h??18;return(0,U.jsxs)(`div`,{"data-slot":`composer`,className:W(`shrink-0`,y),children:[(0,U.jsx)(k2,{...le,fontSize:m,lineHeight:h,affordances:g,bleed:`1ch`,"data-dragging":A||void 0,className:W(`term-composer`,M&&`term-composer-shell`,r&&`opacity-60`),children:(0,U.jsxs)(`div`,{className:`term-composer-body`,children:[R.length>0&&d?(0,U.jsx)(P2,{attachments:d}):null,(0,U.jsxs)(`div`,{className:`term-row`,children:[ae&&!M?ie:null,se,(0,U.jsxs)(`div`,{className:`flex min-w-0 items-start`,children:[(0,U.jsx)(gO,{...w,triggers:I,markdown:!1,normalizeBullets:!1,onSubmit:ee,disabled:r,placeholder:r?`Session ended`:M?A2:i,minHeight:e,maxHeight:e*10,"aria-label":M?`Run a shell command`:`Message the agent`,className:`term-composer-field min-w-0 flex-1`,onImagePaste:e=>d?.add([e]),...te}),ce]})]}),P?(0,U.jsxs)(`div`,{role:`note`,"aria-label":`Composer shortcuts`,className:`term-row`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`}),(0,U.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-[2ch] text-fg-3`,children:ne})]}):null,M?(0,U.jsxs)(`div`,{className:`term-row`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`}),(0,U.jsx)(`span`,{className:`term-composer-shell-hint`,children:j2})]}):f?(0,U.jsxs)(`div`,{className:`term-row`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`}),(0,U.jsx)(`div`,{className:`flex min-w-0 items-center gap-[1ch]`,children:f})]}):null]})}),ue]})}return(0,U.jsxs)(`div`,{"data-slot":`composer`,className:W(`px-[var(--wd-composer-padding)] pb-[var(--wd-composer-padding)]`,y),children:[H,(0,U.jsxs)(`div`,{...le,className:W(`mx-auto w-full max-w-[var(--wd-transcript-max-width)] overflow-hidden border border-border bg-bg`,`transition-colors rounded-lg shadow-(--shadow-xs)`,`focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30`,A&&`border-ring ring-2 ring-ring/30`,M&&`border-[var(--wd-shell-accent)] focus-within:border-[var(--wd-shell-accent)] focus-within:ring-[var(--wd-shell-accent)]/30`,r&&`opacity-60`),children:[R.length>0&&d?(0,U.jsx)(P2,{attachments:d}):null,x?(0,U.jsxs)(`div`,{className:`flex items-end gap-1 p-1`,children:[M?(0,U.jsx)(L2,{onLeave:()=>B(!1)}):oe,(0,U.jsx)(gO,{...w,triggers:I,markdown:!1,normalizeBullets:!1,onSubmit:ee,disabled:r,placeholder:r?`Session ended`:M?A2:i,minHeight:20,maxHeight:192,"aria-label":M?`Run a shell command`:`Message the agent`,className:`min-w-0 flex-1 py-1 text-body-sm text-text`,onImagePaste:e=>d?.add([e]),...te}),ce]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(gO,{...w,triggers:I,markdown:!1,normalizeBullets:!1,onSubmit:ee,disabled:r,placeholder:r?`Session ended`:M?A2:i,minHeight:28,maxHeight:192,"aria-label":M?`Run a shell command`:`Message the agent`,className:`px-3 pt-2.5 pb-0 text-body-sm text-text`,onImagePaste:e=>d?.add([e]),...te}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-2`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[M?(0,U.jsx)(L2,{onLeave:()=>B(!1)}):oe,M?(0,U.jsx)(`span`,{className:`text-label text-text-muted`,children:j2}):f]}),ce]})]})]}),ue]})}function N2({tone:e,label:t,disabled:n,onClick:r,gutter:i,className:a,children:o}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":t,title:t,disabled:n,onClick:r,"data-tone":e,"data-gutter":i||void 0,className:W(`term-glyph`,a),children:o})}function P2({attachments:e}){let t=iM()===`terminal`;return(0,U.jsx)(`div`,{className:W(`flex gap-2 overflow-x-auto`,t?`term-attachments`:`border-b border-border px-2 py-2`),children:e.items.map(t=>(0,U.jsx)(F2,{item:t,onRetry:()=>e.retry(t.key),onRemove:()=>e.remove(t.key)},t.key))})}function F2({item:e,onRetry:t,onRemove:n}){let r=e.status===`failed`,i=iM()===`terminal`,a=i?``:`rounded-md`;return(0,U.jsxs)(`div`,{className:`group relative shrink-0`,title:r?`${e.name} - ${e.error}`:`${e.name} · ${pM(e.bytes)}`,children:[(0,U.jsx)(`div`,{className:W(`flex size-14 items-center justify-center overflow-hidden bg-surface`,a,i?`term-attachment`:`border border-border`,r&&`border-danger/50`),"data-failed":i&&r?``:void 0,children:e.previewUrl?(0,U.jsx)(`img`,{src:e.previewUrl,alt:e.name,className:`size-full object-cover`}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5 text-fg-3`,children:[(0,U.jsx)(sy,{className:`size-4`}),(0,U.jsx)(`span`,{className:`max-w-12 truncate text-[9px] font-semibold uppercase`,children:I2(e.name)})]})}),e.status===`uploading`?(0,U.jsx)(`div`,{className:W(`absolute inset-0 flex items-center justify-center bg-black/35`,a),children:(0,U.jsx)(GT,{className:`size-4 text-white`})}):null,r?(0,U.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Retry ${e.name}`,className:W(`absolute inset-0 flex items-center justify-center bg-black/45 text-warning`,a),children:(0,U.jsx)(Kx,{className:`size-4`})}):null,(0,U.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Remove ${e.name}`,className:W(`absolute flex size-4 items-center justify-center bg-surface text-fg-3 hover:text-fg-1`,i?`term-attachment-remove`:`-top-1 -right-1 rounded-full border border-border shadow-(--shadow-xs)`),children:(0,U.jsx)(DC,{className:`size-2.5`})})]})}function I2(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t+1).toUpperCase():`FILE`}function L2({onLeave:e}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":`Leave shell mode`,title:`Leave shell mode`,onClick:e,className:`shrink-0 rounded px-1.5 py-0.5 font-mono text-label font-semibold text-[var(--wd-shell-accent)]`,children:`$`})}function R2(e){return typeof CSS<`u`&&CSS.supports(`color`,e)?e:void 0}var z2={summary:`Codex budgets 272K input by default and reports 95% of it, so a 1M-class model reads ~258k. That is codex’s price tier, not the model’s ceiling - and it is the number auto-compaction fires on, so the meter is honest.`,hint:`Raising it is yours to set: model_context_window in ~/.codex/config.toml - and watch for auto-compaction failing afterwards.`,detail:[`To raise it, set model_context_window in ~/.codex/config.toml, up to 872000 (reported as 828400). Codex clamps to its own max_context_window, itself below OpenAI’s stated 922,000 max input.`,`Above 272K input, a request bills at 2x input / 1.5x output for the whole request. WorkerDeck never writes this setting - it is a cost decision on your account.`],caveat:`Raise it and watch for auto-compaction failing: openai/codex #16068 reports it stops firing after the first overflow. Unverified here on 0.149.0.`};function B2(e){return(e??`claude`)===`codex`?z2:void 0}function V2(e){return e===void 0?`none`:e>=95?`error`:e>=80?`warning`:`none`}function H2(e){let t=V2(e);return t===`error`?`text-danger`:t===`warning`?`text-warning`:`text-fg-3`}function U2(e){return e>=90?`bg-danger`:e>=70?`bg-warning`:`bg-accent`}function W2({usage:e,engine:t,open:n,onOpenChange:r,className:i}){let a=B2(t);return(0,U.jsx)(Fw,{open:n,onOpenChange:r,children:(0,U.jsxs)(Iw,{className:i,children:[(0,U.jsx)(Lw,{title:`Context`,description:e?.model}),(0,U.jsxs)(Rw,{children:[e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Used`}),(0,U.jsxs)(`span`,{className:`font-mono text-body-sm text-fg-1`,children:[fM(e.totalTokens),` / `,fM(e.maxTokens),` · `,e.percentage.toFixed(0),`%`]})]}),(0,U.jsx)(`div`,{className:`mt-2 h-2 overflow-hidden rounded-full bg-border`,children:(0,U.jsx)(`div`,{className:W(`h-full rounded-full`,U2(e.percentage)),style:{width:`${Math.min(100,Math.max(2,e.percentage))}%`}})}),e.categories.length>0?(0,U.jsxs)(`div`,{className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Breakdown`}),(0,U.jsx)(`div`,{className:`mt-2 flex flex-col gap-3`,children:e.categories.map(t=>{let n=t.tokens/Math.max(e.maxTokens,1)*100,r=R2(t.color);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-fg-4`,style:r?{backgroundColor:r}:void 0}),(0,U.jsx)(`span`,{className:`truncate text-body-sm text-fg-1`,children:t.name})]}),(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-label text-fg-3`,children:fM(t.tokens)})]}),(0,U.jsx)(`div`,{className:`mt-1 h-1 overflow-hidden rounded-full bg-border`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full bg-fg-4`,style:{width:`${Math.min(100,n)}%`,backgroundColor:r}})})]},t.name)})})]}):null]}):(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`No reading yet - the context window is measured after a turn completes.`}),a?(0,U.jsxs)(`div`,{className:`mt-5 border-t border-border pt-4`,children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Why this window is 272K`}),(0,U.jsx)(`p`,{className:`mt-2 text-body-sm text-fg-2`,children:a.summary}),a.detail.map(e=>(0,U.jsx)(`p`,{className:`mt-2 text-body-sm text-fg-3`,children:e},e)),(0,U.jsx)(`p`,{className:`mt-2 text-body-sm text-warning`,children:a.caveat})]}):null]})]})})}function G2({tasks:e,showCompleted:t,onShowCompletedChange:n,onSelectTask:r,className:i}){let a=XO(e),o=Iee(e,t),s=e.length-o.length;return(0,U.jsxs)(`div`,{className:W(`flex flex-col`,i),children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 pb-1.5`,children:[(0,U.jsxs)(`span`,{className:`text-label text-fg-3`,children:[a.done,` of `,a.total,` done`,a.failed>0?` · ${a.failed} failed`:``]}),a.done>0&&n?(0,U.jsx)(`button`,{type:`button`,onClick:()=>n(!t),className:`shrink-0 rounded-[4px] px-1 py-0.5 text-label text-fg-4 outline-none hover:bg-row-hover hover:text-fg-2`,children:t?`Hide completed`:`Show completed (${a.done})`}):null]}),o.length===0?(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:e.length===0?`No tasks yet - a checklist appears once the agent plans one.`:`${s} completed, all hidden.`}):(0,U.jsx)(`div`,{className:`flex flex-col`,children:o.map(e=>(0,U.jsx)(K2,{task:e,onSelect:r},e.key))})]})}function K2({task:e,onSelect:t}){let n=t!==void 0&&e.toolUseId!==void 0,r=e.state===`failed`?`text-danger`:e.state===`done`?`text-fg-4`:`text-fg-2`,i=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(q2,{state:e.state}),(0,U.jsx)(`span`,{className:W(`min-w-0 flex-1 truncate text-left`,e.state===`done`?`line-through`:void 0),children:e.label}),e.detail?(0,U.jsx)(`span`,{className:`shrink-0 tabular-nums text-fg-4`,children:e.detail}):null,n?(0,U.jsx)(p_,{className:`size-3.5 shrink-0 text-fg-4`}):null]}),a=W(`flex w-full items-center gap-1.5 rounded-[4px] px-1.5 py-1 text-body-sm outline-none`,r);return n?(0,U.jsx)(`button`,{type:`button`,title:e.label,onClick:()=>t(e),className:W(a,`hover:bg-row-active`),children:i}):(0,U.jsx)(`div`,{className:a,children:i})}function q2({state:e}){switch(e){case`running`:return(0,U.jsx)(GT,{className:`size-[13px] shrink-0`});case`failed`:return(0,U.jsx)(pv,{className:`size-[13px] shrink-0`});case`done`:return(0,U.jsx)(rv,{className:`size-[13px] shrink-0`});default:return(0,U.jsx)(xv,{className:`size-[13px] shrink-0 text-fg-4`})}}function J2({tasks:e,showCompleted:t,onShowCompletedChange:n,onSelectTask:r,open:i,onOpenChange:a,className:o}){return(0,U.jsx)(Fw,{open:i,onOpenChange:a,children:(0,U.jsxs)(Iw,{className:o,children:[(0,U.jsx)(Lw,{title:`Tasks`,description:`The agent's checklist and the tasks it has spawned`}),(0,U.jsx)(Rw,{children:(0,U.jsx)(G2,{tasks:e,showCompleted:t,onShowCompletedChange:n,onSelectTask:r?e=>{a(!1),r(e)}:void 0})})]})})}function Y2({type:e}){return e===`dir`?(0,U.jsx)(Sy,{className:`size-3.5 shrink-0 text-accent`}):e===`symlink`?(0,U.jsx)(gb,{className:`size-3.5 shrink-0 text-fg-4`}):(0,U.jsx)(ly,{className:`size-3.5 shrink-0 text-fg-4`})}function X2({client:e,cwd:t,open:n,onOpenChange:r}){let[i,a]=(0,v.useState)(t),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(),x=(0,v.useCallback)(async t=>{_(!0),b(void 0);try{let n=await e.listHostDir(t);a(n.path),s(n.entries),l(n.truncated??!1)}catch(e){b(e instanceof Error?e.message:`Could not read that directory`)}finally{_(!1)}},[e]);(0,v.useEffect)(()=>{n&&(h(void 0),d(``),p(void 0),b(void 0),t&&x(t))},[n,t,x]),(0,v.useEffect)(()=>{if(!n||!t)return;let r=u.trim();if(!r){p(void 0);return}let i=setTimeout(()=>{e.findHostFiles(t,r,40).then(e=>p(e.matches)).catch(()=>p([]))},150);return()=>clearTimeout(i)},[e,t,u,n]);let S=async t=>{_(!0),b(void 0);try{let n=await e.readHostFile(t);h({path:n.path,bytes:n.bytes,content:n.encoding===`utf8`?n.content:`(binary file - not shown)`})}catch(e){b(e instanceof Error?e.message:`Could not read that file`)}finally{_(!1)}},C=i&&t&&i!==t?i.slice(0,i.lastIndexOf(`/`))||`/`:void 0,w=f??o;return(0,U.jsx)(Fw,{open:n,onOpenChange:r,children:(0,U.jsxs)(Iw,{size:`lg`,children:[(0,U.jsx)(Lw,{title:m?m.path.split(`/`).pop():`Files`,description:m?m.path:i,actions:m?(0,U.jsxs)(lo,{variant:`ghost`,size:`xs`,onClick:()=>h(void 0),children:[(0,U.jsx)(sv,{className:`size-3.5`}),`Back`]}):C?(0,U.jsxs)(lo,{variant:`ghost`,size:`xs`,onClick:()=>void x(C),children:[(0,U.jsx)(sv,{className:`size-3.5`}),`Up`]}):null}),(0,U.jsxs)(Rw,{className:`flex flex-col gap-3`,children:[y?(0,U.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:y}):null,m?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:pM(m.bytes)}),(0,U.jsx)(KT,{code:m.content,label:m.path.split(`/`).pop()})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(oS,{className:`absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4`}),(0,U.jsx)(_o,{value:u,onChange:e=>d(e.target.value),placeholder:`Search this project…`,className:`pl-7`,spellCheck:!1})]}),g&&w.length===0?(0,U.jsx)(`div`,{className:`py-6 text-center`,children:(0,U.jsx)(GT,{className:`size-4 text-fg-4`})}):w.length===0?(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:f?`No matching files.`:`This directory is empty.`}):(0,U.jsx)(`ul`,{className:`flex flex-col`,children:f?f.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>void S(e.path),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsx)(ly,{className:`size-3.5 shrink-0 text-fg-4`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:e.relative})]})},e.path)):o.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>e.type===`dir`?void x(e.path):void S(e.path),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsx)(Y2,{type:e.type}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:[e.name,e.type===`dir`?`/`:``]}),e.bytes===void 0?null:(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:pM(e.bytes)})]})},e.path))}),c&&!f?(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`More entries than the server will return - use the search box.`}):null]})]})]})})}var Z2={connected:`success`,failed:`danger`,"needs-auth":`warning`,pending:`info`,disabled:`neutral`};function Q2({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:i=!0,className:a}){let[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)(),y=(0,v.useCallback)(async()=>{if(t){d(!0),l(void 0);try{s(await e.listMcpServers(t))}catch(e){l(e instanceof Error?e.message:`Could not read MCP status`)}finally{d(!1)}}},[e,t]);(0,v.useEffect)(()=>{n&&(h(void 0),_(void 0),y())},[n,y]);let b=async(n,r)=>{if(t){p(n),l(void 0);try{s(await e.mcpServerAction(t,n,r))}catch(e){l(e instanceof Error?e.message:`Could not ${r} ${n}`)}finally{p(void 0)}}},x=o?.find(e=>e.name===m),S=x?.tools?.find(e=>e.name===g),C=S?.name??x?.name??`MCP servers`;return(0,U.jsx)(Fw,{open:n,onOpenChange:r,children:(0,U.jsxs)(Iw,{className:a,children:[(0,U.jsx)(Lw,{title:C,description:S?`${x?.name} tool`:x?x.serverInfo?.name:void 0,actions:m?(0,U.jsxs)(lo,{variant:`ghost`,size:`xs`,onClick:()=>g?_(void 0):h(void 0),children:[(0,U.jsx)(sv,{className:`size-3.5`}),`Back`]}):(0,U.jsxs)(lo,{variant:`ghost`,size:`xs`,onClick:()=>void y(),disabled:u,children:[u?(0,U.jsx)(GT,{className:`size-3 text-current`}):(0,U.jsx)(Kx,{className:`size-3`}),`Refresh`]})}),(0,U.jsxs)(Rw,{children:[c?(0,U.jsx)(`div`,{className:`mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:c}):null,S?(0,U.jsx)(t4,{tool:S}):x?(0,U.jsx)(e4,{server:x,busy:f===x.name,canManage:i,onAct:e=>void b(x.name,e),onSelectTool:_}):c&&!o?null:(0,U.jsx)($2,{servers:o,loading:u,onSelect:h})]})]})})}function $2({servers:e,loading:t,onSelect:n}){if(t&&!e)return(0,U.jsx)(`div`,{className:`py-6 text-center`,children:(0,U.jsx)(GT,{className:`size-4 text-fg-4`})});if(!e?.length)return(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`No MCP servers configured for this session.`});let r=[...new Set(e.map(e=>e.scope??`other`))];return(0,U.jsx)(`div`,{className:`flex flex-col gap-4`,children:r.map(t=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3 capitalize`,children:t}),(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:e.filter(e=>(e.scope??`other`)===t).map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm text-fg-1`,children:e.name}),e.tools?.length?(0,U.jsxs)(`span`,{className:`shrink-0 text-label text-fg-4`,children:[e.tools.length,` tools`]}):null,(0,U.jsx)(fo,{variant:Z2[e.status]??`neutral`,dot:!0,className:`shrink-0`,children:e.status}),(0,U.jsx)(lv,{className:`size-3.5 shrink-0 text-fg-4`})]})},e.name))})]},t))})}function e4({server:e,busy:t,canManage:n,onAct:r,onSelectTool:i}){let a=e.status===`disabled`;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(zw,{label:`Status`,children:(0,U.jsx)(fo,{variant:Z2[e.status]??`neutral`,dot:!0,children:e.status})}),e.transport?(0,U.jsx)(zw,{label:`Transport`,children:e.transport}):null,e.scope?(0,U.jsx)(zw,{label:`Scope`,children:e.scope}):null,e.serverInfo?(0,U.jsxs)(zw,{label:`Server`,children:[e.serverInfo.name,` `,e.serverInfo.version]}):null,e.command?(0,U.jsx)(zw,{label:`Command`,mono:!0,children:[e.command,...e.args??[]].join(` `)}):null,e.url?(0,U.jsx)(zw,{label:`URL`,mono:!0,children:e.url}):null]}),e.error?(0,U.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm break-words text-danger`,children:e.error}):null,n?(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsxs)(lo,{variant:`outline`,size:`sm`,disabled:t,onClick:()=>r(`reconnect`),children:[t?(0,U.jsx)(GT,{className:`size-3 text-current`}):(0,U.jsx)(Kx,{className:`size-3`}),`Reconnect`]}),(0,U.jsxs)(lo,{variant:`outline`,size:`sm`,disabled:t,onClick:()=>r(a?`enable`:`disable`),children:[a?(0,U.jsx)(Ox,{className:`size-3`}):(0,U.jsx)(Ex,{className:`size-3`}),a?`Enable`:`Disable`]})]}):null,(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Tools`}),e.tools?.length?(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:e.tools.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>i(e.name),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:e.name}),e.title?(0,U.jsx)(`span`,{className:`min-w-0 shrink truncate text-label text-fg-4`,children:e.title}):null,(0,U.jsx)(lv,{className:`size-3.5 shrink-0 text-fg-4`})]})},e.name))}):(0,U.jsx)(`p`,{className:`py-2 text-body-sm text-fg-4`,children:e.status===`connected`?`This server exposes no tools.`:`Tools are listed once the server connects.`})]})]})}function t4({tool:e}){let t=e.annotations;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.title?(0,U.jsx)(`p`,{className:`text-body-sm font-medium text-fg-1`,children:e.title}):null,e.description?(0,U.jsx)(`p`,{className:`text-body-sm whitespace-pre-wrap text-fg-2`,children:e.description}):(0,U.jsx)(`p`,{className:`text-body-sm text-fg-4`,children:`This tool carries no description.`}),t?(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[t.readOnly?(0,U.jsx)(fo,{variant:`success`,children:`read-only`}):null,t.destructive?(0,U.jsx)(fo,{variant:`danger`,children:`destructive`}):null,t.openWorld?(0,U.jsx)(fo,{variant:`warning`,children:`open world`}):null]}):null,e.inputSchema===void 0?(0,U.jsx)(`p`,{className:W(`text-label text-fg-4`),children:`Parameters aren’t available: this engine names and describes each tool but reports no input schema.`}):(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Parameters`}),(0,U.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto rounded-md bg-surface px-3 py-2 text-label text-fg-2`,children:n4(e.inputSchema)})]})]})}function n4(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}var r4={user:`Personal`,repo:`This project`,system:`System`,admin:`Managed`};function i4({skills:e,open:t,onOpenChange:n,onUse:r,className:i}){let[a,o]=(0,v.useState)(),s=e?.find(e=>e.name===a);return(0,U.jsx)(Fw,{open:t,onOpenChange:e=>{e||o(void 0),n(e)},children:(0,U.jsxs)(Iw,{className:i,children:[(0,U.jsx)(Lw,{title:s?s.displayName??s.name:`Skills`,description:s?s.name===(s.displayName??s.name)?void 0:s.name:`Capabilities the agent can choose to use. Not commands - the model picks them from their descriptions.`,actions:s?(0,U.jsxs)(lo,{variant:`ghost`,size:`xs`,onClick:()=>o(void 0),children:[(0,U.jsx)(sv,{className:`size-3.5`}),`Back`]}):void 0}),(0,U.jsx)(Rw,{children:s?(0,U.jsx)(o4,{skill:s,onUse:r,onUsed:()=>n(!1)}):(0,U.jsx)(a4,{skills:e,onSelect:o})})]})})}function a4({skills:e,onSelect:t}){if(!e)return(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`Skills are listed once the session connects - send a message first.`});if(e.length===0)return(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`This session found no skills.`});let n=[...new Set(e.map(e=>e.scope??`other`))];return(0,U.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map(n=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:r4[n]??n}),(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:e.filter(e=>(e.scope??`other`)===n).map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>t(e.name),className:`flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate text-body-sm text-fg-1`,children:e.displayName??e.name}),e.shortDescription??e.description?(0,U.jsx)(`span`,{className:`block truncate text-label text-fg-4`,children:e.shortDescription??e.description}):null]}),e.enabled?null:(0,U.jsx)(fo,{variant:`neutral`,className:`mt-0.5 shrink-0`,children:`off`}),(0,U.jsx)(lv,{className:`mt-0.5 size-3.5 shrink-0 text-fg-4`})]})},e.name))})]},n))})}function o4({skill:e,onUse:t,onUsed:n}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{children:[e.scope?(0,U.jsx)(zw,{label:`Scope`,children:r4[e.scope]??e.scope}):null,(0,U.jsx)(zw,{label:`Status`,children:(0,U.jsx)(fo,{variant:e.enabled?`success`:`neutral`,dot:!0,children:e.enabled?`enabled`:`disabled`})})]}),e.description?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Description`}),(0,U.jsx)(`p`,{className:`mt-1 text-body-sm whitespace-pre-wrap text-fg-2`,children:e.description})]}):(0,U.jsx)(`p`,{className:`text-body-sm text-fg-4`,children:`This skill carries no description.`}),t&&e.enabled?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(lo,{variant:`outline`,size:`sm`,onClick:()=>{t(e),n()},children:`Use this skill`}),(0,U.jsx)(`p`,{className:`mt-1.5 text-label text-fg-4`,children:`Writes an opening message into the composer for you to edit - it isn’t sent, and there is no command that runs a skill directly.`})]}):null]})}function s4(e){return e==="default"}function c4(e){return e.replace(/\[.*\]$/,``)}function l4(e){let t=e.toLowerCase().split(`-`);return t[0]===`claude`&&t.shift(),t[0]??``}function u4(e,t){if(t===e.value||t===e.resolvedModel)return!0;let n=c4(t);if(e.resolvedModel)return n===c4(e.resolvedModel);let r=l4(n);return r!==``&&r===l4(c4(e.value))}function d4(e,t){if(t)return e.filter(e=>!s4(e.value)).find(e=>u4(e,t))}function f4({models:e,model:t,onModelChange:n,variant:r=`toolbar`,disabled:i,className:a}){let o=d4(e,t)??(t?void 0:e.find(e=>s4(e.value)));return(0,U.jsxs)(jC,{items:e.map(e=>({value:e.value,label:e.displayName})),value:o?.value??null,onValueChange:e=>{typeof e==`string`&&e!==o?.value&&n(s4(e)?void 0:e)},disabled:i,children:[(0,U.jsx)(PC,{"aria-label":`Model`,className:W(r===`toolbar`&&`h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover`,a),children:(0,U.jsx)(`span`,{className:W(`truncate`,r===`toolbar`&&`font-mono text-label`),children:(0,U.jsx)(MC,{placeholder:t??`model`})})}),(0,U.jsx)(FC,{className:`min-w-72`,children:e.map(e=>(0,U.jsxs)(IC,{value:e.value,children:[(0,U.jsx)(NC,{children:(0,U.jsx)(`span`,{className:`font-medium`,children:e.displayName})}),e.description?(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:e.description}):null]},e.value))})]})}var p4=[{value:`default`,label:`Manual`,shortLabel:`Manual`,description:`Always ask before making changes`,icon:Wy},{value:`acceptEdits`,label:`Accept edits`,shortLabel:`Edits`,description:`Automatically accept all file edits`,icon:jv},{value:`plan`,label:`Plan`,shortLabel:`Plan`,description:`Create a plan before making changes`,icon:Tv},{value:`auto`,label:`Auto`,shortLabel:`Auto`,description:`The agent handles permission decisions`,icon:kC},{value:`dontAsk`,label:`Don't ask`,shortLabel:`Don't ask`,description:`Never ask - deny anything not pre-approved`,icon:fS},{value:`bypassPermissions`,label:`Bypass permissions`,shortLabel:`Bypass`,description:`Skip every approval - the agent is unsupervised`,icon:oC,dangerous:!0}];function m4(e){return p4.find(t=>t.value===e)}function h4(e,t){return(e?p4.filter(t=>e.includes(t.value)):p4).map(e=>({value:e.value,label:e.label,description:e.value===`bypassPermissions`&&t===!1?`Only available to a session started in this mode`:e.description,dangerous:e.dangerous,disabled:e.value===`bypassPermissions`&&t===!1}))}function g4({mode:e,onModeChange:t,modes:n,canBypass:r,variant:i=`toolbar`,disabled:a,className:o}){let s=e===`bypassPermissions`,c=n?p4.filter(e=>n.includes(e.value)):p4,l=e=>e.value===`bypassPermissions`&&r===!1;return(0,U.jsxs)(jC,{items:c.map(e=>({value:e.value,label:e.label})),value:e??null,onValueChange:n=>{typeof n==`string`&&n!==e&&t(n)},disabled:a,children:[(0,U.jsx)(PC,{"aria-label":`Permission mode`,className:W(i===`toolbar`&&`h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover`,s?`text-danger`:i===`toolbar`?`text-fg-3`:void 0,o),children:(0,U.jsx)(`span`,{className:W(`truncate`,i===`toolbar`&&`text-label`),children:(0,U.jsx)(MC,{placeholder:`permissions`})})}),(0,U.jsx)(FC,{className:`min-w-64`,children:c.map(e=>{let t=l(e);return(0,U.jsxs)(IC,{value:e.value,disabled:t,children:[(0,U.jsx)(NC,{children:(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(e.icon,{className:W(`size-3.5 shrink-0`,e.dangerous?`text-danger`:`text-fg-3`)}),(0,U.jsx)(`span`,{className:W(`font-medium`,e.dangerous&&`text-danger`),children:e.label})]})}),(0,U.jsx)(`span`,{className:W(`pl-5.5 text-label`,t?`text-fg-4`:e.dangerous?`text-danger/80`:`text-fg-4`),children:t?`Only available to a session started in this mode`:e.description})]},e.value)})})]})}function _4(e){if(e?.toolName!==`ExitPlanMode`)return;let t=e.input;if(typeof t!=`object`||!t)return;let n=t.plan;if(typeof n==`string`&&n.trim().length!==0)return n}var v4=(0,v.memo)(function({children:e,streaming:t,className:n}){return(0,U.jsx)(z1,{mode:t?`streaming`:`static`,parseIncompleteMarkdown:t,shikiTheme:[`github-light`,`github-dark`],linkSafety:{enabled:!1},className:W(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,n),children:e})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className);function y4({request:e,onApprove:t,onDeny:n,className:r}){let[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),u=t=>{let r=c.trim();n(e.id,r||void 0,t||void 0),l(``),s(!1)},d=_4(e),f=yM(e.input),p=SM(e.toolName);return(0,U.jsxs)(`div`,{"data-slot":`permission-prompt`,className:W(`rounded-lg border border-warning/40 bg-warning-bg p-3`,r),children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,U.jsx)(Wy,{className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`text-body-sm font-medium text-fg-1`,children:d?`Plan ready for review`:e.title??e.displayName??`Permission needed`}),e.description?(0,U.jsx)(`div`,{className:`mt-0.5 text-label text-fg-3`,children:e.description}):null,e.decisionReason?(0,U.jsx)(`div`,{className:`mt-0.5 text-label text-fg-4`,children:e.decisionReason}):null,d?(0,U.jsx)(`div`,{className:`mt-1.5 max-h-72 overflow-y-auto rounded-md bg-code-bg px-2.5 py-2 text-body-sm text-fg-2`,children:(0,U.jsx)(v4,{children:d})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(p,{className:`size-3 shrink-0 text-fg-3`}),(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-label font-medium text-fg-2`,children:e.toolName}),f?(0,U.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,children:f}):null]}),(0,U.jsxs)(`button`,{type:`button`,className:`mt-1 font-mono text-label text-fg-3 underline-offset-2 hover:underline`,onClick:()=>a(e=>!e),children:[i?`Hide`:`Show`,` `,e.toolName,` input`]}),i?(0,U.jsx)(`pre`,{className:`mt-1.5 max-h-48 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2`,children:JSON.stringify(e.input,null,2)}):null]})]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-1.5`,children:[(0,U.jsx)(lo,{size:`sm`,onClick:()=>t(e.id),children:d?`Approve plan`:`Allow`}),(0,U.jsx)(lo,{size:`sm`,variant:`outline`,onClick:()=>s(e=>!e),children:d?`Keep planning`:`Deny`}),(0,U.jsx)(lo,{size:`sm`,variant:`outline`,onClick:()=>u(!0),children:d?`Stop the turn`:`Deny & stop`})]})]}),o?(0,U.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2 border-t border-warning/30 pt-2.5`,children:[(0,U.jsx)(_o,{autoFocus:!0,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u(!1),e.key===`Escape`&&s(!1)},placeholder:d?`What should change? (optional) - the agent keeps planning and reads this`:`Reason (optional) - the agent reads this and can try something else`,className:`h-7 flex-1`}),(0,U.jsx)(lo,{size:`sm`,variant:`outline`,onClick:()=>s(!1),children:`Cancel`}),(0,U.jsx)(lo,{size:`sm`,variant:`destructive`,onClick:()=>u(!1),children:d?`Keep planning`:`Deny`})]}):null]})}function b4({task:e,items:t,label:n,onBack:r,terminal:i,fontSize:a,lineHeight:o}){let s=e?S0(e,t):!1,c=e?C0(e):!1,l=LM(s),u=t.reduce((e,t)=>e+ +(t.kind===`tool_call`),0),d=s?e?.ts:void 0,f=D2(d!==void 0),p=d===void 0?void 0:dM(f-d),m=e?_0(e):n,h=e?c?`failed`:s?`${l} working…`:`done`:void 0,g=[u>0?`${u} tool${u===1?``:`s`}`:void 0,p].filter(Boolean).join(` · `);return i?(0,U.jsx)(k2,{fontSize:a,lineHeight:o,className:`shrink-0`,children:(0,U.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back to the session`,className:`block w-full cursor-pointer text-left`,children:(0,U.jsxs)(pN,{glyph:`←`,glyphTone:`dim`,indent:1,tone:c?`red`:`green`,children:[m,h?(0,U.jsxs)(gN,{tone:c?`red`:s?`mark`:`dim`,children:[` · `,h]}):null,g?(0,U.jsxs)(gN,{tone:`faint`,children:[` · `,g]}):null]})})}):(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5`,children:[(0,U.jsxs)(lo,{variant:`ghost`,size:`sm`,onClick:r,className:`h-6 gap-1 px-1.5`,children:[(0,U.jsx)(d_,{className:`size-3.5`}),`Back`]}),(0,U.jsx)(`span`,{className:W(`min-w-0 flex-1 truncate text-body-sm`,c?`text-danger`:`text-fg-2`),children:m}),h?(0,U.jsx)(`span`,{className:W(`shrink-0 text-label`,c?`text-danger`:s?`text-accent`:`text-fg-3`),children:h}):null,g?(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:g}):null]})}function x4(e){return(`parentToolUseId`in e?e.parentToolUseId:void 0)??void 0}function S4(e,t){return e.filter(e=>x4(e)===t)}function C4(e){return e.kind===`tool_call`}function w4(e){return e.children.flatMap(e=>`run`in e?e.run:[e.item])}function T4(e,t,n){let r=e.at(-1);if(C4(t)&&!i0(t)){r&&`run`in r&&u0(r.run[0],t)?(r.run.push(t),r.indices.push(n)):e.push({key:`run:${t.id}`,run:[t],indices:[n],index:n});return}e.push({key:`${t.kind}:${t.id}`,item:t,index:n})}function E4(e,t=0,n=!0){if(!n)return e.map((e,n)=>({key:`${e.kind}:${e.id}`,item:e,index:t+n}));let r=new Set;for(let t of e)t.kind===`tool_call`&&x4(t)===void 0&&r.add(t.id);let i=new Map;e.forEach((e,n)=>{let a=x4(e);if(a!==void 0&&r.has(a)){let r=i.get(a);r?r.push({item:e,index:t+n}):i.set(a,[{item:e,index:t+n}])}});let a=[];for(let[n,r]of e.entries()){let e=t+n,o=x4(r);if(!(o!==void 0&&i.has(o))){if(r.kind===`tool_call`){let t=i.get(r.id);if(t){let n=[];for(let e of t)T4(n,e.item,e.index);a.push({key:`task:${r.id}`,task:r,children:n,childIndices:t.map(e=>e.index),index:e});continue}}T4(a,r,e)}}return a}function D4(e,t){return i0(e)||i0(t)?!0:e.kind!==`tool_call`||t.kind!==`tool_call`}function O4(e){return`item`in e?i0(e.item)?`peer_send`:e.item.kind:`tool_call`}function k4(e,t){return O4(e)!==`tool_call`||O4(t)!==`tool_call`}function A4(e){let{sessionId:t,items:n,session:r,reveal:i,openSubagent:a,onSubagentChange:o}=e,[s,c]=(0,v.useState)(void 0),[l,u]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{c(void 0),u(void 0)},[t]);let d=(0,v.useCallback)(()=>{c(e=>{e!==void 0&&u({toolUseId:e,nonce:Date.now()})})},[]),f=a?.nonce,p=a?.toolUseId;(0,v.useEffect)(()=>{p===void 0?d():c(p)},[f]);let m=i?.nonce;(0,v.useEffect)(()=>{m!==void 0&&c(void 0)},[m]),(0,v.useEffect)(()=>{if(s===void 0)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||d()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,d]);let h=(0,v.useRef)(o);h.current=o;let g=(0,v.useRef)(void 0);return(0,v.useEffect)(()=>{g.current!==s&&(g.current=s,h.current?.(s))},[s]),{subagentId:s,enterSubagent:c,leaveSubagent:d,returnReveal:l,frameItems:(0,v.useMemo)(()=>s===void 0?[]:S4(n,s),[n,s]),task:(0,v.useMemo)(()=>s===void 0?void 0:n.find(e=>e.kind===`tool_call`&&e.id===s),[n,s]),fallbackLabel:(0,v.useMemo)(()=>{let e=r?.subagents?.find(e=>e.toolUseId===s);return e?OO(e):`Sub-agent`},[r,s])}}function j4({shell:e,label:t,cols:n,onBack:r,onKill:i,terminal:a,fontSize:o,lineHeight:s}){let c=e?.status===`running`,l=e?JM(e):!1,u=e?GM(e):t,d=e?YM(e):void 0,f=n??e?.cols,p=f===void 0?void 0:`${f} cols`;return a?(0,U.jsx)(k2,{fontSize:o,lineHeight:s,className:`shrink-0`,children:(0,U.jsx)(aN,{actions:c&&i?(0,U.jsx)(dN,{onKill:i}):null,children:(0,U.jsxs)(pN,{glyph:`←`,glyphTone:`dim`,indent:1,tone:l?`red`:`magenta`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back to the session`,className:`cursor-pointer text-left`,children:u}),d?(0,U.jsxs)(gN,{tone:l?`red`:c?`magenta`:`dim`,children:[` · `,d]}):null,p?(0,U.jsxs)(gN,{tone:`faint`,children:[` · `,p]}):null]})})}):(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5`,children:[(0,U.jsxs)(lo,{variant:`ghost`,size:`sm`,onClick:r,className:`h-6 gap-1 px-1.5`,children:[(0,U.jsx)(d_,{className:`size-3.5`}),`Back`]}),(0,U.jsx)(`span`,{className:W(`min-w-0 flex-1 truncate font-mono text-body-sm`,l?`text-danger`:`text-fg-2`),children:u}),d?(0,U.jsx)(`span`,{className:W(`shrink-0 text-label`,l?`text-danger`:c?`text-[var(--wd-shell-accent)]`:`text-fg-3`),children:d}):null,p?(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:p}):null,c&&i?(0,U.jsx)(`button`,{type:`button`,"aria-label":`Kill this shell`,title:`Kill this shell`,className:`shrink-0 text-label text-fg-3 hover:text-danger`,onClick:i,children:(0,U.jsx)(DC,{className:`size-3.5`})}):null]})}function M4({handle:e,shellId:t,onEnded:n,onShell:r,fontSize:i,className:a}){let o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),[l,u]=(0,v.useState)(!1),d=(0,v.useRef)(!1),f=N4(),p=(0,v.useRef)(r);p.current=r;let m=Uj(e,t,{onData:e=>s.current?.write(e),onAttached:e=>{let t=s.current;if(t){t.reset(),e.scrollback&&t.write(e.scrollback);try{c.current?.fit()}catch{}p.current?.(e.shell)}},onEnded:e=>{s.current?.write(`\r\n\x1b[2m[${e}]\x1b[0m\r\n`),n?.(e)}}),h=(0,v.useRef)(m);return h.current=m,(0,v.useEffect)(()=>{let e=!1;return I4().then(({Terminal:t,FitAddon:n})=>{if(e||!o.current)return;let r=new t({allowProposedApi:!0,convertEol:!1,cursorBlink:!0,fontSize:i??12,lineHeight:1.35,fontFamily:`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`,theme:P4(document.documentElement.getAttribute(`data-theme`)),scrollback:5e3}),a=new n;r.loadAddon(a),r.open(o.current),a.fit(),r.onData(e=>h.current.write(e)),r.onResize(({cols:e,rows:t})=>h.current.resize({cols:e,rows:t})),s.current=r,c.current=a,u(!0)}),()=>{e=!0,d.current=!1,h.current.detach(),s.current?.dispose(),s.current=null,c.current=null,u(!1)}},[]),(0,v.useEffect)(()=>{d.current=!1},[t]),(0,v.useEffect)(()=>{let n=s.current;l&&e&&t!==void 0&&n&&!d.current&&(d.current=!0,h.current.attach({cols:n.cols,rows:n.rows}))},[l,e,t]),(0,v.useEffect)(()=>{let e=s.current;e&&(e.options.theme=P4(f))},[f]),(0,v.useEffect)(()=>{let e=o.current;if(!e||!l)return;let t=new ResizeObserver(()=>{try{c.current?.fit()}catch{}});return t.observe(e),()=>t.disconnect()},[l]),(0,U.jsxs)(`div`,{className:W(`relative min-h-0 flex-1 overflow-hidden px-2 py-1`,a),children:[(0,U.jsx)(`div`,{ref:o,className:`h-full w-full`,onClick:()=>s.current?.focus()}),l&&m.status!==`idle`?null:(0,U.jsx)(`div`,{className:`absolute inset-0 grid place-items-center`,children:(0,U.jsx)(GT,{})})]})}function N4(){let[e,t]=(0,v.useState)(()=>typeof document>`u`?null:document.documentElement.getAttribute(`data-theme`));return(0,v.useEffect)(()=>{let e=document.documentElement,n=()=>t(e.getAttribute(`data-theme`));n();let r=new MutationObserver(n);return r.observe(e,{attributes:!0,attributeFilter:[`data-theme`]}),()=>r.disconnect()},[]),e}function P4(e){return e===`light`?{background:`#00000000`,foreground:`#1f2328`,cursor:`#1f2328`,selectionBackground:`#b9c7d980`}:{background:`#00000000`,foreground:`#d4d4d4`,cursor:`#d4d4d4`,selectionBackground:`#3a4a5f80`}}var F4;function I4(){return F4??=(async()=>{let[e,t]=await Promise.all([Ij(()=>import(`./xterm-ScmBfeDI.js`),[]),Ij(()=>import(`./addon-fit-DIOBYJe3.js`),[])]);return{Terminal:e.Terminal,FitAddon:t.FitAddon}})(),F4}function L4(e){let{sessionId:t,items:n,session:r,shells:i,reveal:a,openShell:o,onShellChange:s}=e,[c,l]=(0,v.useState)(void 0),[u,d]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{l(void 0),d(void 0)},[t]);let f=(0,v.useRef)(void 0),p=(0,v.useMemo)(()=>c===void 0?void 0:n.find(e=>e.kind===`shell`&&e.shell.id===c),[n,c]);f.current=p?.id;let m=(0,v.useCallback)(()=>{l(e=>{let t=f.current;e!==void 0&&t!==void 0&&d({toolUseId:t,nonce:Date.now()})})},[]),h=o?.nonce,g=o?.shellId;(0,v.useEffect)(()=>{g===void 0?m():l(g)},[h]);let _=a?.nonce;(0,v.useEffect)(()=>{_!==void 0&&l(void 0)},[_]),(0,v.useEffect)(()=>{if(c===void 0)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||m()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c,m]);let y=(0,v.useRef)(s);y.current=s;let b=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{b.current!==c&&(b.current=c,y.current?.(c))},[c]);let x=(0,v.useMemo)(()=>{if(c!==void 0)return p?.shell??i?.find(e=>e.id===c)??r?.shells?.find(e=>e.id===c)},[p,i,r,c]);return{shellId:c,enterShell:l,leaveShell:m,returnReveal:u,shell:x,label:x&&(x.label||x.command.split(`
|
|
200
|
+
`)[0])||`shell`}}var R4=[{value:`auto`,label:`Auto-answer`,description:`pick each question’s recommended option`},{value:`ask`,label:`Ask`,description:`wait for a watcher or webhook controller to answer`},{value:`deny`,label:`Disabled`,description:`the agent is told to decide on its own`}],z4={labels:[],other:``,otherActive:!1};function B4(e){let t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(`, `)}function V4({request:e,onAnswer:t,onDismiss:n,className:r}){let i=Lk(e.input),[a,o]=(0,v.useState)(()=>i.map(()=>z4)),s=(e,t)=>{o(n=>n.map((n,r)=>r===e?{...n,...t}:n))},c=(e,t,n)=>{let r=a[e]??z4;n?s(e,{labels:r.labels.includes(t)?r.labels.filter(e=>e!==t):[...r.labels,t]}):s(e,{labels:r.labels[0]===t?[]:[t],otherActive:!1})},l=i.every((e,t)=>B4(a[t]??z4)!==``);return(0,U.jsx)(`div`,{"data-slot":`question-prompt`,className:W(`rounded-lg border border-info/40 bg-info-bg p-3`,r),children:(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,U.jsx)(Ab,{className:`mt-0.5 size-4 shrink-0 text-info`}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[i.map((e,t)=>{let n=a[t]??z4;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.header?(0,U.jsx)(fo,{variant:`info`,children:e.header}):null,(0,U.jsx)(`span`,{className:`text-body-sm font-medium text-fg-1`,children:e.question})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.options.map(r=>{let i=n.labels.includes(r.label);return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>c(t,r.label,e.multiSelect===!0),className:W(`rounded-md border px-2.5 py-1.5 text-left transition-colors`,i?`border-info bg-bg`:`border-border bg-bg/50 hover:border-border-strong hover:bg-bg`),children:[(0,U.jsx)(`span`,{className:`block text-body-sm font-medium text-fg-1`,children:r.label}),r.description?(0,U.jsx)(`span`,{className:`block text-label text-fg-4`,children:r.description}):null,i&&r.preview?(0,U.jsx)(`pre`,{className:`mt-1.5 max-h-40 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2`,children:r.preview}):null]},r.label)}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>s(t,{otherActive:!n.otherActive}),className:W(`shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors`,n.otherActive?`border-info bg-bg text-fg-1`:`border-border bg-bg/50 text-fg-3 hover:border-border-strong hover:bg-bg`),children:`Other…`}),n.otherActive?(0,U.jsx)(vo,{autoFocus:!0,rows:1,value:n.other,onChange:e=>s(t,{other:e.target.value}),placeholder:`Type your own answer`,className:`max-h-40 flex-1 overflow-y-auto py-1.5 field-sizing-content`}):null]})]})]},t)}),(0,U.jsx)(`div`,{children:(0,U.jsx)(lo,{size:`sm`,onClick:()=>{let n={};i.forEach((e,t)=>{n[e.question]=B4(a[t]??z4)}),t(e.id,{...e.input,answers:n})},disabled:!l,children:`Answer`})})]}),(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Dismiss question`,className:`shrink-0`,onClick:()=>n(e.id,`Question dismissed by user`),children:(0,U.jsx)(DC,{className:`size-3.5`})})]})})}function H4({dashed:e}){return(0,U.jsx)(`div`,{className:W(`term-rule-row`,e&&`term-rule-dashed`),"aria-hidden":!0})}function U4({children:e}){return(0,U.jsx)(pN,{tone:`faint`,children:e})}function W4({children:e,className:t}){return(0,U.jsx)(`div`,{className:W(`term-box`,t),children:e})}function G4({title:e,subject:t}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(pN,{tone:`blue`,bold:!0,children:e}),t?(0,U.jsx)(pN,{tone:`dim`,children:t}):null]})}var K4={check:[`[ ]`,`[✓]`],radio:[`( )`,`(•)`]};function q4(e){return!(e instanceof HTMLElement)||!(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable)?!1:(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e.value:e.textContent??``).trim().length>0}function J4({options:e,focused:t,onFocus:n,onChoose:r,active:i=!0,autoFocus:a=!0,label:o}){let s=(0,v.useRef)([]);(0,v.useEffect)(()=>{i&&(s.current.some(e=>e!==null&&e===document.activeElement)||a&&!q4(document.activeElement))&&s.current[t]?.focus()},[i,t,a]);let c=r=>{e.length>0&&n((t+r+e.length)%e.length)};return(0,U.jsx)(`div`,{role:`group`,"aria-label":o,onKeyDown:t=>{if(t.key===`ArrowDown`){c(1),t.preventDefault();return}if(t.key===`ArrowUp`){c(-1),t.preventDefault();return}let i=Number(t.key);Number.isInteger(i)&&i>=1&&i<=Math.min(e.length,9)&&(n(i-1),r(i-1),t.preventDefault())},children:e.map((e,i)=>{let a=i===t;return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`button`,{ref:e=>{s.current[i]=e},type:`button`,tabIndex:a?0:-1,"aria-pressed":e.checked,onFocus:()=>n(i),onClick:()=>r(i),className:`term-press`,children:(0,U.jsxs)(pN,{columns:5,glyph:`${a?`❯`:` `} ${i+1}.`,glyphTone:a?`fg`:`faint`,tone:e.danger?`red`:e.selected?`green`:`fg`,"data-focused":a?``:void 0,children:[e.checked===void 0?null:(0,U.jsxs)(gN,{tone:e.checked?`green`:`faint`,children:[K4[e.marker??`check`][+!!e.checked],` `]}),(0,U.jsx)(gN,{bold:a||e.selected,children:e.label})]})}),e.description?(0,U.jsx)(pN,{columns:5,tone:`dim`,children:e.description}):null,e.detail?(0,U.jsx)(`div`,{className:`term-detail`,children:e.detail}):null]},e.key)})})}function Y4({value:e,onChange:t,onSubmit:n,onCancel:r,placeholder:i}){return(0,U.jsx)(pN,{columns:5,glyph:` ›`,glyphTone:`dim`,children:(0,U.jsx)(`textarea`,{autoFocus:!0,rows:1,value:e,placeholder:i,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),n()),e.key===`Escape`&&(e.stopPropagation(),r())},className:`term-input`})})}function X4({tabs:e,active:t,onSelect:n}){return(0,U.jsxs)(pN,{glyph:`←`,glyphTone:`faint`,children:[e.map((e,r)=>(0,U.jsxs)(`button`,{type:`button`,tabIndex:-1,onClick:()=>n(r),className:W(`term-tab`,r===t&&`term-tab-active`),children:[e.glyph,` `,e.label]},e.key)),(0,U.jsx)(gN,{tone:`faint`,children:` →`})]})}var Z4={maxHeight:`min(24rem, 50vh)`,overflowY:`auto`};function Q4({request:e,onApprove:t,onDeny:n,className:r}){let[i,a]=(0,v.useState)(0),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),u=t=>{let r=c.trim();n(e.id,r||void 0,t||void 0),l(``),s(!1)},d=_4(e),f=d?void 0:bN(e.input),p=d?``:yM(e.input),m=d?`Plan ready for review`:e.displayName??e.title??`Permission needed`,h=f?.path??(p||void 0),g=o?(0,U.jsx)(Y4,{value:c,onChange:l,onSubmit:()=>u(!1),onCancel:()=>s(!1),placeholder:d?`What should change? (optional) - the agent keeps planning and reads this`:`Reason (optional) - the agent reads this and can try something else`}):void 0,_=d?[{key:`allow`,label:`Approve plan`},{key:`deny`,label:`Keep planning - tell it what to change`,detail:g},{key:`stop`,label:`No, and stop the turn`,danger:!0}]:[{key:`allow`,label:`Yes`},{key:`deny`,label:`No, and tell the agent what to do differently`,detail:g},{key:`stop`,label:`No, and stop the turn`,danger:!0}];return(0,U.jsxs)(`div`,{"data-slot":`permission-prompt`,className:r,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),u(!1))},children:[(0,U.jsx)(H4,{}),(0,U.jsx)(G4,{title:m,subject:h}),(0,U.jsx)(mN,{}),d?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{style:Z4,children:(0,U.jsx)(r0,{children:d})}),(0,U.jsx)(mN,{}),(0,U.jsx)(H4,{dashed:!0})]}):f?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(xN,{patch:f}),(0,U.jsx)(mN,{}),(0,U.jsx)(H4,{dashed:!0})]}):e.description?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(pN,{tone:`dim`,children:e.description}),(0,U.jsx)(mN,{})]}):null,e.decisionReason?(0,U.jsx)(pN,{tone:`faint`,children:e.decisionReason}):null,(0,U.jsx)(pN,{children:d?`Ready to implement this plan?`:e.title??`Do you want to proceed?`}),(0,U.jsx)(J4,{label:m,options:_,focused:i,onFocus:a,active:!o,onChoose:n=>{n===0?t(e.id):n===1?s(!0):u(!0)}}),(0,U.jsx)(mN,{}),(0,U.jsx)(U4,{children:o?`Enter to send · Shift+Enter for a new line · Esc to go back`:`Enter to select · ↑/↓ to navigate · 1-3 to choose · Esc to cancel`})]})}var $4={labels:[],other:``,otherActive:!1};function e3(e){let t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(`, `)}function t3({request:e,onAnswer:t,onDismiss:n,className:r}){let i=Lk(e.input),[a,o]=(0,v.useState)(()=>i.map(()=>$4)),[s,c]=(0,v.useState)(()=>i.map(()=>0)),[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(0),p=l>=i.length,m=a[l]??$4,h=e=>e3(a[e]??$4)!==``,g=i.every((e,t)=>h(t)),_=(e,t)=>o(n=>n.map((n,r)=>r===e?{...n,...t}:n)),y=(e,t,n)=>{o(r=>r.map((r,i)=>i===e?n?{...r,labels:r.labels.includes(t)?r.labels.filter(e=>e!==t):[...r.labels,t]}:{...r,labels:[t],otherActive:!1}:r))},b=()=>{let n={};i.forEach((e,t)=>{n[e.question]=e3(a[t]??$4)}),t(e.id,{...e.input,answers:n})},x=()=>n(e.id,`Question dismissed by user`),S=e=>u(t=>Math.min(i.length,Math.max(0,t+e)));return(0,U.jsxs)(`div`,{"data-slot":`question-prompt`,className:r,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),x();return}e.key===`Tab`&&(e.preventDefault(),S(e.shiftKey?-1:1))},children:[(0,U.jsx)(H4,{}),(0,U.jsx)(X4,{tabs:[...i.map((e,t)=>({key:`q${t}`,label:e.header||`Question ${t+1}`,glyph:h(t)?`▣`:`▢`})),{key:`submit`,label:`Submit`,glyph:`✓`}],active:l,onSelect:u}),(0,U.jsx)(mN,{}),p?(0,U.jsx)(r3,{questions:i,answers:i.map((e,t)=>e3(a[t]??$4)),complete:g,cursor:d,onCursor:f,onSubmit:b,onCancel:x}):(0,U.jsx)(n3,{question:i[l],selection:m,cursor:s[l]??0,onCursor:e=>c(t=>t.map((t,n)=>n===l?e:t)),onToggle:e=>y(l,e,i[l].multiSelect===!0),onOther:e=>_(l,e),onAdvance:()=>S(1),onDismiss:x},l),(0,U.jsx)(mN,{}),(0,U.jsx)(U4,{children:!p&&m.otherActive?`Enter to submit · Shift+Enter for a new line · Tab to switch questions · Esc to cancel`:`Enter to select · ↑/↓ to navigate · Tab to switch questions · Esc to cancel`})]})}function n3({question:e,selection:t,cursor:n,onCursor:r,onToggle:i,onOther:a,onAdvance:o,onDismiss:s}){let c=e.multiSelect===!0,l=[...e.options.map((e,r)=>{let i=t.labels.includes(e.label);return{key:e.label,label:e.label,description:e.description,checked:c?i:void 0,marker:`check`,selected:!c&&i,detail:e.preview&&n===r?(0,U.jsx)(W4,{children:e.preview.split(`
|
|
201
|
+
`).map((e,t)=>(0,U.jsx)(pN,{columns:0,tone:`dim`,children:e||` `},t))}):void 0}}),{key:`__other`,label:`Other…`,checked:t.otherActive,marker:`check`,detail:t.otherActive?(0,U.jsx)(Y4,{value:t.other,onChange:e=>a({other:e}),onSubmit:o,onCancel:()=>a({otherActive:!1,other:``}),placeholder:`Type your own answer`}):void 0},...c?[{key:`__next`,label:`Submit`}]:[],{key:`__chat`,label:`Chat about this`}];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(pN,{bold:!0,tone:`bright`,children:e.question}),(0,U.jsx)(mN,{}),(0,U.jsx)(J4,{label:e.question,options:l,focused:n,active:!t.otherActive,onFocus:r,onChoose:n=>{if(n<e.options.length){i(e.options[n].label),c||o();return}if(n===e.options.length){a({otherActive:!t.otherActive});return}if(c&&n===e.options.length+1){o();return}s()}})]})}function r3({questions:e,answers:t,complete:n,cursor:r,onCursor:i,onSubmit:a,onCancel:o}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(pN,{bold:!0,tone:`bright`,children:`Review your answers`}),(0,U.jsx)(mN,{}),e.map((e,n)=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(pN,{glyph:`●`,glyphTone:`dim`,children:e.question}),(0,U.jsx)(pN,{indent:1,glyph:`→`,glyphTone:`green`,children:(0,U.jsx)(gN,{tone:t[n]?`green`:`faint`,children:t[n]||`not answered`})})]},n)),(0,U.jsx)(mN,{}),(0,U.jsx)(pN,{children:n?`Ready to submit your answers?`:`Some questions are unanswered.`}),(0,U.jsx)(J4,{label:`Submit answers`,options:[{key:`submit`,label:n?`Submit answers`:`Submit anyway`},{key:`cancel`,label:`Cancel`,danger:!0}],focused:r,onFocus:i,onChoose:e=>e===0?a():o()})]})}function i3({state:e,client:t,sessionId:n,open:r,onOpenChange:i}){let a=e.session,o=e.permissionMode?m4(e.permissionMode):void 0;return(0,U.jsx)(Fw,{open:r,onOpenChange:i,children:(0,U.jsxs)(Iw,{children:[(0,U.jsx)(Lw,{title:`Session info`,description:a?.title}),(0,U.jsx)(Rw,{children:(0,U.jsxs)(`div`,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsxs)(`div`,{className:`pb-2`,children:[(0,U.jsx)(zw,{label:`Engine`,children:e.engine??`claude`}),a?.profile?(0,U.jsx)(zw,{label:`Profile`,children:a.profile}):null,e.model?(0,U.jsx)(zw,{label:`Model`,mono:!0,children:e.model}):null,o?(0,U.jsx)(zw,{label:`Permission mode`,children:o.label}):null,a?.apiKeySource?(0,U.jsx)(zw,{label:`Credentials`,children:a.apiKeySource}):null]}),(0,U.jsxs)(`div`,{className:`py-2`,children:[e.cwd?(0,U.jsx)(a3,{label:`Working directory`,value:e.cwd}):null,e.sdkSessionId?(0,U.jsx)(a3,{label:`Engine session id`,value:e.sdkSessionId}):null,a?(0,U.jsx)(a3,{label:`Gateway session id`,value:a.id}):null]}),(0,U.jsxs)(`div`,{className:`py-2`,children:[a?.createdAt?(0,U.jsx)(zw,{label:`Started`,children:hM(a.createdAt)}):null,a?.numTurns===void 0?null:(0,U.jsx)(zw,{label:`Turns`,children:a.numTurns}),(0,U.jsx)(zw,{label:`Cost`,mono:!0,children:uM(e.costUsd??(e.totalCostUsd||void 0))})]}),e.capabilities.vfs?(0,U.jsx)(o3,{client:t,sessionId:n,open:r}):null]})})]})})}function a3({label:e,value:t}){return(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-2 py-1.5`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`text-label text-fg-3`,children:e}),(0,U.jsx)(`div`,{className:`mt-0.5 font-mono text-label break-all text-fg-1`,children:t})]}),(0,U.jsx)(WT,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function o3({client:e,sessionId:t,open:n}){let[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(!n||!t)return;let r=!1;return o(!0),e.listSessionFiles(t).then(e=>{r||i(e)}).catch(()=>{r||i([])}).finally(()=>{r||o(!1)}),()=>{r=!0}},[e,t,n]),(0,U.jsxs)(`div`,{className:`pt-3`,children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Files`}),a?(0,U.jsx)(`div`,{className:`py-3 text-center`,children:(0,U.jsx)(GT,{className:`size-4 text-fg-4`})}):r?.length?(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:r.map(n=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`a`,{href:t?e.sessionFileUrl(t,n.path):void 0,className:`flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover`,children:[(0,U.jsx)($v,{className:`size-3.5 shrink-0 text-fg-4`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:n.path}),(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:pM(n.bytes)})]})},n.path))}):(0,U.jsx)(`p`,{className:`py-2 text-body-sm text-fg-4`,children:`Nothing delivered yet.`})]})}var s3={starting:{label:`Starting`,variant:`info`,busy:!0},running:{label:`Running`,variant:`info`,busy:!0},awaiting_approval:{label:`Needs approval`,variant:`warning`,busy:!0},idle:{label:`Idle`,variant:`success`,busy:!1},parked:{label:`Parked`,variant:`accent`,busy:!1},failed:{label:`Failed`,variant:`danger`,busy:!1},closed:{label:`Closed`,variant:`neutral`,busy:!1}};function c3(e=3e4){let[t,n]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function l3({usage:e,engine:t}){let n=B2(t);return(0,U.jsx)(uT,{content:(0,U.jsxs)(`div`,{className:`flex max-w-64 min-w-44 flex-col gap-1 py-0.5`,children:[e.categories.map(e=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-fg-4`,style:R2(e.color)?{backgroundColor:e.color}:void 0}),(0,U.jsx)(`span`,{className:`flex-1`,children:e.name}),(0,U.jsx)(`span`,{className:`font-mono text-fg-3`,children:fM(e.tokens)})]},e.name)),(0,U.jsxs)(`div`,{className:`mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1`,children:[(0,U.jsx)(`span`,{children:`Total`}),(0,U.jsxs)(`span`,{className:`font-mono text-fg-3`,children:[fM(e.totalTokens),` / `,fM(e.maxTokens),` (`,e.percentage.toFixed(0),`%)`]})]}),n?(0,U.jsxs)(`div`,{className:`mt-0.5 flex flex-col gap-1 border-t border-border pt-1 text-fg-3`,children:[(0,U.jsx)(`span`,{children:n.summary}),(0,U.jsx)(`span`,{children:n.hint})]}):null]}),children:(0,U.jsxs)(`span`,{className:W(`inline-flex cursor-default items-center gap-1 font-mono text-label`,H2(e.percentage)),children:[`Ctx `,fM(e.totalTokens)]})})}function u3({label:e,info:t,now:n}){let r=t.utilization,i=t.resetsAt===void 0?void 0:t.resetsAt*1e3;return(0,U.jsx)(uT,{content:(0,U.jsxs)(`div`,{className:`flex min-w-36 flex-col gap-1 py-0.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,U.jsxs)(`span`,{children:[e,` usage`]}),(0,U.jsx)(`span`,{className:`font-mono text-fg-3`,children:r===void 0?`-`:`${r.toFixed(1)}%`})]}),i===void 0?null:(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{children:`Resets in`}),(0,U.jsx)(`span`,{className:`font-mono text-fg-3`,children:mM(i,n)})]}),t.isUsingOverage?(0,U.jsx)(`div`,{className:`text-warning`,children:`Using overage`}):null,t.status===`rejected`?(0,U.jsx)(`div`,{className:`text-danger`,children:`Limit reached`}):null]}),children:(0,U.jsxs)(`span`,{className:W(`cursor-default font-mono text-label whitespace-nowrap`,t.status===`rejected`?`text-danger`:H2(r??0)),children:[(0,U.jsx)(XT,{value:r??0,className:`mr-1 inline-block align-middle`}),e,r===void 0?``:` ${r.toFixed(0)}%`,i===void 0?null:(0,U.jsxs)(`span`,{className:`text-fg-4`,children:[` · `,mM(i,n)]})]})})}function d3({onClick:e,hint:t,children:n}){return e?(0,U.jsx)(`button`,{type:`button`,onClick:e,"aria-label":t,className:`rounded-md py-0.5 leading-4 transition-colors outline-none hover:bg-surface-hover focus-visible:bg-surface-hover`,children:n}):(0,U.jsx)(U.Fragment,{children:n})}function f3({state:e,rateLimits:t,connected:n,connection:r,onOpenStatus:i,onOpenContext:a,onOpenUsage:o,tasks:s,onOpenTasks:c,controls:l,actions:u,placement:d=`top`,className:f}){let p=s3[e.status],m=c3(),h=t??e.rateLimits,g=h?.five_hour,_=h?.seven_day,v=r??(n===!1?`reconnecting`:`live`),y=iM()===`terminal`,b=s&&s.length>0?XO(s):void 0;return(0,U.jsxs)(`div`,{"data-slot":`status-bar`,className:W(`flex h-[var(--wd-status-bar-height)] items-baseline gap-2 border-border bg-surface p-1.5`,d===`bottom`?y?void 0:`border-t`:`border-b`,f),children:[(0,U.jsx)(d3,{onClick:i,hint:`Session info`,children:v===`live`?(0,U.jsxs)(fo,{variant:p.variant,dot:!p.busy,className:`items-baseline`,children:[p.busy?(0,U.jsx)(GT,{className:`size-3 self-center text-current`}):null,p.label]}):(0,U.jsxs)(fo,{variant:v===`offline`?`danger`:`warning`,dot:!1,className:`items-baseline`,children:[v===`offline`?(0,U.jsx)(dee,{className:`size-3 self-center text-current`}):(0,U.jsx)(Rx,{className:`size-3 animate-spin self-center text-current`}),v===`offline`?`Offline`:`Reconnecting…`]})}),e.capabilities.contextUsage&&e.contextUsage?(0,U.jsx)(d3,{onClick:a,hint:`Context breakdown`,children:(0,U.jsx)(l3,{usage:e.contextUsage,engine:e.engine})}):null,g||_?(0,U.jsx)(d3,{onClick:o,hint:`Plan usage`,children:(0,U.jsxs)(`span`,{className:`inline-flex items-baseline gap-2`,children:[g?(0,U.jsx)(u3,{label:`Session`,info:g,now:m}):null,_?(0,U.jsx)(u3,{label:`Weekly`,info:_,now:m}):null]})}):null,b?(0,U.jsx)(d3,{onClick:c,hint:`Tasks`,children:(0,U.jsxs)(`span`,{className:`text-label text-fg-3`,children:[(0,U.jsx)(`span`,{className:W(`tabular-nums`,b.running>0?`text-info`:void 0),children:Fee(b)}),` tasks`]})}):null,l?(0,U.jsx)(`span`,{className:`self-center`,children:l}):null,(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(`span`,{className:`font-mono text-label text-fg-3`,children:uM(e.costUsd??(e.totalCostUsd||void 0))}),u?(0,U.jsx)(`span`,{className:`self-center`,children:u}):null]})}var p3={damping:.7,stiffness:.05,mass:1.25},m3=70,h3=1e3/60,g3=350,_3=!1;globalThis.document?.addEventListener(`mousedown`,()=>{_3=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{_3=!1}),globalThis.document?.addEventListener(`click`,()=>{_3=!1});var v3=(e={})=>{let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(e.initial!==!1),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null);s.current=e;let c=(0,v.useCallback)(()=>{if(!_3)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,v.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,v.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,v.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=m3}}},[]),f=(0,v.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=x3(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/h3;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:x3(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,v.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,v.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,v.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=y3(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=y3(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=x3(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:g3})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function y3(e,t){let n=(0,v.useCallback)(t=>(n.current=t,e(t)),t);return n}var b3=new Map;function x3(...e){let t={...p3},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return b3.has(r)||b3.set(r,Object.freeze(t)),n?`instant`:b3.get(r)}var S3=(0,v.createContext)(null),C3=typeof window<`u`?v.useLayoutEffect:v.useEffect;function w3({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,v.useRef)(null),d=v3({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:v.useCallback((e,t)=>(b?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:y}=e??d,b=(0,v.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:y,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,y]);return(0,v.useImperativeHandle)(c,()=>b,[b]),C3(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),v.createElement(S3.Provider,{value:b},v.createElement(`div`,{...l},typeof t==`function`?t(b):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=T3();return v.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},v.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(w3||={});function T3(){let e=(0,v.useContext)(S3);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}function E3({className:e,children:t,...n}){return(0,U.jsx)(w3,{"data-slot":`conversation`,className:W(`relative flex-1 overflow-y-auto`,e),initial:`instant`,resize:`instant`,role:`log`,...n,children:t})}function D3({className:e,children:t,...n}){return(0,U.jsx)(w3.Content,{"data-slot":`conversation-content`,className:W(`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] flex-col gap-4 px-4 py-4`,e),...n,children:t})}function O3({className:e}){let{isAtBottom:t,scrollToBottom:n}=T3();return t?null:(0,U.jsx)(lo,{variant:`outline`,size:`icon`,"aria-label":`Scroll to bottom`,"data-slot":`conversation-scroll-button`,className:W(`absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)`,e),onClick:()=>void n(`instant`),children:(0,U.jsx)(l_,{className:`size-4`})})}function k3({label:e,className:t}){return(0,U.jsxs)(`div`,{"data-slot":`loader`,className:W(`flex items-center gap-2 py-1 text-body-sm text-fg-4`,t),children:[(0,U.jsx)(`span`,{className:`flex items-center gap-1`,children:[0,1,2].map(e=>(0,U.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-fg-4`,style:{animationDelay:`${e*160}ms`}},e))}),e?(0,U.jsx)(`span`,{children:e}):null]})}function A3({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:i}){let a=[{icon:Pb,text:`Tell the agent what to do.`},...t?[{icon:PS,text:`Type / for the CLI’s slash commands.`}]:[],...n?[{icon:ES,text:`Type $ to draft a message for one of the agent’s skills.`}]:[],...r?[{icon:y_,text:`Type @ to search this project’s files.`}]:[]];return(0,U.jsxs)(`div`,{className:W(`flex flex-col items-center gap-4 py-10`,i),children:[(0,U.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-xl bg-surface text-fg-3`,children:(0,U.jsx)(QS,{className:`size-5`})}),e?(0,U.jsx)(`p`,{className:`max-w-full truncate font-mono text-label text-fg-4`,children:e}):null,(0,U.jsx)(`ul`,{className:`w-full max-w-sm divide-y divide-border overflow-hidden rounded-lg bg-surface`,children:a.map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-3 px-3.5 py-2.5`,children:[(0,U.jsx)(e.icon,{className:`size-4 shrink-0 text-fg-4`}),(0,U.jsx)(`span`,{className:`text-body-sm text-fg-3`,children:e.text})]},e.text))})]})}function j3(e){return typeof e==`object`?e.key:e}function M3(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function N3(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function P3(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var F3=(e,t)=>Math.abs(e-t)<1.01,I3=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},L3,R3=()=>{if(L3!==void 0)return L3;if(typeof navigator>`u`)return L3=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return L3=!0;let e=navigator.maxTouchPoints;return L3=navigator.platform===`MacIntel`&&e!==void 0&&e>0},z3=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},B3=e=>e,V3=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},H3=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(z3(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(z3(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},U3={passive:!0},W3=typeof window>`u`||`onscrollend`in window,G3=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&W3,o=0,s=a?null:I3(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,U3),a&&r.addEventListener(`scrollend`,u,U3),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},K3=(e,t)=>G3(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),q3=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},J3=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})};function Y3(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var X3=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:B3,rangeExtractor:V3,onChange:()=>{},measureElement:q3,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>j3(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Y3(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:c}=this.options,l=0;for(;l<a&&c(l)!==e;)l++;if(l<a){let e=n[l];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=N3(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,R3()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,U3),e.addEventListener(`touchend`,n,U3),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(R3()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!F3(this.getScrollOffset()-i,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=N3(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=N3(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=M3(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=N3(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=$3(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=N3(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&a!=null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f),this._retryClampedAdjustment()}},this.getVirtualItems=N3(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return P3(t[Z3(0,t.length-1,r?e=>n[e*2]:e=>P3(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(e===0)return!1;if(R3()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;{let n=this.getScrollOffset()+this.scrollAdjustments+e,r=this.scrollElement,i=r!==null&&(`scrollHeight`in r||`document`in r)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&n>i+.5?{target:n,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&F3(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},Z3=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Q3(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function $3(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=Q3(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Z3(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var e6=typeof document<`u`?v.useLayoutEffect:v.useEffect;function t6({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=v.useReducer(e=>e+1,0)[1],a=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=v.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=e=>{let t=a.current;if(!t.enabled||!t.container)return;s(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,o=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let s=a.start-o,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==s&&(t.lastPositions.set(c,s),r?c.style.transform=n?`translate3d(${s}px, 0, 0)`:`translate3d(0, ${s}px, 0)`:c.style[i]=`${s}px`)}},l={...r,onChange:(t,n)=>{var s;let l=a.current,u=!0;if(l.enabled){c(t);let e=t.range,n=l.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(l.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,Ed.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[u]=v.useState(()=>{let e=new X3(l),t=e.measureElement;return e.measureElement=e=>{o.current=!0;try{t(e)}finally{o.current=!1}},Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return u.setOptions(l),e6(()=>u._didMount(),[]),e6(()=>(s(u),u._willUpdate())),e6(()=>{c(u)}),u}function n6(e){return t6({observeElementRect:H3,observeElementOffset:K3,scrollToFn:J3,...e})}function r6(e,t,n){return{width:e,ch:t,line:n,cache:new WeakMap}}function i6(e,t){if(!(`item`in e))return A6(e,t).px;let n=t.cache.get(e.item);if(n)return n.px;let r=k6(e.item,t);return t.cache.set(e.item,r),r.px}function a6(e,t){let n=Math.max(1,Math.floor(t.width/t.ch+y6));return(Math.min(v6(e,n).lines,4)+1)*t.line}function o6(e){let t=document.createElement(`span`);t.textContent=`0`.repeat(200),t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.whiteSpace=`pre`,e.appendChild(t);let n=t.getBoundingClientRect().width/200;return t.remove(),n}var s6=new Intl.Segmenter(`en`,{granularity:`grapheme`}),c6=[[4352,4447],[11904,12350],[12353,13311],[13312,19903],[19968,40959],[40960,42191],[44032,55203],[63744,64255],[65072,65103],[65280,65376],[65504,65510],[131072,262141]];function l6(e){return c6.some(([t,n])=>e>=t&&e<=n)}var u6=/\p{Extended_Pictographic}/u;function d6(e){if(u6.test(e)||e.includes(``)||e.includes(`️`))return{w:2,exact:!1};let t=e.codePointAt(0)??0;return l6(t)?{w:2,exact:!1}:t<32?{w:0,exact:!0}:{w:1,exact:!0}}var f6=2,p6=new Set([`-`,`-`,`-`,`?`]),m6=/^[\x20-\x7e]*$/;function h6(e){let t=[],n=0,r=()=>{n>0&&t.push({kind:`word`,w:n,exact:!0}),n=0};for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a===32){r();let e=t[t.length-1];e?.kind===`space`?e.w+=1:t.push({kind:`space`,w:1,exact:!0});continue}if(n+=1,a===45||a===63){let t=e.charCodeAt(i+1);t>=48&&t<=57||r()}}return r(),t}function g6(e){if(m6.test(e))return h6(e);let t=[],n={w:0,exact:!0},r=0,i=()=>{n.w>0&&t.push({kind:`word`,w:n.w,exact:n.exact}),n={w:0,exact:!0}},a=[...s6.segment(e)].map(e=>e.segment);for(let[e,o]of a.entries()){if(o===` `){i();let e=t.at(-1);e?.kind===`space`?e.w+=1:t.push({kind:`space`,w:1,exact:!0}),r+=1;continue}if(o===` `){i();let e=f6-r%f6||f6,n=t.at(-1);n?.kind===`space`?n.w+=e:t.push({kind:`space`,w:e,exact:!0}),r+=e;continue}let{w:s,exact:c}=d6(o);if(l6(o.codePointAt(0)??0)||u6.test(o)){i(),t.push({kind:`word`,w:s,exact:c}),r+=s;continue}n.w+=s,n.exact=n.exact&&c,r+=s,p6.has(o)&&!/^\d/.test(a[e+1]??``)&&i()}return i(),t}function _6(e,t){if(t<=0)return{lines:1,exact:!1};let n=g6(e),r=1,i=0,a=!0;for(let e of n){if(a&&=e.exact,e.kind===`space`){i+=e.w;continue}if(i+e.w<=t){i+=e.w;continue}if(e.w<=t){r+=1,i=e.w;continue}i>0&&(r+=1);let n=Math.ceil(e.w/t);r+=n-1,i=e.w-(n-1)*t}return{lines:r,exact:a}}function v6(e,t){let n=0,r=!0;for(let i of e.split(`
|
|
202
|
+
`)){let e=_6(i,t);n+=Math.max(1,e.lines),r&&=e.exact}return{lines:Math.max(1,n),exact:r}}var y6=1e-4;function b6(e,t){return{px:e.px+t.px,exact:e.exact&&t.exact}}function x6(e,t,{indentCells:n=0,gutterCells:r=2,extraPx:i=0}={}){let a=t.width-i-(n+r)*t.ch,{lines:o,exact:s}=v6(e,Math.floor(a/t.ch+y6));return{px:o*t.line,exact:s}}function S6(e){return e.replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/``([^`]+)``/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/__([^_]+)__/g,`$1`).replace(/\*([^*\s][^*]*)\*/g,`$1`).replace(/(^|\W)_([^_]+)_(?=\W|$)/g,`$1$2`).replace(/\\([\\`*_{}[\]()#+.!-])/g,`$1`)}function C6(e){let t=[],n=[];for(let r of e){let e=/(?:\s{2}|\\)$/.test(r);n.push(S6(r.replace(/(?:\s+|\\)$/,``))),e&&(t.push(n.join(` `)),n=[])}return n.length&&t.push(n.join(` `)),t}function w6(e){let t=e.split(`
|
|
203
|
+
`),n=[],r=0,i=e=>e!==void 0&&e.trim()===``;for(;r<t.length;){let e=t[r];if(e.trim()===``){r+=1;continue}if(e.startsWith("```")){let e=[];for(r+=1;r<t.length&&!t[r].startsWith("```");)e.push(t[r]),r+=1;r+=1,n.push({t:`fence`,code:e.join(`
|
|
204
|
+
`)});continue}let a=/^(#{1,6})\s+(.*)$/.exec(e);if(a){n.push({t:`h`,text:S6(a[2])}),r+=1;continue}if(/^(-{3,}|\*{3,}|_{3,})\s*$/.test(e)){n.push({t:`hr`}),r+=1;continue}if(/^>\s?/.test(e)){let e=[];for(;r<t.length&&/^>\s?/.test(t[r]);)e.push(t[r].replace(/^>\s?/,``)),r+=1;let i=[],a=[];for(let t of e)t.trim()===``?(a.length&&i.push(C6(a)),a=[]):a.push(t);a.length&&i.push(C6(a)),n.push({t:`quote`,paras:i});continue}let o=e=>{let t=/^(\s*)([-*+]|\d+\.)\s+(.*)$/.exec(e);if(t)return{depth:Math.floor(t[1].length/2),ordered:/\d/.test(t[2]),text:t[3]}};if(o(e)){let e=[],a=[],s;for(;r<t.length;){let n=o(t[r]);if(!n){if(i(t[r])&&o(t[r+1]??``)){r+=1;continue}break}if(n.depth===0){if(s!==void 0&&n.ordered!==s)break;s=n.ordered}a[n.depth]=n.ordered?3:2;let c=a.slice(0,n.depth).reduce((e,t)=>e+(t??2),0),l=[n.text];for(r+=1;r<t.length&&t[r].trim()!==``&&!o(t[r]);)l.push(t[r].trimStart()),r+=1;e.push({lines:C6(l),gutter:a[n.depth],indent:c})}n.push({t:`list`,items:e});continue}if(e.trimStart().startsWith(`|`)){let e=0;for(;r<t.length&&t[r].trimStart().startsWith(`|`);)t[r].trim().replace(/^\||\|$/g,``).split(`|`).map(e=>e.trim()).every(e=>/^:?-+:?$/.test(e))||(e+=1),r+=1;n.push({t:`table`,rows:Math.max(1,e)});continue}let s=[e];for(r+=1;r<t.length&&t[r].trim()!==``&&!t[r].startsWith("```")&&!/^(#{1,6})\s+/.test(t[r])&&!/^>\s?/.test(t[r])&&!o(t[r])&&!t[r].trimStart().startsWith(`|`)&&!/^(-{3,}|\*{3,}|_{3,})\s*$/.test(t[r]);)s.push(t[r]),r+=1;n.push({t:`p`,lines:C6(s)})}return n}function T6(e,t,n=0){let r=t.width-n-2*t.ch,i=Math.floor(r/t.ch+y6),a=w6(e),o={px:0,exact:!0};for(let[e,n]of a.entries())switch(e>0&&(o=b6(o,{px:t.line,exact:!0})),n.t){case`p`:for(let e of n.lines){let n=v6(e,i);o=b6(o,{px:n.lines*t.line,exact:n.exact})}break;case`h`:{let e=v6(n.text,i);o=b6(o,{px:e.lines*t.line,exact:e.exact});break}case`fence`:{let e=0,r=!0;for(let a of n.code.split(`
|
|
205
|
+
`)){let n=_6(a,i);e+=Math.max(1,n.lines)*t.line,r&&=n.exact}o=b6(o,{px:Math.max(e,t.line),exact:r});break}case`list`:{let e=0,r=!0;for(let a of n.items)for(let n of a.lines){let o=v6(n,i-a.indent-a.gutter);e+=o.lines*t.line,r&&=o.exact}o=b6(o,{px:e,exact:r});break}case`quote`:{let e=0,r=!0;for(let[a,o]of n.paras.entries()){a>0&&(e+=t.line);for(let n of o){let a=v6(n,i-2);e+=a.lines*t.line,r&&=a.exact}}o=b6(o,{px:e,exact:r});break}case`table`:o=b6(o,{px:n.rows*t.line,exact:!0});break;case`hr`:o=b6(o,{px:t.line,exact:!0})}return{px:Math.max(o.px,t.line),exact:o.exact}}function E6(e,t,n=0){let r=e.hunks.map(e=>{let t=e.newStart,n=e.oldStart;return e.lines.map(e=>{let r=e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`,i=e.slice(1),a=r===`add`?t++:r===`remove`?n++:t;return r===`context`&&(n++,t++),{number:a,text:i}})}),i=e.hunks.some(e=>e.newStart>0),a=i?String(Math.max(...r.flat().map(e=>e.number),1)).length:0,o=i?a+3:2,s={px:0,exact:!0};for(let[e,i]of r.entries()){e>0&&(s=b6(s,{px:t.line,exact:!0}));for(let e of i)s=b6(s,x6(e.text||` `,t,{indentCells:2,gutterCells:o,extraPx:n}))}return e.truncated&&(s=b6(s,{px:t.line,exact:!0})),s}function D6(e,t,n){let r=t2(e.name,e.input),i=r?r.summary:yM(e.input),a=e.backend&&e.backend!==`server`?` · ${e.backend}`:``,o=x6(`${e.name}(${i})${a}`,t,{gutterCells:2,extraPx:n}),s=e.result?.images;if(s?.length&&(o=b6(o,{px:s.length*12*t.line,exact:!0})),e.patch)return b6(o,E6(e.patch,t,n));if(r){for(let e of r.shown)o=b6(o,x6(n2(e),t,{indentCells:3,gutterCells:3,extraPx:n}));return r.more&&(o=b6(o,x6(r.more,t,{indentCells:3,gutterCells:3,extraPx:n}))),o}let c=e.result?.text??``;if(!c)return o;let{shown:l,more:u}=I0(c.trimEnd().split(`
|
|
206
|
+
`),e.result?.totalChars);for(let e of l)o=b6(o,x6(e||` `,t,{indentCells:3,gutterCells:3,extraPx:n}));return u&&(o=b6(o,x6(u,t,{indentCells:3,gutterCells:3,extraPx:n}))),o}function O6(e){return`parentToolUseId`in e&&e.parentToolUseId!=null?14:0}function k6(e,t){let n=O6(e);switch(e.kind){case`user`:{let r={px:0,exact:!0};if(e.attachments?.length&&(r=b6(r,x6(e.attachments.map(e=>e.name).join(`, `),t,{extraPx:n}))),e.text){let i=e.origin?`${a0(e.origin)}: `:``;for(let[a,o]of e.text.split(`
|
|
207
|
+
`).entries())r=b6(r,x6((a===0?i:``)+(o||` `),t,{extraPx:n}))}return r}case`assistant_text`:return T6(e.text,t,n);case`thinking`:return x6(e.text,t,{extraPx:n});case`tool_call`:return i0(e)?{px:t.line+n,exact:!0}:D6(e,t,n);case`turn_result`:{let r=x6(`${e.isError?e.subtype:`done`} · ${dM(e.durationMs)} · ${uM(e.totalCostUsd)}`,t,{extraPx:n});for(let i of e.errors??[])r=b6(r,x6(i,t,{extraPx:n}));return r}case`notice`:return x6(e.text,t,{extraPx:n});case`compaction`:return x6(lM(e),t,{extraPx:n});case`file_delivered`:return x6(`${e.path} · ${pM(e.bytes)}`+(e.description?` · ${e.description}`:``),t,{extraPx:n});case`shell`:{let r=QM(e,!1),i=x6(ZM(e),t,{extraPx:n});for(let e of r)i=b6(i,x6(e||` `,t,{extraPx:n}));let a=$M(e,!1,r.length);return a&&(i=b6(i,x6(a,t,{extraPx:n}))),i}default:return{px:0,exact:!1}}}function A6(e,t){if(`task`in e)return x6(w0(e.task,w4(e)),t);if(`run`in e){let n=f0(e.run);if(n.kind===`call`)return k6(n.item,t);let r=n.items.some(e=>e.status===`running`||e.status===`pending`);return x6(p0(n.items,r),t)}return k6(e.item,t)}function j6(e,t){let n;for(let r of e.marks)(!n||Math.abs(r.y-t)<Math.abs(n.y-t))&&(n=r);return n?.mark}var M6={user:`l`,subagent:`l`,shell:`l`,turn:`r`,turnFailed:`r`,toolFailed:`r`,error:`r`,approval:`f`,recap:`f`,bookmark:`f`},N6={approval:7,error:6,turnFailed:5,toolFailed:4,user:3,turn:2,bookmark:1,subagent:1,shell:1,recap:0},P6={user:`you`,subagent:`sub-agent`,shell:`shell`,turn:`response · turn end`,turnFailed:`turn failed`,toolFailed:`tool failed`,error:`error`,approval:`pending approval`,recap:`catch-up boundary`,bookmark:`bookmark`},F6=2;function I6(e,t,n){return t>0?e/Math.max(t,n):0}function L6(e){return`${e.isError?e.subtype:`done`} · ${dM(e.durationMs)} · ${uM(e.totalCostUsd)}`}function R6(e){switch(e.kind){case`user`:case`assistant_text`:case`thinking`:case`notice`:return e.text;case`shell`:return e.shell.command;case`tool_call`:return`${e.name}(${yM(e.input)})`;case`turn_result`:return L6(e);case`file_delivered`:return e.path;default:return``}}function z6(e,t){let{items:n,bookmarks:r,frameParentId:i,recapRow:a,pendingApprovals:o,rowIndexFor:s,offsetOfRow:c,sizeOfRow:l,positionInRow:u,totalSize:d,viewportH:f}=e,p=[],m=new Set;for(let e of n){let t=x4(e);t!==void 0&&m.add(t)}let h=new Map;n.forEach((e,t)=>{e.kind===`tool_call`&&x4(e)===i&&h.set(s(t),t)});let g={},_=()=>{let e=g.response??g.turn;e!==void 0&&p.push({kind:g.failed?`turnFailed`:`turn`,itemIndex:e,rowIndex:s(e),turnIndex:g.turn}),g={}};n.forEach((e,t)=>{if(e.kind===`tool_call`&&m.has(e.id)&&p.push({kind:`subagent`,itemIndex:t,rowIndex:s(t)}),e.kind===`user`&&x4(e)===i)_(),p.push({kind:`user`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`turn_result`)g.turn=t,g.failed=e.isError,_();else if(e.kind===`notice`&&e.level===`error`)p.push({kind:`error`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`shell`)p.push({kind:`shell`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`tool_call`&&(e.status===`failed`||e.result?.isError===!0)&&h.get(s(t))===t)p.push({kind:`toolFailed`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`assistant_text`&&x4(e)===i){if(i!==void 0){p.push({kind:`turn`,itemIndex:t,rowIndex:s(t)});return}g.response=t}}),_();for(let e of r)e>=0&&e<n.length&&p.push({kind:`bookmark`,itemIndex:e,rowIndex:s(e)});a&&p.push({kind:`recap`,itemIndex:-1,rowIndex:a.rowIndex});let v=I6(t,d,f),y=new Map;for(let e of p){let n=e.itemIndex>=0?u?.(e.itemIndex):void 0,r=l(e.rowIndex),i=n?F6:Math.max(F6,Math.round(r*v)),a=Math.min(Math.max(0,t-i),Math.round((c(e.rowIndex)+(n?n.ordinal/n.count*r:0))*v)),o=M6[e.kind],s=y.get(o)??[];s.push({mark:e,y:a,h:i}),y.set(o,s)}let b=[];for(let[e,t]of y){t.sort((e,t)=>e.y-t.y);let n=null;for(let{mark:r,y:i,h:a}of t)n&&i<=n.y+n.h+1?(n.h=Math.max(n.h,i+a-n.y),N6[r.kind]>N6[n.kind]&&(n.kind=r.kind),n.marks.push({mark:r,y:i})):(n={lane:e,kind:r.kind,y:i,h:a,marks:[{mark:r,y:i}]},b.push(n))}return o.length>0&&b.push({lane:M6.approval,kind:`approval`,y:Math.max(0,t-F6),h:F6,marks:[]}),b}function B6(e,t,{items:n,pendingApprovals:r,recapRow:i}){let a=e.marks.length>1?` · ${e.marks.length} marks`:``,o=null;if(e.kind===`approval`){let e=r[0];o=e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{"data-tone":`bright`,children:e.title??`Permission required`}),(0,U.jsx)(`div`,{className:`term-scrub-ex`,"data-tone":`fg`,children:`${e.displayName??e.toolName}(${yM(e.input)})`})]}):null}else if(e.kind===`recap`&&!t)o=(0,U.jsxs)(`div`,{"data-tone":`faint`,children:[`※ `,i?.label]});else if(t){let e=n[t.itemIndex];if(t.kind===`recap`)o=(0,U.jsxs)(`div`,{"data-tone":`faint`,children:[`※ `,i?.label]});else if(t.kind===`turn`||t.kind===`turnFailed`){let r=t.turnIndex===void 0?void 0:n[t.turnIndex];o=(0,U.jsxs)(U.Fragment,{children:[e?.kind===`assistant_text`?(0,U.jsxs)(`div`,{className:`term-scrub-ex`,"data-tone":`fg`,children:[(0,U.jsx)(`span`,{"data-tone":`dim`,children:`● `}),e.text]}):null,r?.kind===`turn_result`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{"data-tone":r.isError?`red`:`faint`,children:L6(r)}),r.errors?.map((e,t)=>(0,U.jsx)(`div`,{"data-tone":`red`,children:e},t))]}):null]})}else if(e){let n=t.kind===`toolFailed`&&e.kind===`tool_call`?e.result?.text.split(`
|
|
208
|
+
`).find(e=>e.trim()!==``):void 0;o=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`term-scrub-ex`,"data-tone":t.kind===`error`||t.kind===`toolFailed`?`red`:`fg`,children:[t.kind===`user`?(0,U.jsx)(`span`,{"data-tone":`dim`,children:`❯ `}):null,R6(e)]}),n?(0,U.jsx)(`div`,{className:`term-scrub-ex`,"data-tone":`red`,children:n}):null]})}}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{"data-tone":`faint`,children:[P6[t?.kind??e.kind],a]}),o]})}function V6(e){let{scrollOffset:t,viewportH:n,totalSize:r,onJumpToRow:i,interactive:a,fontSize:o,lineHeight:s}=e,c=T3(),l=(0,v.useRef)(null),u=(0,v.useRef)(null),[d,f]=(0,v.useState)(0),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(()=>f(e.clientHeight));return t.observe(e),f(e.clientHeight),()=>t.disconnect()},[]);let[g,_]=(0,v.useState)(t);(0,v.useEffect)(()=>{let e=c.scrollRef.current;if(!e)return;let t=()=>_(e.scrollTop);return e.addEventListener(`scroll`,t,{passive:!0}),_(e.scrollTop),()=>e.removeEventListener(`scroll`,t)},[c.scrollRef]),(0,v.useEffect)(()=>{m(null)},[e.items]),(0,v.useEffect)(()=>{if(!a)return;let e=l.current;if(!e)return;let t=e=>{let t=c.scrollRef.current;t&&(t.scrollTop+=e.deltaY,e.preventDefault())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[a,c.scrollRef]),(0,v.useLayoutEffect)(()=>{let e=u.current;if(!e||!p)return;let t=e.offsetHeight,n=l.current?.clientHeight??0;e.style.top=`${Math.max(4,Math.min(n-t-4,p.y-t/2))}px`},[p]);let y=(0,v.useMemo)(()=>d>0?z6(e,d):[],[e.items,e.bookmarks,e.recapRow,e.pendingApprovals,r,d,n]),b=I6(d,r,n),x=Math.max(2,Math.min(d,Math.round(n*b))),S=Math.max(0,Math.min(d-x,Math.round(g*b))),C=e=>{let t=l.current,n=c.scrollRef.current;if(!t||!n)return;let r=t.getBoundingClientRect();n.scrollTop=Math.min(1,Math.max(0,(e-r.top)/r.height))*n.scrollHeight-n.clientHeight/2},w=e=>e-(l.current?.getBoundingClientRect().top??0),T=(e,t)=>{if(e.kind===`approval`&&e.marks.length===0){c.scrollToBottom();return}let n=j6(e,w(t));n&&i(n.rowIndex)},E=(e,t)=>{let n=w(t),r=j6(e,n);m(t=>t&&t.cluster===e&&t.mark===r?t:{cluster:e,mark:r,y:Math.min(Math.max(n,e.y),e.y+e.h)})},D=Math.max(1,r-n);return(0,U.jsx)(k2,{fontSize:o,lineHeight:s,className:`term-scrubber`,"data-interactive":a||void 0,...a?{role:`scrollbar`,"aria-orientation":`vertical`,"aria-label":`Transcript overview`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.max(0,Math.round(g/D*100)))}:{"aria-hidden":!0},children:(0,U.jsxs)(`div`,{ref:l,className:`term-scrubber-body`,...a?{onPointerDown:e=>{c.stopScroll(),h.current={y:e.clientY,moved:!1,target:e.target},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:e=>{let t=h.current;t&&(!t.moved&&Math.abs(e.clientY-t.y)<3||(t.moved=!0,m(null),C(e.clientY)))},onPointerUp:e=>{let t=h.current;if(h.current=null,!t||t.moved)return;let n=t.target?.closest?.(`[data-ci]`),r=n?Number(n.dataset.ci):NaN;Number.isInteger(r)&&y[r]?T(y[r],e.clientY):C(e.clientY)}}:null,children:[(0,U.jsx)(`div`,{className:`term-scrub-band`,style:{top:S,height:x}}),y.map((e,t)=>(0,U.jsx)(`div`,{"data-ci":t,className:`term-scrub-mark`,"data-lane":e.lane,"data-kind":e.kind,style:{top:e.y,height:e.h},...a?{onPointerEnter:t=>E(e,t.clientY),onPointerMove:t=>{h.current||E(e,t.clientY)},onPointerLeave:()=>m(null)}:null},t)),p?(0,U.jsx)(`div`,{ref:u,className:`term-scrub-peek`,style:{top:p.y},children:B6(p.cluster,p.mark,e)}):null]})})}function H6(e,t){let n;for(let r of e.marks)(!n||Math.abs(r.y-t)<Math.abs(n.y-t))&&(n=r);return n?.mark}var U6={user:`l`,subagent:`l`,shell:`l`,turn:`r`,turnFailed:`r`,toolFailed:`r`,error:`r`,approval:`f`,recap:`f`,bookmark:`f`},W6={approval:7,error:6,turnFailed:5,toolFailed:4,user:3,turn:2,bookmark:1,subagent:1,shell:1,recap:0},G6={user:`you`,subagent:`sub-agent`,shell:`shell`,turn:`response · turn end`,turnFailed:`turn failed`,toolFailed:`tool failed`,error:`error`,approval:`pending approval`,recap:`catch-up boundary`,bookmark:`bookmark`};function K6(e){return`${e.isError?e.subtype:`done`} · ${dM(e.durationMs)} · ${uM(e.totalCostUsd)}`}function q6(e){switch(e.kind){case`user`:case`assistant_text`:case`thinking`:case`notice`:return e.text;case`shell`:return e.shell.command;case`tool_call`:return`${e.name}(${yM(e.input)})`;case`turn_result`:return K6(e);case`file_delivered`:return e.path;default:return``}}function J6(e,{frameParentId:t,bookmarks:n=[],recapItemIndex:r}={}){let i=[],a=new Set;for(let t of e){let e=x4(t);e!==void 0&&a.add(e)}let o={},s=()=>{let e=o.response??o.turn;e!==void 0&&i.push({kind:o.failed?`turnFailed`:`turn`,itemIndex:e,turnIndex:o.turn}),o={}};e.forEach((e,n)=>{if(e.kind===`tool_call`&&a.has(e.id)&&i.push({kind:`subagent`,itemIndex:n}),e.kind===`user`&&x4(e)===t)s(),i.push({kind:`user`,itemIndex:n});else if(e.kind===`turn_result`)o.turn=n,o.failed=e.isError,s();else if(e.kind===`notice`&&e.level===`error`)i.push({kind:`error`,itemIndex:n});else if(e.kind===`shell`)i.push({kind:`shell`,itemIndex:n});else if(e.kind===`tool_call`&&x4(e)===t&&(e.status===`failed`||e.result?.isError===!0))i.push({kind:`toolFailed`,itemIndex:n});else if(e.kind===`assistant_text`&&x4(e)===t){if(t!==void 0){i.push({kind:`turn`,itemIndex:n});return}o.response=n}}),s();for(let t of n)t>=0&&t<e.length&&i.push({kind:`bookmark`,itemIndex:t});return r!==void 0&&i.push({kind:`recap`,itemIndex:r}),i}function Y6(e,t,n){let r=Math.max(1,n),i=Math.max(2,Math.round(t/r)),a=new Map;for(let n of e){let e=Math.min(Math.max(0,t-i),Math.round(n.itemIndex/r*t)),o=U6[n.kind],s=a.get(o)??[];s.push({mark:n,y:e}),a.set(o,s)}let o=[];for(let[e,t]of a){t.sort((e,t)=>e.y-t.y);let n=null;for(let{mark:r,y:a}of t)n&&a<=n.y+n.h+1?(n.h=Math.max(n.h,a+i-n.y),W6[r.kind]>W6[n.kind]&&(n.kind=r.kind),n.marks.push({mark:r,y:a})):(n={lane:e,kind:r.kind,y:a,h:i,marks:[{mark:r,y:a}]},o.push(n))}return o}function X6(e){return{lane:U6.approval,kind:`approval`,y:Math.max(0,e-2),h:2,marks:[]}}function Z6(e,t,n,r){let i=e.marks.length>1?` · ${e.marks.length} marks`:``,a=null;if(e.kind===`approval`){let e=r[0];a=e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{children:e.title??`Permission required`}),(0,U.jsx)(`div`,{className:`wd-scrub-ex`,"data-tone":`muted`,children:`${e.displayName??e.toolName}(${yM(e.input)})`})]}):null}else if(t&&t.kind!==`recap`){let e=n[t.itemIndex];if(t.kind===`turn`||t.kind===`turnFailed`){let r=t.turnIndex===void 0?void 0:n[t.turnIndex];a=(0,U.jsxs)(U.Fragment,{children:[e?.kind===`assistant_text`?(0,U.jsx)(`div`,{className:`wd-scrub-ex`,children:e.text}):null,r?.kind===`turn_result`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{"data-tone":r.isError?`danger`:`muted`,children:K6(r)}),r.errors?.map((e,t)=>(0,U.jsx)(`div`,{"data-tone":`danger`,children:e},t))]}):null]})}else if(e){let n=t.kind===`toolFailed`&&e.kind===`tool_call`?e.result?.text.split(`
|
|
209
|
+
`).find(e=>e.trim()!==``):void 0;a=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`wd-scrub-ex`,"data-tone":t.kind===`error`||t.kind===`toolFailed`?`danger`:void 0,children:[t.kind===`user`?(0,U.jsx)(`span`,{"data-tone":`muted`,children:`❯ `}):null,q6(e)]}),n?(0,U.jsx)(`div`,{className:`wd-scrub-ex`,"data-tone":`danger`,children:n}):null]})}}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{"data-tone":`muted`,children:[G6[t?.kind??e.kind],i]}),a]})}function Q6({items:e,pendingApprovals:t,recapItemIndex:n,bookmarks:r,frameParentId:i,interactive:a=!1,onJumpToItem:o,className:s}){let c=(0,v.useRef)(null),l=(0,v.useRef)(null),[u,d]=(0,v.useState)(0),[f,p]=(0,v.useState)(null);(0,v.useEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(()=>d(e.clientHeight));return t.observe(e),d(e.clientHeight),()=>t.disconnect()},[]),(0,v.useEffect)(()=>{p(null)},[e]),(0,v.useLayoutEffect)(()=>{let e=l.current;if(!e||!f)return;let t=e.offsetHeight,n=c.current?.clientHeight??0;e.style.top=`${Math.max(4,Math.min(n-t-4,f.y-t/2))}px`},[f]);let m=(0,v.useMemo)(()=>{if(u<=0)return[];let a=Y6(J6(e,{frameParentId:i,bookmarks:r,recapItemIndex:n}),u,e.length);return t.length>0&&a.push(X6(u)),a},[e,i,r,n,t,u]),h=e=>e-(c.current?.getBoundingClientRect().top??0),g=(t,n)=>{if(t.kind===`approval`&&t.marks.length===0){e.length>0&&o?.(e.length-1);return}let r=H6(t,h(n));r&&o?.(r.itemIndex)},_=(e,t)=>{let n=h(t),r=H6(e,n);p(t=>t&&t.cluster===e&&t.mark===r?t:{cluster:e,mark:r,y:Math.min(Math.max(n,e.y),e.y+e.h)})};return(0,U.jsxs)(`div`,{ref:c,className:W(`wd-scrubber`,s),"data-interactive":a||void 0,"aria-hidden":!0,children:[m.map((e,t)=>(0,U.jsx)(`div`,{className:`wd-scrub-mark`,"data-lane":e.lane,"data-kind":e.kind,style:{top:e.y,height:e.h},...a?{onClick:t=>g(e,t.clientY),onPointerEnter:t=>_(e,t.clientY),onPointerMove:t=>_(e,t.clientY),onPointerLeave:()=>p(null)}:null},t)),f?(0,U.jsx)(`div`,{ref:l,className:`wd-scrub-peek`,style:{top:f.y},children:Z6(f.cluster,f.mark,e,t)}):null]})}var $6=new WeakMap,e8=new WeakMap;function t8(e){if(e){if(`item`in e)return e.item;if(`run`in e)return e.run[0];if(`task`in e)return e.task}}function n8(e,t){let n=t8(e[t-1]),r=t8(e[t]);return!n||!r||D4(n,r)}function r8(e){let t=$6.get(e);if(t)return t;let n=new Map;return e.forEach((e,t)=>{if(`task`in e)for(let r of e.childIndices)n.set(r,t)}),$6.set(e,n),n}function i8(e,t){let n=r8(e).get(t);if(n!==void 0)return n;let r=0,i=e.length-1,a=0;for(;r<=i;){let n=r+i>>1,o=e[n],s;if(`index`in o)s=o.index;else{let t=e[n+1];s=t&&`index`in t?t.index:2**53-1}s<=t?(`index`in o&&(a=n),r=n+1):i=n-1}return a}function a8(e){let t=e8.get(e);if(t)return t;let n=new Map;for(let t of e)if(`task`in t){let e=t.childIndices.length;t.childIndices.forEach((t,r)=>n.set(t,{ordinal:r,count:e}))}else if(`run`in t&&t.run.length>1){let e=t.run.length;t.indices.forEach((t,r)=>n.set(t,{ordinal:r,count:e}))}return e8.set(e,n),n}function o8(e,t){return a8(e).get(t)}function s8(e){let{terminal:t,fontSize:n,lineHeight:r,rowsRef:i}=e,[a,o]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!t)return;let e=i.current;if(!e)return;let n,r=()=>{let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--term-line`)),n=e.clientWidth,r=o6(e);t&&n&&r&&o(e=>e&&e.width===n&&e.ch===r&&e.line===t?e:r6(n,r,t))},a=new ResizeObserver(()=>{clearTimeout(n),n=setTimeout(r,150)});return a.observe(e),r(),()=>{a.disconnect(),clearTimeout(n)}},[t,n,r,i]),a}var c8=4,l8=50;function u8(e){let{state:t}=e;t.escapedFromLock=!1;let n=e.scrollToBottom({animation:`instant`,ignoreEscapes:!0,duration:750});t.animation={behavior:`instant`,ignoreEscapes:!0,promise:Promise.resolve(n)},t.scrollTop=t.calculatedTargetScrollTop}function d8(e,t){let{state:n}=e;if(n.resizeDifference=t,requestAnimationFrame(()=>{setTimeout(()=>{n.resizeDifference===t&&(n.resizeDifference=0)},1)}),n.animation?.ignoreEscapes){n.scrollTop=n.calculatedTargetScrollTop;return}e.scrollToBottom(`instant`)}function f8(e){let{rows:t,terminal:n,stickyPrompt:r,epoch:i,promptRows:a,scrollElement:o,rowsRef:s,virtualizer:c,stick:l,jumpToRecapRef:u,repinRef:d}=e,f=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(f.current),[]);let p=(e,u=`center`)=>{if(e<0||e>=t.length||!o)return;if(l.stopScroll(),clearTimeout(f.current),u===`start`){let l=e=>n&&i&&e>0&&n8(t,e)?i.line:0,u=()=>{let t=(c.measurementsCache[e]?.start??0)+(s.current?s.current.getBoundingClientRect().top-o.getBoundingClientRect().top+o.scrollTop:0)+l(e);return n&&r&&i&&!a.includes(e)&&a.some(t=>t<e)&&(t-=i.line),Math.round(t)},d=e=>{let t=u();o.scrollTo({top:t,behavior:`instant`}),!(e>=c8)&&(f.current=setTimeout(()=>{Math.abs(o.scrollTop-u())>1&&d(e+1)},l8))};d(0);return}let d=t=>{let n=o.querySelector(`[data-index="${e}"]`);if(n){n.scrollIntoView({behavior:`instant`,block:u});return}t>=c8||(c.scrollToIndex(e,{align:u,behavior:`auto`}),f.current=setTimeout(()=>d(t+1),l8))};d(0)};return(0,v.useEffect)(()=>{if(u)return u.current=()=>{p(t.findIndex(e=>e.key===`recap`),`start`)},()=>{u.current=null}}),(0,v.useEffect)(()=>{if(d)return d.current=()=>{clearTimeout(f.current),u8(l)},()=>{d.current=null}}),p}function p8({item:e,fileUrl:t}){switch(e.kind){case`user`:return(0,U.jsx)(f2,{item:e});case`assistant_text`:return(0,U.jsx)(p2,{item:e});case`thinking`:return(0,U.jsx)(m2,{item:e});case`tool_call`:return i0(e)?(0,U.jsx)(d2,{item:e}):(0,U.jsx)(g2,{item:e});case`turn_result`:return(0,U.jsx)(S2,{item:e});case`notice`:return(0,U.jsx)(w2,{item:e});case`compaction`:return(0,U.jsx)(C2,{item:e});case`file_delivered`:return(0,U.jsx)(E2,{item:e,href:t?.(e.path)});case`shell`:return(0,U.jsx)(T2,{item:e});default:return null}}function m8({text:e,terminal:t}){let[n,r]=(0,v.useState)(!1);return t?(0,U.jsx)(`div`,{"data-slot":`brief`,children:(0,U.jsx)(k0,{onPress:()=>r(e=>!e),expanded:n,children:(0,U.jsx)(pN,{glyph:`>`,glyphTone:`blue`,tone:`dim`,children:(0,U.jsx)(`span`,{className:W(`whitespace-pre-wrap`,!n&&`term-brief-clip`),style:n?void 0:{WebkitLineClamp:4},children:e})})})}):(0,U.jsx)(`div`,{"data-slot":`brief`,className:`px-4 py-2 text-body-sm whitespace-pre-wrap text-fg-2`,children:e})}function h8({block:e,fileUrl:t,onOpenSubagent:n}){let[r,i]=(0,v.useState)(!1),a=A0(r),o=(0,v.useMemo)(()=>w4(e),[e]),s=o.some(e=>e.kind===`user`)?void 0:v0(e.task),c=S0(e.task,o),l=C0(e.task),u=LM(c),d=(0,U.jsxs)(`div`,{ref:a,className:r?`term-open`:void 0,children:[(0,U.jsx)(k0,{onPress:()=>i(e=>!e),expanded:r,children:(0,U.jsx)(pN,{glyph:c?u:`●`,glyphTone:l?`red`:c?`mark`:`dim`,tone:l?`red`:`green`,children:c?(0,U.jsx)(`span`,{className:`term-shimmer`,children:w0(e.task,o)}):w0(e.task,o)})}),r?(0,U.jsxs)(`div`,{className:`term-nested`,children:[s?(0,U.jsx)(m8,{text:s,terminal:!0}):null,e.children.map((n,r)=>(0,U.jsxs)(v.Fragment,{children:[r>0&&k4(e.children[r-1],n)?(0,U.jsx)(mN,{}):null,`run`in n?(0,U.jsx)(x2,{items:n.run}):(0,U.jsx)(p8,{item:n.item,fileUrl:t})]},n.key))]}):null]});return n===void 0?d:(0,U.jsx)(aN,{actions:(0,U.jsx)(lN,{onOpen:()=>n(e.task.id)}),children:d})}function g8({item:e,href:t,className:n}){let r=e.path.split(`/`).pop()||e.path;return(0,U.jsxs)(`div`,{"data-slot":`file-delivered`,className:W(`flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5`,n),children:[(0,U.jsx)(sy,{className:`size-4 shrink-0 text-fg-3`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`truncate font-mono text-body-sm font-medium text-fg-1`,children:r}),(0,U.jsxs)(`div`,{className:`truncate text-label text-fg-4`,children:[pM(e.bytes),e.description?` · ${e.description}`:``]})]}),t?(0,U.jsxs)(`a`,{href:t,download:r,className:W(`flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5`,`text-body-sm text-fg-2 transition-colors hover:bg-surface-hover`),children:[(0,U.jsx)($v,{className:`size-3.5`}),`Download`]}):null]})}function _8({from:e,className:t,children:n,...r}){return(0,U.jsx)(`div`,{"data-slot":`message`,"data-from":e,className:W(`flex w-full flex-col items-start gap-1`,t),...r,children:n})}function v8({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`message-content`,className:W(`min-w-0 text-body-sm leading-6 text-fg-1`,`in-data-[from=user]:max-w-[85%] in-data-[from=user]:rounded-lg in-data-[from=user]:rounded-bl-sm`,`in-data-[from=user]:bg-accent-bg in-data-[from=user]:px-3 in-data-[from=user]:py-2`,`in-data-[from=user]:whitespace-pre-wrap`,`in-data-[from=assistant]:w-full`,e),...t})}function y8({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){let[i,a]=(0,v.useState)(n??t),o=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!o.current){if(t)a(!0);else{let e=setTimeout(()=>a(!1),600);return()=>clearTimeout(e)}}},[t]);let s=e.trim()!==``;return!s&&!t?null:(0,U.jsxs)(`div`,{"data-slot":`reasoning`,"data-streaming":t||void 0,className:W(`w-full`,r),children:[(0,U.jsxs)(`button`,{type:`button`,disabled:!s,onClick:()=>{o.current=!0,a(e=>!e)},className:`flex items-center gap-1.5 text-label text-fg-3 transition-colors outline-none disabled:cursor-default hover:text-fg-1 disabled:hover:text-fg-3`,children:[(0,U.jsx)(F_,{className:`size-3.5`}),(0,U.jsx)(`span`,{children:t?`Thinking…`:`Thought process`}),s?(0,U.jsx)(av,{className:W(`size-3.5 transition-transform`,i&&`rotate-180`)}):null]}),i&&s?(0,U.jsx)(`div`,{className:`mt-2 border-l-2 border-border pl-3 text-body-sm text-fg-3 [&_*]:text-fg-3`,children:(0,U.jsx)(v4,{streaming:t,children:e})}):null]})}var b8=2e3,x8=new Set([`CodexImageGeneration`,`CodexImageView`]);function S8(e){if(!x8.has(e.name))return;let t=e.input,n=t?.savedPath??t?.path;return typeof n==`string`?n:void 0}var C8={running:{label:`Running`,variant:`info`,busy:!0},pending:{label:`Executing`,variant:`info`,busy:!0},deferred:{label:`Deferred`,variant:`accent`,busy:!1},settled:{label:`Done`,variant:`success`,busy:!1},failed:{label:`Error`,variant:`danger`,busy:!1}},w8={ts:`ts`,tsx:`tsx`,js:`js`,jsx:`jsx`,mjs:`js`,cjs:`js`,json:`json`,jsonc:`json`,md:`md`,mdx:`md`,css:`css`,scss:`scss`,html:`html`,xml:`xml`,yml:`yaml`,yaml:`yaml`,toml:`toml`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,sh:`bash`,bash:`bash`,zsh:`bash`,fish:`fish`,sql:`sql`,graphql:`graphql`,dockerfile:`dockerfile`,diff:`diff`,patch:`diff`};function T8(e){if(e.name===`Bash`||e.name===`CodexCommand`)return`bash`;if(e.name===`CodexFileChange`)return`diff`;let t=e.input,n=t?.file_path??t?.path;return typeof n==`string`?w8[n.slice(n.lastIndexOf(`.`)+1).toLowerCase()]:void 0}function E8({item:e,hostImage:t,className:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),l=B0(),u=S8(e),d=e.status??(e.result===void 0?`running`:`settled`),f=C8[d],p=d===`failed`||e.result?.isError===!0,m=SM(e.name),h=U0(e.name),g=e.result?.text??``,_=!a&&g.length>b8,y=_?g.slice(0,b8):g,b=e.result?.truncated===!0,x=e.result?.totalChars??g.length,S=r?(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border p-2.5`,children:[h?(0,U.jsx)(`p`,{className:`font-mono text-label text-fg-4`,children:e.name}):null,(0,U.jsx)(D8,{code:JSON.stringify(e.input,null,2),language:`json`,label:`Parameters`}),e.logs?.length?(0,U.jsx)(D8,{code:e.logs.join(`
|
|
210
|
+
`),label:`Logs`}):null,e.result===void 0?null:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(D8,{code:y||`(empty result)`,language:T8(e),label:p?`Error`:`Result`,className:W(p&&`border-danger/40 [&_pre]:text-danger`)}),s?(0,U.jsxs)(`p`,{className:`mt-1 text-label text-fg-3`,children:[`Fetching `,x.toLocaleString(),` chars…`]}):_||b?(0,U.jsxs)(`button`,{type:`button`,className:`mt-1 text-label text-fg-3 underline-offset-2 hover:underline`,onClick:()=>{o(!0),b&&(c(!0),l(e.id).finally(()=>c(!1)))},children:[`Show all `,x.toLocaleString(),` chars`]}):null]})]}):null,C=u&&t?(0,U.jsx)(k8,{path:u,load:t}):null,w=e.result?.images?.length?(0,U.jsx)(`div`,{className:`flex flex-col gap-2 border-t border-border p-2.5`,children:e.result.images.map(t=>(0,U.jsx)(O8,{toolUseId:e.id,image:t},t.partIndex))}):null;return(0,U.jsxs)(`div`,{"data-slot":`tool-call`,"data-state":d,className:W(`w-full overflow-hidden rounded-lg border border-border bg-surface`,n),children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:W(`flex w-full items-center gap-2 px-3 py-2 text-left transition-colors outline-none`,`hover:bg-surface-hover focus-visible:bg-surface-hover`),children:[(0,U.jsx)(m,{className:`size-3.5 shrink-0 text-fg-3`}),(0,U.jsx)(`span`,{className:W(`shrink-0 text-body-sm font-medium text-fg-1`,h===void 0&&`font-mono`),title:e.name,children:h??e.name}),e.backend&&e.backend!==`server`?(0,U.jsx)(fo,{variant:`neutral`,className:`shrink-0`,children:e.backend}):null,(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-4`,children:yM(e.input)}),(0,U.jsxs)(fo,{variant:f.variant,dot:!f.busy,className:`shrink-0 gap-1`,children:[f.busy?(0,U.jsx)(GT,{className:`size-3 text-current`}):null,d===`deferred`?(0,U.jsx)(Dv,{className:`size-3 text-current`}):null,f.label]}),(0,U.jsx)(av,{className:W(`size-3.5 shrink-0 text-fg-4 transition-transform`,r&&`rotate-180`)})]}),C,w,S]})}function D8({code:e,label:t,className:n}){return(0,U.jsx)(KT,{code:e,label:t,variant:`panel`,className:n})}function O8({toolUseId:e,image:t}){let{src:n,failed:r}=Y0({toolUseId:e,...t});return(0,U.jsx)(`div`,{className:`flex h-60 items-start overflow-hidden rounded-md border border-border bg-surface-hover`,children:n?(0,U.jsx)(`img`,{src:n,alt:M0(t),className:`h-full max-w-full object-contain`}):(0,U.jsx)(`span`,{className:`p-2 text-label text-fg-4`,children:r?N0:M0(t)})})}function k8({path:e,load:t}){let[n,r]=(0,v.useState)();return(0,v.useEffect)(()=>{let n=!1;return r(void 0),t(e).then(e=>{n||r(e)}).catch(()=>{}),()=>{n=!0}},[e,t]),n?(0,U.jsx)(`div`,{className:`border-t border-border p-2.5`,children:(0,U.jsx)(`img`,{src:n,alt:e.split(`/`).pop()??`Generated image`,className:`max-h-96 w-auto max-w-full rounded-md border border-border`})}):null}function A8({item:e}){return(0,U.jsxs)(`div`,{"data-slot":`turn-result`,className:`py-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,U.jsxs)(`span`,{className:W(`font-mono text-label`,e.isError?`text-danger`:`text-fg-4`),children:[e.isError?e.subtype:`turn done`,` · `,dM(e.durationMs),` · `,uM(e.costUsd??e.totalCostUsd)]}),(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`})]}),e.errors?.length?(0,U.jsx)(`ul`,{className:`mt-1 flex flex-col gap-0.5 text-center`,children:e.errors.map((e,t)=>(0,U.jsx)(`li`,{className:`text-label break-words text-danger`,children:e},t))}):null]})}function j8({item:e}){return(0,U.jsx)(`div`,{"data-slot":`notice`,className:W(`rounded-md border px-3 py-2 text-body-sm`,e.level===`error`?`border-transparent bg-danger-bg text-danger`:`border-border bg-surface text-fg-3`),children:e.text})}function M8({item:e,fileUrl:t,attachmentUrl:n,hostImage:r,terminal:i}){if(i)return(0,U.jsx)(p8,{item:e,fileUrl:t});switch(e.kind){case`user`:return(0,U.jsxs)(_8,{from:`user`,children:[e.origin?(0,U.jsx)(`div`,{className:`wd-peer-origin text-xs text-muted-foreground`,children:l2(e.origin)}):null,e.attachments?.length?(0,U.jsx)(I8,{attachments:e.attachments,attachmentUrl:n}):null,e.text?(0,U.jsx)(v8,{children:(0,U.jsx)(HM,{text:e.text})}):null]});case`assistant_text`:return(0,U.jsx)(_8,{from:`assistant`,children:(0,U.jsx)(v8,{children:(0,U.jsx)(v4,{streaming:e.streaming,children:e.text})})});case`thinking`:return(0,U.jsx)(y8,{isStreaming:e.id===`streaming-thinking`,children:e.text});case`tool_call`:return(0,U.jsx)(E8,{item:e,hostImage:r});case`turn_result`:return(0,U.jsx)(A8,{item:e});case`notice`:return(0,U.jsx)(j8,{item:e});case`compaction`:return(0,U.jsx)(P8,{item:e});case`file_delivered`:return(0,U.jsx)(g8,{item:e,href:t?.(e.path)});case`shell`:return(0,U.jsx)(N8,{item:e});default:return null}}function N8({item:e}){let[t,n]=(0,v.useState)(!1),r=o2(),i=e.shell.status===`running`,a=XM(e),o=QM(e,t),s=$M(e,t,o.length),c=e.shell.id,l=r.verify;return(0,v.useEffect)(()=>{i&&l(c)},[i,c,l]),(0,U.jsxs)(`div`,{"data-slot":`shell`,className:`overflow-hidden rounded-md border border-border bg-surface`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5`,children:[(0,U.jsx)(`span`,{className:`font-mono text-label text-[var(--wd-shell-accent)]`,children:`$`}),(0,U.jsx)(`button`,{type:`button`,"aria-expanded":t,className:`min-w-0 flex-1 truncate text-left font-mono text-label text-fg-1`,onClick:()=>{let i=!t;n(i),i&&e.truncated&&e.expanded===void 0&&!e.missing&&r.loadOutput(c)},children:KM(e)}),(0,U.jsx)(`span`,{className:W(`shrink-0 text-label`,a?`text-danger`:`text-fg-4`),children:qM(e)}),r.open?(0,U.jsx)(`button`,{type:`button`,"aria-label":`Open terminal`,title:`Open terminal`,className:`shrink-0 text-label text-fg-3 hover:text-fg-1`,onClick:()=>r.open?.(c),children:`⤢`}):null,i?(0,U.jsx)(`button`,{type:`button`,"aria-label":`Kill this shell`,className:`shrink-0 text-label text-fg-3`,onClick:()=>void r.kill(c),children:`✕`}):null]}),o.length>0?(0,U.jsx)(`pre`,{className:`overflow-x-auto border-t border-border px-3 py-2 font-mono text-label whitespace-pre-wrap text-fg-2`,children:o.join(`
|
|
211
|
+
`)}):null,s?(0,U.jsx)(`div`,{className:`px-3 pb-2 text-label text-fg-4`,children:s}):null]})}function P8({item:e}){return(0,U.jsxs)(`div`,{"data-slot":`compaction`,className:`flex items-center gap-2 py-1`,children:[(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,U.jsxs)(`span`,{className:`font-mono text-label ${e.error===void 0?`text-fg-3`:`text-danger`}`,children:[e.pending?`⋯`:`≡`,` `,lM(e)]}),(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})}function F8({line:e,since:t,terminal:n}){let r=t===void 0?void 0:hM(t),i=r?`${e} · last here ${r}`:e;return n?(0,U.jsx)(`div`,{"data-slot":`recap`,children:(0,U.jsxs)(pN,{glyph:`※`,glyphTone:`faint`,tone:`faint`,children:[`recap: `,i]})}):(0,U.jsxs)(`div`,{"data-slot":`recap`,className:`flex items-center gap-2 py-1`,children:[(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,U.jsxs)(`span`,{className:`font-mono text-label text-fg-3`,children:[`※ recap: `,i]}),(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})}function I8({attachments:e,attachmentUrl:t}){return(0,U.jsx)(`div`,{className:`mb-1 flex flex-wrap justify-start gap-1.5`,children:e.map(e=>{let n=t?.(e.id);return e.mediaType.startsWith(`image/`)&&n?(0,U.jsx)(`img`,{src:n,alt:e.name,className:`size-20 rounded-md border border-border object-cover`},e.id):(0,U.jsx)(`span`,{className:`rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3`,children:e.name},e.id)})})}function L8(e,t){return e!==void 0&&t<e}function R8(e,t){let n=`parentToolUseId`in e?e.parentToolUseId:void 0;return n!=null&&n!==t?`border-l-2 border-border pl-3`:void 0}function z8(e){return e.text||(e.attachments??[]).map(e=>e.name).join(`, `)}function B8({top:e,height:t,gapClass:n,gapPx:r,terminal:i,scrollRoot:a,index:o,measureRef:s,head:c,content:l}){let u=(0,v.useRef)(null),d=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=u.current,t=d.current;if(!e||!t||!a)return;let n=()=>{let n=t.getBoundingClientRect().top<a.getBoundingClientRect().top;e.toggleAttribute(`data-stuck`,n)};return n(),a.addEventListener(`scroll`,n,{passive:!0}),()=>a.removeEventListener(`scroll`,n)},[a,e,t,n]),(0,U.jsxs)(`div`,{"data-sticky-lane":i?`terminal`:`cards`,className:`absolute inset-x-0`,style:{top:e,height:t},children:[(0,U.jsx)(`div`,{"data-sticky-headlane":``,"aria-hidden":!0,children:(0,U.jsx)(`div`,{ref:u,"data-sticky-head":``,className:i&&n||void 0,children:c})}),(0,U.jsx)(`div`,{ref:d,"aria-hidden":!0,className:`absolute left-0 w-px`,style:{top:n?i?`var(--term-line)`:r:0,height:1}}),(0,U.jsx)(`div`,{ref:s,"data-index":o,className:n||void 0,children:l})]})}function V8({rows:e,boundary:t,since:n,terminal:r,replaying:i,stickyPrompt:a,frameParentId:o,onOpenSubagent:s,gap:c,fontSize:l,lineHeight:u,items:d,pendingApprovals:f,scrubber:p,bookmarks:m,affordances:h,fileUrl:g,attachmentUrl:_,hostImage:y,jumpToRecapRef:b,repinRef:x,reveal:S}){let C=T3(),[w,T]=(0,v.useState)(null),E=(0,v.useMemo)(()=>e.flatMap((e,t)=>`item`in e&&e.item.kind===`user`&&x4(e.item)===void 0?[t]:[]),[e]),D=(0,v.useRef)({enabled:!1,promptRows:[]});D.current={enabled:a,promptRows:E},(0,v.useEffect)(()=>{T(C.scrollRef.current)},[C.scrollRef]),(0,v.useEffect)(()=>{if(!w)return;let e=w.clientHeight,t=new ResizeObserver(()=>{let t=w.clientHeight;if(t===e)return;let n=t-e;e=t,C.state.isAtBottom&&d8(C,n)});return t.observe(w),()=>t.disconnect()},[w,C]);let O=(0,v.useRef)(i);(0,v.useLayoutEffect)(()=>{let e=O.current;O.current=i,e&&!i&&C.state.isAtBottom&&(C.state.scrollTop=C.state.calculatedTargetScrollTop)},[i,C]);let k=(0,v.useRef)(null),A=s8({terminal:r,fontSize:l,lineHeight:u,rowsRef:k}),j=n6({count:e.length,getScrollElement:()=>(w&&j.scrollElement!==w&&(j.scrollOffset=w.scrollTop),w),estimateSize:t=>{if(r&&A){let n=e[t],r=t>0&&n8(e,t)?A.line:0;return n&&`text`in n&&n.key===`brief`?a6(n.text,A)+r:n&&!(`line`in n)?i6(n,A)+r:A.line+r}return(r?36:100)+c.px},overscan:8,getItemKey:t=>e[t].key,rangeExtractor:(0,v.useCallback)(e=>{let t=new Set(V3(e)),{enabled:n,promptRows:r}=D.current;if(n){let e=j.scrollOffset??0,n=-1;for(let t of r)if((j.measurementsCache[t]?.start??1/0)<=e)n=t;else break;n>=0&&t.add(n)}return[...t].sort((e,t)=>e-t)},[]),useFlushSync:!0});j.shouldAdjustScrollPositionOnItemSizeChange=(e,t,n)=>{if(C.state.isAtBottom)return!1;let r=(n.scrollOffset??0)+n.scrollAdjustments;return n.itemSizeCache.has(e.key)?e.end<=r&&n.scrollDirection!==`backward`:e.start<r},(0,v.useEffect)(()=>{if(!r||!A)return;j.measure();let e=k.current;if(e){j.getTotalSize();for(let t of e.querySelectorAll(`[data-index]`)){let e=Number(t.getAttribute(`data-index`));Number.isInteger(e)&&e>=0&&j.resizeItem(e,t.getBoundingClientRect().height)}}},[r,A,j]);let M=f8({rows:e,terminal:r,stickyPrompt:a,epoch:A,promptRows:E,scrollElement:w,rowsRef:k,virtualizer:j,stick:C,jumpToRecapRef:b,repinRef:x}),N=S?.nonce,P=S?.toolUseId;(0,v.useEffect)(()=>{if(P===void 0)return;let t=d.findIndex(e=>e.kind===`tool_call`&&e.id===P);t<0||M(i8(e,t),`start`)},[N]);let F=rN(h).hover,I=(0,v.useMemo)(()=>{if(!m?.length)return[];let e=new Map(d.map((e,t)=>[e.id,t]));return m.map(t=>e.get(t)).filter(e=>e!==void 0)},[m,d]),L=e.findIndex(e=>e.key===`recap`),R=L>=0?{rowIndex:L,label:e[L].line}:void 0;(0,v.useEffect)(()=>{if(r&&p&&F&&w)return w.setAttribute(`data-term-scrubber-host`,``),()=>w.removeAttribute(`data-term-scrubber-host`)},[r,p,F,w]);let z=j.measurementsCache;return(0,U.jsxs)(`div`,{ref:k,"data-slot":`transcript-rows`,className:`relative w-full`,style:{height:j.getTotalSize()},children:[(0,U.jsx)(E0,{items:d,children:j.getVirtualItems().map(i=>{let l=e[i.index],u=i.index>0&&(!r||n8(e,i.index))?c.className:void 0,d=`run`in l?(0,U.jsx)(`div`,{className:W(L8(t,l.index)&&`opacity-45`),children:(0,U.jsx)(x2,{items:l.run})}):`item`in l?(0,U.jsx)(`div`,{className:W(L8(t,l.index)&&`opacity-45`,R8(l.item,o)),children:(0,U.jsx)(M8,{item:l.item,fileUrl:g,attachmentUrl:_,hostImage:y,terminal:r})}):`text`in l&&l.key===`brief`?(0,U.jsx)(m8,{text:l.text,terminal:r}):`line`in l?(0,U.jsx)(F8,{line:l.line,since:n,terminal:r}):(0,U.jsx)(`div`,{className:W(L8(t,l.index)&&`opacity-45`),children:(0,U.jsx)(h8,{block:l,fileUrl:g,onOpenSubagent:s})});if(a&&`item`in l&&l.item.kind===`user`&&x4(l.item)===void 0){let e=E.find(e=>e>i.index),t=e===void 0?j.getTotalSize():z[e]?.start??i.start;return(0,U.jsx)(B8,{top:i.start,height:Math.max(t-i.start,0),gapClass:u,gapPx:c.px,terminal:r,scrollRoot:w,index:i.index,measureRef:j.measureElement,head:r?d:z8(l.item),content:d},l.key)}return(0,U.jsx)(`div`,{ref:j.measureElement,"data-index":i.index,className:W(`absolute inset-x-0 top-0`,u),style:{transform:`translateY(${i.start}px)`},children:d},l.key)})}),p&&w?.parentElement?(0,Ed.createPortal)(r?(0,U.jsx)(V6,{items:d,pendingApprovals:f,recapRow:R,bookmarks:I,frameParentId:o,rowIndexFor:t=>i8(e,t),positionInRow:t=>o8(e,t),offsetOfRow:e=>j.measurementsCache[e]?.start??0,sizeOfRow:e=>j.measurementsCache[e]?.size??0,totalSize:j.getTotalSize(),scrollOffset:j.scrollOffset??0,viewportH:j.scrollRect?.height??0,onJumpToRow:e=>M(e,`start`),interactive:F,fontSize:l,lineHeight:u}):(0,U.jsx)(Q6,{items:d,pendingApprovals:f,recapItemIndex:L>=0?t:void 0,bookmarks:I,frameParentId:o,interactive:F,onJumpToItem:t=>M(i8(e,t),`start`)}),w.parentElement):null]})}function H8(e){let t=e===`running`||e===`starting`,[n,r]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{r(e=>t?e??Date.now():void 0)},[t]),t?n:void 0}function U8(e){if(e.status!==`running`&&e.status!==`starting`)return!1;let t=e.items.at(-1);return t?t.kind===`assistant_text`&&t.streaming||t.kind===`thinking`&&t.id===`streaming-thinking`?!1:t.kind!==`turn_result`||e.status===`running`:!0}function W8({active:e,fontSize:t,lineHeight:n,affordances:r,children:i}){return e?(0,U.jsx)(k2,{fontSize:t,lineHeight:n,affordances:r,bleed:`1ch`,className:`term-transcript`,children:i}):(0,U.jsx)(U.Fragment,{children:i})}function G8({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:i,variant:a=`cards`,density:o=`comfortable`,fontSize:s,lineHeight:c,affordances:l,stickyPrompt:u=!1,scrubber:d,bookmarks:f,sessionNames:p,replaying:m=!1,catchUp:h,jumpToRecapRef:g,repinRef:_,reveal:y,frame:b,onOpenSubagent:x,emptyState:S,className:C}){let w=a===`terminal`,T=(0,v.useMemo)(()=>b?S4(e.items,b.parentToolUseId):e.items,[e.items,b]),E=(0,v.useMemo)(()=>b?e.items.find(e=>e.kind===`tool_call`&&e.id===b.parentToolUseId):void 0,[e.items,b]),D=sM[a][o],O=H8(e.status),k=!b&&h&&h.from>0&&h.from<e.items.length?h.from:void 0,A=(0,v.useMemo)(()=>k===void 0?void 0:Vj(Bj(e,k)),[e,k]),j=(0,v.useMemo)(()=>b&&E&&!T.some(e=>e.kind===`user`)?v0(E):void 0,[b,E,T]),M=(0,v.useMemo)(()=>{let e=(e,t)=>E4(T.slice(e,t),e,w);return k===void 0||!A?[...j?[{key:`brief`,text:j}]:[],...e(0,T.length)]:[...e(0,k),{key:`recap`,line:A},...e(k,T.length)]},[T,k,A,w,j]),N=(0,v.useMemo)(()=>e.skills?.map(e=>e.name),[e.skills]);return(0,U.jsx)(rM,{value:a,children:(0,U.jsx)(BM,{names:N,children:(0,U.jsx)(VM,{names:p,children:(0,U.jsxs)(E3,{className:W(m&&`invisible`,C),children:[(0,U.jsx)(D3,{className:W(w&&`gap-0 p-0`),children:(0,U.jsxs)(W8,{active:w,fontSize:s,lineHeight:c,affordances:l,children:[b?E===void 0&&!m?(0,U.jsx)(`div`,{className:W(w?`term-row text-fg-4`:`p-4 text-body-sm text-fg-4`),children:`This sub-agent's work is not in this transcript.`}):null:T.length===0&&e.status!==`starting`?S===void 0?(0,U.jsx)(A3,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(e=>e.enabled),canBrowseFiles:r}):S:null,b&&E===void 0&&!m?null:(0,U.jsx)(V8,{rows:M,boundary:k,since:h?.since,terminal:w,replaying:m,stickyPrompt:!b&&u,gap:D,fontSize:s,lineHeight:c,items:T,pendingApprovals:e.pendingApprovals,scrubber:d,bookmarks:b?void 0:f,affordances:l,fileUrl:t,attachmentUrl:n,hostImage:i,jumpToRecapRef:g,repinRef:_,reveal:b?void 0:y,frameParentId:b?.parentToolUseId,onOpenSubagent:b?void 0:x}),(b?E!==void 0&&S0(E,T):U8(e))?w?(0,U.jsxs)(U.Fragment,{children:[e.items.length>0?(0,U.jsx)(`div`,{className:`term-blank`,"aria-hidden":!0}):null,(0,U.jsx)(O2,{label:e.status===`starting`?`Starting…`:`Working…`,startedAt:O,tokens:e.contextUsage?.totalTokens})]}):(0,U.jsx)(k3,{label:e.status===`starting`?`Starting session…`:void 0}):null]})}),(0,U.jsx)(O3,{}),m?(0,U.jsx)(`div`,{"data-slot":`transcript-hold`,"aria-hidden":!0,className:`wd-hold-appear visible pointer-events-none absolute inset-0 overflow-hidden`,children:(0,U.jsx)(`div`,{className:W(`mx-auto w-full max-w-[var(--wd-transcript-max-width)]`,!w&&`px-4 py-4`),children:w?(0,U.jsx)(k2,{fontSize:s,lineHeight:c,affordances:!1,bleed:`1ch`,className:`term-transcript`,children:(0,U.jsx)(O2,{label:`Loading…`})}):(0,U.jsx)(k3,{label:`Loading session…`})})}):null]})})})})}var K8=.02;function q8(e){let t=e.usageByModel??{},n=e.pricing,r=gk(t,n),i=e.costUsd??(r.unpriced||Object.keys(t).length===0?void 0:r.total),a=e.totalCostUsd,o=Object.entries(t).map(([e,t])=>({model:uk(e),usage:t,tokens:fk(t),costUsd:dk(e,n)?hk(t,e,n).total:void 0,costBasis:t.costBasis})).sort((e,t)=>t.tokens-e.tokens),s=i!==void 0&&a!==void 0?a-i:void 0,c=s!==void 0&&Math.abs(s)>Math.max(.01,K8*Math.max(i??0,a??0));return{displayUsd:i??a,computedUsd:i,reportedUsd:a,breakdown:r,rows:o,unpricedShare:r.unpricedShare,showUnpricedWarning:r.unpricedShare>Lee,unknownBasisModels:pk(t),gapUsd:c?s:void 0}}function J8(e=!0){let[t,n]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(t)},[e]),t}function Y8({windows:e,now:t,className:n}){let r=J8(t===void 0),i=t??r;return(0,U.jsx)(`div`,{className:W(`flex flex-col gap-5`,n),children:e.map(e=>(0,U.jsx)(X8,{window:e,now:i},e.key))})}function X8({window:e,now:t}){let{key:n,info:r,updatedAt:i,inferredReset:a}=e,o=r.utilization??0,s=kk(e,t),c=r.resetsAt===void 0?void 0:r.resetsAt*1e3,l=_M(n),u=c===void 0?void 0:(c-t)/1e3,d=l!==void 0&&u!==void 0&&u>0&&u<l?(l-u)/l:void 0;return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-sm text-fg-1`,children:gM(n)}),(0,U.jsxs)(`span`,{className:W(`shrink-0 font-mono text-body-sm font-medium`,r.status===`rejected`?`text-danger`:s?`text-fg-4`:`text-fg-1`),children:[o.toFixed(0),`% used`]})]}),(0,U.jsxs)(`div`,{className:`relative mt-2 h-2 rounded-full bg-border`,children:[(0,U.jsx)(`div`,{className:W(`h-full rounded-full`,U2(o),s&&`opacity-40`),style:{width:`${Math.min(100,Math.max(2,o))}%`}}),d===void 0?null:(0,U.jsx)(`span`,{"aria-hidden":!0,title:`Spent evenly, usage would be here by now`,className:`absolute -top-1 h-4 w-0.5 -translate-x-1/2 rounded-full bg-fg-1`,style:{left:`${Math.min(100,Math.max(0,d*100))}%`}})]}),(0,U.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-3 text-label text-fg-4`,children:[c===void 0?null:(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(Wx,{className:`size-3`}),` Resets in `,mM(c,t)]}),r.isUsingOverage?(0,U.jsx)(`span`,{className:`text-warning`,children:`overage`}):null,r.status===`rejected`?(0,U.jsx)(`span`,{className:`text-danger`,children:`limit reached`}):null,a?(0,U.jsx)(`span`,{children:`window reset · nothing reported since`}):null,i&&!a?(0,U.jsxs)(`span`,{className:W(s&&`text-warning`),children:[s?`last reported `:``,vM(i,t)]}):null]})]})}function Z8(e){return e===`claude`?`Claude Code`:e}function Q8({label:e,value:t,tone:n}){return(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:n===`muted`?`text-label text-fg-4`:`text-label text-fg-3`,children:e}),(0,U.jsx)(`span`,{className:`font-mono text-body-sm ${n===`muted`?`text-fg-4`:`text-fg-1`}`,children:t})]})}function $8({cost:e,engine:t}){let{breakdown:n,rows:r}=e;return r.length===0?(0,U.jsx)(Q8,{label:`This session has cost`,value:uM(e.displayUsd)}):(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`This session has cost`}),(0,U.jsx)(`span`,{className:`font-mono text-body text-fg-1`,children:uM(e.displayUsd)})]}),(0,U.jsxs)(`div`,{className:`space-y-1 border-t border-border pt-2`,children:[(0,U.jsx)(Q8,{label:`input`,value:uM(n.input),tone:`muted`}),(0,U.jsx)(Q8,{label:`output`,value:uM(n.output),tone:`muted`}),(0,U.jsx)(Q8,{label:`cache write`,value:uM(n.cacheWrite),tone:`muted`}),(0,U.jsx)(Q8,{label:`cache read`,value:uM(n.cacheRead),tone:`muted`})]}),(0,U.jsx)(`div`,{className:`space-y-1 border-t border-border pt-2`,children:r.map(e=>(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`truncate text-label text-fg-4`,children:e.model}),(0,U.jsxs)(`span`,{className:`shrink-0 font-mono text-label text-fg-4`,children:[fM(e.tokens),` · `,e.costUsd===void 0?`no rate`:uM(e.costUsd)]})]},e.model))}),e.showUnpricedWarning?(0,U.jsxs)(`p`,{className:`text-label text-warning`,children:[Math.round(e.unpricedShare*100),`% of these tokens ran on a model with no bundled rate, so the total is an understatement rather than an estimate.`]}):null,e.unknownBasisModels.length>0?(0,U.jsxs)(`p`,{className:`text-label text-warning`,children:[Z8(t),` matched no rate table of its own to `,e.unknownBasisModels.join(`, `),`, so the figure it reports for those tokens is a guess rather than a rate.`]}):null,e.gapUsd===void 0?null:(0,U.jsxs)(`p`,{className:`text-label text-fg-4`,children:[Z8(t),` reports `,uM(e.reportedUsd),` for the same tokens.`]})]})}function e5({spend:e}){let{subscription:t}=e;return(0,U.jsxs)(`div`,{className:`mt-4 space-y-1 border-t border-border pt-3`,children:[(0,U.jsx)(Q8,{label:`This profile, last 7 days`,value:uM(e.weekUsd)}),(0,U.jsx)(Q8,{label:`Last 30 days`,value:uM(e.monthUsd),tone:`muted`}),t?(0,U.jsxs)(`p`,{className:`pt-1 text-label text-fg-4`,children:[t5(t.ratio),` the `,uM(t.weeklyShareUsd),` weekly share of your`,` `,uM(t.monthlyUsd),` a month. A subscription is a flat fee, so this is leverage, not a bill.`]}):null]})}function t5(e){return e>=10?`${Math.round(e)}x`:`${e.toFixed(1)}x`}function n5({rateLimits:e,subscriptionType:t,engine:n,totalCostUsd:r,costUsd:i,usageByModel:a,pricing:o,spend:s,updatedAt:c,open:l,onOpenChange:u,className:d}){let f=J8(l),p=q8({costUsd:i,totalCostUsd:r,usageByModel:a,pricing:o}),m=lk(f);return(0,U.jsx)(Fw,{open:l,onOpenChange:u,children:(0,U.jsxs)(Iw,{className:d,children:[(0,U.jsx)(Lw,{title:`Usage`,description:Z8(n),actions:t?(0,U.jsx)(fo,{variant:`accent`,className:`mt-0.5 shrink-0 capitalize`,children:t}):null}),(0,U.jsxs)(Rw,{children:[e.length===0?(0,U.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:n===`claude`?`This session reports no plan windows - API-key sessions have none, and a subscription session reports them once a turn has run.`:`Plan windows are a claude.ai subscription thing; this session runs on the ${n} engine.`}):(0,U.jsx)(Y8,{windows:e,now:f}),(0,U.jsx)(`div`,{className:`mt-5 border-t border-border pt-3`,children:(0,U.jsx)($8,{cost:p,engine:n})}),s?(0,U.jsx)(e5,{spend:s}):null,(0,U.jsx)(`p`,{className:`mt-3 text-label text-fg-4`,children:m?`${QO} ${m}`:QO}),c?(0,U.jsxs)(`p`,{className:`mt-2 text-label text-fg-4`,children:[`Updated `,vM(c,f)]}):null]})]})})}function r5({terminal:e,metrics:t,affordances:n,children:r}){return e?(0,U.jsx)(k2,{fontSize:t?.fontSize,lineHeight:t?.lineHeight,affordances:n,bleed:`1ch`,className:`term-transcript`,children:r}):(0,U.jsx)(`div`,{className:`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] flex-col gap-2`,children:r})}var i5=[`button`,`a`,`input`,`textarea`,`select`,`summary`,`img`,`[contenteditable="true"]`,`[role="button"]`,`[role="menuitem"]`,`[role="checkbox"]`,`[role="radio"]`,`[role="tab"]`].join(`,`);function a5({client:e,sessionId:t,header:n,panelSurface:r=`internal`,statusSurface:i=`internal`,statusPlacement:a=`top`,onOpenPanel:o,onVitals:s,transcriptVariant:c=`cards`,transcriptDensity:l=`comfortable`,transcriptFont:u=`sans`,affordances:d,terminalMetrics:f,scrubber:p=!1,bookmarks:m,peerMentions:h=!0,onToggleBookmark:g,reveal:_,subagents:y,shells:b,openSubagent:x,onSubagentChange:S,openShell:C,onShellChange:w,stickyPrompt:T=!1,controlsSurface:E=`internal`,onControls:D,focusComposerOnClick:O=!1,unseen:k,readOnly:A=!1,approvalPrompts:j,toolHost:M,clientTools:N,cacheTranscript:P,emptyState:F,onLinkClick:I,onOpenFile:L,fontSize:R,className:z}){let ee=f?.fontSize??R,B=f?.lineHeight??(R===void 0?void 0:Math.round(18/13*R)),V=r===`external`,te=i===`external`,ne=E===`status`&&!te,H=E===`external`||ne,[re,ie]=(0,v.useState)(void 0),[ae,oe]=(0,v.useState)(),[se,ce]=(0,v.useState)(!1),[le,ue]=(0,v.useState)(),{state:de,connection:fe,replaying:pe,protocolMismatch:me,shell:he,pricing:ge,models:_e,effectiveModel:ve,handle:ye,send:be,runShell:xe,approve:Se,deny:Ce,interrupt:we,clearContext:Te,setModel:Ee,setPermissionMode:De,reconnectNow:Oe,loadFullResult:ke,loadShellOutput:Ae,verifyShell:je,killShell:Me}=kA(e,t,{onProtocolError:ie,cacheTranscript:P}),{shellId:Ne,enterShell:Pe,leaveShell:Fe,returnReveal:Ie,shell:Le,label:Re}=L4({sessionId:t,items:de.items,session:de.session,shells:b,reveal:_,openShell:C,onShellChange:w}),ze=(0,v.useMemo)(()=>({loadOutput:Ae,verify:je,kill:Me,open:Pe}),[Ae,je,Me,Pe]);(0,v.useEffect)(()=>ie(void 0),[t]);let{subagentId:Be,enterSubagent:Ve,leaveSubagent:He,returnReveal:Ue,frameItems:We,task:Ge,fallbackLabel:Ke}=A4({sessionId:t,items:de.items,session:de.session,reveal:_,openSubagent:x,onSubagentChange:S}),qe=(0,v.useMemo)(()=>Ue&&Ie?Ue.nonce>=Ie.nonce?Ue:Ie:Ue??Ie,[Ue,Ie]),[Je,Ye]=(0,v.useState)(!1);(0,v.useEffect)(()=>{Ye(!1)},[t]);let[Xe]=(0,v.useState)(k),Ze=Je?void 0:Xe,Qe=Ze?Math.max(0,de.items.length-Ze.itemCount):0,$e=(0,v.useCallback)(e=>{V?o?.(e):oe(e)},[V,o]);(0,v.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&Oe()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[Oe]),zj(ye,M===!1?{enabled:!1}:N?{...M,clientTools:{...M?.clientTools,...N}}:M);let et=c===`terminal`,tt=de.capabilities,{usage:nt,spend:rt}=wj(e,de.session?.profile,{enabled:tt.rateLimits}),it=(0,v.useMemo)(()=>Dk({rateLimits:de.rateLimits,updatedAt:de.rateLimitsUpdatedAt},nt),[de.rateLimits,de.rateLimitsUpdatedAt,nt]),at=(0,v.useMemo)(()=>Object.keys(it).length>0?jk(it):void 0,[it]),ot=(0,v.useMemo)(()=>{let e=Object.values(it).map(e=>e.updatedAt);return e.length>0?Math.max(...e):void 0},[it]),st=(0,v.useMemo)(()=>Pee({checklist:de.checklist,subagents:y??de.session?.subagents}),[de.checklist,y,de.session?.subagents]),ct=(0,v.useMemo)(()=>{let e=tt.permissionModes,t=[];return _e.length>0&&t.push({name:`model`,description:`Switch the model for this session`,argumentHint:`<model>`,requiresArgs:!0,run:e=>{let t=e.split(/\s+/)[0];return t?(Ee(t),!0):!1}}),e.length>1&&t.push({name:`permissions`,description:`Set the permission mode (${e.join(`, `)})`,argumentHint:`<mode>`,requiresArgs:!0,run:t=>{let n=t.split(/\s+/)[0];return e.includes(n)?(De(n),!0):!1}}),tt.clearContext&&t.push({name:`clear`,description:`Clear the conversation - the session keeps running and the old one stays resumable`,run:()=>(Te(),!0)}),tt.mcpStatus&&t.push({name:`mcp`,description:`MCP servers and their status`,run:()=>($e(`mcp`),!0)}),tt.contextUsage&&t.push({name:`context`,description:`Context window usage`,run:()=>($e(`context`),!0)}),t.push({name:`status`,description:`Session details`,run:()=>($e(`info`),!0)}),tt.rateLimits&&t.push({name:`usage`,description:`Rate limits and spend`,run:()=>($e(`usage`),!0)}),tt.skillsList&&t.push({name:`skills`,description:`Browse the skills this session can use`,run:()=>($e(`skills`),!0)}),t},[tt,_e.length,$e,Te,Ee,De]),lt=(0,v.useMemo)(()=>tM(Yj({commands:tt.slashCommands?de.commands:void 0,clientCommands:ct,skills:tt.skillsList?de.skills:void 0})),[tt.slashCommands,tt.skillsList,de.commands,de.skills,ct]),ut=(0,v.useRef)(s);ut.current=s;let dt=ve??de.model,ft=(0,v.useMemo)(()=>h4(tt.permissionModes,de.session?.canBypassPermissions),[tt.permissionModes,de.session?.canBypassPermissions]);(0,v.useEffect)(()=>{ut.current?.({status:de.status,connection:fe,engine:de.engine,capabilities:de.capabilities,model:dt,models:_e,permissionMode:de.permissionMode,permissionModes:ft,skills:de.skills,composerCommands:lt,cwd:de.cwd,contextUsage:de.contextUsage,tasks:st,rateLimits:at,rateLimitsUpdatedAt:ot,itemCount:de.items.length,totalCostUsd:de.totalCostUsd})},[de.status,fe,de.engine,de.capabilities,dt,_e,de.permissionMode,ft,de.skills,lt,de.cwd,de.contextUsage,st,at,ot,de.items.length,de.totalCostUsd]);let pt=(0,v.useRef)(D);pt.current=D;let mt=(0,v.useRef)({setModel:Ee,setPermissionMode:De,interrupt:we});mt.current={setModel:Ee,setPermissionMode:De,interrupt:we};let ht=(0,v.useRef)({setModel:e=>mt.current.setModel(e),setPermissionMode:e=>mt.current.setPermissionMode(e),interrupt:()=>mt.current.interrupt(),focusComposer:()=>Ot.current?.focus(),insertComposerText:e=>Ot.current?.insertText(e)});(0,v.useEffect)(()=>{let e=pt.current;return e?.(ht.current),()=>e?.(void 0)},[t]);let gt=(0,v.useMemo)(()=>new Set(m??[]),[m]),_t=(0,v.useMemo)(()=>g?{has:e=>gt.has(e),toggle:g}:void 0,[gt,g]),vt=de.status===`running`||de.status===`awaiting_approval`,yt=de.status===`failed`||de.status===`closed`,bt=qA(e,t,{capabilities:tt,engine:de.engine}),xt=pj(e,de.cwd),St=vj(e,t,h),Ct=Cj(e,t),wt=(0,v.useCallback)((e,t)=>xt.search(e,{...t,limit:8}),[xt.search]),Tt=(0,v.useMemo)(()=>Ak(it),[it]),Et=o5(e,t,de.producedFiles),Dt=Z0(e,t),Ot=(0,v.useRef)(null),kt=(0,v.useRef)(null),At=(0,v.useRef)(null),jt=(e,t)=>{if(t.length===0){let t=eM(e,ct);if(t&&t.command.run(t.args))return}Ye(!0),At.current?.(),be(e,t)},Mt=(0,U.jsxs)(jw,{children:[(0,U.jsx)(Mw,{render:(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Session actions`,children:(0,U.jsx)(ty,{className:`size-4`})})}),(0,U.jsxs)(Nw,{children:[tt.contextUsage?(0,U.jsxs)(Pw,{onClick:()=>$e(`context`),children:[(0,U.jsx)(tv,{className:`size-3.5 text-fg-3`}),` Context`]}):null,tt.rateLimits?(0,U.jsxs)(Pw,{onClick:()=>$e(`usage`),children:[(0,U.jsx)(Oy,{className:`size-3.5 text-fg-3`}),` Usage`]}):null,(0,U.jsxs)(Pw,{onClick:()=>$e(`info`),children:[(0,U.jsx)(eb,{className:`size-3.5 text-fg-3`}),` Session info`]}),tt.mcpStatus?(0,U.jsxs)(Pw,{onClick:()=>$e(`mcp`),children:[(0,U.jsx)(Sx,{className:`size-3.5 text-fg-3`}),` MCP servers`]}):null,tt.skillsList?(0,U.jsxs)(Pw,{onClick:()=>$e(`skills`),children:[(0,U.jsx)(ES,{className:`size-3.5 text-fg-3`}),` Skills`]}):null,xt.available?(0,U.jsxs)(Pw,{onClick:()=>$e(`files`),children:[(0,U.jsx)(by,{className:`size-3.5 text-fg-3`}),` Project files`]}):null]})]}),Nt=V?null:Mt,Pt=typeof n==`function`,Ft=(0,U.jsxs)(U.Fragment,{children:[_e.length?(0,U.jsx)(f4,{models:_e,model:ve,onModelChange:Ee,disabled:yt,className:ne?`h-5`:void 0}):null,de.permissionMode?(0,U.jsx)(g4,{mode:de.permissionMode,onModeChange:De,modes:tt.permissionModes,canBypass:de.session?.canBypassPermissions,disabled:yt,className:ne?`h-5`:void 0}):null]}),It=te?null:(0,U.jsx)(f3,{state:de,rateLimits:at,connection:fe,placement:a,controls:ne&&!A?Ft:void 0,onOpenStatus:V&&!o?void 0:()=>$e(`info`),onOpenContext:V&&!o?void 0:()=>$e(`context`),onOpenUsage:V&&!o?void 0:()=>$e(`usage`),tasks:st,onOpenTasks:V&&!o?void 0:()=>$e(`tasks`),actions:Pt?void 0:Nt}),Lt=(0,v.useMemo)(()=>L?{cwd:de.cwd,open:L}:void 0,[L,de.cwd]),Rt=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!I)return;let e=Rt.current;if(!e)return;let t=e=>{let t=e.target?.closest?.(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&I(n)&&(e.preventDefault(),e.stopPropagation())};return e.addEventListener(`click`,t,!0),()=>e.removeEventListener(`click`,t,!0)},[I]),(0,U.jsx)(rM,{value:c,children:(0,U.jsx)(oM,{value:l,children:(0,U.jsx)(Y1,{value:Lt,children:(0,U.jsx)(z0,{value:ke,children:(0,U.jsx)(a2,{value:ze,children:(0,U.jsx)(H0,{value:de.toolTitles,children:(0,U.jsx)(K0,{value:Dt,children:(0,U.jsxs)(`div`,{ref:Rt,"data-slot":`session-panel`,"data-agent-font":u,onClick:e=>{O&&!A&&(e.target?.closest(i5)||window.getSelection()?.isCollapsed!==!1&&Ot.current?.focus())},className:W(`flex h-full min-h-0 flex-col overflow-hidden bg-bg`,z),style:R===void 0?void 0:{"--wd-font-size":`${Math.round(R)}px`},children:[Pt?n({actions:Nt}):n,a===`top`?It:null,me===void 0?null:(0,U.jsxs)(c5,{level:`warning`,children:[`Server speaks protocol v`,me,`, this build renders v`,1,`. Some events may not render.`]}),re?(0,U.jsx)(c5,{level:`error`,onDismiss:()=>ie(void 0),children:re}):null,Ne===void 0?null:(0,U.jsx)(j4,{shell:Le,label:Re,onBack:Fe,onKill:()=>void Me(Ne),terminal:et,fontSize:ee,lineHeight:B}),Ne===void 0&&Be!==void 0?(0,U.jsx)(b4,{task:Ge,items:We,label:Ke,onBack:He,terminal:et,fontSize:ee,lineHeight:B}):null,Ne===void 0?(0,U.jsx)(sN,{value:_t,children:(0,U.jsx)(G8,{state:de,fileUrl:t?n=>e.sessionFileUrl(t,n):void 0,attachmentUrl:t?n=>e.attachmentUrl(t,n):void 0,canBrowseFiles:xt.available,sessionNames:St.names,hostImage:Et,variant:c,density:l,fontSize:ee,lineHeight:B,affordances:d,stickyPrompt:T,scrubber:p,bookmarks:m,replaying:pe,catchUp:Ze&&Qe>0?{from:Ze.itemCount,since:Ze.since}:void 0,reveal:le??qe??_,frame:Be===void 0?void 0:{parentToolUseId:Be},onOpenSubagent:Ve,emptyState:F,jumpToRecapRef:kt,repinRef:At},Be??`session`)}):(0,U.jsx)(M4,{handle:ye,shellId:Ne,fontSize:ee},Ne),Ze&&Qe>0&&!pe&&Be===void 0&&Ne===void 0?(0,U.jsx)(`div`,{className:`px-3 pb-1`,children:(0,U.jsxs)(`div`,{"data-slot":`catch-up`,className:`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] items-center gap-2 text-label text-fg-3`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:W(`select-none`,et?`text-fg-3`:`text-accent`),children:`※`}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[Qe,` new `,Qe===1?`row`:`rows`,Ze.since===void 0?``:` since you were last here`]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>kt.current?.(),className:`shrink-0 underline-offset-2 hover:text-fg-1 hover:underline`,children:`jump`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>Ye(!0),className:`shrink-0 underline-offset-2 hover:text-fg-1 hover:underline`,children:`dismiss`})]})}):null,!A&&tt.interactiveApprovals&&de.pendingApprovals.length>0?(0,U.jsx)(`div`,{className:W(et?`pb-2`:`px-3 pb-2`),children:(0,U.jsx)(r5,{terminal:et,metrics:{fontSize:ee,lineHeight:B},affordances:d,children:de.pendingApprovals.map(e=>{let t=j?.[e.toolName];if(t)return(0,U.jsx)(t,{request:e,onApprove:Se,onDeny:Ce},e.id);let n=e.toolName===`AskUserQuestion`&&Lk(e.input).length>0;return et?n?(0,U.jsx)(t3,{request:e,onAnswer:Se,onDismiss:e=>Ce(e,`Question dismissed by user`)},e.id):(0,U.jsx)(Q4,{request:e,onApprove:Se,onDeny:Ce},e.id):n?(0,U.jsx)(V4,{request:e,onAnswer:Se,onDismiss:e=>Ce(e,`Question dismissed by user`)},e.id):(0,U.jsx)(y4,{request:e,onApprove:Se,onDeny:Ce},e.id)})})}):null,A||Be!==void 0||Ne!==void 0?null:(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(M2,{ref:Ot,onSend:jt,onInterrupt:we,busy:vt,disabled:yt||!t,commands:tt.slashCommands?de.commands:void 0,skills:tt.skillsList?de.skills:void 0,clientCommands:ct,attachments:bt,draft:Ct,onSearchFiles:xt.available?wt:void 0,peers:St.peers,onShellCommand:he?xe:void 0,layout:H?`inline`:`stacked`,toolbar:H?void 0:Ft,fontSize:ee,lineHeight:B,affordances:d})}),a===`bottom`?It:null,V?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i3,{state:de,client:e,sessionId:t,open:ae===`info`,onOpenChange:e=>oe(e?`info`:void 0)}),(0,U.jsx)(W2,{usage:de.contextUsage,engine:de.engine??`claude`,open:ae===`context`,onOpenChange:e=>oe(e?`context`:void 0)}),(0,U.jsx)(n5,{rateLimits:Tt,subscriptionType:de.subscriptionType,engine:de.engine??`claude`,totalCostUsd:de.totalCostUsd,costUsd:de.costUsd,usageByModel:de.usageByModel,pricing:ge,spend:rt,updatedAt:ot,open:ae===`usage`,onOpenChange:e=>oe(e?`usage`:void 0)}),(0,U.jsx)(Q2,{client:e,sessionId:t,canManageServers:tt.mcpServerActions,open:ae===`mcp`,onOpenChange:e=>oe(e?`mcp`:void 0)}),(0,U.jsx)(J2,{tasks:st,showCompleted:se,onShowCompletedChange:ce,onSelectTask:e=>{e.toolUseId&&ue({toolUseId:e.toolUseId,nonce:Date.now()})},open:ae===`tasks`,onOpenChange:e=>oe(e?`tasks`:void 0)}),(0,U.jsx)(i4,{skills:de.skills,open:ae===`skills`,onOpenChange:e=>oe(e?`skills`:void 0),onUse:e=>Ot.current?.insertText(Jj(e))}),(0,U.jsx)(X2,{client:e,cwd:de.cwd,open:ae===`files`,onOpenChange:e=>oe(e?`files`:void 0)})]})]})})})})})})})})}function o5(e,t,n){let r=(0,v.useRef)(new Map),i=(0,v.useRef)([]);return(0,v.useEffect)(()=>()=>{for(let e of i.current)URL.revokeObjectURL(e);i.current=[]},[]),(0,v.useCallback)(a=>{let o=n?.[a],s=o?`produced:${o.fileId}`:`fs:${a}`,c=r.current.get(s);if(c)return c;let l=o&&t?e.readProducedFile(t,o.fileId).then(e=>{if(e.size===0)return;let t=URL.createObjectURL(e);return i.current.push(t),t}).catch(()=>void 0):e.readHostFile(a).then(e=>{if(e.encoding!==`base64`)return;let t=s5[a.slice(a.lastIndexOf(`.`)+1).toLowerCase()];return t?`data:${t};base64,${e.content}`:void 0}).catch(()=>void 0);return r.current.set(s,l),l},[e,t,n])}var s5={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`};function c5({level:e,onDismiss:t,children:n}){return(0,U.jsx)(`div`,{className:`px-3 pt-2`,children:(0,U.jsxs)(`div`,{role:`alert`,className:W(`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] items-start gap-2 rounded-md border px-3 py-2 text-body-sm`,e===`error`?`border-danger/40 bg-danger-bg text-danger`:`border-warning/40 bg-warning-bg text-warning`),children:[(0,U.jsx)(oC,{className:`mt-0.5 size-3.5 shrink-0`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:n}),t?(0,U.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss`,className:`shrink-0 opacity-70 transition-opacity hover:opacity-100`,children:(0,U.jsx)(DC,{className:`size-3.5`})}):null]})})}var l5=`[^\\s:'"\`()\\[\\]{}<>|]+`,u5=RegExp(`(?:^|[\\s'"\`([{<@,])((?:\\.\\.?)?(?:/${l5})+|[^\\s:'"\`()\\[\\]{}<>|@,]+(?:/${l5})+)(?::(\\d+))?`),d5=/^([\w.@-]+\.[A-Za-z0-9]{1,10})(?::(\d+))?$/,f5=/[.,;:!?)\]}'"`]+$/,p5=/\.[A-Za-z0-9]{1,10}$/;function m5(e,t=!1){let n=e??``,r=u5.exec(n);if(!r)return t?h5(n):void 0;let i=r[1].replace(f5,``);if(i.includes(`/`)&&!i.endsWith(`/`)&&(i.startsWith(`/`)||i.startsWith(`./`)||i.startsWith(`../`)||p5.test(i)))return{path:i,line:r[2]?Number(r[2]):void 0,length:i.length+(r[2]?r[2].length+1:0)}}function h5(e){let t=d5.exec(e.trim());if(!t)return;let n=t[2]?Number(t[2]):void 0;return{path:t[1],line:n,length:t[0].length}}var g5=`wd-path-link`,_5=.6;function v5(e){if(!e)return;let t=e.closest(`code`)!==null,n=e.textContent?.trim()??``,r=m5(n,t);if(r&&!(!t&&r.length<n.length*_5))return{path:r.path,line:r.line}}function y5({container:e,onOpen:t,enabled:n=!0,ignore:r}){(0,v.useEffect)(()=>{let i=e.current;if(!i||!n)return;let a=e=>r!==void 0&&e?.closest(r)!==null&&e!==void 0,o,s=()=>{o?.classList.remove(g5),o=void 0},c=e=>{if(!e.metaKey&&!e.ctrlKey)return;let n=e.target instanceof HTMLElement?e.target:void 0;if(a(n))return;let r=v5(n);r&&(e.preventDefault(),e.stopPropagation(),s(),t(r))},l=e=>{if(!e.metaKey&&!e.ctrlKey)return s();let t=e.target instanceof HTMLElement?e.target:void 0;t!==o&&(s(),t&&!a(t)&&v5(t)&&(o=t,t.classList.add(g5)))},u=e=>{!e.metaKey&&!e.ctrlKey&&s()};return i.addEventListener(`click`,c,!0),i.addEventListener(`mousemove`,l),document.addEventListener(`keydown`,u),document.addEventListener(`keyup`,u),window.addEventListener(`blur`,s),()=>{s(),i.removeEventListener(`click`,c,!0),i.removeEventListener(`mousemove`,l),document.removeEventListener(`keydown`,u),document.removeEventListener(`keyup`,u),window.removeEventListener(`blur`,s)}},[e,t,n,r])}function b5(e,t){return G1(e,t)?.path??e}var x5={anchor:s_,atom:__,beaker:x_,bike:T_,binary:D_,blocks:k_,bot:j_,box:N_,brain:F_,briefcase:L_,brush:z_,bug:V_,"building-2":U_,cable:G_,camera:Y_,car:Z_,cat:$_,"circuit-board":Cv,cloud:kv,code:jv,coffee:Nv,cog:Fv,compass:Lv,container:zv,cpu:Uv,"credit-card":Gv,database:qv,diamond:Yv,dog:Zv,feather:iee,film:see,flame:fy,"flask-conical":my,folder:Sy,"gamepad-2":Ey,gauge:Oy,gem:Ay,ghost:My,gift:Py,"git-branch":Iy,globe:Ry,"graduation-cap":By,hammer:Hy,hexagon:Ky,house:Jy,image:Qy,key:nb,landmark:ib,laptop:ob,layers:cb,leaf:ub,library:fb,lightbulb:mb,lock:wb,mail:Eb,map:Ob,"message-circle":Mb,mic:Ib,monitor:Rb,moon:Bb,mountain:Hb,music:Wb,network:Kb,newspaper:Jb,notebook:Xb,orbit:Qb,package:ex,palette:nx,"pen-tool":ux,phone:gx,"piggy-bank":vx,plane:bx,plug:Sx,puzzle:Ax,radar:Mx,radio:Px,receipt:Ix,rocket:Bx,ruler:Jx,satellite:Xx,scale:eS,scissors:nS,server:cS,shield:mS,ship:gS,"shopping-cart":vS,signal:bS,smartphone:wS,sparkles:ES,sprout:OS,square:RS,star:BS,sun:HS,table:WS,tag:KS,target:XS,telescope:JS,terminal:QS,"test-tube":eC,"tree-pine":iC,trophy:cC,truck:uC,umbrella:fC,users:gC,wallet:vC,wand:cee,waves:lee,webhook:uee,wifi:fee,wrench:TC,zap:kC};function S5({icon:e,src:t,name:n,className:r}){if(!e)return null;if(e.type===`image`)return t?(0,U.jsx)(`img`,{src:t,alt:``,"aria-hidden":!0,title:n,className:W(`inline-block size-3 shrink-0 object-contain`,r)}):null;let i=x5[e.name]??Sy;return(0,U.jsx)(i,{className:W(`inline-block size-3 shrink-0`,r)})}function C5({usage:e,engine:t,size:n=11,className:r}){if(e===void 0)return null;let i=B2(t),a=`Context ${e.percentage.toFixed(0)}% · ${fM(e.totalTokens)} / ${fM(e.maxTokens)}`,o=W(`shrink-0 leading-none`,H2(e.percentage),r),s=(0,U.jsx)(XT,{value:e.percentage,size:n,strokeWidth:2});return i?(0,U.jsx)(uT,{render:(0,U.jsx)(`span`,{className:o}),content:(0,U.jsxs)(`div`,{className:`flex max-w-64 flex-col gap-1 py-0.5`,children:[(0,U.jsx)(`span`,{className:`font-mono text-fg-2`,children:a}),(0,U.jsx)(`span`,{className:`text-fg-3`,children:i.summary}),(0,U.jsx)(`span`,{className:`text-fg-3`,children:i.hint})]}),children:s}):(0,U.jsx)(`span`,{title:a,className:o,children:s})}var w5={claude:{title:`Claude`,d:`M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z`},codex:{title:`OpenAI`,d:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`},gemini:{title:`Gemini`,d:`M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z`},deepseek:{title:`DeepSeek`,d:`M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z`},moonshot:{title:`Moonshot`,d:`M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z`}};function T5(e,t){if(e===`claude`)return`claude`;if(e===`codex`)return`codex`;let n=t?.toLowerCase()??``;if(n){if(n.includes(`gemini`))return`gemini`;if(n.includes(`deepseek`))return`deepseek`;if(n.includes(`moonshot`)||n.includes(`kimi`))return`moonshot`;if(n.includes(`claude`))return`claude`;if(n.startsWith(`gpt`)||n.startsWith(`o1`)||n.startsWith(`o3`)||n.includes(`openai`))return`codex`}}var E5={claude:`text-vendor-claude`,codex:`text-vendor-openai`},D5={claude:`text-vendor-claude`};function O5(e,t){return E5[T5(e,t)??``]??`text-fg-3`}function k5(e,t){return D5[T5(e,t)??``]??`text-fg-3`}function A5({engine:e,model:t,className:n}){let r=w5[T5(e,t)??``];return r?(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,fillRule:`evenodd`,role:`img`,"aria-label":r.title,className:W(`size-3 shrink-0 text-fg-3`,n),children:[(0,U.jsx)(`title`,{children:r.title}),(0,U.jsx)(`path`,{d:r.d})]}):(0,U.jsx)(`span`,{"aria-hidden":!0,title:e,className:W(`shrink-0 text-fg-3`,n),children:`·`})}function j5({row:e,className:t}){let{info:n}=e,r=W(`size-4 shrink-0`,t);if(e.state===`attention`)return(0,U.jsx)(C_,{className:W(r,`animate-pulse text-warning`)});if(e.state===`working`)return(0,U.jsx)(GT,{className:W(r,`text-info`)});switch(n.status){case`failed`:return(0,U.jsx)(pv,{className:W(r,`text-danger`)});case`closed`:return(0,U.jsx)(yv,{className:W(r,`text-fg-4`)});case`parked`:return(0,U.jsx)(_v,{className:W(r,`text-fg-3`)});default:return(0,U.jsx)(Bb,{className:W(r,`text-fg-4`)})}}function M5(e,t,n=`all`,r){let i=EO(e,n).filter(DO).map(e=>({key:e.toolUseId,kind:`agent`,label:OO(e),noun:`agent`,state:P5(e.status),detail:e.toolCount>0?String(e.toolCount):void 0,title:`${OO(e)} · ${e.toolCount} tool${e.toolCount===1?``:`s`}`,onSelect:()=>t(e.toolUseId)}));return r===void 0?i:[...i,...RO(e,r.now).map(e=>N5(e,r))]}function N5(e,t){let n=YM(e),r=e.status===`running`;return{key:e.id,kind:`shell`,label:WM(e),noun:`shell`,state:JM(e)?`failed`:r?`running`:`done`,detail:r?void 0:n,title:`${GM(e)} · ${n}`,onSelect:()=>t.onSelect(e.id),onKill:r&&t.onKill?()=>t.onKill?.(e.id):void 0}}function P5(e){switch(e){case`running`:return`running`;case`failed`:return`failed`;default:return`done`}}function F5({step:e,active:t=!1,onSelect:n}){let r=e.state===`failed`?`text-danger`:e.kind===`shell`?`text-[var(--wd-shell-accent)]`:`text-success`;return(0,U.jsxs)(`div`,{className:W(`flex w-full items-center rounded-[4px] pr-1.5`,t?`bg-row-selected`:`hover:bg-row-active`,r),children:[(0,U.jsxs)(`button`,{type:`button`,title:e.title,"aria-current":t||void 0,onClick:e=>{e.stopPropagation(),n()},className:`flex min-w-0 flex-1 items-center gap-1.5 py-1 pr-1 pl-3.5 text-left text-micro outline-none`,children:[(0,U.jsx)(I5,{step:e}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.detail?(0,U.jsx)(`span`,{className:`shrink-0 tabular-nums text-fg-4`,children:e.detail}):null,(0,U.jsx)(p_,{className:`size-3.5 shrink-0 text-fg-4`})]}),e.onKill?(0,U.jsx)(`button`,{type:`button`,"aria-label":`Kill ${e.label}`,title:`Kill this shell`,onClick:t=>{t.stopPropagation(),e.onKill?.()},className:`shrink-0 px-1 text-micro leading-none text-fg-4 outline-none hover:text-danger`,children:`✕`}):null]})}function I5({step:e}){if(e.kind===`shell`)return(0,U.jsx)(`span`,{className:`w-[11px] shrink-0 text-center leading-none`,children:`$`});switch(e.state){case`running`:return(0,U.jsx)(GT,{className:`size-[11px] shrink-0`});case`failed`:return(0,U.jsx)(pv,{className:`size-[11px] shrink-0`});default:return(0,U.jsx)(rv,{className:`size-[11px] shrink-0`})}}var L5={meta:!1,ctrl:!1,alt:!1};function R5({row:e,active:t=!1,activeStepKey:n,showGateway:r,showProject:i=!0,projectIcons:a,subagents:o=`active`,onSelect:s,onSelectSubagent:c,onSelectShell:l,onKillShell:u,now:d,onRename:f,renameOn:p=`doubleClick`,editing:m,onEditingChange:h,actions:g,className:_}){let{info:y}=e,[b,x]=(0,v.useState)(!1),S=m??b,C=e=>{x(e),h?.(e)},w=y.engine??`claude`,T=i?PO(e):IO(e),E=i?FO(e):void 0,D=i?y.project?.icon:void 0,O=D?.type===`image`?a?.[D.hash]:void 0,k=uM(y.costUsd??y.totalCostUsd),A=[r?e.hostName:void 0,y.profile?`@${y.profile}`:void 0,k===`-`?void 0:k].filter(e=>!!e),j=xM(y.model),M=[];j&&M.push((0,U.jsx)(`span`,{className:k5(w,y.model),children:j},`model`)),T!==void 0&&M.push((0,U.jsxs)(`span`,{title:E,children:[(0,U.jsx)(S5,{icon:D,src:O,name:E,className:`mr-1.5 size-4 align-[-0.3em]`}),T]},`project`));for(let e of A)M.push((0,U.jsx)(`span`,{children:e},e));let N=M5(y,e=>c?c(e):s?.(L5),o,{now:d??Date.now(),onSelect:e=>l?l(e):s?.(L5),onKill:u}),P=N.some(e=>e.key===n);return(0,U.jsxs)(`div`,{"data-slot":`session-item`,"data-active":t||void 0,role:`button`,tabIndex:0,onClick:e=>{e.detail>1||S||s?.({meta:e.metaKey,ctrl:e.ctrlKey,alt:e.altKey})},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s?.({meta:e.metaKey,ctrl:e.ctrlKey,alt:e.altKey}))},className:W(`group flex w-full cursor-pointer flex-col p-1 text-left outline-none`,`rounded-[4px] transition-colors focus-visible:ring-2 focus-visible:ring-ring`,P?`bg-row-selected-weak`:t?`bg-row-selected`:`hover:bg-row-hover`,_),children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 py-0.5 pr-0.5 pl-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex h-5 items-center gap-1.5 overflow-hidden`,children:[(0,U.jsx)(z5,{children:(0,U.jsx)(j5,{row:e})}),S&&f?(0,U.jsx)(B5,{initial:y.title??``,onCommit:e=>{C(!1),e!==(y.title??``)&&f(e)},onCancel:()=>C(!1)}):(0,U.jsx)(`span`,{onDoubleClick:f&&p===`doubleClick`?e=>{e.stopPropagation(),C(!0)}:void 0,className:`min-w-0 flex-1 truncate text-body-sm font-medium tracking-[-0.005em] text-fg-1`,children:MO(y)}),e.unseen>0?(0,U.jsx)(`span`,{title:`${e.unseen} new message${e.unseen===1?``:`s`}`,className:W(`flex h-4 min-w-6 shrink-0 items-center justify-center rounded-full px-2`,`text-[0.75rem] leading-none tracking-[-0.005em] tabular-nums`,e.state===`working`?`bg-badge text-badge-fg`:`bg-accent text-accent-fg`),children:e.unseen}):null,(0,U.jsx)(C5,{usage:y.contextUsage,engine:w,size:16,className:`p-0.5`})]}),(0,U.jsxs)(`div`,{className:`flex h-5 items-center gap-1.5 overflow-hidden text-body-sm tracking-[-0.005em]`,children:[(0,U.jsx)(z5,{children:(0,U.jsx)(A5,{engine:w,model:y.model,className:W(`size-4`,O5(w,y.model))})}),(0,U.jsx)(`span`,{className:`min-w-0 truncate text-fg-4`,children:M.map((e,t)=>(0,U.jsxs)(v.Fragment,{children:[t>0?` · `:``,e]},t))}),(0,U.jsxs)(`span`,{className:`shrink-0 text-fg-4`,children:[M.length>0?`· `:``,hM(y.lastActivityAt??y.createdAt)]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1`}),g]})]}),N.length>0?(0,U.jsx)(`div`,{className:`flex flex-col`,children:N.map(e=>(0,U.jsx)(F5,{step:e,active:e.key===n,onSelect:e.onSelect},e.key))}):null]})}function z5({children:e}){return(0,U.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:e})}function B5({initial:e,onCommit:t,onCancel:n}){let[r,i]=(0,v.useState)(e),a=(0,v.useRef)(null);return(0,v.useEffect)(()=>{a.current?.focus(),a.current?.select()},[]),(0,v.useEffect)(()=>{let e=()=>{a.current?.focus(),a.current?.select()};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[]),(0,U.jsx)(`input`,{ref:a,value:r,spellCheck:!1,placeholder:`Session name`,"aria-label":`Session name`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),onChange:e=>i(e.target.value),onBlur:()=>{document.hasFocus()&&t(r.trim())},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?t(r.trim()):e.key===`Escape`&&n()},className:W(`-my-0.5 min-w-0 flex-1 rounded-sm border border-ring bg-bg px-1 py-px`,`text-body-sm leading-5 text-fg-1 outline-none`)})}function V5(e){return W(`px-2 py-1.5 hover:bg-row-hover`,e?`mr-1 ml-0 rounded-r-md border-l-4 border-l-accent`:`mx-1 rounded-md`)}function H5({rows:e,config:t,onConfigChange:n,scope:r,activeId:i,activeSubagentId:a,activeShellId:o,now:s,onSelect:c,onDelete:l,onRename:u,onClearContext:d,onSelectSubagent:f,onSelectShell:p,onKillShell:m,emptyState:h,showControls:g=!0,projectIcons:_,className:y}){let b=(0,v.useMemo)(()=>WO(e,t,r),[e,t,r]),x=(0,v.useMemo)(()=>Oee(b,t),[b,t]),S=kee(t,r,b.length,e.length),C=(0,v.useMemo)(()=>AO(e),[e]),w=(0,v.useMemo)(()=>jO(e),[e]),T=(0,v.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.hostId,n.hostName);return[...t].map(([e,t])=>({id:e,name:t}))},[e]),E=e=>n({...t,...e});return(0,U.jsxs)(`div`,{"data-slot":`session-browser`,className:W(`flex flex-col gap-3`,y),children:[(0,U.jsxs)(`div`,{className:W(`flex flex-col gap-1.5 px-2`,!g&&`hidden`),children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(oS,{className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-fg-4`}),(0,U.jsx)(_o,{value:t.search,onChange:e=>E({search:e.target.value}),placeholder:`Search sessions`,"aria-label":`Search sessions`,className:`pl-8`})]}),(0,U.jsx)(K5,{label:`State`,children:(0,U.jsx)(q5,{label:`State`,value:t.states,options:SO.map(e=>({value:e,label:CO[e]})),onChange:e=>E({states:e})})}),C.length>1?(0,U.jsx)(K5,{label:`Engine`,children:(0,U.jsx)(q5,{label:`Engine`,value:t.adapters,options:C.map(e=>({value:e,label:e})),onChange:e=>E({adapters:e})})}):null,T.length>1?(0,U.jsx)(K5,{label:`Gateway`,children:(0,U.jsx)(q5,{label:`Gateway`,value:t.gateways,options:T.map(e=>({value:e.id,label:e.name})),onChange:e=>E({gateways:e})})}):null,w.length>1?(0,U.jsx)(K5,{label:`Project`,children:(0,U.jsx)(q5,{label:`Project`,value:t.projects??[],options:w.map(e=>({value:e.key,label:e.label})),onChange:e=>E({projects:e})})}):null,(0,U.jsx)(K5,{label:`Group`,children:(0,U.jsx)(J5,{label:`Group`,value:t.groupBy,options:[{value:`none`,label:`No grouping`},{value:`state`,label:`By state`},{value:`adapter`,label:`By engine`},...w.length>1?[{value:`project`,label:`By project`}]:[],...T.length>1?[{value:`gateway`,label:`By gateway`}]:[]],onChange:e=>E({groupBy:e})})}),(0,U.jsx)(K5,{label:`Sub-agents`,children:(0,U.jsx)(J5,{label:`Sub-agents`,value:t.subagents,options:[{value:`active`,label:`Hide completed`},{value:`all`,label:`Show all`},{value:`none`,label:`Hide all`}],onChange:e=>E({subagents:e})})}),(0,U.jsx)(K5,{label:`Sort`,children:(0,U.jsx)(J5,{label:`Sort`,value:t.sortBy,options:[{value:`recent`,label:`Recent`},{value:`name`,label:`Name`},{value:`state`,label:`State`},...w.length>1?[{value:`project`,label:`Project`}]:[],...T.length>1?[{value:`gateway`,label:`Gateway`}]:[]],onChange:e=>E({sortBy:e})})})]}),S?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 text-label text-fg-4`,children:[(0,U.jsxs)(`span`,{children:[S.shown,` of `,S.total,S.causes.length?` · ${S.causes.join(` · `)}`:null]}),(0,U.jsx)(`button`,{type:`button`,className:`text-fg-3 underline underline-offset-2 hover:text-fg-1`,onClick:()=>n(YO(t)),children:`Show all`})]}):null,e.length===0?h??(0,U.jsx)(JT,{icon:(0,U.jsx)(cb,{}),title:`No sessions yet`}):b.length===0?Aee(t)?(0,U.jsx)(JT,{icon:(0,U.jsx)(iS,{}),title:`No matches`,description:`No session matches the current search and filters.`,action:`Clear filters`,onAction:()=>n(YO(t))}):(0,U.jsx)(JT,{icon:(0,U.jsx)(cb,{}),title:`Nothing here`,description:`No session to show.`}):(0,U.jsx)(`div`,{className:`flex flex-col gap-4 px-1`,children:x.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t.groupBy!==`none`&&e.label?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-label font-medium text-fg-4`,children:[t.groupBy===`project`?(0,U.jsx)(S5,{icon:e.rows[0]?.info.project?.icon,src:U5(e.rows[0],_),name:e.label}):null,(0,U.jsx)(`span`,{className:`uppercase tracking-wide`,children:e.label}),(0,U.jsx)(`span`,{className:`text-fg-4/70`,children:e.rows.length})]}):null,e.rows.map(e=>(0,U.jsx)(W5,{row:e,active:e.info.id===i,activeSubagentId:a,activeShellId:o,now:s,showGateway:T.length>1&&t.groupBy!==`gateway`,showProject:t.groupBy!==`project`,subagents:t.subagents,projectIcons:_,onSelect:c,onDelete:l,onRename:u,onClearContext:d,onSelectSubagent:f,onSelectShell:p,onKillShell:m},`${e.hostId}:${e.info.id}`))]},e.key))})]})}function U5(e,t){let n=e?.info.project?.icon;return n?.type===`image`?t?.[n.hash]:void 0}function W5({row:e,active:t,activeSubagentId:n,activeShellId:r,now:i,showGateway:a,showProject:o=!0,subagents:s,projectIcons:c,onSelect:l,onDelete:u,onRename:d,onClearContext:f,onSelectSubagent:p,onSelectShell:m,onKillShell:h}){let{info:g}=e,[_,y]=(0,v.useState)(!1);return(0,U.jsx)(R5,{row:e,active:t===!0,activeStepKey:r??n,now:i,showGateway:a,showProject:o,subagents:s,projectIcons:c,onSelect:()=>l?.(e),onSelectSubagent:p?t=>p(e,t):void 0,onSelectShell:m?t=>m(e,t):void 0,onKillShell:h?t=>h(e,t):void 0,onRename:d?t=>d(e,t):void 0,renameOn:`external`,editing:_,onEditingChange:y,actions:(0,U.jsxs)(U.Fragment,{children:[d&&!_?(0,U.jsx)(G5,{label:`Rename session`,onClick:()=>y(!0),children:(0,U.jsx)(mx,{className:`size-3 text-fg-3`})}):null,f&&g.capabilities?.clearContext?(0,U.jsx)(G5,{label:`Clear context`,title:`Clear the conversation - the session keeps running and the old conversation stays resumable`,onClick:()=>f(e),children:(0,U.jsx)(ree,{className:`size-3 text-fg-3`})}):null,u?(0,U.jsx)(G5,{label:`Close session`,onClick:()=>u(e),children:(0,U.jsx)(nC,{className:`size-3 text-fg-3`})}):null]})})}function G5({label:e,title:t,onClick:n,children:r}){return(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":e,title:t??e,className:`size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),n()},children:r})}function K5({label:e,children:t}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:`w-14 shrink-0 truncate text-label text-fg-3`,children:e}),(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:t})]})}function q5({label:e,value:t,options:n,onChange:r}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsxs)(jC,{multiple:!0,value:t,onValueChange:e=>r(e),children:[(0,U.jsx)(PC,{"aria-label":e,className:`min-w-0 flex-1`,children:(0,U.jsx)(MC,{children:t.length===0?`All`:t.length===1?n.find(e=>e.value===t[0])?.label??`All`:`${t.length} selected`})}),(0,U.jsx)(FC,{children:n.map(e=>(0,U.jsx)(IC,{value:e.value,children:(0,U.jsx)(NC,{children:e.label})},e.value))})]}),t.length>0?(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Clear ${e}`,onClick:()=>r([]),children:(0,U.jsx)(DC,{className:`size-3 text-fg-4`})}):null]})}function J5({label:e,value:t,options:n,onChange:r}){return(0,U.jsxs)(jC,{value:t,onValueChange:e=>r(e),children:[(0,U.jsx)(PC,{"aria-label":e,className:`w-full min-w-0`,children:(0,U.jsx)(MC,{children:n.find(e=>e.value===t)?.label??e})}),(0,U.jsx)(FC,{children:n.map(e=>(0,U.jsx)(IC,{value:e.value,children:(0,U.jsx)(NC,{children:e.label})},e.value))})]})}var Y5=[`all`,`active`,`none`],X5={all:{label:`All sub-agents`,hint:`Showing every sub-agent`},active:{label:`Hide completed`,hint:`Showing running and failed sub-agents`},none:{label:`Hide sub-agents`,hint:`Sub-agents hidden`}},Z5=.34;function Q5({value:e,className:t}){return(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:t,children:[(0,U.jsx)(`path`,{d:`M3 5h18`}),(0,U.jsx)(`path`,{d:`M9 12h12`,opacity:e===`none`?Z5:1}),(0,U.jsx)(`path`,{d:`M9 19h12`,opacity:e===`all`?1:Z5})]})}function $5({value:e,onChange:t,className:n}){let r=X5[e];return(0,U.jsxs)(jw,{children:[(0,U.jsx)(Mw,{render:(0,U.jsxs)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Sub-agents: ${r.label}`,title:r.hint,className:W(`w-9 gap-0.5`,n),children:[(0,U.jsx)(Q5,{value:e,className:`size-4`}),(0,U.jsx)(av,{className:`size-2.5 text-fg-4`})]})}),(0,U.jsx)(Nw,{className:`min-w-44`,children:Y5.map(n=>(0,U.jsxs)(Pw,{onClick:()=>t(n),children:[(0,U.jsx)(Q5,{value:n,className:`size-4 shrink-0 text-fg-3`}),(0,U.jsx)(`span`,{className:`flex-1`,children:X5[n].label}),n===e?(0,U.jsx)(rv,{className:`size-3.5 shrink-0 text-accent`}):null]},n))})]})}function e7(){let[e,t]=(0,v.useState)(T());return(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Toggle theme`,onClick:()=>t(O()),children:e===`dark`?(0,U.jsx)(HS,{className:`size-4`}):(0,U.jsx)(Bb,{className:`size-4`})})}var t7=[{value:`default`,displayName:`Default (recommended)`,description:`The CLI's configured default model`},{value:`fable`,displayName:`Fable`,description:`Fable 5.1 · Most capable for your hardest and longest-running tasks`},{value:`opus`,displayName:`Opus`,description:`Opus 5 with 1M context · Best for everyday, complex tasks`},{value:`sonnet`,displayName:`Sonnet`,description:`Sonnet 5 · Efficient for routine tasks`},{value:`haiku`,displayName:`Haiku`,description:`Haiku 4.5 · Fastest for quick answers`}],n7=`workerdeck.transcript-density`;function r7(){return b(n7)===`compact`?`compact`:`comfortable`}function i7(e){x(n7,e)}var a7=`workerdeck.transcript-variant`;function o7(){let e=b(a7);return e===`terminal`||e===`lines`?`terminal`:`cards`}function s7(e){x(a7,e)}var c7=`workerdeck.transcript-font`;function l7(){return b(c7)===`mono`?`mono`:`sans`}function u7(e){x(c7,e)}var d7=`workerdeck.font-size`;function f7(){let e=b(d7);if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>=8&&t<=24?Math.round(t):void 0}function Wte(e){x(d7,e===void 0?void 0:String(Math.round(e)))}var p7=`workerdeck.catch-up`;function m7(){return b(p7)===`off`?`off`:`on`}function Gte(e){x(p7,e)}function h7({label:e,options:t,read:n,write:r,onChange:i}){let[a,o]=(0,v.useState)(n);return(0,U.jsxs)(jC,{value:a,onValueChange:e=>{o(e),r(e),i?.(e)},children:[(0,U.jsx)(PC,{"aria-label":e,className:`min-w-40`,children:(0,U.jsx)(MC,{children:t.find(e=>e.value===a)?.label})}),(0,U.jsx)(FC,{children:t.map(e=>(0,U.jsx)(IC,{value:e.value,children:(0,U.jsx)(NC,{children:e.label})},e.value))})]})}function g7({title:e,children:t}){return(0,U.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(`h3`,{className:`text-label font-medium tracking-wide text-fg-3 uppercase`,children:e}),t]})}function Kte({open:e,onOpenChange:t}){let[n,r]=(0,v.useState)(o7);return(0,U.jsx)(Fw,{open:e,onOpenChange:t,children:(0,U.jsxs)(Iw,{size:`md`,className:`w-[min(30rem,calc(100vw-2rem))]`,children:[(0,U.jsx)(Lw,{title:`Settings`,description:`Preferences held by this browser. What a run defaults to lives on its profile; server policy lives where the gateway runs.`}),(0,U.jsx)(Rw,{children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,U.jsxs)(g7,{title:`Appearance`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Theme`}),(0,U.jsx)(e7,{})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Agent view style`}),(0,U.jsx)(h7,{label:`Agent view style`,options:[{value:`cards`,label:`Cards`},{value:`terminal`,label:`Terminal`}],read:o7,write:s7,onChange:r})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Font size`}),(0,U.jsx)(h7,{label:`Font size`,options:[{value:``,label:`Default`},{value:`11`,label:`11 px`},{value:`12`,label:`12 px`},{value:`13`,label:`13 px`},{value:`14`,label:`14 px`},{value:`15`,label:`15 px`},{value:`16`,label:`16 px`}],read:()=>String(f7()??``),write:e=>Wte(e?Number(e):void 0)})]}),n===`cards`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Agent view density`}),(0,U.jsx)(h7,{label:`Agent view density`,options:[{value:`comfortable`,label:`Comfortable`},{value:`compact`,label:`Compact`}],read:r7,write:i7})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Agent view font`}),(0,U.jsx)(h7,{label:`Agent view font`,options:[{value:`sans`,label:`Regular`},{value:`mono`,label:`Monospace`}],read:l7,write:u7})]})]}):null]}),(0,U.jsx)(g7,{title:`Sessions`,children:(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`span`,{className:`text-body-sm text-fg-2`,children:[`Catch-up mode`,(0,U.jsx)(`span`,{className:`block text-label text-fg-4`,children:`Mark what arrived since you last read a session, with a bar that counts the new rows and jumps to them.`})]}),(0,U.jsx)(h7,{label:`Catch-up mode`,options:[{value:`on`,label:`On`},{value:`off`,label:`Off`}],read:m7,write:Gte})]})})]})})]})})}function _7({className:e}){return(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:e,children:[(0,U.jsx)(`path`,{d:`M12 3 20.5 7.75 12 12.5 3.5 7.75Z`}),(0,U.jsx)(`path`,{d:`M3.5 12.25 12 17l8.5-4.75`}),(0,U.jsx)(`path`,{d:`M3.5 16.5 12 21.25l8.5-4.75`}),(0,U.jsx)(`path`,{d:`M12 6.15 14.85 7.75 12 9.35 9.15 7.75Z`,fill:`#2fbf71`,stroke:`none`})]})}function v7(e){let t=e,n=new Set,r=()=>t,i=()=>{for(let e of n)e()},a=e=>(n.add(e),()=>void n.delete(e));return{get:r,subscribe:a,set:e=>{t=e,i()},patch:e=>{t={...t,...e},i()},use:()=>(0,v.useSyncExternalStore)(a,r,r)}}var y7=`workerdeck.hosts.v1`;function b7(e){return`workerdeck.host.${e}.key`}var x7=`gateway`,S7=v7({hosts:[],ready:!1});function C7(e){O7.clear(),S7.set(e)}function w7(){let e=S(y7,[]);return Array.isArray(e)?e.map(({implicit:e,...t})=>t):[]}function T7(e){C(y7,e.filter(e=>!e.implicit))}function qte(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function E7(e){return b(b7(e))??``}function D7(e,t){x(b7(e),t===``?void 0:t)}var O7=new Map;function k7(e){let t=O7.get(e);if(t)return t;let n=S7.get().hosts.find(t=>t.id===e);if(!n)return;let r=ij(n);if(r===void 0)return;let i=new cj({baseUrl:r,...n.implicit?{}:oj({baseUrl:r,key:E7(n.id)})});return O7.set(e,i),i}function A7(){return S7.get().hosts.find(e=>e.implicit)??S7.get().hosts[0]}function Jte(){let e=A7();return e?k7(e.id):void 0}function j7(e){return aj(e)}function Yte(e,t){let n=w7(),r=n.some(t=>t.id===e.id)?n.map(t=>t.id===e.id?e:t):[...n,e];T7(r),D7(e.id,t),C7({...S7.get(),hosts:[...S7.get().hosts.filter(e=>e.implicit),...r]})}function Xte(e){let t=w7().filter(t=>t.id!==e);T7(t),D7(e,``),C7({...S7.get(),hosts:[...S7.get().hosts.filter(e=>e.implicit),...t]})}async function Zte(){try{let e=await fetch(`${location.origin}/auth/status`,{headers:{accept:`application/json`}});if(!e.ok||!e.headers.get(`content-type`)?.includes(`application/json`))return!1;let t=await e.json();return typeof t==`object`&&!!t&&`enabled`in t}catch{return!1}}var M7=!1;function N7(){if(M7)return;M7=!0;let e=w7();C7({hosts:e,ready:!1}),Zte().then(t=>{C7({hosts:t?[{id:x7,name:`This gateway`,baseUrl:location.origin,implicit:!0},...e]:e,ready:!0})})}function P7(e){return N7(),S7.subscribe(e)}function F7(){return(0,v.useSyncExternalStore)(P7,S7.get,S7.get)}function Qte(){return N7(),S7.get().hosts}function $te(e){return P7(e)}function I7({host:e,submitLabel:t=`Save`,onSaved:n,actions:r}){let[i,a]=(0,v.useState)(e.name),[o,s]=(0,v.useState)(e.baseUrl),[c,l]=(0,v.useState)(()=>E7(e.id));return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Name`}),(0,U.jsx)(_o,{value:i,onChange:e=>a(e.target.value),placeholder:`Mac mini`})]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Address`}),(0,U.jsx)(_o,{value:o,onChange:e=>s(e.target.value),placeholder:`http://toby.ts.net:8787`,spellCheck:!1,className:`font-mono`})]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Auth key`}),(0,U.jsx)(_o,{type:`password`,value:c,onChange:e=>l(e.target.value),placeholder:`Leave empty for an unauthenticated gateway`,spellCheck:!1}),(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:`Stored in this browser’s local storage, and sent on the WebSocket URL when attaching. Use a gateway you control, over a network you trust.`})]}),(0,U.jsxs)(`div`,{className:`mt-1 flex justify-end gap-2`,children:[r,(0,U.jsx)(lo,{onClick:()=>{if(ij({baseUrl:o})===void 0){DT.error(`That address is not a URL`);return}if(!i.trim()){DT.error(`Give the gateway a name`);return}let t={id:e.id,name:i.trim(),baseUrl:o.trim()};Yte(t,c),n(t)},children:t})]})]})}function ene({open:e,onOpenChange:t,onCreated:n}){let[r,i]=(0,v.useState)(()=>L7());return(0,U.jsx)(Fw,{open:e,onOpenChange:e=>{e&&i(L7()),t(e)},children:(0,U.jsxs)(Iw,{children:[(0,U.jsx)(Lw,{title:`Add gateway`,description:`A workerdeck gateway you run - typically over Tailscale.`}),(0,U.jsx)(Rw,{children:(0,U.jsx)(I7,{host:r,submitLabel:`Add gateway`,onSaved:n,actions:(0,U.jsx)(lo,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`})})})]})})}function L7(){return{id:qte(),name:``,baseUrl:``}}function R7({host:e,onClose:t,onRemoved:n}){return(0,U.jsx)(Fw,{open:!0,onOpenChange:e=>!e&&t(),children:(0,U.jsxs)(Iw,{children:[(0,U.jsx)(Lw,{title:`Remove ${e.name}?`,description:`Its auth key is deleted from this browser. The gateway itself keeps running.`}),(0,U.jsx)(Rw,{children:(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(lo,{variant:`outline`,onClick:t,children:`Cancel`}),(0,U.jsx)(lo,{variant:`destructive`,onClick:()=>{Xte(e.id),n()},children:`Remove`})]})})]})})}function z7(e){return e===`sessions`?`workerdeck.sessions-sidebar-width`:`workerdeck.${e}-sidebar-width`}function B7(e){return e===`sessions`?`workerdeck.sessions-sidebar-collapsed`:`workerdeck.${e}-sidebar-collapsed`}function tne(e){let t=Number(b(z7(e)));return t?Math.min(520,Math.max(240,t)):300}function nne(e,t){x(z7(e),String(t))}function rne(e){return b(B7(e))===`1`}function ine(e,t){x(B7(e),t?`1`:`0`)}var V7=`workerdeck.sessions-filters-shown`;function ane(){return b(V7)===`1`}function one(e){x(V7,e?`1`:`0`)}function H7({section:e,title:t,badge:n,actions:r,children:i,rail:a,railActions:o}){let[s,c]=(0,v.useState)(()=>tne(e)),[l,u]=(0,v.useState)(()=>rne(e)),d=t=>{u(t),ine(e,t)};return l?(0,U.jsxs)(`div`,{className:`flex min-h-0 w-11 shrink-0 flex-col items-center gap-1 border-r border-border bg-sidebar py-1.5`,children:[(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Expand ${t.toLowerCase()}`,onClick:()=>d(!1),children:(0,U.jsx)(ox,{className:`size-4`})}),o,a?(0,U.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col items-center gap-0.5 overflow-y-auto pt-1`,children:a}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{style:{width:s},className:`flex min-h-0 shrink-0 flex-col border-r border-border bg-sidebar`,children:[(0,U.jsxs)(`header`,{className:`flex h-9 shrink-0 items-center gap-1 pr-1 pl-3`,children:[(0,U.jsx)(`span`,{className:`truncate text-label font-medium tracking-wide text-fg-3 uppercase`,children:t}),n,(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Collapse ${t.toLowerCase()}`,onClick:()=>d(!0),children:(0,U.jsx)(ix,{className:`size-3.5`})}),r]}),i]}),(0,U.jsx)(qT,{orientation:`vertical`,value:s,onValueChange:t=>{c(t),nne(e,t)},min:240,max:520,defaultValue:300,"aria-label":`Resize ${t.toLowerCase()} sidebar`})]})}function U7({children:e,className:t}){return(0,U.jsx)(`div`,{className:W(`min-h-0 flex-1 overflow-y-auto pb-2`,t),children:e})}function W7({title:e,status:t,description:n,actions:r,active:i,onSelect:a,onDoubleClick:o}){return(0,U.jsxs)(`div`,{"data-slot":`sidebar-row`,"data-active":i||void 0,onClick:a,onDoubleClick:o,className:W(`group flex cursor-pointer flex-col gap-0.5 text-left transition-colors`,V5(i===!0)),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`button`,{type:`button`,className:W(`min-w-0 flex-1 truncate text-left text-body-sm outline-none`,i?`font-medium text-fg-1`:`text-fg-2`),children:e}),t]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 text-label text-fg-4`,children:[(0,U.jsx)(`button`,{type:`button`,tabIndex:-1,className:`flex min-w-0 flex-1 items-center gap-1.5 truncate text-left font-mono outline-none`,children:n}),r]})]})}function G7({label:e,onClick:t,children:n}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:e=>{e.stopPropagation(),t()},className:`flex size-5 shrink-0 items-center justify-center rounded text-fg-3 opacity-0 transition-opacity outline-none hover:bg-surface-hover hover:text-fg-1 group-hover:opacity-100`,children:n})}var K7=`workerdeck.watermarks.v1`,q7=v7(0),J7=new Fk({read:()=>S(K7,void 0),write:e=>{C(K7,e),q7.set(q7.get()+1)}});function Y7(){return q7.use(),{unseenFor:(0,v.useCallback)((e,t)=>Ik(J7.get(e,t.id),{proseCount:t.proseCount,activityCount:t.activityCount,turns:t.numTurns}),[]),watermarks:J7}}function sne(e,t){let n=J7.get(e,t);return n?{itemCount:n.itemCount,since:n.seenAt}:void 0}function cne(e,t){let n=(0,v.useRef)({});return(0,v.useCallback)(r=>{t&&!document.hidden&&(n.current={...n.current,...r},J7.mark(e,t,n.current))},[e,t])}function lne(e){let{unseenFor:t}=Y7();return(0,v.useMemo)(()=>e.reduce((e,n)=>e+t(n.hostId,n.info),0),[e,t])}var une=5e3,dne=1200,fne=700,X7=v7({snapshots:[],loaded:!1}),pne=X7.set,Z7,Q7=0,$7;function e9(){return Z7??=(async()=>{Q7=Date.now();try{let e=Qte(),t=new Map(X7.get().snapshots.map(e=>[e.host.id,e]));pne({snapshots:await Promise.all(e.map(async e=>{let n=k7(e.id);if(!n)return{host:e,sessions:[],error:`unusable address`};try{return{host:e,sessions:await n.listSessions()}}catch(n){return{host:e,sessions:t.get(e.id)?.sessions??[],error:n instanceof Error?n.message:String(n)}}})),loaded:!0})}finally{Z7=void 0}})(),Z7}function mne(){if($7!==void 0)return;let e=Math.max(0,fne-(Date.now()-Q7));$7=setTimeout(()=>{$7=void 0,e9()},e)}var t9,n9;function hne(e){let t=e?dne:une;(t9===void 0||n9!==t)&&(t9!==void 0&&clearInterval(t9),n9=t,t9=setInterval(()=>void e9(),t))}function r9(){let e=X7.use();(0,v.useEffect)(()=>$te(()=>void e9()),[]);let t=e.snapshots.some(e=>e.sessions.some(e=>{let t=wO(e);return t===`working`||t===`attention`}));return(0,v.useEffect)(()=>{hne(t),X7.get().loaded||e9()},[t]),{...e,refresh:e9}}function i9(e){let{unseenFor:t}=Y7();return(0,v.useMemo)(()=>e.flatMap(({host:e,sessions:n})=>n.filter(e=>!LO(e)).map(n=>({hostId:e.id,hostName:e.name,local:j7(e),adapter:n.engine??`claude`,state:wO(n),info:n,unseen:t(e.id,n)}))),[e,t])}function gne(){let e=jr(),t=bi({select:e=>e.location.pathname.match(/^\/gateways\/(.+)$/)?.[1]}),{hosts:n,ready:r}=F7(),{snapshots:i}=r9(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=i.filter(e=>e.error===void 0).length,u=(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Add gateway`,onClick:()=>o(!0),children:(0,U.jsx)(wx,{className:`size-4`})});return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(H7,{section:`gateways`,title:`Gateways`,badge:r&&n.length>0?(0,U.jsxs)(`span`,{className:`shrink-0 text-label text-fg-4`,children:[l,`/`,n.length]}):void 0,actions:u,railActions:u,children:(0,U.jsxs)(U7,{children:[r&&n.length===0?(0,U.jsx)(JT,{icon:(0,U.jsx)(cS,{}),title:`No gateways yet`,description:(0,U.jsxs)(U.Fragment,{children:[`Add one with `,(0,U.jsx)(YT,{children:`+`}),` above.`]})}):null,n.map(n=>{let r=i.find(e=>e.host.id===n.id),a=r===void 0?`pending`:r.error?`error`:`ok`;return(0,U.jsx)(W7,{active:n.id===t,onSelect:()=>void e({to:`/gateways/$hostId`,params:{hostId:n.id}}),title:n.name,status:(0,U.jsxs)(U.Fragment,{children:[n.implicit?(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:`this page`}):null,(0,U.jsx)(`span`,{"aria-hidden":!0,title:r?.error??(a===`ok`?`Connected`:`Connecting…`),className:W(`size-1.5 shrink-0 rounded-full`,a===`ok`?`bg-success`:a===`error`?`bg-danger`:`bg-fg-4`)})]}),description:n.baseUrl,actions:n.implicit?null:(0,U.jsx)(G7,{label:`Remove ${n.name}`,onClick:()=>c(n),children:(0,U.jsx)(nC,{className:`size-3`})})},n.id)})]})}),s?(0,U.jsx)(R7,{host:s,onClose:()=>c(void 0),onRemoved:()=>{let n=s.id===t;c(void 0),n&&e({to:`/gateways`})}}):null,(0,U.jsx)(ene,{open:a,onOpenChange:o,onCreated:t=>{o(!1),e({to:`/gateways/$hostId`,params:{hostId:t.id}})}})]})}function a9({value:e,onChange:t,models:n=t7,className:r}){return(0,U.jsx)(f4,{variant:`form`,models:n,model:e||void 0,onModelChange:e=>t(e??``),className:r})}function _ne({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Profile`}),(0,U.jsxs)(jC,{items:e.map(e=>({value:e.name,label:e.name})),value:t,onValueChange:e=>n(e),children:[(0,U.jsx)(PC,{className:r,children:(0,U.jsx)(MC,{})}),(0,U.jsx)(FC,{children:e.map(e=>(0,U.jsx)(IC,{value:e.name,children:(0,U.jsx)(NC,{children:(0,U.jsxs)(`span`,{className:e.available===!1?`text-fg-4`:void 0,title:e.unavailableReason,children:[e.description?`${e.name} - ${e.description}`:e.name,e.available===!1?` (unavailable)`:``]})})},e.name))})]})]})}function o9(){return Jte()}function s9(e,t,n){let r=e?.capabilities??zk[e?.engine??`claude`],i=r.permissionModes.includes(t)?t:r.defaultPermissionMode,a,o;if(e?.models?.length)a=e.models,o=e.defaultModel;else if(e?.engine===`provider`){let t=e.provider;a=(t?.models?.length?t.models:t?.model?[t.model]:[]).map(e=>({value:e,displayName:e})),o=t?.model}else a=t7.filter(e=>e.value!=="default");let s=a.find(e=>e.value===n||e.resolvedModel===n),c=s||n===``?n:``;return{capabilities:r,modes:r.permissionModes,models:[{value:`default`,displayName:`Profile default`,description:o??`the profile's configured model`},...a],mode:i,model:c,reasoningEfforts:(s?s.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}var c9={profiles:[]},l9,u9,d9=new Set;async function f9(){let e=await(o9()?.listProfiles().catch(()=>c9)??Promise.resolve(c9));l9=e;for(let t of d9)t(e);return e}function p9(){let[e,t]=(0,v.useState)(l9??c9);(0,v.useEffect)(()=>(d9.add(t),l9||(u9??=f9()),()=>{d9.delete(t)}),[]);let n=(0,v.useCallback)(async()=>{u9=f9(),await u9},[]);return{...e,refresh:n}}function vne(){return p9().profiles}var m9=`workerdeck.last-profile`;function yne(){let e=vne(),[t,n]=(0,v.useState)(()=>b(m9)??``),r=e.some(e=>e.name===t)?t:e[0]?.name??``;return{profiles:e,profile:r,selected:e.find(e=>e.name===r),select:e=>{n(e),x(m9,e)}}}var h9=`workerdeck.last-cwd`;function bne(e){let[t,n]=(0,v.useState)([]);return(0,v.useEffect)(()=>{o9()?.listHostRoots().then(e=>n(e.roots.map(e=>e.path))).catch(()=>n([]))},[]),(0,v.useMemo)(()=>{let n=b(h9),r=[...n?[n]:[],...[...e].sort((e,t)=>(t.lastActivityAt??t.createdAt)-(e.lastActivityAt??e.createdAt)).map(e=>e.cwd),...t];return[...new Set(r)].slice(0,12)},[e,t])}var xne={session:`default`,job:`acceptEdits`},Sne={session:`ask`,job:`auto`};function g9(e){let[t,n]=(0,v.useState)(()=>b(h9)??``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(void 0),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(Sne[e]),{profiles:p,profile:m,selected:h,select:g}=yne(),_=s9(h,s??h?.defaults?.permissionMode??xne[e],a);return{cwd:t,setCwd:n,prompt:r,setPrompt:i,mode:_.mode,setMode:c,model:a,setModel:o,effort:l,setEffort:u,questions:d,setQuestions:f,profiles:p,profile:m,selectProfile:g,engine:_,sessionFields:e=>({cwd:_.capabilities.hostCwd===!1?void 0:t.trim(),profile:m||void 0,prompt:e.prompt,permissionMode:_.mode,model:_.model.trim()||void 0,resume:e.resume,reasoningEffort:l&&_.reasoningEfforts.includes(l)?l:void 0,questionBehavior:_.capabilities.interactiveApprovals?d:void 0,..._.capabilities.settingSources?{settingSources:[`user`,`project`],allowDangerouslySkipPermissions:e.allowBypass||void 0}:{}}),rememberCwd:e=>x(h9,t.trim()||e)}}function _9({form:e}){return e.engine.capabilities.interactiveApprovals?(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Questions`}),(0,U.jsxs)(jC,{items:R4.map(e=>({value:e.value,label:e.label})),value:e.questions,onValueChange:t=>e.setQuestions(t),children:[(0,U.jsx)(PC,{className:`min-w-36`,children:(0,U.jsx)(MC,{})}),(0,U.jsx)(FC,{children:R4.map(e=>(0,U.jsx)(IC,{value:e.value,children:(0,U.jsx)(NC,{children:`${e.label} - ${e.description}`})},e.value))})]})]}):null}function v9({form:e,sessions:t,promptLabel:n,promptPlaceholder:r=`e.g. /verify-content 42, or a task description`,extras:i,actions:a,onProfileChange:o}){let s=bne(t),c=(0,v.useId)(),{engine:l}=e;return(0,U.jsxs)(U.Fragment,{children:[l.capabilities.hostCwd!==!1&&(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Working directory`}),(0,U.jsx)(_o,{value:e.cwd,list:c,onChange:t=>e.setCwd(t.target.value),placeholder:`/path/to/project`,spellCheck:!1,className:`font-mono`}),(0,U.jsx)(`datalist`,{id:c,children:s.map(e=>(0,U.jsx)(`option`,{value:e},e))})]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:n}),(0,U.jsx)(vo,{value:e.prompt,onChange:t=>e.setPrompt(t.target.value),rows:2,placeholder:r})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(_ne,{profiles:e.profiles,value:e.profile,onChange:t=>{e.selectProfile(t),o?.(t)},className:`min-w-32`}),(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Permission mode`}),(0,U.jsx)(g4,{variant:`form`,mode:l.mode,onModeChange:e.setMode,modes:l.modes,className:`min-w-44`})]}),i,(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Model`}),(0,U.jsx)(a9,{value:l.model,onChange:e.setModel,models:l.models,className:`min-w-40`})]}),l.reasoningEfforts.length>0?(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Effort`}),(0,U.jsxs)(jC,{items:[{value:`default`,label:`Default`},...l.reasoningEfforts.map(e=>({value:e,label:e}))],value:e.effort||`default`,onValueChange:t=>e.setEffort(t==="default"?``:String(t)),children:[(0,U.jsx)(PC,{className:`min-w-28`,children:(0,U.jsx)(MC,{})}),(0,U.jsx)(FC,{children:[`default`,...l.reasoningEfforts].map(e=>(0,U.jsx)(IC,{value:e,children:(0,U.jsx)(NC,{children:e})},e))})]})]}):null,a]})]})}var Cne=15e3,y9=v7({jobs:[],stats:void 0,enabled:!0,live:!1,error:void 0}),b9=y9.patch,x9;function S9(){return x9??=(async()=>{try{let e=o9();if(!e)return;let[t,n]=await Promise.all([e.listJobs(),e.queueStats()]);b9({jobs:t,stats:n,enabled:!0,error:void 0})}catch(e){let t=e instanceof Error?e.message:String(e);/not configured/i.test(t)?b9({enabled:!1,error:void 0}):b9({error:t})}finally{x9=void 0}})(),x9}var C9=0,w9,T9;function wne(e){let t=y9.subscribe(e);return++C9===1&&(S9(),w9=setInterval(()=>void S9(),Cne)),()=>{t(),--C9===0&&(clearInterval(w9),w9=void 0,T9?.(),T9=void 0,b9({live:!1}))}}function Tne(){if(T9||!y9.get().enabled||y9.get().stats===void 0||C9===0)return;let e=o9();if(!e)return;let t=e.attachQueue(),n=[t.on(`attached`,()=>void S9()),t.on(`stats`,e=>b9({stats:e})),t.on(`connectionChange`,e=>b9({live:e})),t.on(`event`,e=>{b9({jobs:y9.get().jobs.some(t=>t.id===e.job.id)?y9.get().jobs.map(t=>t.id===e.job.id?e.job:t):[...y9.get().jobs,e.job]})})];T9=()=>{for(let e of n)e();t.detach()}}function E9(){let e=(0,v.useSyncExternalStore)(wne,y9.get,y9.get);return(0,v.useEffect)(Tne,[e.enabled,e.stats]),{...e,refresh:S9}}function Ene({stats:e}){let t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-x-5 gap-y-2 rounded-md border border-border bg-surface px-3 py-2 text-body-sm text-fg-2`,children:[(0,U.jsxs)(`span`,{children:[`Running`,` `,(0,U.jsxs)(`span`,{className:`font-mono text-fg-1`,children:[e.running,`/`,e.maxConcurrency]})]}),(0,U.jsxs)(`span`,{children:[`Queued `,(0,U.jsx)(`span`,{className:`font-mono text-fg-1`,children:e.queued})]}),e.parked>0?(0,U.jsxs)(`span`,{children:[`Parked `,(0,U.jsx)(`span`,{className:`font-mono text-fg-1`,children:e.parked})]}):null,(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[t===void 0?null:(0,U.jsx)(XT,{value:t,className:t>=95?`text-danger`:t>=80?`text-warning`:`text-fg-3`}),`Daily tokens`,` `,(0,U.jsxs)(`span`,{className:`font-mono text-fg-1`,children:[fM(e.dailyTokensUsed),e.dailyTokenLimit===void 0?``:` / ${fM(e.dailyTokenLimit)}`]})]}),e.sessionTokenLimit===void 0?null:(0,U.jsxs)(`span`,{children:[`Per-job cap `,(0,U.jsx)(`span`,{className:`font-mono text-fg-1`,children:fM(e.sessionTokenLimit)})]}),e.paused?(0,U.jsx)(fo,{variant:`warning`,dot:!0,children:`Paused - daily budget exhausted`}):null]})}function Dne({onScheduled:e}){let{snapshots:t}=r9(),n=t.find(e=>e.host.id===A7()?.id)?.sessions??[],r=g9(`job`),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),{engine:m}=r,h=async()=>{if(!r.cwd.trim()||!r.prompt.trim()){DT.error(`Working directory and prompt are required`);return}let t=o.trim()?Number(o.trim()):void 0;if(t!==void 0&&(!Number.isFinite(t)||t<=0)){DT.error(`Max tokens must be a positive number`);return}let n=c.trim()?Number(c.trim()):void 0;if(n!==void 0&&(!Number.isInteger(n)||n<1)){DT.error(`Attempts must be a whole number of at least 1`);return}p(!0);try{r.rememberCwd(r.cwd.trim()),await o9().createJob({session:{...r.sessionFields({allowBypass:i}),prompt:r.prompt.trim()},maxTokens:t,attempts:n,webhook:u.trim()?{url:u.trim()}:void 0}),r.setPrompt(``),DT.success(`Job scheduled`),e()}catch(e){DT.error(e instanceof Error?e.message:`Failed to schedule job`)}finally{p(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(v9,{form:r,sessions:n,promptLabel:`Prompt (the task - runs unattended)`,extras:(0,U.jsx)(_9,{form:r}),actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Max tokens (optional)`}),(0,U.jsx)(_o,{value:o,onChange:e=>s(e.target.value),placeholder:`per-job cap`,inputMode:`numeric`,className:`min-w-28 font-mono`})]}),(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Attempts (optional)`}),(0,U.jsx)(_o,{value:c,onChange:e=>l(e.target.value),placeholder:`1`,inputMode:`numeric`,className:`min-w-20 font-mono`})]}),(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Webhook URL (optional)`}),(0,U.jsx)(_o,{value:u,onChange:e=>d(e.target.value),placeholder:`https://…/hook`,spellCheck:!1,className:`min-w-44 font-mono`})]}),(0,U.jsxs)(lo,{className:`ml-auto`,onClick:()=>void h(),disabled:f,children:[f?(0,U.jsx)(GT,{className:`size-3.5 text-current`}):(0,U.jsx)(wx,{className:`size-4`}),`Schedule`]})]})}),m.capabilities.settingSources?(0,U.jsxs)(`label`,{className:`flex w-fit cursor-pointer items-center gap-2 text-body-sm text-fg-2`,title:`Spawns the CLI with --dangerously-skip-permissions available, so the mode can be switched on while watching the run. The job still starts in the mode selected above.`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked),className:`size-3.5 accent-(--color-fg-1)`}),`Allow switching to `,(0,U.jsx)(`code`,{className:`font-mono`,children:`bypassPermissions`}),` mid-run`,(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:`(dangerous)`})]}):null,(0,U.jsxs)(`p`,{className:`text-label text-fg-4`,children:[`Unattended runs still surface permission prompts - the job's page is read-only, so answer them from the session itself, or pick a mode that doesn't ask. Unanswered prompts deny after the server's timeout. With Questions set to Ask, webhook deliveries carry the full question so a controller can answer via `,(0,U.jsx)(`code`,{className:`font-mono`,children:`POST /sessions/:id/permissions/:requestId`}),`.`]})]})}function One({open:e,onOpenChange:t,onScheduled:n}){return(0,U.jsx)(Fw,{open:e,onOpenChange:t,children:(0,U.jsxs)(Iw,{size:`lg`,children:[(0,U.jsx)(Lw,{title:`Schedule a job`,description:`A one-shot run the queue executes unattended.`}),(0,U.jsx)(Rw,{children:e?(0,U.jsx)(Dne,{onScheduled:n}):null})]})})}function kne(){let{stats:e,enabled:t,error:n}=E9();return(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[n?(0,U.jsxs)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:[`Can't reach the worker server: `,n,`. Start it with `,(0,U.jsx)(`code`,{className:`font-mono`,children:`pnpm server`}),`.`]}):null,t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(JT,{icon:(0,U.jsx)(vb,{}),title:`No job selected`,description:(0,U.jsxs)(U.Fragment,{children:[`Pick one on the left, or schedule one with `,(0,U.jsx)(YT,{children:`+`}),` above.`]})}),e?(0,U.jsx)(`div`,{className:`mt-2 w-full max-w-xl`,children:(0,U.jsx)(Ene,{stats:e})}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(q_,{className:`size-8 text-fg-4`}),(0,U.jsx)(`p`,{className:`text-body-sm text-fg-3`,children:`The server has no job queue configured.`}),(0,U.jsxs)(`p`,{className:`max-w-md text-label text-fg-4`,children:[`Pass `,(0,U.jsxs)(`code`,{className:`font-mono`,children:[`queue: `,`{ maxConcurrency, … }`]}),` to`,` `,(0,U.jsx)(`code`,{className:`font-mono`,children:`createWorkerServer`}),` - the dev server enables it by default.`]})]})]})}var D9={queued:{label:`Queued`,variant:`neutral`},running:{label:`Running`,variant:`info`,busy:!0},parked:{label:`Parked`,variant:`accent`},succeeded:{label:`Succeeded`,variant:`success`},failed:{label:`Failed`,variant:`danger`},canceled:{label:`Canceled`,variant:`warning`}},Ane=[`queued`,`running`,`parked`];function jne(){let e=jr(),t=bi({select:e=>e.location.pathname.match(/^\/jobs\/(.+)$/)?.[1]}),{jobs:n,enabled:r,live:i,refresh:a}=E9(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!1),f=c.trim().toLowerCase(),p=[...n].sort((e,t)=>t.createdAt-e.createdAt).filter(e=>(!u||Ane.includes(e.status))&&(!f||e.prompt.toLowerCase().includes(f)||e.cwd.toLowerCase().includes(f)||(e.profile?.toLowerCase().includes(f)??!1)||e.id.startsWith(f))),m=n.length-p.length,h=r?(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Schedule a job`,onClick:()=>s(!0),children:(0,U.jsx)(wx,{className:`size-4`})}):void 0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(H7,{section:`jobs`,title:`Jobs`,badge:r?(0,U.jsx)(`span`,{"aria-hidden":!0,title:i?`Streaming over the queue socket`:`Polling`,className:W(`size-1.5 shrink-0 rounded-full`,i?`bg-success`:`bg-fg-4`)}):void 0,actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh`,onClick:()=>void a(),children:(0,U.jsx)(Rx,{className:`size-3.5`})}),h]}),railActions:h,children:r?(0,U.jsxs)(U.Fragment,{children:[n.length>0?(0,U.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pb-2`,children:[(0,U.jsx)(_o,{value:c,onChange:e=>l(e.target.value),placeholder:`Search jobs`,"aria-label":`Search jobs`,className:`h-7 min-w-0 flex-1 text-body-sm`}),(0,U.jsx)(lo,{variant:u?`default`:`outline`,size:`xs`,"aria-pressed":u,onClick:()=>d(!u),children:`Active`})]}):null,(0,U.jsxs)(U7,{children:[n.length===0?(0,U.jsx)(JT,{icon:(0,U.jsx)(bb,{}),title:`No jobs yet`,description:(0,U.jsxs)(U.Fragment,{children:[`Schedule one with `,(0,U.jsx)(YT,{children:`+`}),` above.`]})}):p.length===0?(0,U.jsx)(JT,{icon:(0,U.jsx)(iS,{}),title:`No matches`,description:`No job matches the active filter.`,action:`Show all`,onAction:()=>d(!1)}):null,p.map(n=>(0,U.jsx)(Mne,{job:n,active:n.id===t,onOpen:()=>void e({to:`/jobs/$jobId`,params:{jobId:n.id}}),onChanged:()=>void a()},n.id)),m>0?(0,U.jsxs)(`p`,{className:`px-1 pt-2 text-center text-label text-fg-4`,children:[p.length,` of `,n.length]}):null]})]}):(0,U.jsx)(JT,{icon:(0,U.jsx)(bb,{}),title:`No job queue`,description:`This gateway runs without one, so there is nothing to schedule against.`})}),(0,U.jsx)(One,{open:o,onOpenChange:s,onScheduled:()=>{s(!1),a()}})]})}function Mne({job:e,active:t,onOpen:n,onChanged:r}){let i=D9[e.status],a=e.status===`queued`||e.status===`running`||e.status===`parked`,o=[hM(e.finishedAt??e.startedAt??e.createdAt),e.cwd.split(`/`).filter(Boolean).pop()??e.cwd];e.profile&&o.push(`@${e.profile}`);let s=e.usage.costUsd??e.usage.totalCostUsd;return s>0&&o.push(uM(s)),(0,U.jsx)(W7,{active:t,onSelect:n,title:e.prompt,status:(0,U.jsxs)(fo,{variant:i.variant,dot:!i.busy,className:`shrink-0`,children:[i.busy?(0,U.jsx)(GT,{className:`size-3 text-current`}):null,i.label]}),description:o.join(` · `),actions:a?(0,U.jsx)(G7,{label:`Cancel job`,onClick:()=>{o9()?.cancelJob(e.id).then(r).catch(e=>DT.error(e instanceof Error?e.message:`Cancel failed`))},children:(0,U.jsx)(DC,{className:`size-3`})}):null})}var O9=[`web_search`,`download`,`web_fetch`,`deliver_file`];function k9(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function A9({label:e,children:t}){return(0,U.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:e}),t]})}function Nne({onCreated:e}){let[t,n]=(0,v.useState)(`provider`),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)([]),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(!1),O=t===`provider`,k=t===`codex`,A=async()=>{if(!r.trim()){DT.error(`Name is required`);return}let n={name:r.trim(),engine:t};if(a.trim()&&(n.description=a.trim()),O){n.provider={id:s.trim(),model:l.trim()||void 0,models:k9(d).length>0?k9(d):void 0,apiKeyEnv:p.trim()||void 0};let e={};b.length>0&&(e.capabilities=b),k9(S).length>0&&(e.mcpServers=k9(S)),w.trim()&&(e.instructions=w.trim()),Object.keys(e).length>0&&(n.session=e)}else k?_.trim()&&(n.codexHome=_.trim()):n.configDir=h.trim();D(!0);try{await o9().createProfile(n),DT.success(`Profile '${n.name}' created`),e(n.name)}catch(e){DT.error(e instanceof Error?e.message:`Failed to create profile`)}finally{D(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(A9,{label:`Engine`,children:(0,U.jsxs)(jC,{items:[{value:`provider`,label:`provider`},{value:`claude`,label:`claude`},{value:`codex`,label:`codex`}],value:t,onValueChange:e=>n(e),children:[(0,U.jsx)(PC,{className:`min-w-32`,children:(0,U.jsx)(MC,{})}),(0,U.jsxs)(FC,{children:[(0,U.jsx)(IC,{value:`provider`,children:(0,U.jsx)(NC,{children:`provider - model-agnostic engine`})}),(0,U.jsx)(IC,{value:`claude`,children:(0,U.jsx)(NC,{children:`claude - Agent SDK + config dir`})}),(0,U.jsx)(IC,{value:`codex`,children:(0,U.jsx)(NC,{children:`codex - app-server + CODEX_HOME`})})]})]})}),(0,U.jsx)(A9,{label:`Name`,children:(0,U.jsx)(_o,{value:r,onChange:e=>i(e.target.value),placeholder:`kimi`})}),(0,U.jsx)(A9,{label:`Description (optional)`,children:(0,U.jsx)(_o,{value:a,onChange:e=>o(e.target.value),placeholder:`what this profile is for`})})]}),O?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(A9,{label:`Provider id`,children:(0,U.jsx)(_o,{value:s,onChange:e=>c(e.target.value),placeholder:`anthropic / openai / moonshotai`,className:`font-mono`})}),(0,U.jsx)(A9,{label:`Default model`,children:(0,U.jsx)(_o,{value:l,onChange:e=>u(e.target.value),placeholder:`kimi-k3`,className:`font-mono`})}),(0,U.jsx)(A9,{label:`Models offered (comma-separated)`,children:(0,U.jsx)(_o,{value:d,onChange:e=>f(e.target.value),placeholder:`kimi-k3, kimi-k2`,className:`font-mono`})}),(0,U.jsx)(A9,{label:`API key variable`,children:(0,U.jsx)(_o,{value:p,onChange:e=>m(e.target.value),placeholder:`MOONSHOT_API_KEY`,className:`font-mono`})})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(A9,{label:`Capabilities granted`,children:(0,U.jsx)(`div`,{className:`flex flex-wrap gap-3 py-1.5`,children:O9.map(e=>(0,U.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:b.includes(e),onChange:t=>x(n=>t.target.checked?[...n,e]:n.filter(t=>t!==e)),className:`size-3.5 accent-(--color-fg-1)`}),(0,U.jsx)(`code`,{className:`font-mono text-label`,children:e})]},e))})}),(0,U.jsx)(A9,{label:`MCP servers (names, comma-separated)`,children:(0,U.jsx)(_o,{value:S,onChange:e=>C(e.target.value),placeholder:`deepwiki`,className:`font-mono`})})]}),(0,U.jsx)(A9,{label:`Instructions (optional)`,children:(0,U.jsx)(_o,{value:w,onChange:e=>T(e.target.value),placeholder:`prepended to the session's system prompt`})}),(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`Leave capabilities and MCP servers empty to inherit whatever the server's engine factory wired - that factory is the ceiling either way, so a grant here can never exceed it. MCP servers are named, never configured: their transport config (and any credentials in it) stays on the server.`})]}):k?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(A9,{label:`Home directory (optional)`,children:(0,U.jsx)(_o,{value:_,onChange:e=>y(e.target.value),placeholder:`/Users/you/.codex`,spellCheck:!1,className:`font-mono`})}),(0,U.jsxs)(`p`,{className:`text-label text-fg-4`,children:[`This profile's `,(0,U.jsx)(`code`,{className:`font-mono`,children:`CODEX_HOME`}),`. Must resolve inside the server's`,` `,(0,U.jsx)(`code`,{className:`font-mono`,children:`allowedConfigDirRoots`}),` - a home directory is a credential store, so the server bounds which ones a managed profile may point at. Leave it empty to run on the server's own environment.`]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(A9,{label:`Config directory`,children:(0,U.jsx)(_o,{value:h,onChange:e=>g(e.target.value),placeholder:`/Users/you/.claude`,spellCheck:!1,className:`font-mono`})}),(0,U.jsxs)(`p`,{className:`text-label text-fg-4`,children:[`Must resolve inside the server's `,(0,U.jsx)(`code`,{className:`font-mono`,children:`allowedConfigDirRoots`}),` - a config directory is a credential store, so the server bounds which ones a managed profile may point at.`]})]}),(0,U.jsx)(`div`,{className:`flex justify-end`,children:(0,U.jsxs)(lo,{onClick:()=>void A(),disabled:E,children:[E?(0,U.jsx)(GT,{className:`size-3.5 text-current`}):(0,U.jsx)(wx,{className:`size-4`}),`Create profile`]})})]})}function Pne({open:e,onOpenChange:t,onCreated:n}){return(0,U.jsx)(Fw,{open:e,onOpenChange:t,children:(0,U.jsxs)(Iw,{size:`lg`,children:[(0,U.jsx)(Lw,{title:`New profile`,description:`What a session runs as - a Claude config directory, or a model provider.`}),(0,U.jsx)(Rw,{children:e?(0,U.jsx)(Nne,{onCreated:n}):null})]})})}function Fne(){let e=jr(),t=bi({select:e=>e.location.pathname.match(/^\/profiles\/(.+)$/)?.[1]}),{profiles:n,canManage:r,refresh:i}=p9(),[a,o]=(0,v.useState)(!1),s=r?(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`New profile`,onClick:()=>o(!0),children:(0,U.jsx)(wx,{className:`size-4`})}):void 0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(H7,{section:`profiles`,title:`Profiles`,badge:n.length>0?(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:n.length}):void 0,actions:s,railActions:s,children:(0,U.jsxs)(U7,{children:[n.length===0?(0,U.jsx)(JT,{icon:(0,U.jsx)(Xy,{}),title:r?`No profiles yet`:`No profiles`,description:r?(0,U.jsxs)(U.Fragment,{children:[`Add one with `,(0,U.jsx)(YT,{children:`+`}),` above.`]}):`This gateway declares none, and this login may not add them.`}):null,n.map(n=>(0,U.jsx)(W7,{active:n.name===t,onSelect:()=>void e({to:`/profiles/$profileName`,params:{profileName:n.name}}),title:n.name,status:n.managed?null:(0,U.jsx)(fo,{variant:`neutral`,className:`shrink-0`,children:`declared`}),description:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(A5,{engine:n.engine??`claude`,model:n.defaults?.model??n.provider?.model,className:`size-3 shrink-0 text-fg-3`}),(0,U.jsx)(`span`,{className:`min-w-0 truncate`,children:n.configDir??(n.provider?`${n.provider.id}${n.provider.model?` · ${n.provider.model}`:``}`:n.engine??`claude`)})]})},n.name))]})}),(0,U.jsx)(Pne,{open:a,onOpenChange:o,onCreated:t=>{o(!1),i(),e({to:`/profiles/$profileName`,params:{profileName:t}})}})]})}function Ine({sessions:e,onCreated:t}){let n=g9(`session`),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(!1),{engine:l}=n,u=async e=>{let r=e?.cwd??n.cwd.trim();if(!r){DT.error(`Working directory is required`);return}i(!0);try{n.rememberCwd(r),t((await o9().createSession({...n.sessionFields({prompt:e?void 0:n.prompt.trim()||void 0,resume:e?.sessionId,allowBypass:!0}),cwd:r})).id)}catch(e){DT.error(e instanceof Error?e.message:`Failed to create session`)}finally{i(!1)}},d=async()=>{if(!n.cwd.trim()){DT.error(`Set a working directory first - resumable sessions are listed per project`);return}c(!0);try{o(await o9().listSdkSessions({dir:n.cwd.trim(),limit:20,profile:n.profile||void 0}))}catch(e){DT.error(e instanceof Error?e.message:`Failed to list resumable sessions`)}finally{c(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(v9,{form:n,sessions:e,promptLabel:`Initial prompt (optional)`,onProfileChange:()=>o(void 0),extras:(0,U.jsx)(_9,{form:n}),actions:(0,U.jsxs)(lo,{className:`ml-auto`,onClick:()=>void u(),disabled:r,children:[r?(0,U.jsx)(GT,{className:`size-3.5 text-current`}):(0,U.jsx)(wx,{className:`size-4`}),`Create`]})}),l.capabilities.listSessions?(0,U.jsxs)(`div`,{className:`mt-1 border-t border-border pt-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Resume a previous session`}),(0,U.jsxs)(lo,{variant:`ghost`,size:`xs`,onClick:()=>void d(),disabled:s,children:[s?(0,U.jsx)(GT,{className:`size-3 text-current`}):(0,U.jsx)(Hx,{className:`size-3`}),a?`Reload`:`Browse`]})]}),a===void 0?null:a.length===0?(0,U.jsx)(`div`,{className:`py-3 text-center text-body-sm text-fg-4`,children:`No stored sessions for this directory.`}):(0,U.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:a.map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`truncate text-body-sm text-fg-1`,children:e.customTitle??e.summary}),(0,U.jsxs)(`div`,{className:`flex gap-2 font-mono text-label text-fg-4`,children:[e.gitBranch?(0,U.jsx)(`span`,{className:`truncate`,children:e.gitBranch}):null,(0,U.jsx)(`span`,{className:`shrink-0`,children:hM(e.lastModified)})]})]}),(0,U.jsx)(lo,{variant:`outline`,size:`xs`,onClick:()=>void u(e),disabled:r,children:`Resume`})]},e.sessionId))})]}):null]})}function Lne({open:e,onOpenChange:t,sessions:n,onCreated:r}){return(0,U.jsx)(Fw,{open:e,onOpenChange:t,children:(0,U.jsxs)(Iw,{size:`lg`,children:[(0,U.jsx)(Lw,{title:`New session`,description:`Pick a directory and an engine.`}),(0,U.jsx)(Rw,{children:(0,U.jsx)(Ine,{sessions:n,onCreated:r})})]})})}function Rne(){return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsx)(JT,{icon:(0,U.jsx)(_7,{}),title:`No session open`,description:(0,U.jsxs)(U.Fragment,{children:[`Pick one on the left, or start a new one with `,(0,U.jsx)(YT,{children:`+`}),` above.`]})})})}var j9=`workerdeck.view-config`;function zne(){let[e,t]=(0,v.useState)(()=>({...kO,...S(j9,{}),search:``,scoped:!1}));return[e,(0,v.useCallback)(e=>{t(e),C(j9,e)},[])]}function Bne(){let e=jr(),t=bi({select:e=>e.location.pathname.match(/^\/sessions\/[^/]+\/(.+)$/)?.[1]??void 0}),n=Ar({strict:!1}).subagent,r=Ar({strict:!1}).shell,{snapshots:i,refresh:a}=r9(),o=i9(i),s=Sj(o,k7),c=i.filter(e=>e.error!==void 0),l=A7(),u=i.find(e=>e.host.id===l?.id)?.sessions??[],d=t=>{l&&e({to:`/sessions/$hostId/$sessionId`,params:{hostId:l.id,sessionId:t},search:{}})},[f,p]=zne(),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(ane),y=(0,v.useMemo)(()=>WO(o,f),[o,f]),b=t=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{}}),x=(0,v.useRef)(0),S=(t,n)=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{subagent:n,sn:++x.current}}),C=(0,v.useRef)(0),w=(t,n)=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{shell:n,shn:++C.current}}),T=(e,t)=>{k7(e.hostId)?.killShell(e.info.id,t).then(()=>a()).catch(e=>DT.error(e instanceof Error?e.message:`Kill failed`))},E=(e,t)=>{k7(e.hostId)?.updateSession(e.info.id,{title:t||null}).then(()=>a()).catch(e=>DT.error(e instanceof Error?e.message:`Rename failed`))},D=(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`New session`,onClick:()=>h(!0),children:(0,U.jsx)(wx,{className:`size-4`})});return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(H7,{section:`sessions`,title:`Sessions`,railActions:D,actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($5,{value:f.subagents,onChange:e=>p({...f,subagents:e})}),(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":g?`Hide filters`:`Show filters`,"aria-pressed":g,onClick:()=>{_(!g),one(!g)},children:(0,U.jsx)(wy,{className:W(`size-3.5`,g&&`fill-current text-fg-1`)})}),(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh`,onClick:()=>void a(),children:(0,U.jsx)(Rx,{className:`size-3.5`})}),D]}),rail:y.map(e=>(0,U.jsxs)(`button`,{type:`button`,title:`${MO(e.info)} - ${e.state}`,"aria-label":MO(e.info),onClick:()=>b(e),className:W(`flex w-full flex-col items-center gap-0.5 border-l-2 py-1.5`,e.info.id===t?`border-l-accent bg-row-active`:`border-l-transparent hover:bg-row-hover`),children:[(0,U.jsx)(A5,{engine:e.adapter,model:e.info.model,className:`size-4`}),(0,U.jsx)(j5,{row:e})]},e.info.id)),children:[c.map(({host:e,error:t})=>(0,U.jsxs)(`div`,{className:`mx-2 mb-2 rounded-md bg-danger-bg px-2 py-1.5 text-label text-danger`,children:[`Can’t reach `,e.name,`: `,t]},e.id)),(0,U.jsx)(U7,{children:(0,U.jsx)(H5,{rows:o,config:f,onConfigChange:p,showControls:g,projectIcons:s,activeId:t,activeSubagentId:n,activeShellId:r,onSelect:b,onSelectSubagent:S,onSelectShell:w,onKillShell:T,onRename:E,onClearContext:e=>{let t=k7(e.hostId);if(!t)return;let n=t.attach(e.info.id,{reconnect:!1}),r=setTimeout(()=>{n.detach(),DT.error(`Clear failed - the gateway did not answer`)},5e3);n.on(`attached`,()=>{n.clearContext(),setTimeout(()=>{clearTimeout(r),n.detach(),DT.success(`Context cleared - the previous conversation stays resumable`),a()},150)})},onDelete:e=>{k7(e.hostId)?.deleteSession(e.info.id).then(()=>a()).catch(e=>DT.error(e instanceof Error?e.message:`Delete failed`))},emptyState:(0,U.jsx)(JT,{icon:(0,U.jsx)(cb,{}),title:`No sessions yet`,description:(0,U.jsxs)(U.Fragment,{children:[`Start one with `,(0,U.jsx)(YT,{children:`+`}),` above.`]})})})})]}),(0,U.jsx)(Lne,{open:m,onOpenChange:h,sessions:u,onCreated:e=>{h(!1),d(e),a()}})]})}function Vne(){let{snapshots:e}=r9(),t=lne(i9(e));(0,v.useEffect)(()=>{document.title=t>0?`(${t}) workerdeck`:`workerdeck`},[t])}var M9=[{id:`sessions`,label:`Sessions`,icon:IS,path:`/sessions`,sidebar:Bne},{id:`gateways`,label:`Gateways`,icon:Sx,path:`/gateways`,sidebar:gne},{id:`jobs`,label:`Jobs`,icon:vb,path:`/jobs`,sidebar:jne},{id:`profiles`,label:`Profiles`,icon:mC,path:`/profiles`,sidebar:Fne}],N9=`workerdeck.sidebar-collapsed`;function Hne({children:e}){Vne();let t=bi({select:e=>e.location.pathname}),n=[...M9].sort((e,t)=>t.path.length-e.path.length).find(e=>t.startsWith(e.path)),r=n?.sidebar,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(()=>b(N9)===`1`),c=()=>{s(e=>(x(N9,e?`0`:`1`),!e))},l=`flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-row-hover hover:text-fg-1`,u=e=>W(`flex items-center rounded-md text-body-sm transition-colors outline-none`,o?`justify-center p-2`:`gap-2 px-2 py-1.5`,e?`bg-surface font-medium text-fg-1 shadow-(--shadow-xs)`:`text-fg-3 hover:bg-row-hover hover:text-fg-1`);return(0,U.jsxs)(`div`,{className:`flex h-dvh bg-sidebar`,children:[(0,U.jsxs)(`aside`,{className:W(`flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150`,o?`w-14 items-center`:`w-52`),children:[(0,U.jsxs)(`div`,{className:W(`flex items-center py-2`,o?`justify-center`:`gap-2 px-2`),children:[(0,U.jsx)(_7,{className:`size-4 shrink-0 text-fg-1`}),!o&&(0,U.jsx)(`span`,{className:`text-body-sm font-semibold tracking-tight text-fg-1`,children:`workerdeck`})]}),(0,U.jsx)(`nav`,{className:W(`mt-1 flex flex-1 flex-col gap-0.5`,o&&`items-center`),children:M9.map(e=>(0,U.jsxs)(Jr,{to:e.path,title:o?e.label:void 0,"aria-label":e.label,onClick:t=>{e.id===n?.id&&t.preventDefault()},className:u(e.id===n?.id),children:[(0,U.jsx)(e.icon,{className:`size-4 shrink-0`}),!o&&e.label]},e.id))}),(0,U.jsxs)(`div`,{className:W(`mt-1 grid place-items-center gap-1`,o?`grid-rows-3`:`grid-cols-3`),children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(!0),title:`Settings`,"aria-label":`Settings`,className:l,children:(0,U.jsx)(uS,{className:`size-4`})}),(0,U.jsx)(e7,{}),(0,U.jsx)(`button`,{type:`button`,onClick:c,title:o?`Expand sidebar`:`Collapse sidebar`,"aria-label":o?`Expand sidebar`:`Collapse sidebar`,className:l,children:o?(0,U.jsx)(ox,{className:`size-4`}):(0,U.jsx)(ix,{className:`size-4`})})]})]}),(0,U.jsxs)(`div`,{className:`app-frame frame-shine m-2 ml-0 flex min-w-0 flex-1 overflow-hidden rounded-xl`,children:[r?(0,U.jsx)(r,{},n?.id):null,(0,U.jsx)(`main`,{className:`flex min-w-0 flex-1 flex-col overflow-hidden`,children:e??(0,U.jsx)(ui,{})})]}),(0,U.jsx)(Kte,{open:i,onOpenChange:a})]})}function P9({crumbs:e,actions:t,children:n}){return(0,U.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border bg-surface px-3`,children:[(0,U.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`flex min-w-0 items-center gap-1`,children:e.map((e,t)=>(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[t>0?(0,U.jsx)(lv,{"aria-hidden":!0,className:`size-3 shrink-0 text-fg-4`}):null,e.to?(0,U.jsx)(Jr,{to:e.to,className:`shrink-0 text-body-sm text-fg-3 outline-none hover:text-fg-1`,children:e.label}):(0,U.jsx)(`span`,{"aria-current":`page`,className:`min-w-0 truncate text-body-sm font-medium text-fg-1`,title:e.label,children:e.label})]},e.label))}),n,(0,U.jsx)(`span`,{className:`flex-1`}),t]})}function F9({children:e}){return(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,U.jsx)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6`,children:e})})}function I9({label:e,children:t}){return(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-1.5`,children:[(0,U.jsx)(`span`,{className:`shrink-0 text-label font-medium text-fg-3`,children:e}),(0,U.jsx)(`span`,{className:`min-w-0 text-right text-body-sm text-fg-1`,children:t})]})}function Une(){let{hostId:e}=kr({from:`/gateways/$hostId`}),t=jr(),{hosts:n,ready:r}=F7(),{snapshots:i}=r9(),[a,o]=(0,v.useState)(!1),s=n.find(t=>t.id===e),c=i.find(t=>t.host.id===e);if((0,v.useEffect)(()=>{r&&!s&&t({to:`/gateways`})},[r,s,t]),!s)return null;let l=c===void 0?`pending`:c.error?`error`:`ok`;return(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsx)(P9,{crumbs:[{label:`Gateways`,to:`/gateways`},{label:s.name}],actions:s.implicit?null:(0,U.jsxs)(lo,{variant:`outline`,size:`xs`,onClick:()=>o(!0),children:[(0,U.jsx)(nC,{className:`size-3`}),`Remove`]}),children:(0,U.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,title:s.baseUrl,children:s.baseUrl})}),(0,U.jsxs)(F9,{children:[(0,U.jsxs)(po,{children:[(0,U.jsx)(mo,{children:(0,U.jsx)(ho,{children:`Connection`})}),(0,U.jsxs)(go,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsx)(I9,{label:`Status`,children:l===`ok`?(0,U.jsx)(fo,{variant:`success`,dot:!0,children:`Connected`}):l===`error`?(0,U.jsx)(fo,{variant:`danger`,dot:!0,children:`Unreachable`}):(0,U.jsx)(fo,{variant:`neutral`,dot:!0,children:`Connecting…`})}),c?.error?(0,U.jsx)(I9,{label:`Last error`,children:(0,U.jsx)(`span`,{className:`text-danger`,children:c.error})}):null,(0,U.jsx)(I9,{label:`Live sessions`,children:c?c.sessions.length:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`-`})}),(0,U.jsx)(I9,{label:`Reachability`,children:j7(s)?`This machine (loopback)`:`Remote`}),(0,U.jsx)(I9,{label:`Credential`,children:s.implicit?(0,U.jsx)(`span`,{className:`text-fg-4`,children:`the login cookie it set - same origin`}):(0,U.jsx)(`span`,{className:`text-fg-4`,children:`an auth key held in this browser`})})]})]}),s.implicit?(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`This is the gateway that served the page. Its address is this origin and its credential is the cookie it already set, so there is nothing here to change - and nothing to remove, since removing it would just be closing the tab.`}):(0,U.jsxs)(po,{children:[(0,U.jsx)(mo,{children:(0,U.jsx)(ho,{children:`Settings`})}),(0,U.jsx)(go,{children:(0,U.jsx)(I7,{host:s,onSaved:e=>DT.success(`Saved ${e.name}`)},s.id)})]}),a?(0,U.jsx)(R7,{host:s,onClose:()=>o(!1),onRemoved:()=>{o(!1),t({to:`/gateways`})}}):null]})]})}function Wne(){return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsx)(JT,{icon:(0,U.jsx)(Sx,{}),title:`No gateway selected`,description:(0,U.jsxs)(U.Fragment,{children:[`Pick one on the left, or add one with `,(0,U.jsx)(YT,{children:`+`}),` above.`]})})})}function Gne({files:e,activePath:t,onActivate:n,onClose:r,className:i}){return(0,U.jsx)(cT,{delay:500,closeDelay:0,children:(0,U.jsx)(`div`,{"data-slot":`editor-tabs`,role:`tablist`,"aria-label":`Open files`,className:W(`flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-surface`,i),children:e.map(i=>(0,U.jsx)(Kne,{file:i,active:i.path===t,onActivate:()=>n(i.path),onClose:()=>r(i.path),onArrow:t=>{let r=e[e.findIndex(e=>e.path===i.path)+t];r&&n(r.path)}},i.path))})})}function Kne({file:e,active:t,onActivate:n,onClose:r,onArrow:i}){let a=Ej(e),o=(0,v.useRef)(null);return(0,v.useEffect)(()=>{t&&o.current?.scrollIntoView({block:`nearest`,inline:`nearest`})},[t]),(0,U.jsxs)(uT,{side:`bottom`,render:(0,U.jsx)(`div`,{ref:o,role:`tab`,tabIndex:t?0:-1,"aria-selected":t,onClick:n,onAuxClick:e=>{e.button===1&&(e.preventDefault(),r())},onKeyDown:e=>{if(e.key===`ArrowRight`)i(1);else if(e.key===`ArrowLeft`)i(-1);else if(e.key===`Enter`||e.key===` `)n();else return;e.preventDefault()},className:W(`group flex min-w-0 shrink-0 cursor-pointer items-center gap-1.5 border-r border-border px-3 py-1.5 transition-colors`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent focus-visible:ring-inset`,t?`bg-bg text-fg-1`:`text-fg-3 hover:bg-surface-hover hover:text-fg-2`)}),content:(0,U.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,U.jsx)(`span`,{className:`font-mono break-all`,children:e.path}),e.bytes===void 0?null:(0,U.jsx)(`span`,{className:`text-fg-4`,children:pM(e.bytes)})]}),children:[(0,U.jsx)(`span`,{className:W(`max-w-40 truncate font-mono text-label`,a&&`italic`),children:e.name}),e.status===`error`?(0,U.jsx)(`span`,{className:`shrink-0 text-danger`,children:`!`}):null,(0,U.jsxs)(`button`,{type:`button`,"aria-label":a?`Close ${e.name} (unsaved changes)`:`Close ${e.name}`,onClick:e=>{e.stopPropagation(),r()},className:W(`shrink-0 rounded p-0.5 text-fg-4 transition-opacity hover:bg-surface-hover hover:text-fg-1`,t||a?`opacity-70`:`opacity-0 group-hover:opacity-70 focus-visible:opacity-100`),children:[(0,U.jsx)(`span`,{className:W(`block`,a&&`group-hover:hidden`),children:a?(0,U.jsx)(`span`,{className:`block size-3 rounded-full bg-fg-2`}):(0,U.jsx)(DC,{className:`size-3`})}),a?(0,U.jsx)(`span`,{className:`hidden group-hover:block`,children:(0,U.jsx)(DC,{className:`size-3`})}):null]})]})}var L9=12;function qne({tree:e,search:t,activePath:n,onOpenFile:r,onCollapse:i,style:a,className:o}){let[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(),d=s.trim().length>0;return(0,v.useEffect)(()=>{if(!t?.available)return;let e=s.trim();if(!e){u(void 0);return}let n=new AbortController,r=setTimeout(()=>{t.search(e,{limit:60,signal:n.signal}).then(e=>{n.signal.aborted||u(e)})},150);return()=>{n.abort(),clearTimeout(r)}},[t,s]),(0,U.jsxs)(`div`,{"data-slot":`file-tree`,style:a,className:W(`flex min-h-0 min-w-0 flex-col bg-surface`,o),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-2`,children:[t?.available?(0,U.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,U.jsx)(oS,{className:`absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4`}),(0,U.jsx)(_o,{value:s,onChange:e=>c(e.target.value),placeholder:`Search files…`,className:`h-7 pr-7 pl-7 text-label`,spellCheck:!1}),d?(0,U.jsx)(`button`,{type:`button`,onClick:()=>c(``),"aria-label":`Clear search`,className:`absolute top-1/2 right-1.5 -translate-y-1/2 text-fg-4 transition-colors hover:text-fg-2`,children:(0,U.jsx)(DC,{className:`size-3.5`})}):null]}):(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-1 text-label text-fg-4`,children:e.root}),(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh the file tree`,onClick:()=>e.refresh(),children:(0,U.jsx)(Rx,{className:`size-3.5 text-fg-3`})}),i?(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Hide project files`,onClick:i,children:(0,U.jsx)(ix,{className:`size-3.5 text-fg-3`})}):null]}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-1 py-1`,children:e.error?(0,U.jsx)(`p`,{className:`px-2 py-3 text-body-sm text-danger`,children:e.error}):d?l===void 0?(0,U.jsx)(`div`,{className:`py-6 text-center`,children:(0,U.jsx)(GT,{className:`size-4 text-fg-4`})}):l.length===0?(0,U.jsx)(`p`,{className:`px-2 py-6 text-center text-body-sm text-fg-4`,children:`No matching files.`}):(0,U.jsx)(`ul`,{children:l.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsx)(R9,{label:Jne(e.relative),detail:Yne(e.relative),title:e.relative,icon:(0,U.jsx)(ly,{className:`size-3.5 shrink-0 text-fg-4`}),active:e.path===n,onClick:()=>r(e.path)})},e.path))}):e.loading?(0,U.jsx)(`div`,{className:`py-6 text-center`,children:(0,U.jsx)(GT,{className:`size-4 text-fg-4`})}):e.rows.length===0?(0,U.jsx)(`p`,{className:`px-2 py-6 text-center text-body-sm text-fg-4`,children:`This project is empty.`}):(0,U.jsx)(`ul`,{role:`tree`,"aria-label":`Project files`,children:e.rows.map(t=>(0,U.jsxs)(`li`,{role:`treeitem`,"aria-expanded":t.expanded,"aria-level":t.depth+1,children:[(0,U.jsx)(R9,{label:t.entry.name,indent:t.depth,active:t.entry.path===n,icon:t.entry.type===`dir`?t.loading?(0,U.jsx)(GT,{className:`size-3.5 shrink-0 text-fg-4`}):t.expanded?(0,U.jsx)(gy,{className:`size-3.5 shrink-0 text-accent`}):(0,U.jsx)(Sy,{className:`size-3.5 shrink-0 text-accent`}):(0,U.jsx)(Y2,{type:t.entry.type}),chevron:t.entry.type===`dir`?(0,U.jsx)(lv,{className:W(`size-3 shrink-0 text-fg-4 transition-transform`,t.expanded&&`rotate-90`)}):void 0,onClick:()=>t.entry.type===`dir`?e.toggle(t.entry.path):r(t.entry.path)}),t.truncated?(0,U.jsx)(`p`,{className:`truncate py-0.5 text-label text-fg-4`,style:{paddingLeft:(t.depth+1)*L9+22},children:`More entries than the server will return - use search.`}):null]},t.entry.path))})})]})}function R9({label:e,detail:t,title:n,icon:r,chevron:i,indent:a=0,active:o,onClick:s}){let c=(0,v.useRef)(null);return(0,v.useEffect)(()=>{o&&c.current?.scrollIntoView({block:`nearest`})},[o]),(0,U.jsxs)(`button`,{ref:c,type:`button`,onClick:s,title:n??e,style:{paddingLeft:a*L9+4},className:W(`flex w-full items-center gap-1 rounded py-1 pr-2 text-left transition-colors`,o?`bg-surface-hover text-fg-1`:`text-fg-2 hover:bg-surface-hover`),children:[(0,U.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:i}),r,(0,U.jsx)(`span`,{className:`shrink-0 truncate text-label`,children:e}),t?(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label text-fg-4`,children:t}):null]})}function Jne(e){return e.slice(e.lastIndexOf(`/`)+1)}function Yne(e){let t=e.lastIndexOf(`/`);return t===-1?void 0:e.slice(0,t)}function Xne({path:e,value:t,onChange:n,onSave:r,readOnly:i,className:a}){let o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),[l,u]=(0,v.useState)(!1),d=Zne(),f=(0,v.useRef)({onChange:n,onSave:r});return f.current={onChange:n,onSave:r},(0,v.useEffect)(()=>{let n=!1;return Qne().then(r=>{if(n||!o.current)return;c.current=r;let a=r.editor.create(o.current,{value:t,language:V9(e),readOnly:i,automaticLayout:!0,theme:z9(document.documentElement.getAttribute(`data-theme`)),minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineHeight:20,fontFamily:`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`,renderLineHighlight:`line`,smoothScrolling:!0,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10},wordBasedSuggestions:`off`,quickSuggestions:!1});s.current=a,a.onDidChangeModelContent(()=>{f.current.onChange?.(a.getValue())}),a.addCommand(r.KeyMod.CtrlCmd|r.KeyCode.KeyS,()=>{f.current.onSave?.()}),u(!0)}),()=>{n=!0,s.current?.dispose(),s.current=null,u(!1)}},[]),(0,v.useEffect)(()=>{let n=c.current,r=s.current;if(!n||!r||!l)return;let i=n.Uri.parse(`workerdeck://host${e}`),a=n.editor.getModel(i)??n.editor.createModel(t,V9(e),i);r.getModel()!==a&&r.setModel(a)},[e,l,t]),(0,v.useEffect)(()=>{let e=s.current;if(!e||!l)return;let n=e.getModel();n&&n.getValue()!==t&&n.pushEditOperations([],[{range:n.getFullModelRange(),text:t}],()=>null)},[t,l]),(0,v.useEffect)(()=>{l&&s.current?.updateOptions({readOnly:i})},[i,l]),(0,v.useEffect)(()=>{l&&c.current?.editor.setTheme(z9(d))},[d,l]),(0,U.jsxs)(`div`,{className:W(`relative min-h-0 min-w-0 flex-1`,a),children:[(0,U.jsx)(`div`,{ref:o,className:`absolute inset-0`}),l?null:(0,U.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-bg`,children:(0,U.jsx)(GT,{className:`size-4 text-fg-4`})})]})}function Zne(){let[e,t]=(0,v.useState)(()=>typeof document>`u`?null:document.documentElement.getAttribute(`data-theme`));return(0,v.useEffect)(()=>{let e=document.documentElement,n=()=>t(e.getAttribute(`data-theme`));n();let r=new MutationObserver(n);return r.observe(e,{attributes:!0,attributeFilter:[`data-theme`]}),()=>r.disconnect()},[]),e}function z9(e){return e===`light`?`wd-light`:`wd-dark`}var B9;function Qne(){return B9??=(async()=>{let e=await Ij(()=>import(`./vs-CdkLmTlg.js`).then(e=>e.t),__vite__mapDeps([0,1]));return e.editor.defineTheme(`wd-dark`,{base:`vs-dark`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),e.editor.defineTheme(`wd-light`,{base:`vs`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),e})(),B9}function V9(e){let t=e.slice(e.lastIndexOf(`/`)+1);return $ne[t.toLowerCase()]||(ere[t.slice(t.lastIndexOf(`.`)+1).toLowerCase()]??`plaintext`)}var $ne={dockerfile:`dockerfile`,makefile:`plaintext`,".gitignore":`plaintext`,".env":`shell`},ere={ts:`typescript`,tsx:`typescript`,mts:`typescript`,cts:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,md:`markdown`,mdx:`markdown`,css:`css`,scss:`scss`,less:`less`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,yml:`yaml`,yaml:`yaml`,toml:`plaintext`,sh:`shell`,bash:`shell`,zsh:`shell`,fish:`shell`,py:`python`,rb:`ruby`,rs:`rust`,go:`go`,swift:`swift`,java:`java`,kt:`kotlin`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,sql:`sql`,graphql:`graphql`,gql:`graphql`,lua:`lua`,r:`r`,pl:`perl`,dart:`dart`,scala:`scala`,ini:`ini`,cfg:`ini`,conf:`ini`,txt:`plaintext`,log:`plaintext`};function tre({file:e,canWrite:t,onChange:n,onSave:r,onRevert:i,onReload:a,onOverwrite:o,onDismissConflict:s,className:c}){return e?(0,U.jsxs)(`div`,{"data-slot":`file-viewer`,className:W(`flex min-h-0 min-w-0 flex-1 flex-col bg-bg`,c),children:[e.conflict?(0,U.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-warning/40 bg-warning-bg px-3 py-2`,children:[(0,U.jsx)(oC,{className:`size-3.5 shrink-0 text-warning`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 text-body-sm text-warning`,children:`This file changed on disk since you opened it.`}),(0,U.jsx)(lo,{variant:`outline`,size:`xs`,onClick:()=>a?.(e.path),children:`Use the version on disk`}),(0,U.jsx)(lo,{variant:`outline`,size:`xs`,onClick:()=>o?.(e.path),children:`Keep mine`}),(0,U.jsx)(lo,{variant:`ghost`,size:`xs`,onClick:()=>s?.(e.path),children:`Dismiss`})]}):e.saveError?(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-danger/40 bg-danger-bg px-3 py-2`,children:[(0,U.jsx)(oC,{className:`size-3.5 shrink-0 text-danger`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 text-body-sm text-danger`,children:e.saveError}),(0,U.jsx)(lo,{variant:`ghost`,size:`xs`,onClick:()=>s?.(e.path),children:`Dismiss`})]}):null,e.status===`loading`?(0,U.jsx)(H9,{children:(0,U.jsx)(GT,{className:`size-4 text-fg-4`})}):e.status===`error`?(0,U.jsxs)(H9,{children:[(0,U.jsx)(oC,{className:`size-4 text-danger`}),(0,U.jsx)(`p`,{className:`text-body-sm text-danger`,children:e.error})]}):e.status===`binary`?(0,U.jsxs)(H9,{children:[(0,U.jsx)(oee,{className:`size-4 text-fg-4`}),(0,U.jsx)(`p`,{className:`text-body-sm text-fg-4`,children:`This file isn’t text.`}),(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`It can’t be edited here without corrupting it.`})]}):(0,U.jsx)(Xne,{path:e.path,value:Dj(e),readOnly:!t,onChange:n?t=>n(e.path,t):void 0,onSave:r?()=>r(e.path):void 0}),e.status===`ready`&&(e.saving||Ej(e)||!t)?(0,U.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-border px-3 py-1`,children:e.saving?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(GT,{className:`size-3 text-fg-4`}),(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:`Saving…`})]}):t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-label text-fg-3`,children:`Unsaved changes`}),(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(lo,{variant:`ghost`,size:`xs`,onClick:()=>i?.(e.path),children:`Revert`}),(0,U.jsxs)(lo,{variant:`outline`,size:`xs`,onClick:()=>r?.(e.path),children:[`Save`,(0,U.jsx)(`span`,{className:`ml-1 text-fg-4`,children:`⌘S`})]})]}):(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:`Read-only - this gateway doesn’t allow writes.`})}):null]}):null}function H9({children:e}){return(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6`,children:e})}var nre=180,rre=520,ire=220,U9=120;function W9({client:e,sessionId:t,header:n,transcriptVariant:r,transcriptDensity:i,transcriptFont:a,scrubber:o,bookmarks:s,onToggleBookmark:c,stickyPrompt:l,openSubagent:u,reveal:d,subagents:f,onSubagentChange:p,openShell:m,shells:h,onShellChange:g,statusPlacement:_,controlsSurface:y,fontSize:b,onLinkClick:x,onOpenFile:S,unseen:C,readOnly:w,onVitals:T,defaultRailWidth:E=260,defaultRailCollapsed:D,onRailChange:O,className:k}){let{info:A}=Tj(e,t),j=A?.cwd,M=hj(e,j),N=pj(e,j),P=Mj(e),{canWrite:F}=mj(e);(0,v.useEffect)(()=>{if(!P.hasUnsaved)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[P.hasUnsaved]);let I=ore(),[L,R]=(0,v.useState)(D??!1),[z,ee]=(0,v.useState)(E),B=(0,v.useRef)(O);B.current=O,(0,v.useEffect)(()=>{B.current?.({width:z,collapsed:L})},[z,L]);let[V,te]=(0,v.useState)(360),ne=P.files.length>0,H=!I,re=M.available&&!L;(0,v.useEffect)(()=>{H&&R(!0)},[H]);let ie=(0,v.useCallback)(e=>{let t=P.files.find(t=>t.path===e);if(t&&Ej(t)){let e=t.name;if(!window.confirm(`${e} has unsaved changes. Close it and lose them?`))return}P.close(e)},[P]),ae=(0,v.useRef)(null),oe=are(ae);y5({container:ae,onOpen:(0,v.useCallback)(({path:e})=>P.open(b5(e,j)),[P.open,j]),enabled:M.available,ignore:`.monaco-editor, .xterm`});let se=Math.max(U9,oe-ire),[ce,le]=(0,v.useState)(null),ue=n===void 0||ce===null?void 0:typeof n==`function`?e=>(0,Ed.createPortal)(n(e),ce):(0,Ed.createPortal)(n,ce);return(0,U.jsxs)(`div`,{"data-slot":`session-workspace`,className:W(`flex h-full min-h-0 w-full flex-col overflow-hidden bg-bg`,k),children:[n===void 0?null:(0,U.jsx)(`div`,{ref:le,className:`shrink-0`}),(0,U.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,children:[re?(0,U.jsx)(qne,{tree:M,search:N,activePath:P.activePath,onOpenFile:P.open,onCollapse:()=>R(!0),style:{width:H?Math.min(z,320):z},className:W(`shrink-0 border-r border-border`,H&&`absolute inset-y-0 left-0 z-20 shadow-lg`)}):M.available?(0,U.jsx)(`div`,{className:`flex w-8 shrink-0 flex-col items-center border-r border-border bg-surface pt-1.5`,children:(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Show project files`,onClick:()=>R(!1),children:(0,U.jsx)(ox,{className:`size-4 text-fg-3`})})}):null,re&&!H?(0,U.jsx)(qT,{orientation:`vertical`,value:z,onValueChange:ee,min:nre,max:rre,defaultValue:E,"aria-label":`Resize the file tree`}):null,(0,U.jsxs)(`div`,{ref:ae,className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[ne?(0,U.jsxs)(`div`,{className:`flex min-h-0 shrink-0 flex-col overflow-hidden`,style:{height:Math.min(V,se||V)},children:[(0,U.jsx)(Gne,{files:P.files,activePath:P.activePath,onActivate:P.activate,onClose:ie}),(0,U.jsx)(tre,{file:P.active,canWrite:F,onChange:P.edit,onSave:e=>void P.save(e),onRevert:P.revert,onReload:P.reload,onOverwrite:e=>void P.overwrite(e),onDismissConflict:P.dismissConflict})]}):null,ne?(0,U.jsx)(qT,{orientation:`horizontal`,value:Math.min(V,se||V),onValueChange:te,min:U9,max:se,"aria-label":`Resize the open file`}):null,(0,U.jsx)(a5,{client:e,sessionId:t,header:ue,transcriptVariant:r,transcriptDensity:i,transcriptFont:a,scrubber:o,bookmarks:s,onToggleBookmark:c,stickyPrompt:l,openSubagent:u,reveal:d,subagents:f,onSubagentChange:p,openShell:m,shells:h,onShellChange:g,controlsSurface:y,fontSize:b,onLinkClick:x,onOpenFile:S??P.open,statusPlacement:_,unseen:C,readOnly:w,onVitals:T,className:`min-h-0 flex-1`})]}),H&&re?(0,U.jsx)(`button`,{type:`button`,"aria-label":`Close the file tree`,onClick:()=>R(!0),className:`absolute inset-0 z-10 bg-black/30`}):null]})]})}function are(e){let[t,n]=(0,v.useState)(0);return(0,v.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(([e])=>{e&&n(e.contentRect.height)});return r.observe(t),()=>r.disconnect()},[e]),t}function ore(){let[e,t]=(0,v.useState)(!0);return(0,v.useEffect)(()=>{let e=window.matchMedia(`(min-width: 768px)`),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var G9=`workerdeck.rail`,sre={width:260,collapsed:!1};function K9(){let e=S(G9,{});return{width:Math.min(520,Math.max(180,Number(e.width)||sre.width)),collapsed:e.collapsed===!0}}function q9(e){C(G9,e)}function cre(){let{jobId:e}=kr({from:`/jobs/$jobId`}),t=jr(),{jobs:n,refresh:r}=E9(),{snapshots:i}=r9(),a=n.find(t=>t.id===e),o=o9(),s=A7()?.id,c=a?.sessionId!==void 0&&(i.find(e=>e.host.id===s)?.sessions.some(e=>e.id===a.sessionId)??!1),[l,u]=(0,v.useState)(!1);(0,v.useEffect)(()=>{n.length>0&&u(!0)},[n.length]),(0,v.useEffect)(()=>{l&&!a&&(DT.error(`That job is no longer in the queue`),t({to:`/jobs`}))},[l,a,t]);let[d]=(0,v.useState)(r7),[f]=(0,v.useState)(o7),[p]=(0,v.useState)(l7),[m]=(0,v.useState)(f7),[h]=(0,v.useState)(K9);if(!a)return null;let g=(0,U.jsx)(J9,{job:a,onChanged:()=>void r()});return!o||!c||!a.sessionId?(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[g,(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center`,children:[(0,U.jsx)(`p`,{className:`text-body-sm text-fg-3`,children:a.sessionId?`This job’s session is no longer on the gateway.`:`This job never got as far as a session.`}),(0,U.jsx)(`p`,{className:`max-w-md text-label text-fg-4`,children:`The queue keeps the job record - status, usage, error - but the transcript lives with the session, and that one has been closed or swept.`})]})]}):(0,U.jsx)(W9,{client:o,sessionId:a.sessionId,readOnly:!0,transcriptVariant:f,transcriptDensity:d,transcriptFont:p,fontSize:m,scrubber:!0,stickyPrompt:!0,statusPlacement:`bottom`,defaultRailWidth:h.width,defaultRailCollapsed:h.collapsed,onRailChange:q9,header:({actions:e})=>(0,U.jsx)(J9,{job:a,onChanged:()=>void r(),actions:e})},a.sessionId)}function J9({job:e,onChanged:t,actions:n}){let r=D9[e.status],i=e.status===`queued`||e.status===`running`||e.status===`parked`,a=async()=>{try{await o9().cancelJob(e.id),t()}catch(e){DT.error(e instanceof Error?e.message:`Cancel failed`)}};return(0,U.jsxs)(P9,{crumbs:[{label:`Jobs`,to:`/jobs`},{label:e.prompt}],actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(fo,{variant:`neutral`,className:`shrink-0`,children:`read-only`}),(0,U.jsx)(WT,{value:e.id,"aria-label":`Copy job id`}),i?(0,U.jsxs)(lo,{variant:`outline`,size:`xs`,onClick:()=>void a(),children:[(0,U.jsx)(DC,{className:`size-3`}),`Cancel`]}):null,n]}),children:[(0,U.jsxs)(fo,{variant:r.variant,dot:!r.busy,className:`shrink-0`,children:[r.busy?(0,U.jsx)(GT,{className:`size-3 text-current`}):null,r.label]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-x-3 font-mono text-label text-fg-4`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:e.cwd}),e.profile?(0,U.jsxs)(`span`,{className:`shrink-0`,children:[`@`,e.profile]}):null,(0,U.jsx)(`span`,{className:`shrink-0`,children:hM(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?(0,U.jsxs)(`span`,{className:`shrink-0`,children:[`attempt `,e.attempt??1,`/`,e.maxAttempts,e.status===`queued`&&e.nextRunAt!==void 0&&e.nextRunAt>Date.now()?` - retry pending`:``]}):null,e.usage.tokens>0?(0,U.jsxs)(`span`,{className:`shrink-0`,children:[fM(e.usage.tokens),` tok`]}):null,(e.usage.costUsd??e.usage.totalCostUsd)>0?(0,U.jsx)(`span`,{className:`shrink-0`,children:uM(e.usage.costUsd??e.usage.totalCostUsd)}):null,e.error?(0,U.jsx)(`span`,{className:`truncate text-danger`,children:e.error}):null]})]})}function lre({profile:e,onSaved:t}){let n=e.engine===`provider`,[r,i]=(0,v.useState)(e.description??``),[a,o]=(0,v.useState)(e.defaults?.model??``),[s,c]=(0,v.useState)(e.defaults?.permissionMode),[l,u]=(0,v.useState)(e.provider?.model??``),[d,f]=(0,v.useState)((e.provider?.models??[]).join(`, `)),[p,m]=(0,v.useState)(e.session?.capabilities),[h,g]=(0,v.useState)((e.session?.mcpServers??[]).join(`, `)),[_,y]=(0,v.useState)(e.session?.instructions??``),[b,x]=(0,v.useState)(!1),S=s9(e,s??`default`,a),C=S.models.map(t=>t.value==="default"?{...t,displayName:`Unset`,description:e.defaultModel??`whatever the engine's own config picks`}:t),w=async()=>{let i={description:r.trim()||void 0,defaults:{model:a.trim()||void 0,permissionMode:s}};n&&(i.provider={...e.provider,id:e.provider?.id??``,model:l.trim()||void 0,models:k9(d).length>0?k9(d):void 0},i.session={capabilities:p,mcpServers:k9(h).length>0?k9(h):void 0,instructions:_.trim()||void 0}),x(!0);try{t(await o9().updateProfile(e.name,i)),DT.success(`Profile saved`)}catch(e){DT.error(e instanceof Error?e.message:`Failed to save profile`)}finally{x(!1)}};return(0,U.jsxs)(po,{children:[(0,U.jsx)(mo,{children:(0,U.jsx)(ho,{children:`Edit profile`})}),(0,U.jsxs)(go,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(A9,{label:`Description`,children:(0,U.jsx)(_o,{value:r,onChange:e=>i(e.target.value)})}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(A9,{label:`Default model`,children:C.length>1?(0,U.jsx)(a9,{value:a,onChange:o,models:C}):(0,U.jsx)(_o,{value:a,onChange:e=>o(e.target.value),placeholder:`unset - request / engine default`,className:`font-mono`})}),(0,U.jsx)(A9,{label:`Default permission mode`,children:(0,U.jsx)(g4,{variant:`form`,mode:s,onModeChange:c,modes:S.modes})})]}),n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(A9,{label:`Default model id`,children:(0,U.jsx)(_o,{value:l,onChange:e=>u(e.target.value),className:`font-mono`})}),(0,U.jsx)(A9,{label:`Models offered (comma-separated)`,children:(0,U.jsx)(_o,{value:d,onChange:e=>f(e.target.value),className:`font-mono`})})]}),(0,U.jsx)(A9,{label:`Capabilities granted`,children:(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 py-1.5`,children:[(0,U.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:p===void 0,onChange:e=>m(e.target.checked?void 0:[]),className:`size-3.5 accent-(--color-fg-1)`}),`not declared`]}),O9.map(e=>(0,U.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2`,children:[(0,U.jsx)(`input`,{type:`checkbox`,disabled:p===void 0,checked:p?.includes(e)??!1,onChange:t=>m(n=>t.target.checked?[...n??[],e]:(n??[]).filter(t=>t!==e)),className:`size-3.5 accent-(--color-fg-1) disabled:opacity-40`}),(0,U.jsx)(`code`,{className:`font-mono text-label`,children:e})]},e))]})}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(A9,{label:`MCP servers (names, comma-separated)`,children:(0,U.jsx)(_o,{value:h,onChange:e=>g(e.target.value),className:`font-mono`})}),(0,U.jsx)(A9,{label:`Instructions`,children:(0,U.jsx)(_o,{value:_,onChange:e=>y(e.target.value)})})]})]}):null,(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`Name and engine are fixed - sessions and jobs are pinned to the name, and the engine decides what the rest of these fields mean.`}),(0,U.jsxs)(lo,{onClick:()=>void w(),disabled:b,children:[b?(0,U.jsx)(GT,{className:`size-3.5 text-current`}):(0,U.jsx)(Qx,{className:`size-4`}),`Save`]})]})]})]})}function ure(e){window.location.href=`vscode://file${e}`}function dre(){return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsx)(JT,{icon:(0,U.jsx)(mC,{}),title:`No profile selected`,description:`A profile is what a session runs as - its config directory and credentials, or a model provider.`})})}function Y9({items:e,empty:t}){return e.length===0?(0,U.jsx)(`span`,{className:`text-fg-4`,children:t}):(0,U.jsx)(`span`,{className:`flex flex-wrap justify-end gap-1`,children:e.map(e=>(0,U.jsx)(fo,{variant:`neutral`,children:e},e))})}function fre(){let{profileName:e}=kr({from:`/profiles/$profileName`}),t=jr(),{refresh:n}=p9(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)();(0,v.useEffect)(()=>{let t=!0,n=()=>{o9()?.getProfile(e).then(e=>{t&&i(e)}).catch(e=>{t&&o(e instanceof Error?e.message:`Failed to load profile`)})};n();let r=setInterval(n,6e4);return()=>{t=!1,clearInterval(r)}},[e]);let s=r?.profile,c=r?.config,l=(0,v.useMemo)(()=>Ak(s?.usage),[s?.usage]),u=async()=>{try{await o9().deleteProfile(e),await n(),DT.success(`Profile '${e}' deleted`),t({to:`/profiles`})}catch(e){DT.error(e instanceof Error?e.message:`Delete failed`)}};return(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsx)(P9,{crumbs:[{label:`Profiles`,to:`/profiles`},{label:e}],actions:(0,U.jsxs)(U.Fragment,{children:[s?.configDir?(0,U.jsxs)(lo,{variant:`outline`,size:`xs`,onClick:()=>ure(s.configDir),children:[(0,U.jsx)(jv,{className:`size-3`}),`Open in VSCode`]}):null,s?.managed?(0,U.jsxs)(lo,{variant:`outline`,size:`xs`,onClick:()=>void u(),children:[(0,U.jsx)(nC,{className:`size-3`}),`Delete`]}):null]}),children:s?.description?(0,U.jsx)(`span`,{className:`min-w-0 truncate text-label text-fg-4`,children:s.description}):null}),(0,U.jsxs)(F9,{children:[a?(0,U.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:a}):null,!r&&!a?(0,U.jsx)(GT,{className:`mx-auto size-5 text-fg-4`}):null,s&&c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(po,{children:[(0,U.jsx)(mo,{children:(0,U.jsx)(ho,{children:`Worker defaults`})}),(0,U.jsxs)(go,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsx)(I9,{label:`Engine`,children:(0,U.jsx)(fo,{variant:`neutral`,children:s.engine??`claude`})}),s.engine===`provider`?(0,U.jsx)(I9,{label:`Provider`,children:(0,U.jsx)(`span`,{className:`font-mono text-label`,children:s.provider?.id})}):(0,U.jsx)(I9,{label:`Config directory`,children:(0,U.jsx)(`span`,{className:`font-mono text-label`,children:s.configDir})}),(0,U.jsx)(I9,{label:`Default model`,children:s.defaults?.model??s.provider?.model??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`request / engine default`})}),(0,U.jsx)(I9,{label:`Default permission mode`,children:s.defaults?.permissionMode??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`request / engine default`})}),s.engine===`provider`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I9,{label:`Models offered`,children:(0,U.jsx)(Y9,{items:s.provider?.models??[],empty:`the default model only`})}),(0,U.jsx)(I9,{label:`API key variable`,children:s.provider?.apiKeyEnv?(0,U.jsx)(`span`,{className:`font-mono text-label`,children:s.provider.apiKeyEnv}):(0,U.jsx)(`span`,{className:`text-fg-4`,children:`provider SDK default`})})]}):null]})]}),l.length>0?(0,U.jsxs)(po,{children:[(0,U.jsx)(mo,{children:(0,U.jsx)(ho,{children:`Plan usage`})}),(0,U.jsx)(go,{children:(0,U.jsx)(Y8,{windows:l})})]}):null,s.engine===`provider`?(0,U.jsxs)(po,{children:[(0,U.jsx)(mo,{children:(0,U.jsx)(ho,{children:`Session grants`})}),(0,U.jsxs)(go,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsx)(I9,{label:`Capabilities`,children:(0,U.jsx)(Y9,{items:s.session?.capabilities??[],empty:`not declared - whatever the server wired`})}),(0,U.jsx)(I9,{label:`MCP servers`,children:(0,U.jsx)(Y9,{items:s.session?.mcpServers??[],empty:`not declared - every connected server`})}),(0,U.jsx)(I9,{label:`Instructions`,children:s.session?.instructions?`${s.session.instructions.length} characters`:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`none`})})]})]}):null,s.engine===`provider`?null:(0,U.jsxs)(po,{children:[(0,U.jsx)(mo,{children:(0,U.jsx)(ho,{children:`Claude Code configuration`})}),(0,U.jsxs)(go,{className:`flex flex-col divide-y divide-border`,children:[c.settings?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I9,{label:`Model (settings.json)`,children:c.settings.model??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`not set`})}),(0,U.jsx)(I9,{label:`Default permission mode`,children:c.settings.defaultPermissionMode??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`not set`})}),(0,U.jsx)(I9,{label:`Permission rules`,children:(0,U.jsx)(`span`,{className:`font-mono text-label`,children:c.settings.permissionRules?`${c.settings.permissionRules.allow} allow · ${c.settings.permissionRules.ask} ask · ${c.settings.permissionRules.deny} deny`:`-`})}),(0,U.jsx)(I9,{label:`Env vars (names only)`,children:(0,U.jsx)(Y9,{items:c.settings.envKeys??[],empty:`none`})}),(0,U.jsx)(I9,{label:`Hooks`,children:(0,U.jsx)(Y9,{items:c.settings.hooks??[],empty:`none`})})]}):(0,U.jsx)(I9,{label:`settings.json`,children:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`not found`})}),(0,U.jsx)(I9,{label:`User memory (CLAUDE.md)`,children:c.hasUserMemory?`present`:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`none`})}),(0,U.jsx)(I9,{label:`Skills`,children:(0,U.jsx)(Y9,{items:c.skills,empty:`none`})}),(0,U.jsx)(I9,{label:`Agents`,children:(0,U.jsx)(Y9,{items:c.agents,empty:`none`})}),(0,U.jsx)(I9,{label:`Commands`,children:(0,U.jsx)(Y9,{items:c.commands,empty:`none`})})]})]}),s.managed?(0,U.jsx)(lre,{profile:s,onSaved:e=>i({...r,profile:e})}):null,(0,U.jsxs)(`p`,{className:`text-label text-fg-4`,children:[s.managed?`Stored on the server and editable here. `:`View only - this profile is declared in the server options. `,`Other profile configuration lives on the server (the `,(0,U.jsx)(`code`,{className:`font-mono`,children:`profiles`}),` option; for Claude profiles, the config directory itself, e.g. via VSCode). Provider credentials are resolved from the server's environment and never leave it.`]})]}):null]})]})}var X9=`workerdeck.bookmarks.v1`;function Z9(e,t){return`${e}:${t}`}function pre(e,t){let[n,r]=(0,v.useState)(()=>S(X9,{}));return{bookmarks:(0,v.useMemo)(()=>n[Z9(e,t)]??[],[n,e,t]),toggle:(0,v.useCallback)(n=>{r(r=>{let i=Z9(e,t),a=r[i]??[],o=a.includes(n)?a.filter(e=>e!==n):[...a,n],s={...r,[i]:o};return o.length===0&&delete s[i],C(X9,s),s})},[e,t])}}function mre(){let{hostId:e,sessionId:t}=kr({from:`/sessions/$hostId/$sessionId`}),{ready:n}=F7(),r=jr(),i=k7(e);return(0,v.useEffect)(()=>{n&&!i&&(DT.error(`That gateway is not configured here`),r({to:`/sessions`}))},[n,i,r]),i?(0,U.jsx)(hre,{hostId:e,sessionId:t,client:i},`${e}:${t}`):null}function hre({hostId:e,sessionId:t,client:n}){let r=jr(),{subagent:i,sn:a,reveal:o,rn:s,shell:c,shn:l}=Ar({from:`/sessions/$hostId/$sessionId`}),{info:u,error:d}=Tj(n,t),f=cne(e,t),{bookmarks:p,toggle:m}=pre(e,t),[h]=(0,v.useState)(()=>m7()===`on`?sne(e,t):void 0),[g]=(0,v.useState)(r7),[_]=(0,v.useState)(o7),[y]=(0,v.useState)(l7),[b]=(0,v.useState)(f7),[x]=(0,v.useState)(K9);(0,v.useEffect)(()=>{d&&(DT.error(`Session not found`),r({to:`/sessions`}))},[d,r]);let[S,C]=(0,v.useState)(()=>!document.hidden);(0,v.useEffect)(()=>{let e=()=>C(!document.hidden);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let{snapshots:w}=r9(),T=(0,v.useMemo)(()=>w.find(t=>t.host.id===e)?.sessions.find(e=>e.id===t),[w,e,t]);(0,v.useEffect)(()=>{T&&S&&f({activity:T.activityCount,prose:T.proseCount,turns:T.numTurns})},[T?.activityCount,T?.proseCount,T?.numTurns,S,f]);let E=async()=>{try{await n.deleteSession(t)}catch{}r({to:`/sessions`})},D=u?.cwd?.split(`/`).filter(Boolean).pop();return(0,U.jsx)(W9,{client:n,sessionId:t,transcriptVariant:_,transcriptDensity:g,transcriptFont:y,fontSize:b,openSubagent:i?{toolUseId:i,nonce:a??0}:void 0,reveal:o?{toolUseId:o,nonce:s??0}:void 0,subagents:T?.subagents,onSubagentChange:n=>{n!==i&&r({to:`/sessions/$hostId/$sessionId`,params:{hostId:e,sessionId:t},search:n===void 0?{}:e=>({subagent:n,sn:e.sn}),replace:!0})},openShell:c?{shellId:c,nonce:l??0}:void 0,shells:T?.shells,onShellChange:n=>{n!==c&&r({to:`/sessions/$hostId/$sessionId`,params:{hostId:e,sessionId:t},search:e=>({subagent:e.subagent,sn:e.sn,shell:n,shn:e.shn}),replace:!0})},scrubber:!0,bookmarks:p,onToggleBookmark:m,stickyPrompt:!0,statusPlacement:`bottom`,controlsSurface:`status`,defaultRailWidth:x.width,defaultRailCollapsed:x.collapsed,onRailChange:q9,unseen:h,onVitals:e=>{f({itemCount:e.itemCount}),mne()},header:({actions:e})=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border bg-surface px-3 py-2`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-sm font-medium text-fg-1`,children:u?.title??D??t.slice(0,8)}),u?.engine&&u.engine!==`claude`?(0,U.jsx)(fo,{variant:`neutral`,className:`shrink-0`,children:u.engine}):null,u?.cwd?(0,U.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,title:u.cwd,children:u.cwd}):null,(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(WT,{value:t,"aria-label":`Copy session id`}),(0,U.jsxs)(qC,{children:[(0,U.jsx)(JC,{render:(0,U.jsx)(lo,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close session`,children:(0,U.jsx)(nC,{className:`size-4 text-fg-3`})})}),(0,U.jsxs)(XC,{children:[(0,U.jsx)(ZC,{children:`Close this session?`}),(0,U.jsx)(QC,{children:`The run is terminated on the server. You can pick it up later from “Resume a previous session” - the transcript is kept by the engine, not by the gateway.`}),(0,U.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,U.jsx)(YC,{render:(0,U.jsx)(lo,{variant:`outline`,children:`Cancel`})}),(0,U.jsx)(lo,{variant:`destructive`,onClick:()=>void E(),children:`Close session`})]})]})]}),e]})},t)}var Q9=$r({component:Hne}),gre=Zr({getParentRoute:()=>Q9,path:`/`,beforeLoad:()=>{throw Ve({to:`/sessions`})}}),_re=Zr({getParentRoute:()=>Q9,path:`/sessions`,component:Rne}),vre=Zr({getParentRoute:()=>Q9,path:`/sessions/$hostId/$sessionId`,component:mre,validateSearch:e=>({subagent:typeof e.subagent==`string`?e.subagent:void 0,sn:typeof e.sn==`number`?e.sn:void 0,reveal:typeof e.reveal==`string`?e.reveal:void 0,rn:typeof e.rn==`number`?e.rn:void 0,shell:typeof e.shell==`string`?e.shell:void 0,shn:typeof e.shn==`number`?e.shn:void 0})}),yre=Zr({getParentRoute:()=>Q9,path:`/sessions/$sessionId`,beforeLoad:({params:e})=>{throw Ve({to:`/sessions/$hostId/$sessionId`,params:{hostId:x7,sessionId:e.sessionId},search:{}})}}),bre=Zr({getParentRoute:()=>Q9,path:`/gateways`,component:Wne}),xre=Zr({getParentRoute:()=>Q9,path:`/gateways/$hostId`,component:Une}),Sre=Zr({getParentRoute:()=>Q9,path:`/jobs`,component:kne}),Cre=Zr({getParentRoute:()=>Q9,path:`/jobs/$jobId`,component:cre}),wre=Zr({getParentRoute:()=>Q9,path:`/profiles`,component:dre}),Tre=Zr({getParentRoute:()=>Q9,path:`/profiles/$profileName`,component:fre}),Ere=Zr({getParentRoute:()=>Q9,path:`/settings`,beforeLoad:()=>{throw Ve({to:`/sessions`})}}),Dre=gi({routeTree:Q9.addChildren([gre,_re,vre,yre,bre,xre,Sre,Cre,wre,Tre,Ere]),history:wt()});function Ore(){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(yi,{router:Dre}),(0,U.jsx)(VT,{})]})}E();var $9=document.getElementById(`root`);if(!$9)throw Error(`Root element #root not found`);(0,y.createRoot)($9).render((0,U.jsx)(v.StrictMode,{children:(0,U.jsx)(Ore,{})}));export{Ij as a,s as c,eQ as i,l,L1 as n,Hn as o,V1 as r,d as s,kQ as t};
|