@workerdeck/web 3.4.0 → 3.6.1

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.
@@ -0,0 +1,214 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vs--sdmWUZx.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`),te=Symbol.for(`react.activity`),B=Symbol.for(`react.legacy_hidden`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.for(`react.view_transition`),V=Symbol.for(`react.recoverable`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var H=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===H?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 te:return`Activity`;case re: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)?vp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vp(t),e=yp(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&&(hh._currentValue=t.memoizedState,he(ye,e)),t=ge.current;var n=yp(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),hh._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:jh(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=bm(e);e!==null;){if(n=e[vt])return n;e=bm(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)&&(Wd(),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=tp(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){qf(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=tp(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=Td.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=Nd;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<Pd)throw Pd=0,Fd=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=th(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case te:return e=Oi(31,n,t,a),e.elementType=te,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 B:case re:return e=a|32,e=Oi(30,n,t,e),e.elementType=re,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`:Jf(`cancel`,t),Jf(`close`,t);break;case`iframe`:case`object`:case`embed`:Jf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)Jf(Gf[n],t);break;case`source`:Jf(`error`,t);break;case`img`:case`image`:case`link`:Jf(`error`,t),Jf(`load`,t);break;case`details`:Jf(`toggle`,t);break;case`input`:Jf(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Jf(`invalid`,t);break;case`textarea`:Jf(`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||sp(t.textContent,n)?(r.popover!=null&&(Jf(`beforetoggle`,t),Jf(`toggle`,t)),r.onScroll!=null&&Jf(`scroll`,t),r.onScrollEnd!=null&&Jf(`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`||xp(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=ym(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=ym(e)}else t===27?(t=ea,Ap(e.type)?(e=vm,vm=null,ea=e):ea=t):ea=$i?_m(e.stateNode.nextSibling):null;return!0}function la(){ea=$i=null,ta=!1}function ua(){var e=na;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,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=[hh]:e.push(hh))}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=Bf(),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(bd=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=Ef;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=Ef;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?td.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=td,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)||ae(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)||ae(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)||ae(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(ae(o)){if(l=ae(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),G=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uo(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 fo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ed&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 mo(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 ho(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 go=!1;function _o(){if(go){var e=La;if(e!==null)throw e}}function vo(e,t,n,r){go=!1;var i=e.updateQueue;G=!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?(rd&f)===f:(r&f)===f){f!==0&&f===Ia&&(go=!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:G=!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),dd|=o,e.lanes=o,e.memoizedState=d}}function yo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function bo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yo(n[e],t)}var xo=pe(null),So=pe(0);function Co(e,t){e=ld,he(So,e),he(xo,t),ld=e|t.baseLanes}function wo(){he(So,ld),he(xo,xo.current)}function To(){ld=So.current,me(xo),me(So)}var Eo=pe(null),Do=null;function Oo(e){var t=e.alternate;he(No,No.current&1),he(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){he(No,No.current),he(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(he(No,No.current),he(Eo,e),Do===null&&(Do=e)):jo()}function jo(){he(No,No.current),he(Eo,Eo.current)}function Mo(e){me(Eo),Do===e&&(Do=null),me(No)}var No=pe(0);function Po(e,t){he(Eo,Eo.current),he(No,t)}function Fo(e){me(No),me(Eo),Do===e&&(Do=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mm(n)||hm(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 Lo=0,Ro=null,zo=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(i(321))}function Yo(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 Xo(e,t,n,r,i,a){return Lo=a,Ro=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ce.H=e===null||e.memoizedState===null?pc:mc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){ce.H=fc;var t=zo!==null&&zo.next!==null;if(Lo=0,Bo=zo=Ro=null,Vo=!1,Go=0,Ko=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&ba(e)&&(jc=!0))}function Qo(e,t,n,r){Ro=e;var a=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=a)throw Error(i(301));if(a+=1,Bo=zo=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=hc,o=t(n,r)}while(Ho);return o}function $o(){var e=ce.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(zo===null?null:zo.memoizedState)!==e&&(Ro.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}Lo=0,Bo=zo=Ro=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?Ro.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(zo===null){var e=Ro.alternate;e=e===null?null:e.memoizedState}else e=zo.next;var t=Bo===null?Ro.memoizedState:Bo.next;if(t!==null)Bo=t,zo=e;else{if(e===null)throw Ro.alternate===null?Error(i(467)):Error(i(310));zo=e,e={memoizedState:zo.memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},Bo===null?Ro.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Za(Ko,e,t),t=Ro,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,ce.H=t===null||t.memoizedState===null?pc:mc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===V)return;if(e.$$typeof===F)return Sa(e)}throw Error(i(438,String(e)))}function cs(e){var t=null,n=Ro.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ro.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=as(),Ro.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]=ne;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),zo,e)}function ds(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?(Lo&f)===f:(rd&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((Lo&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,Ro.lanes|=p,dd|=p;f=u.action,Uo&&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,Ro.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(jc=!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 fs(e){var t=is(),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)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ps(e,t,n){var r=Ro,a=is(),o=ta;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((zo||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,Rs(gs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,td===null)throw Error(i(349));o||Lo&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ro.updateQueue,t===null?(t=as(),Ro.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function vs(e){var t=Ci(e,2);t!==null&&zd(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,zo,typeof r==`function`?r:ls)}function xs(e,t,n,r,a){if(lc(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,Ss(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ss(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),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),ce.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if(ta){var n=td.formState;if(n!==null){a:{var r=Ro;if(ta){if(ea){b:{for(var i=ea,a=ra;i.nodeType!==8;){if(!a){i=null;break b}if(i=_m(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=_m(i.nextSibling),r=i.data===`F!`;break a}}aa(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=oc.bind(null,Ro,r),r.dispatch=n,r=ys(!1),a=cc.bind(null,Ro,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,Ro,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),zo,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Ka?Ja:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Ro.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=zo;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ro.updateQueue,t===null&&(t=as(),Ro.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 Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();Ro.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;zo!==null&&r!==null&&Yo(r,zo.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(Ro.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function Ls(e,t){Fs(8390656,8,e,t)}function Rs(e,t){Is(2048,8,e,t)}function zs(e){Ro.flags|=4;var t=Ro.updateQueue;if(t===null)t=as(),Ro.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Bs(e){var t=is().memoizedState;return zs({ref:t,nextImpl:e}),function(){if(ed&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Vs(e,t){return Is(4,2,e,t)}function Hs(e,t){return Is(4,4,e,t)}function Us(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 Ws(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Us.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||Lo&1073741824&&!(rd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),Ro.lanes|=e,dd|=e,n)}function Ys(e,t,n,r){return Lr(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(rd&261930)?(jc=!0,e.memoizedState=n):(e=Ld(),Ro.lanes|=e,dd|=e,t):(e=Js(e,n,r),Lr(e,t)||(jc=!0),e)}function Xs(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,cc(e,!1,t,n);try{var c=i(),l=ce.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,Ba(c,r),Id(e)):sc(e,t,r,Id(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{le.p=a,o!==null&&s.types!==null&&(o.types=s.types),ce.T=o}}function Zs(){}function Qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=$s(e).queue;Xs(e,a,t,ue,n===null?Zs:function(){return ec(e),n(r)})}function $s(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:ls,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ec(e){var t=$s(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},Id())}function tc(){return Sa(hh)}function nc(){return is().memoizedState}function rc(){return is().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=fo(n);var r=po(t,e,n);r!==null&&(zd(r,t,n),mo(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=Si(e,t,n,r),n!==null&&(zd(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,Id())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(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),td===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return zd(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&zd(t,e,2)}function lc(e){var t=e.alternate;return e===Ro||t!==null&&t===Ro}function uc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dt(e,n)}}var fc={readContext:Sa,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},pc={readContext:Sa,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:Ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){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=ac.bind(null,Ro,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=oc.bind(null,Ro,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Xs.bind(null,Ro,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ro,a=rs();if(ta){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),td===null)throw Error(i(349));rd&127||ms(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ls(gs.bind(null,r,o,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,o,n,t),null),n},useId:function(){var e=rs(),t=td.identifierPrefix;if(ta){var n=qi,r=Ki;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,Ro,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=ic.bind(null,Ro)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if(ed&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:Sa,use:ss,useCallback:Ks,useContext:Sa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(is(),zo.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs},hc={readContext:Sa,use:ss,useCallback:Ks,useContext:Sa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=is();return zo===null?Js(n,e,t):Ys(n,zo.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return zo===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs};function gc(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 _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=fo(r);i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(zd(t,e,r),mo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=fo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(zd(t,e,r),mo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=fo(n);r.tag=2,t!=null&&(r.callback=t),t=po(e,r,n),t!==null&&(zd(t,e,n),mo(t,e,n))}};function vc(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 yc(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&&_c.enqueueReplaceState(t,t.state,null)}function bc(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 xc(e){gi(e)}function Sc(e){console.error(e)}function Cc(e){gi(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(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 Ec(e,t,n){return n=fo(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=fo(e),e.tag=3,e}function Oc(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(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(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=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?Zd():n.alternate===null&&ud===0&&(ud=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),bf(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)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),Zd(),!1}if(ta)return t=Eo.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=Ec(e.stateNode,r,a),ho(e,a),ud!==4&&(ud=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),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=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=Ec(n.stateNode,r,e),ho(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`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Dc(a),Oc(a,e,n,r),ho(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(i(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?co(t,null,n,r):W(t,e.child,n,r)}function Nc(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=Xo(e,t,n,o,a,i),s=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(ta&&s&&Xi(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(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,Fc(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,!cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,cl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,sl(e,t,i)}}return Uc(e,t,n,r,i)}function Ic(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 Rc(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?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Wa(t,null),wo(),jo()):(Wa(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function Lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rc(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),wo(),Ao(t),e!==null&&ya(e,t,r,!0),t.childLanes=i,null}function zc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bc(e,t,n){return W(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function Vc(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=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(ko(t),(e=ea)?(e=pm(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 zc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ko(t),a){if(t.flags&256)t.flags&=-257,t=Bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(jc||ya(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(xo.current===null){if(r=td,r!==null&&(s=ft(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),zd(r,e,s),Ac;Zd()}t=Bc(e,t,n)}else e=o.treeContext,ea=_m(s.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=zc(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 Hc(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 Uc(e,t,n,r,i){return xa(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(ta&&r&&Xi(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return xa(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!jc?(ts(e,t,a),sl(e,t,a)):(ta&&r&&Xi(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(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=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},lo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(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&&_c.enqueueReplaceState(a,a.state,null),vo(t,r,a,i),_o(),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=bc(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)&&yc(t,a,r,o),G=!1;var f=t.memoizedState;a.state=f,vo(t,r,a,i),_o(),l=t.memoizedState,s||f!==l||G?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=G||vc(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,uo(e,t),o=t.memoizedProps,u=bc(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)&&yc(t,a,r,c),G=!1,f=t.memoizedState,a.state=f,vo(t,r,a,i),_o();var p=t.memoizedState;o!==d||f!==p||G||e!==null&&e.dependencies!==null&&ba(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=G||vc(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,Hc(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)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Kc(e,t,n,r){return la(),t.flags|=256,Mc(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Ga()}}function Yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function Xc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ta){if(i?Oo(t):jo(),(e=ea)?(e=pm(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=hm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(jo(),i=t.mode,a=Qc({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=Jc(n),r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(null,r)):(Oo(t),Zc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return el(e,t,a,o,r,c,s,n)}return i?(jo(),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,Lc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Jc(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=Yc(e,o,n),t.memoizedState=qc,Lc(e.child,r)):(Oo(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 Zc(e,t){return t=Qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return W(t,e.child,null,n),e=Zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function el(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(jo(),o=a.fallback,s=t.mode,a=Qc({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=Jc(c),a.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,a)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(t),hm(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})),$c(e,t,c)}if(jc||ya(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(xo.current!==null)return $c(e,t,c);if(r=td,r!==null&&(a=ft(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),zd(r,e,a),Ac;return mm(o)||Zd(),$c(e,t,c)}return mm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=_m(o.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=Zc(t,a.children),t.flags|=134221824,t)}function tl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_a(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function rl(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 il(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 al(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(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&&tl(e,n,t);else if(e.tag===19)tl(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=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,il(t)),rl(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&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rl(t,!0,n,null,a,r);break;case`together`:rl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rl(t,!1,i,n,a,r)}return t.child}function ol(e,t,n){var r=t.pendingProps;return ha(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=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 cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ba(e)))}function ll(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,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=ya(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(Oo(t),e=sl(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return al(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 al(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:ha(t,Oa,e.memoizedState.cache)}return sl(e,t,n)}function ul(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!cl(e,n)&&!(t.flags&128))return jc=!1,ll(e,t,n);jc=!!(e.flags&131072)}}else jc=!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=bc(e,r),t.tag=1,t=Gc(null,t,e,r,n)):(t.tag=0,t=Uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=bc(r,t.pendingProps),Gc(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,uo(e,t),vo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ha(t,Oa,r),r!==o.cache&&va(t,[Oa],n,!0),_o(),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=Kc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),da(a),t=Kc(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=_m(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=sl(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Hc(e,t),e===null?(n=Vm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ta||(t.stateNode=bp(t.type,t.pendingProps,ve.current,t)):t.memoizedState=Vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&ta&&(r=t.stateNode=Cm(t.type,t.pendingProps,ve.current),$i=t,ra=!0,a=ea,Ap(t.type)?(vm=a,ea=_m(r.firstChild)):ea=a),Mc(e,t,t.pendingProps.children,n),Hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ta&&((a=r=ea)&&(r=dm(r,t.type,t.pendingProps,ra),r===null?a=!1:(t.stateNode=r,$i=t,ea=_m(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,xp(a,o)?r=null:s!==null&&xp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Xo(e,t,$o,null,null,n),hh._currentValue=a),Hc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&ta&&((e=n=ea)&&(n=fm(n,t.pendingProps,ra),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||aa(t)),null;case 13:return Xc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=W(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Hc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return ol(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,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return al(e,t,n);case 31:return Vc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return xa(t),r=Sa(Oa),e===null?(a=Ua(),a===null&&(a=td,o=ka(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},lo(t),ha(t,Oa,a)):((e.lanes&n)!==0&&(uo(e,t),vo(t,null,null,n),_o()),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))),Mc(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:Hc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function dl(e){e.flags|=4}function fl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?nh(t,r):nh(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(Jd())e.flags|=8192;else throw $a=Ya,qa}}else e.flags&=-16777217}function pl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!rh(t)){if(Jd())e.flags|=8192;else throw $a=Ya,qa}}function ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ot(),e.lanes|=t,hd|=t)}function hl(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 gl(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 _l(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 gl(t),null;case 1:return gl(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)?dl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ua())),gl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(dl(t),o===null?(gl(t),fl(t,a,null,r,n)):(gl(t),pl(t,o))):o?o===e.memoizedState?(gl(t),t.flags&=-16777217):(dl(t),gl(t),pl(t,o)):(e=e.memoizedProps,e!==r&&dl(t),gl(t),fl(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&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}e=ge.current,ca(t)?oa(t,e):(e=Cm(a,r,n),t.stateNode=e,dl(t))}return gl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}if(o=ge.current,ca(t))oa(t,o);else{var s=_p(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(up(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&&dl(t)}}return gl(t),t.subtreeFlags&=-33554433,fl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&dl(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||sp(e.nodeValue,n)),e||aa(t,!0)}else e=_p(e).createTextNode(r),e[vt]=t,t.stateNode=e}return gl(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;gl(t),e=!1}else n=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(i(558))}return gl(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;gl(t),a=!1}else a=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(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),ml(t,t.updateQueue),gl(t),null);case 4:return xe(),e===null&&Zf(t.stateNode.containerInfo),t.flags|=67108864,gl(t),null;case 10:return ga(t.type),gl(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return gl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)hl(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Io(e),o!==null){for(t.flags|=128,hl(r,!1),e=o.updateQueue,t.updateQueue=e,ml(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return Po(t,No.current&1|2),ta&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>xd&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ml(t,e),hl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ta)return gl(t),null}else 2*Ie()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,a=!0,hl(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=No.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ta?Po(t,o):(n=o,he(Eo,t),he(No,n),Do===null&&(Do=t)),ta&&Ji(t,r.treeForkCount),e}return gl(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gl(t),t.subtreeFlags&6&&(t.flags|=8192)):gl(t),n=t.updateQueue,n!==null&&ml(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),gl(t),null;case 25:return null;case 30:return t.flags|=33554432,gl(t),null}throw Error(i(156,t.tag))}function vl(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(Mo(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(Mo(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 Fo(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 Mo(t),To(),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 yl(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&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:ga(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&me(Ha);break;case 24:ga(Oa)}}function bl(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){yf(t,t.return,e)}}function xl(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){yf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){yf(t,t.return,e)}}function Sl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bo(t,n)}catch(t){yf(e,e.return,t)}}}function Cl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){yf(e,t,n)}}function wl(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=Hp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Up(e);m(e.child,!1,om,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){yf(e,t,n)}}function Tl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){yf(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){yf(e,t,n)}else n.current=null}}function El(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++)cm(e.stateNode,t[n])}function Dl(e){for(var t=e.return;t!==null&&(Al(t)&&cm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function Ol(e){for(var t=e.return;t!==null&&(Al(t)&&lm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function kl(e){return e.tag===5||e.tag===3||e.tag===27}function Al(e){return e&&e.tag===7&&e.stateNode!==null}function jl(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){yf(e,e.return,t)}}function Ml(e,t,n){try{var r=e.stateNode;fp(r,e.type,n,t),r[yt]=t}catch(t){yf(e,e.return,t)}}function Nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ap(e.type)||e.tag===4}function Pl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Nl(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&&Ap(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 Fl(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)),El(e,r),Ht=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Ap(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),El(e,r),Ht=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Ap(e.type)&&(n=e.stateNode)),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){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);up(t,r,n),t[vt]=e,t[yt]=n}catch(t){yf(e,e.return,t)}}var Rl=!1,zl=null;function Bl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Rl=!0)}var Vl=null;function Hl(){var e=Vl;return Vl=null,e}var Ul=0;function Wl(e,t,n,r,i){return Ul=0,Gl(e.child,t,n,r,i)}function Gl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ip(o);r.push(s),s.view&&(a=!0)}else a||Ip(o).view&&(a=!0);Rl=!0,Np(o,Ul===0?t:t+`_`+Ul,n),Ul++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Gl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Kl(e,t){for(;e!==null;)e.tag===5?Pp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Kl(e.child,t)),e=e.sibling}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ql(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`&&(Wl(e,n,t,null,!1)||Kl(e.child,!1))}e=e.sibling}}function Jl(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`?ql(e):Wl(e,i,a,null,!1)?(ql(e),n.paired||t||Rd(e,r.onEnter)):Kl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e,t),e=e.sibling;else ql(e)}function Yl(e){if(zl!==null&&zl.size!==0){var t=zl;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`&&(Wl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Kl(e.child,!1)),t.delete(r),t.size===0)break}}}Yl(e)}e=e.sibling}}}function Xl(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=zl===null?void 0:zl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Wl(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,zl.delete(n),Rd(e,t.onShare)):Kl(e.child,!1)),zl!==null&&Yl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else zl!==null&&Yl(e)}function Zl(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`&&Wl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Zl(e);e=e.sibling}}function Ql(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,Kl(e.child,!1))}Ql(e)}e=e.sibling}}function $l(e){if(e.tag===30)e.stateNode.paired=null,Kl(e.child,!1),Ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Ql(e)}function eu(e){for(e=e.child;e!==null;)e.tag===30?Kl(e.child,!1):e.subtreeFlags&33554432&&eu(e),e=e.sibling}function tu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ul<a.length){var l=a[Ul],u=Ip(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&&Np(c,Ul===0?n:n+`_`+Ul,i),s&&e.flags&4||(Vl===null&&(Vl=[]),Vl.push(c,Ul===0?r:r+`_`+Ul,t.memoizedProps)),Ul++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:tu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function nu(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(Lp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ul=0,i=tu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&nu(e,t);e=e.sibling}}var ru=!1,iu=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,cu=null,lu=!1,uu=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,hp=wh,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(gp={focusedElem:e,selectionRange:r},wh=!1,n=(n&335544064)===n,cu=t,t=n?9270:1024;cu!==null;){if(e=cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Xl(r[a]);if(e.alternate===null&&e.flags&2)n&&Bl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Xl(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Bl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,cu=r):(n&&Zl(e),mu(n))}}zl=null}function mu(e){for(;cu!==null;){var t=cu,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=bc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){yf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)um(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:um(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`&&Wl(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,cu=r;break}cu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&bl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){yf(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){yf(n,n.return,e)}}}r&64&&Sl(n),r&512&&wl(n,n.return);break;case 3:if(Fu(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{bo(e,t)}catch(e){yf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ll(n);case 26:case 5:Fu(e,n),t===null&&r&4&&jl(n),r&512&&wl(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),gm(e,n))));break;case 22:if(r=n.memoizedState!==null||ru,!r){var a=t!==null&&t.memoizedState!==null||iu;t=ru,i=iu,ru=r,(iu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),ru=t,iu=i}break;case 30:Fu(e,n),r&512&&wl(n,n.return);break;case 7:r&512&&wl(n,n.return);default:Fu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)_u(e,t),e=e.sibling}function _u(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){yf(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Ht=!0}catch(t){yf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Mp(s,!0):Mp(e.stateNode,!1)}catch(t){yf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:_u(n,r);break a;case 22:n.memoizedState===null&&vu(n,r);break a;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(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 bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:iu||Tl(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!iu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:iu||Tl(n,t),Ol(n);var r=bu,i=xu;Ap(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),wm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:iu||Tl(n,t),Ol(n);case 6:if(n.tag===6&&Ol(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),Ht=!0}catch(e){yf(n,t,e)}else try{bu.removeChild(n.stateNode),Ht=!0}catch(e){yf(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,jp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Xh(e)):jp(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:xl(2,n,t),iu||xl(4,n,t),Su(e,t,n);break;case 1:iu||(Tl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Cl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:iu=(r=iu)||n.memoizedState!==null,Su(e,t,n),iu=r;break;case 30:Tl(n,t),Su(e,t,n);break;case 7:iu||Tl(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xh(e)}catch(e){yf(t,t.return,e)}}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xh(e)}catch(e){yf(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(i(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function Ou(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(Ap(l.type)){bu=l.stateNode,xu=!1;break a}break;case 5:bu=l.stateNode,xu=!1;break a;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(bu===null)throw Error(i(160));Cu(s,c,o),bu=null,xu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(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}Ou(t,e,n),ju(e),a&4&&(xl(3,e,e.return),bl(3,e),xl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),a&64&&ru&&(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=ku,Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(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(ru)e.stateNode=bp(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`))),up(r,t,n),r[vt]=e,Mt(r),t=r;break a;case`link`:if(o=$m(`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),up(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=$m(`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),up(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 ru||eh(o,e.type,e.stateNode)}else e.stateNode=Jm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ml(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||iu||t.parentNode.removeChild(t)):a.count--,n===null?ru||eh(o,e.type,e.stateNode):Jm(o,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),r!==null&&a&4&&Ml(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=au,au=!1,Ou(t,e,n),au=o,ju(e),a&512&&(iu||r===null||Tl(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),Ht=!0}catch(t){yf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ml(e,t,r===null?t:r.memoizedProps)),a&1024&&(ou=!0);break;case 6:if(Ou(t,e,n),ju(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){yf(e,e.return,t)}}break;case 3:if(Ht=!1,Qm=null,o=ku,ku=Om(t.containerInfo),Ou(t,e,n),ku=o,ju(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Xh(t.containerInfo)}catch(t){yf(e,e.return,t)}ou&&(ou=!1,Mu(e)),Ht=!1;break;case 4:a=au,au=ru,r=Ut(),o=ku,ku=Om(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=o,Ht&&uu&&(du=!0),Ht=r,au=a;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=Ie()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ru,l=iu,u=au;ru=c||o,au=u||o,iu=l||s,Ou(t,e,n),iu=l,au=u,ru=c,ju(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ru||iu||(t=s||iu,n=ru,r=iu,ru=o||ru,iu=t,Iu(e,2),ru=n,iu=r),!o&&au||gu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:a&512&&(iu||r===null||Tl(r,r.return)),a=Ut(),o=uu,s=(n&335544064)===n,c=e.memoizedProps,uu=s&&hi(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&Ht&&(e.flags|=4),uu=o,Ht=a;break;case 21:break;case 7:a&512&&(iu||r===null||Tl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Nl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Al(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(kl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Il(e,Pl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),Il(e,Pl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Fl(e,Pl(e),u,s);break;default:throw Error(i(161))}}catch(t){yf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,wh=!0,t.reset(),wh=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else nu(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Jl(e,!1);else switch(e.tag){case 3:if(fu=lu=!1,Hl(),Nu(t,e),!lu&&!du){if(e=Vl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Pp(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`})),fu=!0}Vl=null;break;case 5:Nu(t,e);break;case 4:r=lu,lu=!1,Nu(t,e),lu&&(du=!0),lu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Jl(e,!1));break;case 30:r=lu,i=Hl(),lu=!1,Nu(t,e),lu&&(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,Ul=0,t=tu(e,n,t,o,s,a,!0),Ul!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Vl=i):i!==null&&(i.push.apply(i,Vl),Vl=i),lu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),Iu(n,r);break;case 1:Tl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Cl(n,n.return,i),Iu(n,r);break;case 27:r&2&&wm(n.stateNode,n.type,n.memoizedProps);case 5:Tl(n,n.return),n.tag!==5&&n.tag!==27||Ol(n),Iu(n,r);break;case 6:Ol(n);break;case 26:Tl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||iu||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:Tl(n,n.return),Iu(n,r);break;case 7:Tl(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(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:Lu(i,a,n),bl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){yf(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++)yo(l[i],c)}catch(e){yf(r,r.return,e)}}s&&o&64&&Sl(a),wl(a,a.return);break;case 27:n&2&&Ll(a);case 5:a.tag!==5&&a.tag!==27||Dl(a),Lu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 6:Dl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ru||eh(Om(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),wl(a,a.return);break;case 30:Lu(i,a,n),wl(a,a.return);break;case 7:wl(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(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 zu(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 Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&eu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&$l(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&bl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&fu&&(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){Bu(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){yf(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:Bu(e,t,n,r);break;case 13:Bu(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&&$l(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&$l(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Kl(a.child,!0),Kl(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(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:Hu(a,o,s,c,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(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:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ah(n,e)):oh(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&ah(n,e));break;case 3:case 4:var r=ku;ku=Om(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,zl===null&&(zl=new Map),zl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(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 Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&xl(9,e,e.return);break;case 3:Ju(e);break;case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;cu!==null;){var n=cu;switch(n.tag){case 0:case 11:case 15:xl(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,cu=r;else a:for(n=e;cu!==null;){r=cu;var i=r.sibling,a=r.return;if(yu(r),r===n){cu=null;break a}if(i!==null){i.return=a,cu=i;break a}cu=a}}}var Qu={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}},$u=typeof WeakMap==`function`?WeakMap:Map,ed=0,td=null,nd=null,rd=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return ed&2&&rd!==0?rd&-rd:ce.T===null?ht():Bf()}function Ld(){if(md===0){if(!(rd&536870912)||ta){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),md=e}else md=536870912}return e=Eo.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Hp(pi(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===td&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,rd,md,!1)),ct(e,n),(!(ed&2)||e!==td)&&(e===td&&(!(ed&2)&&(fd|=n),ud===4&&Ud(e,rd,md,!1)),Mf(e))}function Bd(e,t,n){if(ed&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||rt(e,t),a=r?ef(e,t):Qd(e,t,!0),o=r;do{if(a===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n)){a=Qd(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=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=Qd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,a=4;break a}o=_d,_d=a,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(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:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=yd+300-Ie(),10<a)){if(Ud(r,t,md,!od),nt(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=wp(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),a);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}while(1);Mf(e)}function Vd(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},zl=null,Ku(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=uh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?yd-Ie():(a&4194048)===a?bd-Ie():0,m=ch(d,m),m!==null)){Dd=a,e.cancelPendingCommit=m(cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l);return}cf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(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 Ud(e,t,n,r){t=it(e,t),t&=~pd,t&=~fd,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 Wd(){return ed&6?!0:(Nf(0,!1),!1)}function Gd(){if(nd!==null){if(id===0)var e=nd.return;else e=nd,ma=pa=null,ns(e),no=null,ro=0,e=nd;for(;e!==null;)yl(e.alternate,e),e=e.return;nd=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Tp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),td=e,nd=n=Ai(e.current,null),rd=t,id=0,ad=null,od=!1,sd=rt(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=it(e,t),bi(),n}function qd(e,t){Ro=null,ce.H=fc,t===Ka||t===Ja?(t=eo(),id=3):t===qa?(t=eo(),id=4):id=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,nd===null&&(ud=1,wc(e,Ri(t,e.current)))}function Jd(){var e=Eo.current;return e===null?!0:(rd&4194048)===rd?Do===null:(rd&62914560)===rd||rd&536870912?e===Do:!1}function Yd(){var e=ce.H;return ce.H=fc,e===null?fc:e}function Xd(){var e=ce.A;return ce.A=Qu,e}function Zd(){ud=4,od||(rd&4194048)!==rd&&Eo.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||td===null||Ud(td,rd,md,!1)}function Qd(e,t,n){var r=ed;ed|=2;var i=Yd(),a=Xd();(td!==e||rd!==t)&&(Sd=null,Kd(e,t)),t=!1;var o=ud;a:do try{if(id!==0&&nd!==null){var s=nd,c=ad;switch(id){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=id;if(id=0,ad=null,af(e,s,c,l),n&&sd){o=0;break a}break;default:l=id,id=0,ad=null,af(e,s,c,l)}}$d(),o=ud;break}catch(t){qd(e,t)}while(1);return t&&e.shellSuspendCounter++,ma=pa=null,ed=r,ce.H=i,ce.A=a,nd===null&&(td=null,rd=0,bi()),o}function $d(){for(;nd!==null;)nf(nd)}function ef(e,t){var n=ed;ed|=2;var r=Yd(),a=Xd();td!==e||rd!==t?(Sd=null,xd=Ie()+500,Kd(e,t)):sd=rt(e,t);a:do try{if(id!==0&&nd!==null){t=nd;var o=ad;b:switch(id){case 1:id=0,ad=null,af(e,t,o,1);break;case 2:case 9:if(Xa(o)){id=0,ad=null,rf(t);break}t=function(){id!==2&&id!==9||td!==e||(id=7),Mf(e)},o.then(t,t);break a;case 3:id=7;break a;case 4:id=5;break a;case 7:Xa(o)?(id=0,ad=null,rf(t)):(id=0,ad=null,af(e,t,o,7));break;case 5:var s=null;switch(nd.tag){case 26:s=nd.memoizedState;case 5:case 27:var c=nd;if(s?rh(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)nd=l;else{var u=c.return;u===null?nd=null:(nd=u,of(u))}break b}}id=0,ad=null,af(e,t,o,5);break;case 6:id=0,ad=null,af(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(i(462))}}tf();break}catch(t){qd(e,t)}while(1);return ma=pa=null,ce.H=r,ce.A=a,ed=n,nd===null?(td=null,rd=0,bi(),ud):0}function tf(){for(;nd!==null&&!Pe();)nf(nd)}function nf(e){var t=ul(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?of(e):nd=t}function rf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wc(n,t,t.pendingProps,t.type,void 0,rd);break;case 11:t=Wc(n,t,t.pendingProps,t.type.render,t.ref,rd);break;case 5:ns(t);var r=t;r===$i&&(ta?(sa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(sa(r),ta=!0));default:yl(n,t),t=nd=ji(t,ld),t=ul(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?of(e):nd=t}function af(e,t,n,r){ma=pa=null,ns(t),no=null,ro=0;var i=t.return;try{if(kc(e,i,t,n,rd)){ud=1,wc(e,Ri(n,e.current)),nd=null;return}}catch(t){if(i!==null)throw nd=i,t;ud=1,wc(e,Ri(n,e.current)),nd=null;return}t.flags&32768?(ta||r===1?e=!0:sd||rd&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),sf(t,e)):of(t)}function of(e){var t=e;do{if(t.flags&32768){sf(t,od);return}e=t.return;var n=_l(t.alternate,t,ld);if(n!==null){nd=n;return}if(t=t.sibling,t!==null){nd=t;return}nd=t=e}while(t!==null);ud===0&&(ud=5)}function sf(e,t){do{var n=vl(e.alternate,e);if(n!==null){n.flags&=32767,nd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){nd=e;return}nd=e=n}while(e!==null);ud=6,nd=null}function cf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do gf();while(wd!==0);if(ed&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===td&&(nd=td=null,rd=0),Ed=t,Td=e,Dd=n,kd=a,Ad=r,lf(e,t,n,s,c,l,f)}}function lf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=yi,lt(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=Na(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(Be,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),Rl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=ce.T,ce.T=null,i=le.p,le.p=2,a=ed,ed|=4;try{pu(e,t,n)}finally{ed=a,le.p=i,ce.T=r}}wd=1,Rl?jd=Bp(o,e.containerInfo,Nd,ff,pf,df,mf,_f,uf,null,null):(ff(),pf(),mf())}function uf(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function df(){wd===3&&(wd=0,Pu(Ed,Td),wd=4)}function ff(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=ce.T,ce.T=null;var i=le.p;le.p=2;var a=ed;ed|=4;try{uu=du=!1,Au(t,e,n),n=gp;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}}wh=!!hp,gp=hp=null}finally{ed=a,le.p=i,ce.T=r}}e.current=t,wd=2}}function pf(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=ce.T,ce.T=null;var r=le.p;le.p=2;var i=ed;ed|=4;try{hu(e,t.alternate,t)}finally{ed=i,le.p=r,ce.T=n}}wd=3}}function mf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,Fe();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,hf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=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=Md,o=Nd,Nd=null,i!==null&&(Md=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);Dd&3&&gf(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Nf(0,!1)}}function hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function gf(){return jd!==null&&(jd.skipTransition(),jd=null),ff(),pf(),mf(),_f()}function _f(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=mt(Dd),r=ce.T,a=le.p;try{le.p=32>n?32:n,ce.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,ed&6)throw Error(i(331));var c=ed;if(ed|=4,Yu(o.current),Vu(o,o.current,s,n),ed=c,Nf(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{le.p=a,ce.T=r,hf(e,t)}}function vf(e,t,n){t=Ri(n,t),t=Ec(e.stateNode,t,2),e=po(e,t,2),e!==null&&(ct(e,2),Mf(e))}function yf(e,t,n){if(e.tag===3)vf(e,e,n);else for(;t!==null;){if(t.tag===3){vf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Ri(n,e),n=Dc(2),r=po(t,n,2),r!==null&&(Oc(n,r,t,e),ct(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;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)||(cd=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,td===e&&(rd&n)===n&&(ud===4||ud===3&&(rd&62914560)===rd&&300>Ie()-yd?ed&2?pd|=n:Kd(e,0):pd|=n,hd===rd&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=ot()),e=Ci(e,t),e!==null&&(ct(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(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),Sf(e,n)}function Tf(e,t){return Me(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;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,Rf(r,a))}else a=rd,a=nt(r,r===td?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&Cp()&&(e=jf);for(var t=Ie(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}wd!==0&&wd!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(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=td,n=rd,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===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=Lf.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 Lf(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(gf()&&e.callbackNode!==n)return null;var r=rd;return r=nt(e,e===td?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(gf())return null;Bd(e,t,!0)}function zf(){Op(function(){ed&6?Me(Re,Pf):Ff()})}function Bf(){if(jf===0){var e=Ia;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:mn(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[yt]||null).action),o=r.submitter;o&&(t=(t=o[yt]||null)?Vf(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(jf!==0){var e=new FormData(i,o);Qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<ui.length;Uf++){var Wf=ui[Uf];di(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.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 Gf=`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(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(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 Jf(e,t){var n=t[xt];n===void 0&&(n=t[xt]=new Set);var r=e+`__bubble`;n.has(r)||(Qf(t,e,2,!1),n.add(r))}function Yf(e,t,n){var r=0;t&&(r|=4),Qf(n,e,r,t)}var Xf=`_reactListening`+Math.random().toString(36).slice(2);function Zf(e){if(!e[Xf]){e[Xf]=!0,Pt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Yf(t,!1,e),Yf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xf]||(t[Xf]=!0,Yf(`selectionchange`,!1,t))}}function Qf(e,t,n,r){switch(jh(t)){case 2:var i=Th;break;case 8:i=Eh;break;default:i=Dh}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 $f(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(ep(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,np):null,c!==null&&rp(s,u,c,d,!1),l!==null&&f!==null&&rp(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=tp(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=tp(r,`onBeforeInput`),0<b.length&&(v=new qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function ep(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tp(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(ep(e,i,a)),i=Cn(e,t),i!=null&&r.push(ep(e,i,a))),e.tag===3)return r;e=e.return}return[]}function np(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rp(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(ep(n,l,c))):i||(l=Cn(n,a),l!=null&&o.push(ep(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ip=/\r\n?/g,ap=/\u0000|\uFFFD/g;function op(e){return(typeof e==`string`?e:``+e).replace(ip,`
10
+ `).replace(ap,``)}function sp(e,t){return t=op(t),op(e)===t}function cp(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`&&cp(e,t,`name`,a.name,a,null),cp(e,t,`formEncType`,a.formEncType,a,null),cp(e,t,`formMethod`,a.formMethod,a,null),cp(e,t,`formTarget`,a.formTarget,a,null)):(cp(e,t,`encType`,a.encType,a,null),cp(e,t,`method`,a.method,a,null),cp(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&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`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`:Jf(`beforetoggle`,e),Jf(`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 lp(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&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`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 up(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Jf(`error`,e),Jf(`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:cp(e,t,o,s,n,null)}}a&&cp(e,t,`srcSet`,n.srcSet,n,null),r&&cp(e,t,`src`,n.src,n,null);return;case`input`:Jf(`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:cp(e,t,r,d,n,null)}}tn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Jf(`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:cp(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 Jf(`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:cp(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:cp(e,t,l,r,n,null)}return;case`dialog`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Jf(`cancel`,e),Jf(`close`,e);break;case`iframe`:case`object`:Jf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)Jf(Gf[r],e);break;case`image`:Jf(`error`,e),Jf(`load`,e);break;case`details`:Jf(`toggle`,e);break;case`embed`:case`source`:case`link`:Jf(`error`,e),Jf(`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:cp(e,t,u,r,n,null)}return;default:if(dn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&lp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&cp(e,t,c,r,n,null))}var dp={};function fp(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)||cp(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&&cp(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)||cp(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&&cp(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:cp(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&&cp(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:cp(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:cp(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)&&cp(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:cp(e,t,u,p,r,m)}return;default:if(dn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&lp(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||lp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&cp(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||cp(e,t,f,p,r,m)}function pp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function mp(){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&&pp(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&&pp(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 hp=null,gp=null;function _p(e){return e.nodeType===9?e:e.ownerDocument}function vp(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 yp(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 bp(e,t,n,r){return n=_p(n).createElement(e),n[vt]=r,n[yt]=t,up(n,e,t),Mt(n),n}function xp(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 Sp=null;function Cp(){var e=window.event;return e&&e.type===`popstate`?e!==Sp&&(Sp=e,!0):(Sp=null,!1)}var wp=typeof setTimeout==`function`?setTimeout:void 0,Tp=typeof clearTimeout==`function`?clearTimeout:void 0,Ep=typeof Promise==`function`?Promise:void 0,Dp=typeof requestAnimationFrame==`function`?requestAnimationFrame:wp,Op=typeof queueMicrotask==`function`?queueMicrotask:Ep===void 0?wp:function(e){return Ep.resolve(null).then(e).catch(kp)};function kp(e){setTimeout(function(){throw e})}function Ap(e){return e===`head`}function jp(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),Xh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tm(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`&&Tm(e.ownerDocument.body)}n=i}while(n);Xh(t)}function Mp(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 Np(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 Pp(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 Fp(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 Ip(e){return Fp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Lp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Fp(t,n,e)}function Rp(e){return e.documentElement.clientHeight}function zp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Bp(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`&&(Rp(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+=ih(f),u>sh){s.length=o;break}f=new Promise(zp.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 Vp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Vp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Vp.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},Vp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Hp(e){return{name:e,group:new Vp(`group`,e),imagePair:new Vp(`image-pair`,e),old:new Vp(`old`,e),new:new Vp(`new`,e)}}function Up(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Up.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(Jp(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=Kp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Wp,e,s,r)}this._eventListeners=a}};function Wp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Up.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Jp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Kp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Gp,e,n,i),r.splice(t,1),a!==null&&a()}};function Gp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Kp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function qp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Jp(e,t,n,r){if(e.length===0)return-1;r=qp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&qp(a.optionsOrUseCapture)===r)return i}return-1}Up.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,Kp(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,Kp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Up.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=b(e),xm(e,t))}Up.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Xp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yp(t[n],e);n--);};function Xp(e,t){return t.push(e),!1}Up.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=_p(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0))};function Zp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Up.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Up.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,$p,e,void 0,void 0);for(var n=t=0;n<em.length;n++){var r=em[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):em[t++]=r}em.length=t}};function $p(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var em=[],tm=!1;function nm(e,t,n){em.push({fragmentInstance:e,observer:t,instance:n}),tm||(tm=!0,Sm(function(){tm=!1;var e=em;em=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Up.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,rm,e,void 0,void 0),e};function rm(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}Up.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Up.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Xp,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||im(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function im(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 am(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)}Up.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Xp,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),am(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),am(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function om(e,t){return e=b(e),sm(e,t),!1}function sm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function cm(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,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<em.length;i++){var a=em[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(em[r++]=a)}em.length=r,n.observe(e)}),sm(e,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.removeEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?nm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function um(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`:um(n),Dt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function dm(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=_m(e.nextSibling),e===null)break}return null}function fm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_m(e.nextSibling),e===null))return null;return e}function pm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_m(e.nextSibling),e===null))return null;return e}function mm(e){return e.data===`$?`||e.data===`$~`}function hm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gm(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 _m(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 vm=null;function ym(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _m(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bm(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 xm(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 Sm(e){Dp(function(){Dp(function(t){return e(t)})})}function Cm(e,t,n){switch(t=_p(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 wm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&cp(e,t,r,null,dp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===hn&&(e.onclick=null),Dt(e)}function Tm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Dt(e)}var Em=new Map,Dm=new Set;function Om(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 km=le.d;le.d={f:Am,r:jm,D:Pm,C:Fm,L:Im,m:Lm,X:zm,S:Rm,M:Bm};function Am(){var e=km.f(),t=Wd();return e||t}function jm(e){var t=kt(e);t!==null&&t.tag===5&&t.type===`form`?ec(t):km.r(e)}var Mm=typeof document>`u`?null:document;function Nm(e,t,n){var r=Mm;if(r&&typeof t==`string`&&t){var i=$t(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Dm.has(i)||(Dm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),up(t,`link`,e),Mt(t),r.head.appendChild(t)))}}function Pm(e){km.D(e),Nm(`dns-prefetch`,e,null)}function Fm(e,t){km.C(e,t),Nm(`preconnect`,e,t)}function Im(e,t,n){km.L(e,t,n);var r=Mm;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=Hm(e);break;case`script`:a=Km(e)}if(!(Em.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Em.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Um(a))||t===`script`&&r.querySelector(qm(a))))){var o=r.createElement(`link`);up(o,`link`,e),t===`style`&&(o[Et]=!0,o.onload=o.onerror=function(){Nt(o)}),Mt(o),r.head.appendChild(o)}}}function Lm(e,t){km.m(e,t);var n=Mm;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=Km(e)}if(!Em.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Em.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qm(a)))return}r=n.createElement(`link`),up(r,`link`,e),Mt(r),n.head.appendChild(r)}}}function Rm(e,t,n){km.S(e,t,n);var r=Mm;if(r&&e){var i=jt(r).hoistableStyles,a=Hm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Um(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Em.get(a))&&Xm(e,n);var c=o=r.createElement(`link`);Mt(c),up(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,Ym(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zm(e,t){km.X(e,t);var n=Mm;if(n&&e){var r=jt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=D({src:e,async:!0},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),Mt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t){km.M(e,t);var n=Mm;if(n&&e){var r=jt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),Mt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t,n,r){var a=(a=ve.current)?Om(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=Hm(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=Hm(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(Um(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Em.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},Em.set(e,o)),Gm(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=Km(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 Hm(e){return`href="`+$t(e)+`"`}function Um(e){return`link[rel="stylesheet"][`+e+`]`}function Wm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Gm(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),up(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 Km(e){return`[src="`+$t(e)+`"]`}function qm(e){return`script[async]`+e}function Jm(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),up(r,`style`,a),Ym(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hm(n.href);var o=e.querySelector(Um(a));if(o)return t.state.loading|=4,t.instance=o,Mt(o),o;r=Wm(n),(a=Em.get(a))&&Xm(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}),up(o,`link`,r),t.state.loading|=4,Ym(o,n.precedence,e),t.instance=o;case`script`:return o=Km(n.src),(a=e.querySelector(qm(o)))?(t.instance=a,Mt(a),a):(r=n,(a=Em.get(o))&&(r=D({},n),Zm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Mt(a),up(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,Ym(r,n.precedence,e));return t.instance}function Ym(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 Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qm=null;function $m(e,t,n){if(Qm===null){var r=new Map,i=Qm=new Map;i.set(n,r)}else i=Qm,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 eh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function th(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 nh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function rh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ih(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ah(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ih(t),e.suspenseyImages.push(t)),e=dh.bind(e),t.decode().then(e,e))}function oh(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=Hm(r.href),a=t.querySelector(Um(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=uh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Mt(a);return}a=t.ownerDocument||t,r=Wm(r),(i=Em.get(i))&&Xm(r,i),a=a.createElement(`link`),Mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),up(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=uh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var sh=0;function ch(e,t){return e.stylesheets&&e.count===0&&ph(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ph(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&sh===0&&(sh=62500*mp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ph(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>sh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function lh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ph(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function uh(){this.count--,lh(this)}function dh(){this.imgCount--,lh(this)}var fh=null;function ph(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fh=new Map,t.forEach(mh,e),fh=null,uh.call(e))}function mh(e,t){if(!(t.state.loading&4)){var n=fh.get(e);if(n)var r=n.get(null);else{n=new Map,fh.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=uh.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 hh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function gh(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 _h(e,t,n,r,i,a,o,s,c,l,u,d){return e=new gh(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},lo(a),e}function vh(e){return e?(e=Ei,e):Ei}function yh(e,t,n,r,i,a){i=vh(i),r.context===null?r.context=i:r.pendingContext=i,r=fo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=po(e,r,t),n!==null&&(zd(n,e,t),mo(n,e,t))}function bh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xh(e,t){bh(e,t),(e=e.alternate)&&bh(e,t)}function Sh(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&zd(t,e,67108864),xh(e,67108864)}}function Ch(e){if(e.tag===13||e.tag===31){var t=Id();t=pt(t);var n=Ci(e,t);n!==null&&zd(n,e,t),xh(e,t)}}var wh=!0;function Th(e,t,n,r){var i=ce.T;ce.T=null;var a=le.p;try{le.p=2,Dh(e,t,n,r)}finally{le.p=a,ce.T=i}}function Eh(e,t,n,r){var i=ce.T;ce.T=null;var a=le.p;try{le.p=8,Dh(e,t,n,r)}finally{le.p=a,ce.T=i}}function Dh(e,t,n,r){if(wh){var i=Oh(r);if(i===null)$f(e,t,r,kh,n),Bh(e,r);else if(Hh(i,e,t,n,r))r.stopPropagation();else if(Bh(e,r),t&4&&-1<zh.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}Mf(a),!(ed&6)&&(xd=Ie()+500,Nf(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&zd(s,a,2),Wd(),xh(a,2)}if(a=Oh(r),a===null&&$f(e,t,r,kh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else $f(e,t,r,null,n)}}function Oh(e){return e=_n(e),Ah(e)}var kh=null;function Ah(e){if(kh=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 kh=e,null}function jh(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 Mh=!1,Nh=null,Ph=null,Fh=null,Ih=new Map,Lh=new Map,Rh=[],zh=`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 Bh(e,t){switch(e){case`focusin`:case`focusout`:Nh=null;break;case`dragenter`:case`dragleave`:Ph=null;break;case`mouseover`:case`mouseout`:Fh=null;break;case`pointerover`:case`pointerout`:Ih.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Lh.delete(t.pointerId)}}function Vh(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&&Sh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Hh(e,t,n,r,i){switch(t){case`focusin`:return Nh=Vh(Nh,e,t,n,r,i),!0;case`dragenter`:return Ph=Vh(Ph,e,t,n,r,i),!0;case`mouseover`:return Fh=Vh(Fh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ih.set(a,Vh(Ih.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Lh.set(a,Vh(Lh.get(a)||null,e,t,n,r,i)),!0}return!1}function Uh(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(){Ch(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,gt(e.priority,function(){Ch(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 Wh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Oh(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&&Sh(t),e.blockedOn=n,!1;t.shift()}return!0}function Gh(e,t,n){Wh(e)&&n.delete(t)}function Kh(){Mh=!1,Nh!==null&&Wh(Nh)&&(Nh=null),Ph!==null&&Wh(Ph)&&(Ph=null),Fh!==null&&Wh(Fh)&&(Fh=null),Ih.forEach(Gh),Lh.forEach(Gh)}function qh(e,n){e.blockedOn===n&&(e.blockedOn=null,Mh||(Mh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Kh)))}var Jh=null;function Yh(e){Jh!==e&&(Jh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Jh===e&&(Jh=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(Ah(r||n)===null)continue;break}var a=kt(n);a!==null&&(e.splice(t,3),t-=3,Qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Xh(e){function t(t){return qh(t,e)}Nh!==null&&qh(Nh,e),Ph!==null&&qh(Ph,e),Fh!==null&&qh(Fh,e),Ih.forEach(t),Lh.forEach(t);for(var n=0;n<Rh.length;n++){var r=Rh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rh.length&&(n=Rh[0],n.blockedOn===null);)Uh(n),n.blockedOn===null&&Rh.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||Yh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[yt]||null)s=o.formAction;else if(Ah(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Yh(n)}}}function Zh(){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 Qh(e){this._internalRoot=e}$h.prototype.render=Qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;yh(n,Id(),e,t,null,null)},$h.prototype.unmount=Qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yh(e.current,2,null,e,null,null),Wd(),t[bt]=null}};function $h(e){this._internalRoot=e}$h.prototype.unstable_scheduleHydration=function(e){if(e){var t=ht();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rh.length&&t!==0&&t<Rh[n].priority;n++);Rh.splice(n,0,e),n===0&&Uh(e)}};var eg=n.version;if(eg!==`19.3.0`)throw Error(i(527,eg,`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 tg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:ce,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{Ge=ng.inject(tg),Ke=ng}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=xc,s=Sc,c=Cc;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=_h(e,1,!1,null,null,n,r,null,o,s,c,Zh),e[bt]=t.current,Zf(e),new Qh(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 te(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 B=[`http:`,`https:`,`mailto:`,`tel:`];function ne(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 re=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function V(e,t){if(!e)return!1;if(re.test(e))return!0;let n=ne(e);return n?!t.has(n):!1}function ie(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+=te(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=te(r?e.slice(r):e)}return t}function ae(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function H(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(()=>{H(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:ie(e),external:!1,searchStr:o,search:F(t?.search,i),hash:ie(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:ie(yt(o.pathname)),external:!!this.rewrite&&Dt(o,this.origin),searchStr:c,search:F(t?.search,s),hash:ie(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(ie(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=ae(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?ne(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(re.test(n)||(r=ne(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??B}),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(!V(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`&&ne(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||ne(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 te=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}))},B=()=>{L===`intent`&&Pr(r,k)},re=()=>{L===`intent`&&Gr(i)};return ee.onClick=Kr(y,te),ee.onBlur=Kr(b,re),ee.onFocus=Kr(x,z),ee.onMouseEnter=Kr(S,z),ee.onMouseLeave=Kr(C,re),ee.onTouchStart=Kr(w,B),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||!V(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],te=()=>[``,`none`,`full`,l,Fa,Da],B=()=>[``,ha,Ia,Oa],ne=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],V=()=>[ha,_a,Ra,Ma],ie=()=>[``,`none`,m,Fa,Da],ae=()=>[`none`,ha,Fa,Da],H=()=>[`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:[...ne(),`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:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-bs":[{"border-bs":B()}],"border-w-be":[{"border-be":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":B()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ne(),`hidden`,`none`]}],"divide-style":[{divide:[...ne(),`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:[...ne(),`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:B()}],"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":B()}],"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":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"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":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"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":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"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":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"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":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"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":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"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":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"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":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"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":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"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":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"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:ie()}],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":ie()}],"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:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"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`}}),G=(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}));G.displayName=`Button`;var lo=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 uo({className:e,variant:t=`neutral`,mono:n,dot:r,children:i,...a}){return(0,U.jsxs)(`span`,{"data-slot":`badge`,className:W(lo({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 fo({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card`,className:W(`rounded-lg border border-border bg-surface`,e),...t})}function po({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 mo({className:e,...t}){return(0,U.jsx)(`h3`,{className:W(`text-heading-3 font-semibold text-text`,e),...t})}function ho({className:e,...t}){return(0,U.jsx)(`div`,{className:W(`px-4 pb-4`,e),...t})}var go=(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}));go.displayName=`Input`;var _o=(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}));_o.displayName=`Textarea`;var vo={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},yo={...vo,position:`fixed`,top:0,left:0},bo={...vo,position:`absolute`},xo={};function So(e,t){let n=v.useRef(xo);return n.current===xo&&(n.current=e(t)),n}function Co(e,t,n,r){let i=So(To).current;return Eo(i,e,t,n,r)&&Oo(i,[e,t,n,r]),i.callback}function wo(e){let t=So(To).current;return Do(t,e)&&Oo(t,e),t.callback}function To(){return{callback:null,cleanup:null,refs:[]}}function Eo(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Do(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Oo(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 ko(e){let t=v.useRef(!0);t.current&&(t.current=!1,e())}function Ao(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 jo(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Mo({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 No=typeof document<`u`?v.useLayoutEffect:()=>{},Po={...v},Fo=Po.useInsertionEffect,Io=Fo&&Fo!==Po.useLayoutEffect?Fo:e=>e();function Lo(e){let t=So(Ro).current;return t.next=e,Io(t.effect),t.trampoline}function Ro(){let e={next:void 0,callback:zo,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function zo(){}function Bo(e){let t=So(Vo,e).current;return t.next=e,No(t.effect),t}function Vo(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ho(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 Uo=Ho(`https://base-ui.com/production-error`,`Base UI`),Wo=19;function Go(e){return Wo>=e}var Ko=[],qo=void 0;function Jo(){return qo}function Yo(e){Ko.push(e)}function Xo(e){let t=(t,n)=>{let r=So(Qo).current,i;try{qo=r;for(let e of Ko)e.before(r);i=e(t,n);for(let e of Ko)e.after(r);r.didInitialize=!0}finally{qo=void 0}return i};return t.displayName=e.displayName||e.name,t}function Zo(e){return v.forwardRef(Xo(e))}function Qo(){return{didInitialize:!1}}var $o=yr(),es=Go(19)?rs:is;function ts(e,t,n,r,i){return es(e,t,n,r,i)}function ns(e,t,n,r,i){let a=v.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,$o.useSyncExternalStore)(e.subscribe,a,a)}Yo({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,$o.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function rs(e,t,n,r,i){let a=Jo();if(!a)return ns(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 is(e,t,n,r,i){return(0,xr.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var as=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 ts(this,e,t,n,r)}};function os(){}var ss=Object.freeze([]),cs=Object.freeze({}),ls=class extends as{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){v.useDebugValue(e);let n=this;No(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;No(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;No(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){v.useDebugValue(e);let n=this,r=t!==void 0;No(()=>{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),ts(this,this.selectors[e],t,n,r)}useContextCallback(e,t){v.useDebugValue(e);let n=Lo(t??os);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 us(){return typeof window<`u`}function ds(e){return ms(e)?(e.nodeName||``).toLowerCase():`#document`}function fs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ps(e){return((ms(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ms(e){return us()?e instanceof Node||e instanceof fs(e).Node:!1}function hs(e){return us()?e instanceof Element||e instanceof fs(e).Element:!1}function gs(e){return us()?e instanceof HTMLElement||e instanceof fs(e).HTMLElement:!1}function _s(e){return!us()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof fs(e).ShadowRoot}function vs(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ks(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ys(e){return/^(table|td|th)$/.test(ds(e))}function bs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var xs=/transform|translate|scale|rotate|perspective|filter/,Ss=/paint|layout|strict|content/,Cs=e=>!!e&&e!==`none`,ws;function Ts(e){let t=hs(e)?ks(e):e;return Cs(t.transform)||Cs(t.translate)||Cs(t.scale)||Cs(t.rotate)||Cs(t.perspective)||!Ds()&&(Cs(t.backdropFilter)||Cs(t.filter))||xs.test(t.willChange||``)||Ss.test(t.contain||``)}function Es(e){let t=js(e);for(;gs(t)&&!Os(t);){if(Ts(t))return t;if(bs(t))return null;t=js(t)}return null}function Ds(){return ws??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ws}function Os(e){return/^(html|body|#document)$/.test(ds(e))}function ks(e){return fs(e).getComputedStyle(e)}function As(e){return hs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function js(e){if(ds(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_s(e)&&e.host||ps(e);return _s(t)?t.host:t}function Ms(e){let t=js(e);return Os(t)?(e.ownerDocument||e).body:gs(t)&&vs(t)?t:Ms(t)}function Ns(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ms(e),i=r===e.ownerDocument?.body,a=fs(r);if(i){let e=Ps(a);return t.concat(a,a.visualViewport||[],vs(r)?r:[],e&&n?Ns(e):[])}return t.concat(r,Ns(r,[],n))}function Ps(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fs(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Is(e){return e?.ownerDocument||document}function Ls(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Rs(e){v.useEffect(e,ss)}var zs=null;globalThis.requestAnimationFrame;var Bs=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)}},Vs=class e{static create(){return new e}static request(e){return Bs.request(e)}static cancel(e){return Bs.cancel(e)}currentId=zs;request(e){this.cancel(),this.currentId=Bs.request(()=>{this.currentId=zs,e()})}cancel=()=>{this.currentId!==zs&&(Bs.cancel(this.currentId),this.currentId=zs)};disposeEffect=()=>this.cancel};function Hs(){let e=So(Vs.create).current;return Rs(e.disposeEffect),e}var Us=0,Ws=class e{static create(){return new e}currentId=Us;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Us,t()},e)}isStarted(){return this.currentId!==Us}clear=()=>{this.currentId!==Us&&(clearTimeout(this.currentId),this.currentId=Us)};disposeEffect=()=>this.clear};function Gs(){let e=So(Ws.create).current;return Rs(e.disposeEffect),e}function Ks(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:qs,platform:Js,maxTouchPoints:Ys}=Ks(),Xs=qs.toLowerCase(),Zs=Js.toLowerCase(),Qs=/^i(os$|p)/.test(Zs)||Zs===`macintel`&&Ys>1,$s=`android`,ec=Zs===$s||Xs.includes($s),tc=!Qs&&Zs.startsWith(`mac`);Zs.startsWith(`win`),!ec&&/^(linux|chrome os)/.test(Zs);var nc=tc||Qs,rc=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!rc&&Xs.includes(`firefox`),!rc&&Xs.includes(`chrom`);var ic=nc,ac=/jsdom|happydom/.test(Xs);function oc(e){e.preventDefault(),e.stopPropagation()}function sc(e){return`nativeEvent`in e}function cc(e){return e.pointerType===``&&e.isTrusted?!0:ec&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function lc(e){return ac?!1:!ec&&e.width===0&&e.height===0||ec&&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 uc(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function dc(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function fc(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function pc(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&_s(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function mc(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var hc=`data-base-ui-focusable`,gc=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,_c=`ArrowLeft`,vc=`ArrowRight`,yc=`ArrowUp`,bc=`ArrowDown`,xc=`data-starting-style`,Sc=`data-ending-style`,Cc={[xc]:``},wc={[Sc]:``},Tc={transitionStatus(e){return e===`starting`?Cc:e===`ending`?wc:null}},Ec=`data-open`,Dc=`data-closed`,Oc=`data-anchor-hidden`,kc=`data-popup-open`,Ac=`data-pressed`,jc={[kc]:``},Mc={[kc]:``,[Ac]:``},Nc={[Ec]:``},Pc={[Dc]:``},Fc={[Oc]:``},Ic={open(e){return e?jc:null}},Lc={open(e){return e?Mc:null}},Rc={open(e){return e?Nc:Pc},anchorHidden(e){return e?Fc:null}},zc={...Rc,...Tc},Bc=`data-trigger-disabled`;function Vc(e,t){if(!hs(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Bc);for(let[,e]of t.entries())if(pc(e,n))return!e.hasAttribute(Bc);return!1}function Hc(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 Uc(e){return e.matches(`html,body`)}function Wc(e){return gs(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Gc(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gc}`)!=null}function Kc(e){return e?e.getAttribute(`role`)===`combobox`&&Wc(e):!1}function qc(e){if(!e||ac)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Jc(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Yc(e,t){return t!=null&&!uc(t)?0:typeof e==`function`?e():e}function Xc(e,t,n){let r=Yc(e,n);return typeof r==`number`?r:r?.[t]}function Zc(e){return typeof e==`function`?e():e}function Qc(e,t){return t||e===`click`||e===`mousedown`}function $c(e){return e?.includes(`mouse`)&&e!==`mousedown`}var el=`none`,tl=`trigger-press`,nl=`trigger-hover`,rl=`trigger-focus`,il=`outside-press`,al=`item-press`,ol=`close-press`,sl=`focus-out`,cl=`escape-key`,ll=`list-navigation`,ul=`cancel-open`,dl=`sibling-open`,fl=`disabled`,pl=`imperative-action`,ml=`window-resize`;function hl(e,t,n,r){let i=!1,a=!1,o=r??cs;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 gl=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ws,currentIdRef:{current:null},currentContextRef:{current:null}});function _l(e,t){e.current=t.current}function vl(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=Gs();return No(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Xc(i.current,`open`),close:Xc(n,`close`)}},[n,o,i,a]),(0,U.jsx)(gl.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function yl(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(gl),[f,p]=v.useState(!1),m=v.useRef(n);return No(()=>{m.current=n},[n]),No(()=>{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]),No(()=>{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:Xc(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,hl(el))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),No(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,_l(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 bl=v.forwardRef(function(e,t){let[n,r]=v.useState();No(()=>{ic&&rc&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,U.jsx)(`span`,{...e,ref:t,style:yo,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),xl=Math.min,Sl=Math.max,Cl=Math.round,wl=Math.floor,Tl=e=>({x:e,y:e}),El={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Dl(e,t,n){return Sl(e,xl(t,n))}function Ol(e,t){return typeof e==`function`?e(t):e}function kl(e){return e.split(`-`)[0]}function Al(e){return e.split(`-`)[1]}function jl(e){return e===`x`?`y`:`x`}function Ml(e){return e===`y`?`height`:`width`}function Nl(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Pl(e){return jl(Nl(e))}function Fl(e,t,n){n===void 0&&(n=!1);let r=Al(e),i=Pl(e),a=Ml(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Wl(o)),[o,Wl(o)]}function Il(e){let t=Wl(e);return[Ll(e),t,Ll(t)]}function Ll(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Rl=[`left`,`right`],zl=[`right`,`left`],Bl=[`top`,`bottom`],Vl=[`bottom`,`top`];function Hl(e,t,n){switch(e){case`top`:case`bottom`:return n?t?zl:Rl:t?Rl:zl;case`left`:case`right`:return t?Bl:Vl;default:return[]}}function Ul(e,t,n,r){let i=Al(e),a=Hl(kl(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ll)))),a}function Wl(e){let t=kl(e);return El[t]+e.slice(t.length)}function Gl(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Kl(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Gl(e)}function ql(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 Jl(e,t){return t<0||t>=e.length}function Yl(e,t){return Zl(e.current,{disabledIndices:t})}function Xl(e,t){return Zl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Zl(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&&Ql(e,a,r));return a}function Ql(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!eu(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function $l(e){return e.visibility===`hidden`||e.visibility===`collapse`}function eu(e,t=e?ks(e):null){return!e||!e.isConnected||!t||$l(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var tu=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function nu(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return _s(n)?n.host:null}function ru(e){for(let t of Array.from(e.children))if(ds(t)===`summary`)return t;return null}function iu(e,t){let n=ru(t);return!!n&&(e===n||pc(n,e))}function au(e){let t=e?ds(e):``;return e!=null&&e.matches(tu)&&(t!==`summary`||e.parentElement!=null&&ds(e.parentElement)===`details`&&ru(e.parentElement)===e)&&(t!==`details`||ru(e)==null)&&(t!==`input`||e.type!==`hidden`)}function ou(e){if(!au(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=nu(t)){let n=t!==e,r=ds(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ds(t)===`details`&&!t.open&&!iu(e,t)||t.hasAttribute(`hidden`)||!r&&!su(t,n))return!1}return!0}function su(e,t){let n=ks(e);return t?n.display!==`none`:eu(e,n)}function cu(e){let t=e.tabIndex;if(t<0){let t=ds(e);if(t===`details`||t===`audio`||t===`video`||gs(e)&&e.isContentEditable)return 0}return t}function lu(e){if(ds(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function uu(e,t){let n=lu(e);if(!n)return!0;let r=t.find(e=>{let t=lu(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=lu(e);return t?.name===n.name&&t.form===n.form})===n}function du(e){if(gs(e)&&ds(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return gs(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function fu(e,t){du(e).forEach(e=>{au(e)&&t.push(e),fu(e,t)})}function pu(e,t,n){du(e).forEach(e=>{gs(e)&&e.matches(t)&&n.push(e),pu(e,t,n)})}function mu(e){return ou(e)&&cu(e)>=0}function hu(e){let t=[];return fu(e,t),t.filter(ou)}function gu(e){let t=hu(e);return t.filter(e=>cu(e)>=0&&uu(e,t))}function _u(e,t){let n=gu(e),r=n.length;if(r===0)return;let i=fc(Is(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function vu(e){return _u(Is(e).body,1)||e}function yu(e){return _u(Is(e).body,-1)||e}function bu(e,t){if(!e)return null;let n=gu(Is(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 xu(e){return bu(e,1)}function Su(e){return bu(e,-1)}function Cu(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!pc(n,r)}function wu(e){gu(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Tu(e){let t=[];pu(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 Eu(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Eu(e,t.id,n)])}function Du(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 Ou(e){return`data-base-ui-${e}`}var ku=0;function Au(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(ku);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),os;let o=requestAnimationFrame(a);return ku=o,()=>{ku===o&&(cancelAnimationFrame(o),ku=0)}}var ju={inert:new WeakMap,"aria-hidden":new WeakMap},Mu=`data-base-ui-inert`,Nu={inert:new WeakSet,"aria-hidden":new WeakSet},Pu=new WeakMap,Fu=0;function Iu(e){return Nu[e]}function Lu(e){return e?_s(e)?e.host:Lu(e.parentNode):null}var Ru=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Lu(t);return e.contains(n)?n:null}).filter(e=>e!=null),zu=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Bu=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{ds(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Vu(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Ru(t,e),l=i?Bu(t,zu(c),new Set(c)):[],u=[],d=[];if(a){let e=ju[a],n=Iu(a);s=n,o=e;let r=Ru(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Bu(t,zu(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=(Pu.get(e)||0)+1;Pu.set(e,t),d.push(e),t===1&&e.setAttribute(Mu,``)}),Fu+=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=(Pu.get(e)||0)-1;Pu.set(e,t),t||e.removeAttribute(Mu)}),--Fu,Fu||(ju.inert=new WeakMap,ju[`aria-hidden`]=new WeakMap,Nu.inert=new WeakSet,Nu[`aria-hidden`]=new WeakSet,Pu=new WeakMap)}}function Hu(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Is(e[0]).body;return Vu(e,a,n,r,{mark:i})}var Uu=0;function Wu(e,t=`mui`){let[n,r]=v.useState(e),i=e||n;return v.useEffect(()=>{n??(Uu+=1,r(`${t}-${Uu}`))},[n,t]),i}var Gu=Po.useId;function Ku(e,t){if(Gu!==void 0){let n=Gu();return e??(t?`${t}-${n}`:n)}return Wu(e,t)}function qu(e){if(!v.isValidElement(e))return null;let t=e,n=t.props;return(Go(19)?n?.ref:t.ref)??null}function Ju(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Yu(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 Xu(e,t){return typeof e==`function`?e(t):e}function Zu(e,t){return typeof e==`function`?e(t):e}var Qu={};function $u(e,t,n,r,i){if(!n&&!r&&!i&&!e)return td(t);let a=td(e);return t&&(a=nd(a,t)),n&&(a=nd(a,n)),r&&(a=nd(a,r)),i&&(a=nd(a,i)),a}function ed(e){if(e.length===0)return Qu;if(e.length===1)return td(e[0]);let t=td(e[0]);for(let n=1;n<e.length;n+=1)t=nd(t,e[n]);return t}function td(e){return od(e)?{...sd(e,Qu)}:rd(e)}function nd(e,t){return od(t)?sd(t,e):id(e,t)}function rd(e){let t={...e};for(let e in t){let n=t[e];ad(e,n)&&(t[e]=ld(n))}return t}function id(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Ju(e.style,r);break;case`className`:e[n]=dd(e.className,r);break;default:e[n]=ad(n,r)?cd(e[n],r):r}}return e}function ad(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 od(e){return typeof e==`function`}function sd(e,t){return od(e)?e(t):e??Qu}function cd(e,t){return t?e?(...n)=>{let r=n[0];if(fd(r)){let i=r;ud(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:ld(t):e}function ld(e){return e&&((...t)=>{let n=t[0];return fd(n)&&ud(n),e(...t)})}function ud(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function dd(e,t){return t?e?t+` `+e:t:e}function fd(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function pd(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=_d(r));let i=md(t,n,r);if(n.enabled===!1)return null;let a=n.state??cs;return vd(e,r,i,a)}function md(e,t,n){let{className:r,style:i}=e,{state:a=cs,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Xu(r,a):void 0,d=l?Zu(i,a):void 0,f=l?Yu(a,c):cs,p=l&&s?hd(s):void 0,m=l?Ju(f,p)??{}:cs;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?wo([m.ref,qu(n),...o]):Co(m.ref,qu(n),o):Co(null,null)),l?(u!==void 0&&(m.className=dd(m.className,u)),d!==void 0&&(m.style=Ju(m.style,d)),m):cs}function hd(e){return Array.isArray(e)?ed(e):$u(void 0,e)}var gd=Symbol.for(`react.lazy`);function _d(e){if(e?.$$typeof!==gd)return e;let t=v.Children.toArray(e)[0];return v.isValidElement(t)?t:e}function vd(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=$u(n,t.props);return e.ref=n.ref,v.cloneElement(t,e)}if(e&&typeof e==`string`)return yd(e,n);throw Error(Uo(8))}function yd(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 bd={style:{transition:`none`}},xd=`data-base-ui-click-trigger`,Sd={fallbackAxisSide:`none`},Cd={fallbackAxisSide:`end`},wd={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Td=l(h(),1),Ed=v.createContext(null),Dd=()=>v.useContext(Ed),Od=Ou(`portal`);function kd(e={}){let{ref:t,container:n,componentProps:r=cs,elementProps:i}=e,a=Ku(),o=Dd()?.portalNode,[s,c]=v.useState(null),[l,u]=v.useState(null),d=Lo(e=>{e!==null&&u(e)}),f=v.useRef(null);No(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(ms(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=pd(`div`,r,{ref:[t,d],props:[{id:a,[Od]:``},i]}),m=s&&p?Td.createPortal(p,s):null;return{node:l,nodeId:v.isValidElement(p)?p.props.id:void 0,subtree:m}}var Ad=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}=kd({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&&Cu(e)&&(e.type===`focusin`?y.current&&=(Tu(l),!1):(wu(l),y.current=!0))}return Fs(Ls(l,`focusin`,e,!0),Ls(l,`focusout`,e,!0))},[l,b]),No(()=>{l&&x===!0&&y.current&&(Tu(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)(Ed.Provider,{value:C,children:[S&&l&&(0,U.jsx)(bl,{"data-type":`outside`,ref:f,onFocus:e=>{Cu(e,l)?m.current?.focus():yu(g?g.domReference:null)?.focus()}}),S&&l&&(0,U.jsx)(`span`,{role:s,"aria-owns":u,style:wd}),l&&Td.createPortal(a,l),S&&l&&(0,U.jsx)(bl,{"data-type":`outside`,ref:p,onFocus:e=>{Cu(e,l)?h.current?.focus():(vu(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,hl(`focus-out`,e.nativeEvent)))}})]})]})});function jd(){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 Md=class{nodesRef={current:[]};events=jd();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)}},Nd=v.createContext(null),Pd=v.createContext(null),Fd=()=>v.useContext(Nd)?.id||null,Id=e=>{let t=v.useContext(Pd);return e??t};function Ld(e){let t=Ku(),n=Id(e),r=Fd();return No(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Rd(e){let{children:t,id:n}=e,r=Fd();return(0,U.jsx)(Nd.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function zd(e){let{children:t,externalTree:n}=e,r=So(()=>n??new Md).current;return(0,U.jsx)(Pd.Provider,{value:r,children:t})}function Bd(e){return e==null?e:`current`in e?e.current:e}function Vd(e,t){let n=fs(mc(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 Hd=20,Ud=[];function Wd(){Ud=Ud.filter(e=>e.deref()?.isConnected)}function Gd(e){Wd(),e&&ds(e)!==`body`&&(Ud.push(new WeakRef(e)),Ud.length>Hd&&(Ud=Ud.slice(-20)))}function Kd(){return Wd(),Ud[Ud.length-1]?.deref()}function qd(e){return e?mu(e)?e:gu(e)[0]||e:null}function Jd(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=hu(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return mu(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 Yd(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=Lo(()=>x.current.floatingContext?.nodeId),C=i===!1,w=Kc(_)&&C,T=Bo(i),E=Bo(a),D=Bo(l),O=Bo(g),k=Id(p),A=Dd(),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=Co(L,f,A?.beforeInsideRef),ee=Co(R,A?.afterInsideRef),te=Gs(),B=Gs(),ne=Hs(),re=A!=null,V=Jc(y),ie=Lo((e=V)=>e?gu(e):[]),ae=Lo(()=>m?.().filter(e=>e!=null)??[]);v.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&pc(V,fc(Is(V)))&&ie().length===0&&!w&&oc(e)}return Ls(Is(V),`keydown`,e)},[r,V,s,w,ie]),v.useEffect(()=>{if(r||!g)return;let e=Is(V);function t(){N.current=!1}function n(e){let t=mc(e),n=ae(),r=pc(y,t)||pc(_,t)||pc(A?.portalNode,t)||n.some(e=>e===t||pc(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,B.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return Fs(Ls(e,`pointerdown`,n,!0),Ls(e,`pointerup`,t,!0),Ls(e,`pointercancel`,t,!0),Ls(e,`keydown`,i,!0),t)},[r,y,_,V,g,A,B,ae]),v.useEffect(()=>{if(r||!c)return;let e=Is(V);function t(){M.current=!0,B.start(0,()=>{M.current=!1})}function n(e){let t=mc(e);mu(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=mc(t);s&&n==null&&i!=null&&pc(y,i)&&Gd(i),queueMicrotask(()=>{let a=S(),c=h.context.triggerElements,l=ae(),f=n?.hasAttribute(Ou(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Bd(d),Bd(u)].includes(n),p=!(pc(_,n)||pc(y,n)||pc(n,y)||pc(A?.portalNode,n)||l.some(e=>e===n||pc(e,n))||c.hasMatchingElement(e=>pc(e,n))||f||k&&(Eu(k.nodesRef.current,a).find(e=>pc(e.context?.elements.floating,n)||pc(e.context?.elements.domReference,n))||Du(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Jc(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&V&&Jd(V),o&&r!==_&&!eu(i)&&fc(e)===e.body){if(gs(V)&&(V.focus(),o===`popup`)){ne.request(()=>{V.focus()});return}let e=ie(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||V;gs(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==Kd())&&(j.current=!0,h.setOpen(!1,hl(sl,t)))})}function a(){N.current||(x.current.insideReactTree=!0,te.start(0,()=>{x.current.insideReactTree=!1}))}let l=gs(_)?_:null;if(y||l)return Fs(l&&Ls(l,`focusout`,i),l&&Ls(l,`pointerdown`,t),y&&Ls(y,`focusin`,n),y&&Ls(y,`focusout`,i),y&&A&&Ls(y,`focusout`,a,!0))},[r,_,y,V,s,k,A,h,c,o,ie,w,S,x,te,B,ne,u,d,ae]),v.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Ou(`portal`)}]`)||[]),t=(k?Du(k.nodesRef.current,S()):[]).find(e=>Kc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Hu([y,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ae(),t,Bd(d),Bd(u),w?_:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=Hu([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,y,s,A,w,k,S,u,d,ae]),No(()=>{if(!g||r||!gs(V))return;F.current=``,I.current=``;let e=Is(V),t=fc(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||pc(V,t))return;let i=null,a=()=>(i??=ie(V),i[0]||V),o;o=r===!0||r===null?a():Bd(r),o||=a();let s=pc(V,fc(e));Au(o,{preventScroll:o===V,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=fc(e);return!(t!==o&&pc(V,t))}})})},[r,g,V,ie,T,D,O]),No(()=>{if(r||!V)return;let e=Is(V),t=fc(e),n=D.current==null;Gd(t);function i(e){if(e.open||(F.current=Vd(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(cc(e.nativeEvent)||lc(e.nativeEvent))j.current=!1;else{let e=!1;Is(V).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&&ds(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Kd()||null,typeof i==`boolean`?s:Bd(i)||s||null}return()=>{b.off(`openchange`,i);let t=fc(e),n=ae(),r=pc(y,t)||n.some(e=>e===t||pc(e,t))||k&&Eu(k.nodesRef.current,S(),!1).some(e=>pc(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=qd(c),i=typeof o!=`boolean`;if(o&&!j.current&&gs(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,V,E,D,b,k,_,S,ae]),No(()=>{if(!rc||g||!y)return;let e=fc(Is(y));gs(e)&&Wc(e)&&pc(y,e)&&e.blur()},[g,y]),No(()=>{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,_]),No(()=>{if(!r&&V)return Jd(V),()=>{queueMicrotask(Wd)}},[r,V]);let H=!r&&(!s||!w)&&(re||s);return(0,U.jsxs)(v.Fragment,{children:[H&&(0,U.jsx)(bl,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=ie();Au(e[e.length-1])}else A?.portalNode&&(j.current=!1,Cu(e,A.portalNode)?vu(_)?.focus():Bd(d??A.beforeOutsideRef)?.focus())}}),n,H&&(0,U.jsx)(bl,{"data-type":`inside`,ref:ee,onFocus:e=>{s?Au(ie()[0]):A?.portalNode&&(c&&(j.current=!0),Cu(e,A.portalNode)?yu(_)?.focus():Bd(u??A.afterOutsideRef)?.focus())}})]})}function Xd(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=tl}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=v.useRef(void 0),f=Hs(),p=Gs(),m=v.useMemo(()=>{function e(e,t,n,r){let i=hl(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=uc(e.pointerType,!0)&&lc(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||uc(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=mc(o);if(Wc(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}uc(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}:cs,[n,m])}function Zd(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 Qd(e){return e!=null&&e.clientX!=null}function $d(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=Lo(e=>{i.set(`positionReference`,e)}),g=Lo((e,t,n)=>{l.current||(!c.current.openEvent||Qd(c.current.openEvent))&&i.set(`positionReference`,Zd(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=Lo(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),y=uc(d)?o:a;v.useEffect(()=>{if(!n){h(s);return}if(!y)return;function e(){u.current?.(),u.current=null}let t=fs(o);function r(t){let n=mc(t);pc(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||Qd(c.current.openEvent)?u.current=Ls(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 ef(){return!1}function tf(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function nf(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ef,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=Id(c),h=Lo(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,y=Lo(()=>a),{escapeKey:b,outsidePress:x}=tf(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=Gs(),A=Gs(),j=Lo(()=>{A.clear(),f.current.insideReactTree=!1}),M=Lo(e=>{let t=f.current.floatingContext?.nodeId;return(m?Eu(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Lo(e=>Hc(e,l.select(`floatingElement`))||Hc(e,l.select(`domReferenceElement`))),P=Lo(e=>{o()&&l.setOpen(!1,hl(tl,e.nativeEvent))}),F=Lo(e=>{if(!u||!n||!r||e.key!==`Escape`||E.current||!b&&M(`__escapeKeyBubbles`))return;let t=hl(cl,sc(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!b&&!t.isPropagationAllowed&&e.stopPropagation()}),I=Lo(()=>{f.current.insideReactTree=!0,A.start(0,j)}),L=Lo(e=>{if(!u||!n||e.button!==0)return;let t=mc(e.nativeEvent);pc(l.select(`floatingElement`),t)&&(S.current||(S.current=!0,C.current=!1))}),R=Lo(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 Ws,t=new Ws,i=Is(d);function a(){e.clear(),E.current=!0}function o(){e.start(rc?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&&Eu(m.nodesRef.current,t).some(t=>Hc(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=mc(e),r=`[${Ou(`inert`)}]`,i=hs(n)?n.getRootNode():null,a=Array.from((_s(i)?i:Is(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>pc(e,n))))return;let s=hs(n)?n:null;for(;s&&!Os(s);){let e=js(s);if(Os(e)||!hs(e))break;s=e}if(!(a.length&&hs(n)&&!Uc(n)&&!pc(n,l.select(`floatingElement`))&&a.every(e=>!pc(s,e)))){if(gs(n)&&!(`touches`in e)){let t=Os(n),r=ks(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&&!cc(e)&&!T.current)return;if(w.current){t.clear(),w.current=!1;return}}(typeof g!=`function`||g(e))&&(M(`__outsidePressBubbles`)||(l.setOpen(!1,hl(il,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=mc(e);if(!n)return;let r=Ls(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 te(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 B(e){L(e,te)}function ne(e){p()===`sloppy`&&O.current&&!N(e)&&(O.current.dismissOnTouchEnd&&A(e),k.clear(),O.current=null)}function re(e){L(e,ne)}let V=Fs(r&&Fs(Ls(i,`keydown`,F),Ls(i,`compositionstart`,a),Ls(i,`compositionend`,o)),_&&Fs(Ls(i,`click`,z,!0),Ls(i,`pointerdown`,z,!0),Ls(i,`pointerup`,ee,!0),Ls(i,`pointercancel`,ee,!0),Ls(i,`mousedown`,z,!0),Ls(i,`mouseup`,ee,!0),Ls(i,`touchstart`,R,{capture:!0,passive:!0}),Ls(i,`touchmove`,B,{capture:!0,passive:!0}),Ls(i,`touchend`,re,{capture:!0,passive:!0})));return()=>{V(),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 rf(e,t,n){let{reference:r,floating:i}=e,a=Nl(t),o=Pl(t),s=Ml(o),c=kl(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=Al(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function af(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}=Ol(t,e),p=Kl(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ql(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=ql(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 of=50,sf=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:af},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=rf(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<of&&(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}=rf(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},cf=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}=Ol(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=kl(r),_=Nl(o),v=kl(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Wl(o)]:Il(o)),x=p!==`none`;!d&&x&&b.push(...Ul(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=Fl(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`||_===Nl(t)||T.every(e=>Nl(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=Nl(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{}}}},lf=new Set([`left`,`top`]);async function uf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=kl(n),s=Al(n),c=Nl(n)===`y`,l=lf.has(o)?-1:1,u=a&&c?-1:1,d=Ol(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 df=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 uf(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}}}}},ff=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}=Ol(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Nl(i),p=jl(f),m=u[p],h=u[f],g=(e,t)=>Dl(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}}}}}},pf=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}=Ol(e,t),u={x:n,y:r},d=Nl(i),f=jl(d),p=u[f],m=u[d],h=Ol(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=lf.has(kl(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}}}},mf=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}=Ol(e,t),c=await i.detectOverflow(t,s),l=kl(n),u=Al(n),d=Nl(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=xl(p-c[m],g),y=xl(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*Sl(c.left,c.right):S=p-2*Sl(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 hf(e){let t=ks(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=gs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Cl(n)!==a||Cl(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function gf(e){return hs(e)?e:e.contextElement}function _f(e){let t=gf(e);if(!gs(t))return Tl(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=hf(t),o=(a?Cl(n.width):n.width)/r,s=(a?Cl(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var vf=Tl(0);function yf(e){let t=fs(e);return!Ds()||!t.visualViewport?vf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bf(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===fs(e)}function xf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=gf(e),o=Tl(1);t&&(r?hs(r)&&(o=_f(r)):o=_f(e));let s=bf(a,n,r)?yf(a):Tl(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=fs(a),t=hs(r)?fs(r):r,n=e,i=Ps(n);for(;i&&t!==n;){let e=_f(i),t=i.getBoundingClientRect(),r=ks(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=fs(i),i=Ps(n)}}return ql({width:u,height:d,x:c,y:l})}function Sf(e,t){let n=As(e).scrollLeft;return t?t.left+n:xf(ps(e)).left+n}function Cf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Sf(e,n),y:n.top+t.scrollTop}}function wf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ps(r),s=t?bs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Tl(1),u=Tl(0),d=gs(r);if((d||!a)&&((ds(r)!==`body`||vs(o))&&(c=As(r)),d)){let e=xf(r);l=_f(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Cf(o,c):Tl(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 Tf(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ef(e){let t=As(e),n=e.ownerDocument.body,r=Sl(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Sl(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Sf(e),o=-t.scrollTop;return ks(n).direction===`rtl`&&(a+=Sl(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Df=25;function Of(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=fs(e),a=ps(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ds()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Sf(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<=Df&&(s-=o)}return{width:s,height:c,x:l,y:u}}function kf(e,t){let n=xf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=_f(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Af(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Of(e,n,t);else if(t===`document`)r=Ef(ps(e));else if(hs(t))r=kf(t,n);else{let n=yf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ql(r)}function jf(e,t){let n=t.get(e);if(n)return n;let r=Ns(e,[],!1).filter(e=>hs(e)&&ds(e)!==`body`),i=null,a=ks(e).position===`fixed`,o=a?js(e):e;for(;hs(o)&&!Os(o);){let e=ks(o),t=Ts(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=js(o)}return t.set(e,r),r}function Mf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?bs(t)?[]:jf(t,this._c):[].concat(n),r],o=Af(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=Af(t,a[e],i);s=Sl(n.top,s),c=xl(n.right,c),l=xl(n.bottom,l),u=Sl(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Nf(e){let{width:t,height:n}=hf(e);return{width:t,height:n}}function Pf(e,t,n){let r=gs(t),i=ps(t),a=n===`fixed`,o=xf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Tl(0);if((r||!a)&&((ds(t)!==`body`||vs(i))&&(s=As(t)),r)){let e=xf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Sf(i));let l=i&&!r&&!a?Cf(i,s):Tl(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 Ff(e){return ks(e).position===`static`}function If(e,t){if(!gs(e)||ks(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ps(e)===n&&(n=n.ownerDocument.body),n}function Lf(e,t){let n=fs(e);if(bs(e))return n;if(!gs(e)){let t=js(e);for(;t&&!Os(t);){if(hs(t)&&!Ff(t))return t;t=js(t)}return n}let r=If(e,t);for(;r&&ys(r)&&Ff(r);)r=If(r,t);return r&&Os(r)&&Ff(r)&&!Ts(r)?n:r||Es(e)||n}var Rf=async function(e){let t=this.getOffsetParent||Lf,n=this.getDimensions,r=await n(e.floating);return{reference:Pf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zf(e){return ks(e).direction===`rtl`}var Bf={convertOffsetParentRelativeRectToViewportRelativeRect:wf,getDocumentElement:ps,getClippingRect:Mf,getOffsetParent:Lf,getElementRects:Rf,getClientRects:Tf,getDimensions:Nf,getScale:_f,isElement:hs,isRTL:zf};function Vf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hf(e,t,n){let r=null,i,a=ps(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=wl(d),h=wl(a.clientWidth-(u+f)),g=wl(a.clientHeight-(d+p)),_=wl(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Sl(0,xl(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Vf(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=fs(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Uf(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=gf(e),u=i||a?[...l?Ns(l):[],...t?Ns(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Hf(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?xf(e):null;c&&g();function g(){let t=xf(e);h&&!Vf(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 Wf=df,Gf=ff,Kf=cf,qf=mf,Jf=pf,Yf=(e,t,n)=>{let r=new Map,i=n??{},a={...Bf,...i.platform,_c:r};return sf(e,t,{...i,platform:a})},Xf=typeof document<`u`?v.useLayoutEffect:function(){};function Zf(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(!Zf(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)&&!Zf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Qf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $f(e,t){let n=Qf(e);return Math.round(t*n)/n}function ep(e){let t=v.useRef(e);return Xf(()=>{t.current=e}),t}function tp(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);Zf(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=ep(c),O=ep(i),k=ep(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Yf(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Zf(T.current,t)&&(T.current=t,Td.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Xf(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Xf(()=>(j.current=!0,()=>{j.current=!1}),[]),Xf(()=>{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=$f(N.floating,u.x),r=$f(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Qf(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 np=(e,t)=>{let n=Wf(e);return{name:n.name,fn:n.fn,options:[e,t]}},rp=(e,t)=>{let n=Gf(e);return{name:n.name,fn:n.fn,options:[e,t]}},ip=(e,t)=>({fn:Jf(e).fn,options:[e,t]}),ap=(e,t)=>{let n=Kf(e);return{name:n.name,fn:n.fn,options:[e,t]}},op=(e,t)=>{let n=qf(e);return{name:n.name,fn:n.fn,options:[e,t]}},sp={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},cp=class extends ls{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:jd(),nested:n,triggerElements:i},sp),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&dc(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 lp(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 cp({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),No(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};hs(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 up(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),No(()=>{if(!e&&o&&i!==`ending`&&n){let e=Vs.request(()=>{a(`ending`)});return()=>{Vs.cancel(e)}}},[e,o,i,n]),No(()=>{if(!e||t)return;let n=Vs.request(()=>{a(void 0)});return()=>{Vs.cancel(n)}},[t,e]),No(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Vs.request(()=>{a(`idle`)});return()=>{Vs.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var dp=null;function fp(e){if(!dp){let e=[];dp=e,queueMicrotask(()=>{dp=null,Td.flushSync(()=>{for(let t of e)t()})})}dp.push(e)}function pp(e,t=!1,n=!1){let r=Hs();return Lo((i,a=null)=>{r.cancel();let o=Bd(e);if(o==null)return;let s=o,c=()=>{if(!n){Td.flushSync(i);return}fp(()=>{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=xc;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 mp(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Lo(a),s=pp(r,n,i);v.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var hp={tabIndex:-1,[hc]:``};function gp(e){return t=>t!==`touch`||e.current}function _p(e,t=!1){let n=Ku(),r=Fd()!=null,i=So(()=>e(n,r)).current;return lp({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function vp({handle:e,store:t}){return No(()=>e.attachStore(t),[e,t]),null}function yp(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function bp(e,t){let n=v.useRef(null);return Lo(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),yp(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),yp(t))})}function xp(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 Sp(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Cp(e,t,n,r={}){let i=n.reason,a=i===nl,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Sp(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=xp(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?Td.flushSync(l):l()}function wp(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=bp(e,n),o=Lo(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=Lo(e=>{a(e),e&&o(e)});return No(()=>(s(t.current),()=>s(null)),[s,t,n,e]),No(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Tp(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=v.useRef(null),i=e.useState(`open`);No(()=>{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=hl(el);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 Ep(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=up(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=Lo(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return mp({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function Dp(e,t){e.useSyncedValues(t),No(()=>()=>{e.update({activeTriggerProps:cs,inactiveTriggerProps:cs,popupProps:cs})},[e])}function Op(e,t){No(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),No(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var kp=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 Ap(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new cp({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:cs,inactiveTriggerProps:cs,popupProps:cs}}var jp=e=>e.triggerIdProp??e.activeTriggerId,Mp=e=>e.openProp??e.open,Np=e=>(e.popupElement?.id??e.floatingId)||void 0;function Pp(e,t){return t!==void 0&&Mp(e)&&jp(e)===t}function Fp(e,t){return Pp(e,t)?!0:t!==void 0&&Mp(e)&&jp(e)==null&&e.triggerCount===1}var Ip={open:Mp,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:jp,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Np,isTriggerActive:(e,t)=>t!==void 0&&jp(e)===t,isOpenedByTrigger:(e,t)=>Pp(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&jp(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Fp(e,t)?Np(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Lp(e){let t=v.useCallback(t=>e===void 0?os:e.subscribeStore(t),[e]),n=v.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,$o.useSyncExternalStore)(t,n,()=>e?.serverStore)}function Rp(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Ku(),a=Fd()!=null,o=So(()=>new cp({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new kp,floatingId:i,syncOnly:!1,nested:a})).current;return No(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=hs(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 zp(e){return Bp(e,e.rootContext)}function Bp(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=Id(r),_=v.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=tp({...e,elements:{..._,...l&&{reference:l}}}),b=hs(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=hs(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=v.useCallback(e=>{(hs(e)||e===null)&&(h.current=e,f(e)),(hs(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!hs(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 No(()=>{o&&(h.current=o)},[o]),No(()=>{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 Vp=tc&&rc;function Hp(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=Gs();v.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=fs(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&gs(e)&&e===fc(Is(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return Fs(Ls(t,`blur`,r),Vp&&Ls(t,`keydown`,a,!0),Vp&&Ls(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`);hs(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=mc(t.nativeEvent);if(hs(a)){if(Vp&&!t.relatedTarget){if(!l.current&&!Wc(a))return}else if(!qc(a))return}let o=Vc(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,hl(rl,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,hl(rl,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=hs(n)&&n.hasAttribute(Ou(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=fc(Is(e));(n||t!==e)&&(pc(o.current.floatingContext?.refs.floating.current,t)||pc(e,t)||a||Vc(n??t,i.context.triggerElements)||i.setOpen(!1,hl(rl,r)))})}}},[o,r,i,u]);return v.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var Up=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 Ws,this.restTimeout=new Ws,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Wp=new WeakMap;function Gp(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Wp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Wp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Kp(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Wp.get(n);a&&a!==e&&Gp(a),Gp(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Wp.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function qp(e){let t=e.context.dataRef.current,n=So(()=>t.hoverInteractionState??Up.create()).current;return t.hoverInteractionState||=n,Rs(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Jp(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=Id(),d=Fd(),f=qp(a),p=Gs(),m=Lo(()=>Qc(l.current.openEvent?.type,f.interactedInside)),h=Lo(()=>$c(l.current.openEvent?.type)),g=Lo(()=>{Gp(f)});No(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),v.useEffect(()=>g,[g]),No(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&hs(c)&&s){let e=c,t=s,n=Is(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 Kp(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&&Eu(u.nodesRef.current,d).length>0)}function t(e){let t=Xc(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,hl(nl,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=mc(e);if(!Gc(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(Vc(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&hs(o)&&Eu(u.nodesRef.current,r,!1).some(e=>pc(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,hl(nl,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Fs(y&&Ls(y,`mouseenter`,c),y&&Ls(y,`mouseleave`,_),y&&Ls(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var Yp={current:null};function Xp(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Yp,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=Id(l),b=qp(h),x=v.useRef(!1),S=Bo(i),C=Bo(r),w=Bo(o),T=Bo(n),E=Bo(p),D=Bo(f),O=Lo(()=>Qc(g.current.openEvent?.type,b.interactedInside)),k=Lo(()=>E.current?.()!==!1),A=Lo((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!pc(e,t);if(!hs(n))return!1;let i=n;return r.hasMatchingElement(e=>pc(e,i))&&(!e||!pc(e,i))}),j=Lo(()=>{b.handler&&=(Is(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=Lo(()=>{Gp(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===nl,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=Xc(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{h.setOpen(!1,hl(nl,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),h.setOpen(!1,hl(nl,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!hs(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!uc(b.pointerType))return;let t=Zc(w.current),n=Xc(C.current,`open`,b.pointerType),r=mc(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(hs(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(pc(e,r)){s=e;break}}hs(i)&&hs(o)&&!h.context.triggerElements.hasElement(i)&&pc(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&&hs(s)&&hs(o)&&pc(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,hl(nl,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,hl(nl,e,s))}):g&&k()&&h.setOpen(!0,hl(nl,e,s)))}function i(t){if(O()){M();return}j();let n=Is(h.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Vc(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`||!pc(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){pc(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=m?Ls(t,`mouseout`,o):void 0;return s?Fs(Ls(t,`mousemove`,r,{once:!0}),Ls(t,`mouseenter`,r),Ls(t,`mouseleave`,i),l):Fs(Ls(t,`mouseenter`,r),Ls(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&&!uc(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;Kp(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Zc(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,hl(nl,t,n))}b.pointerType===`touch`?Td.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,h,w,k])}var Zp=`Escape`;function Qp(e){return rc&&e.movementX===0&&e.movementY===0}function $p(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function em(e,t){return $p(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function tm(e,t,n){return $p(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function nm(e,t,n){return $p(t,n?e===_c:e===vc,e===bc)}function rm(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Zp:$p(t,n?e===vc:e===_c,e===yc)}function im(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=Jc(E),A=Kc(D),j=Bo(k),M=Fd(),N=Id(x),P=v.useRef(f),F=v.useRef(o??-1),I=v.useRef(null),L=v.useRef(!0),R=Lo(e=>{i(F.current===-1?null:F.current,e)}),z=v.useRef(!!E),ee=v.useRef(T),te=v.useRef(!1),B=v.useRef(!1),ne=v.useRef(null),re=Bo(h),V=Bo(T),ie=Bo(o),ae=Bo(b),H=Hs(),oe=Hs(),se=Lo(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):ne.current=Au(e,{sync:te.current,preventScroll:!0})}let t=n.current[F.current],r=B.current;t&&e(t),(te.current?e=>e():e=>H.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),pe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});No(()=>{O.current.orientation=g},[O,g]),No(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(B.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),No(()=>{if(a){if(!T){te.current=!1;return}if(E){if(r==null){if(te.current=!1,ie.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||tm(I.current,g,u)||l?Yl(n):Xl(n),I.current=null,R())};t()}}else Jl(n.current,r)||(F.current=r,se(),B.current=!1)}}},[a,T,E,r,ie,l,n,g,u,R,se,oe]),No(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=fc(Is(D??t??null)),r=e.some(e=>e.context&&pc(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),No(()=>{ee.current=T,z.current=!!E}),No(()=>{T||(I.current=null,P.current=f)},[T,f]);let ce=r!=null,le=Lo(e=>{if(!V.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),ue=Lo(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),de=Lo(()=>Yl(n,re.current)),fe=Lo(e=>{if(L.current=!1,te.current=!0,e.which===229||!V.current&&e.currentTarget===j.current)return;if(l&&rm(e.key,g,u,C)){em(e.key,ue())||oc(e),w.setOpen(!1,hl(ll,e.nativeEvent)),gs(D)&&(d?N?.events.emit(`virtualfocus`,D):D.focus());return}let t=F.current,r=Yl(n,h),i=Xl(n,h);if(A||(e.key===`Home`&&(oc(e),F.current=r,R(e)),e.key===`End`&&(oc(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(em(e.key,g)){if(oc(e),T&&!d&&fc(e.currentTarget.ownerDocument)===e.currentTarget){F.current=tm(e.key,g,u)?r:i,R(e);return}tm(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(te.current=!1,F.current=r):F.current=Zl(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,Zl(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(te.current=!1,F.current=i):F.current=Zl(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,Zl(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),Jl(n.current,F.current)&&(F.current=-1),R(e)}}),pe=v.useMemo(()=>({onFocus(e){te.current=!0,le(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){Qp(e)||(te.current=!0,B.current=!1,p&&le(e))},onPointerLeave(e){if(!V.current||!L.current||e.pointerType===`touch`)return;te.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ae.current&&(ne.current?.(),ne.current=null,F.current=-1,R(e),!d)){let e=j.current,t=fc(Is(e));e&&pc(e,t)&&e.focus({preventScroll:!0})}}}),[le,V,j,p,n,R,ae,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=mc(e.nativeEvent);if(t&&!pc(j.current,t))return;oc(e),w.setOpen(!1,hl(sl,e.nativeEvent)),gs(D)&&D.focus();return}fe(e)},onPointerMove(e){Qp(e)||(L.current=!0)}}),[me,fe,j,A,w,T,d,D]),ge=v.useMemo(()=>{function e(e){w.setOpen(!0,hl(ll,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&cc(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&lc(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=w.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=nm(t.key,ue(),u),a=em(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=em(t.key,ue());I.current=l&&e?null:t.key}if(l){i&&(oc(t),n?(F.current=de(),R(t)):e(t));return}a&&(ie.current!=null&&(F.current=ie.current),oc(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,ie,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 am(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=Gs(),m=v.useRef(``),h=v.useRef(u??i??-1),g=v.useRef(null),_=Lo(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!eu(n)||n?.matches(`:disabled`)?!1:o==null||!Ql(ss,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===` `&&(oc(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!==` `&&(oc(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=Lo(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);pc(n,t)||pc(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});No(()=>{(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 om=.1,sm=om*om,cm=.5;function lm(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function um(e,t,n,r,i,a,o,s,c,l){let u=!1;return lm(e,t,n,r,i,a)&&(u=!u),lm(e,t,i,a,o,s)&&(u=!u),lm(e,t,o,s,c,l)&&(u=!u),lm(e,t,c,l,n,r)&&(u=!u),u}function dm(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function fm(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 pm(e={}){let{blockPointerEvents:t=!1}=e,n=new Ws,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*sm;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=mc(r),g=r.type===`mouseleave`,_=pc(u,h),v=pc(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&hs(r.relatedTarget)&&pc(u,r.relatedTarget))return;function y(){return!!(s&&Eu(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=fm(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=fm(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=fm(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=fm(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!dm(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?cm/2:cm*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+cm+1,o=C||T?S.bottom-cm:S.top,s=C?T?S.bottom-cm:S.top:S.bottom-cm;M=um(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?cm/2:cm*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-cm,o=C||T?S.top+cm:S.bottom,s=C?T?S.top+cm:S.bottom:S.top+cm;M=um(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?cm/2:cm*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+cm+1,o=w||E?S.right-cm:S.left,s=w?E?S.right-cm:S.left:S.right-cm;M=um(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?cm/2:cm*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-cm,o=w||E?S.left+cm:S.right,s=w?E?S.left+cm:S.right:S.left+cm;M=um(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 mm=v.createContext(void 0),hm=v.createContext(void 0),gm=v.createContext(void 0);function _m(){let e=v.useContext(mm);if(e===void 0)throw Error(Uo(60));return e}function vm(){let e=v.useContext(hm);if(e===void 0)throw Error(Uo(101));return e}function ym(){let e=v.useContext(gm);if(e===void 0)throw Error(Uo(61));return e}var bm=`data-valid`,xm=`data-invalid`,Sm={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Cm={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},wm={valid(e){return e===null?null:e?{[bm]:``}:{[xm]:``}}},Tm={invalid:void 0,name:void 0,validityData:{state:Sm,errors:[],error:``,value:``,initialValue:null},setValidityData:os,disabled:void 0,setTouched:os,setDirty:os,setFilled:os,setFocused:os,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Cm,registerFieldControl:os,validation:{getValidationProps:(e,t=cs)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:os,getInputControl:()=>null,commit:async()=>{},change:os}},Em=v.createContext(Tm);function Dm(e=!0){let t=v.useContext(Em);if(t.setValidityData===os&&!e)throw Error(Uo(28));return t}function Om(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Dm(),s=So(()=>Symbol());No(()=>{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]),No(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function km(e){return Ku(e,`base-ui`)}var Am=v.createContext({controlId:void 0,registerControlId:os,resetControlId:os,labelId:void 0,setLabelId:os,messageIds:[],setMessageIds:os,getDescriptionProps:e=>e});function jm(){return v.useContext(Am)}function Mm(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=jm(),o=km(),s=So(()=>Symbol()),c=v.useRef(!1),l=v.useRef(!1),u=Lo(()=>{c.current&&i!==os&&(c.current=!1,i(s.current,void 0))});return No(()=>{if(!n||i===os){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]),No(()=>u,[u]),(n?r:void 0)??t??o}function Nm(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 Pm=(e,t)=>Object.is(e,t);function Fm(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Im(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Nm(e,t,(e,t)=>Fm(e,t,n)):e!==t}function Lm(e,t,n){return e?e.some(e=>e!==void 0&&Fm(t,e,n)):!1}function Rm(e,t,n){return e?e.findIndex(e=>e!==void 0&&Fm(e,t,n)):-1}function zm(e,t){if(t!==Pm)return n=>Lm(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 Bm(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(zm(t,n)):Rm(e,t,n);return i===-1?null:i}function Vm(e,t,n,r,i,a){return Lm(r,t,i)?a!=null&&e>a&&Lm(r,n[a],i)?a:e:e===a?Bm(n,r,i,!0):a}function Hm(e,t,n){return e.filter(e=>!Fm(t,e,n))}function Um(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Wm(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function Gm(e){return Wm(e?.[0])}function Km(e){return Gm(e)?e.flatMap(e=>e.items):e}function qm(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Gm(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 Jm(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 Um(e)}function Ym(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Um(e.value):Um(e)}function Xm(e,t,n){function r(){return Jm(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=Km(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 Zm(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,U.jsx)(v.Fragment,{children:Xm(r,t,n)},i)),e),[])}var Qm={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:Ym(t,r)!==``},hasNullItemLabel:(e,t)=>t?qm(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=>Fm(t,e,n)):Fm(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},$m=v.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:os,validationMode:`onSubmit`,submitCountRef:{current:0}});function eh(){return v.useContext($m)}function th(e,t){let n=v.useRef(e),r=Lo(t);No(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function nh(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 rh(e,t){let{onClick:n,onPointerDown:r}=nh(Lo((n,r)=>{(typeof e==`function`?e():e)||t(r||(Qs?`touch`:``))}));return v.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function ih(e){let[t,n]=v.useState(null),r=rh(e,n);return th(e,t=>{t&&!e&&n(null)}),v.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function ah(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function oh(e,t){return Math.max(0,e-t)}function sh(e,t){if(t<=0)return 0;let n=ah(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 ch(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=Pm,highlightItemOnHover:w=!0,children:T}=e,{clearErrors:E}=eh(),{setDirty:D,setTouched:O,setFocused:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=Dm(),I=Mm({id:t}),L=N||d,R=M??c,[z,ee]=Mo({controlled:n,default:b?r??ss:r,name:`Select`,state:`value`}),[te,B]=Mo({controlled:a,default:o,name:`Select`,state:`open`}),ne=v.useRef([]),re=v.useRef([]),V=v.useRef(null),ie=v.useRef(null),ae=v.useRef(0),H=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}=up(te),{openMethod:ge,triggerProps:_e}=ih(te),ve=So(()=>new ls({id:I,labelId:void 0,modal:m,multiple:b,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,value:z,open:te,mounted:pe,transitionStatus:he,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:cs,triggerProps:cs,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:os,setOpen:os,handleScrollArrowVisibility:os,onOpenChangeComplete:os,listRef:ne,popupRef:V,scrollHandlerRef:ie,scrollArrowsMountedCountRef:ae,valueRef:H,valuesRef:oe,labelsRef:re,typingRef:se,selectionRef:ue,firstItemTextRef:ce,selectedItemTextRef:le,alignItemWithTriggerActiveRef:de,initialValueRef:fe},Qm)).current,ye=ve.useState(`activeIndex`),be=ve.useState(`selectedIndex`),xe=ve.useState(`triggerElement`),Se=ve.useState(`positionerElement`),Ce=Ao(ge),we=ge??Ce,Te=v.useMemo(()=>b?``:Ym(z,S),[b,z,S]),Ee=v.useMemo(()=>b&&Array.isArray(z)?z.map(e=>Ym(e,S)):Ym(z,S),[b,z,S]);Om(Bo(xe),I,z,Lo(()=>Ee),!L,c);let De=b?Array.isArray(z)&&z.length>0:z!=null&&Te!==``;No(()=>{j(De)},[De,j]),No(function(){let e=Bm(oe.current,z,C,b);e===null&&(le.current=null),!te&&ve.set(`selectedIndex`,e)},[b,te,z,C,ve]),th(z,()=>{E(R),D(Im(z,A.initialValue,C)),P.change(z)});let Oe=Lo((e,t)=>{s?.(e,t),!t.isCanceled&&(B(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),F===`onBlur`&&P.commit(z)))}),ke=Lo(()=>{me(!1),ve.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});mp({enabled:!h,open:te,ref:V,onComplete(){te||ke()}}),v.useImperativeHandle(h,()=>({unmount:ke}),[ke]);let Ae=Lo((e,t)=>{i?.(e,t),!t.isCanceled&&ee(e)}),je=Lo(e=>{let t=oh(e.scrollHeight,e.clientHeight),n=sh(e.scrollTop,t),r=n>0,i=n<t;ve.set(`scrollUpArrowVisible`,r),ve.set(`scrollDownArrowVisible`,i)}),Me=Rp({open:te,onOpenChange:Oe,elements:{reference:xe,floating:Se}}),Ne=Xd(Me,{enabled:!L,event:`mousedown`}),Pe=nf(Me),Fe=im(Me,{enabled:!L,listRef:ne,activeIndex:ye,selectedIndex:be,disabledIndices:ss,onNavigate(e){(e!==null||te)&&ve.set(`activeIndex`,e)},focusItemOnHover:w}),Ie=am(Me,{enabled:!L&&(te||!f&&!b),listRef:re,activeIndex:ye,selectedIndex:be,disabledIndices:e=>jo(ne.current[e]),onMatch(e){te?ve.set(`activeIndex`,e):Ae(oe.current[e],hl(el))},onTyping(e){se.current=e}}),Le=v.useMemo(()=>$u(Ie.reference,Fe.reference,Pe.reference,Ne.reference,_e),[Ne.reference,Ie.reference,Fe.reference,Pe.reference,_e]),Re=v.useMemo(()=>$u(hp,Ie.floating,Fe.floating,Pe.floating),[Ie.floating,Fe.floating,Pe.floating]),ze=Fe.item??cs;ve.useContextCallback(`setValue`,Ae),ve.useContextCallback(`setOpen`,Oe),ve.useContextCallback(`handleScrollArrowVisibility`,je),ve.useContextCallback(`onOpenChangeComplete`,_),ko(()=>{ve.update({popupProps:Re,triggerProps:Le})}),ve.useSyncedValues({id:I,modal:m,multiple:b,value:z,open:te,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=Co(g,P.inputRef),He=b?void 0:R,Ue=v.useMemo(()=>!b||!Array.isArray(z)||!R?null:z.map(e=>{let t=Ym(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)(mm.Provider,{value:ve,children:[(0,U.jsx)(hm.Provider,{value:Be,children:(0,U.jsx)(gm.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=hl(el,e.nativeEvent);function r(){if(b)return;let e=t.toLowerCase(),r=oe.current.findIndex(t=>Ym(t,S).toLowerCase()===e||Jm(t,x).toLowerCase()===e);r===-1&&(r=oe.current.findIndex((t,n)=>{let r=re.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?bo:yo,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ue]})}function lh(e,t){return e??t}var uh=5;function dh(e,t){let n=fh(t);return e.clientX>=n.left-uh&&e.clientX<=n.right+uh&&e.clientY>=n.top-uh&&e.clientY<=n.bottom+uh}function fh(e){let t=e.getBoundingClientRect(),n=fs(e);if(ac)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 ph=v.createContext(void 0);function mh(e=!1){let t=v.useContext(ph);if(t===void 0&&!e)throw Error(Uo(16));return t}function hh(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 gh(e,t,{detail:n=0}={}){e.dispatchEvent(new(fs(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function _h(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=v.useRef(null),s=mh(!0),c=a??s!==void 0,{props:l}=hh({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=v.useCallback(()=>{let e=o.current;vh(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return No(u,[u]),{getButtonProps:v.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return $u({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(ud(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=vh(r),s=!i&&yh(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(),gh(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),gh(r,e)))},onKeyUp(e){if(!t){if(ud(e),a?.(e),e.target===e.currentTarget&&i&&c&&vh(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),gh(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Lo(e=>{o.current=e,u()})}}function vh(e){return gs(e)&&e.tagName===`BUTTON`}function yh(e){return gs(e)&&e.tagName===`A`&&!!e.href}var bh=`data-popup-side`,xh=400,Sh={...Lc,...wm,popupSide:e=>e?{[bh]:e}:null,value:()=>null},Ch=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}=Dm(),{labelId:h}=jm(),g=_m(),{readOnly:_,required:y,disabled:b}=vm(),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=lh(h,A);Mm({id:i});let F=Bo(E),I=v.useRef(null),{getButtonProps:L,buttonRef:R}=_h({disabled:x,native:o}),z=g.useStateSetter(`triggerElement`),ee=Gs(),te=Gs(),B=Gs();v.useEffect(()=>{if(S)return B.start(xh,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{B.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},te.clear()},[S,g,te,B]);let ne=$u(T,{id:N,role:`combobox`,"aria-expanded":S,"aria-haspopup":`listbox`,"aria-controls":S?D?.id??Jc(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,hl(el,e.nativeEvent)),ee.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){pc(E,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&f.commit(w))},onMouseDown(e){if(S)return;let t=Is(e.currentTarget);function n(e){if(!I.current)return;let t=e.target;pc(I.current,t)||pc(F.current,t)||dh(e,I.current)||g.context.setOpen(!1,hl(ul,e))}te.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,L),re=f.getValidationProps(x,ne);re.role=`combobox`;let V={...p,open:S,disabled:x,value:w,readOnly:_,popupSide:M,placeholder:!j};return pd(`button`,e,{ref:[t,I,R,z],state:V,stateAttributesMapping:Sh,props:re})}),wh={value:()=>null},Th=v.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=_m(),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)?Zm(l,u,d):Xm(l,u,d)),pd(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:wh})}),Eh=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return pd(`span`,e,{state:{open:_m().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Ic})}),Dh=v.forwardRef(function(e,t){let n=_m(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,U.jsx)(Ad,{ref:t,...e}):null});function Oh(e){return Go(19)?e:e?`true`:void 0}var kh=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Ah(){return v.useContext(kh)}function jh(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Lo(i),[,o]=v.useState(!1),s=So(Nh).current,c=So(Mh).current,l=v.useRef(0),u=v.useRef(!0),d=v.useRef(null),f=v.useRef(null),p=Lo(()=>{u.current||(u.current=!0,o(e=>!e))}),m=Lo((e,t)=>{c.set(e,t),p()}),h=Lo(e=>{c.delete(e),p()}),g=Lo(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(!Ih(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Lh(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=Fh(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=Lo(()=>{let[e,t]=Ph(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))});No(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),No(()=>{u.current&&y()}),No(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=Lo(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)(kh.Provider,{value:x,children:t})}function Mh(){return new Map}function Nh(){return new Set}function Ph(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)=>Lh(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 Fh(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Ih(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 Lh(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Rh=v.createContext(void 0);function zh(){return v.useContext(Rh)?.direction??`ltr`}var Bh=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`}=Ol(e,t)||{};if(l==null)return{};let f=Kl(u),p={x:n,y:r},m=Pl(i),h=Ml(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=Dl(k,j,A),N=!c.arrow&&Al(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}}}),Vh=(e,t)=>{let{name:n,fn:r}=Bh(e);return{name:n,fn:r,options:[e,t]}},Hh={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}}}},Uh={sideX:`left`,sideY:`top`},Wh=`--available-width`,Gh=`--available-height`,Kh=`--anchor-width`,qh=`--anchor-height`,Jh=`--transform-origin`,Yh=Wh,Xh=Gh;function Zh(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 Qh(e,t,n){let{rects:r,placement:i}=e;return{side:Zh(t,kl(i),n),align:Al(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function $h(e){return eg(e,zp)}function eg(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=Lo(j),N=j?M:n,P=Bo(n),F=Bo(g),I=zh()===`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`),te=+(i===`top`),B=+(i===`right`),ne=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},V=v.useRef(null),ie=Bo(a),ae=Bo(s),H=typeof a==`function`?0:a,oe=typeof s==`function`?0:s,se=[];p&&se.push(p),se.push(np(e=>{let t=Qh(e,i,I),n=typeof ie.current==`function`?ie.current(t):ie.current,r=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[H,oe,I,i]));let ce=D===`none`&&E!==`shift`,le=!ce&&(u||k||E===`shift`),ue=E===`none`?null:ap({...re,padding:{top:z.top+1+ee,right:z.right+1+ne,bottom:z.bottom+1+te,left:z.left+1+B},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),de=ce?null:rp({...re,rootBoundary:A,mainAxis:D!==`none`,crossAxis:le,limiter:u||k?void 0:ip(e=>{if(!V.current)return{};let{width:t,height:n}=V.current.getBoundingClientRect(),r=Nl(kl(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[re,u,k,A,z,D]);E===`shift`||D===`shift`||o===`center`?se.push(de,ue):se.push(ue,de),se.push(op({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(Yh,`${t}px`),i.setProperty(Xh,`${n}px`);let a=fs(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(Kh,`${u}px`),i.setProperty(qh,`${d}px`)}}),Vh(e=>({element:V.current||Is(e.elements.floating).createElement(`div`),padding:V.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=kl(r),u=Al(r),d=Nl(l)===`y`,f=V.current,p=typeof a==`function`?a(Qh(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(Jh,d?`${m} ${h}`:`${h} ${m}`),{}}},Hh,x),No(()=>{!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)=>Uf(...e,fe),nodeId:b,externalTree:C}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||Uh,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[Yh]=`100vw`,e[Xh]=`100vh`,xe||(e.opacity=0),e},[x,Te,Ce,he,we,ge,Se,xe]),De=v.useRef(null);No(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(tg(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`&&tg(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 Uf(me.reference,me.floating,ve,fe)},[m,g,me,ve,fe]);let Oe=kl(ye),ke=Zh(i,Oe,I),Ae=Al(ye)||`center`,je=!!_e.hide?.referenceHidden;No(()=>{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:V,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,V,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function tg(e){return e!=null&&`current`in e}var ng=v.createContext(void 0);function rg(){let e=v.useContext(ng);if(!e)throw Error(Uo(59));return e}var ig=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 ag(e,t){e&&Object.assign(e.style,t)}var og={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function sg(e){return e===`starting`?bd:cs}function cg(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),pd(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},sg(r),i],stateAttributesMapping:Rc})}var lg={},ug={},dg=``;function fg(e,t){return vs(e)?e:t}function pg(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fg(t,n)).overflowY)}function eee(e){if(typeof document>`u`)return!1;let t=Is(e);return fs(t).innerWidth-t.documentElement.clientWidth>0}function tee(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Is(e),n=t.documentElement,r=t.body,i=fg(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 mg(e){let t=Is(e),n=t.documentElement,r=t.body,i=fg(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 hg(e){let t=Is(e),n=t.documentElement,r=t.body,i=fs(n),a=0,o=0,s=!1,c=Vs.create();if(rc&&(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,lg={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},dg=n.style.scrollBehavior,ug={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=fg(n,r);if(s=tee(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,lg),Object.assign(r.style,ug),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=dg)}function d(){u(),c.request(l)}l();let f=Ls(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var gg=new class{lockCount=0;restore=null;timeoutLock=Ws.create();timeoutUnlock=Ws.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=Is(e),n=t.documentElement,r=t.body,i=fs(n);if(pg(i,n,r)){let t=new i.MutationObserver(()=>{pg(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=Qs||!eee(e);this.restore=a?mg(e):hg(e)}};function _g(e=!0,t=null){No(()=>{if(e)return gg.acquire(t)},[e,t])}var vg=20;function yg(e,t,n,r){let[i,a]=v.useState(!1);No(()=>{if(!e||!t||n==null){a(!1);return}let r=Is(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-vg)},[e,t,n]),_g(e&&(!t||i),r)}var bg={position:`fixed`},nee=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=Sd,style:_,...y}=e,b=_m(),x=ym(),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),yg((F||w)&&S,E===`touch`,D,O);let I=$h({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?bg:I.positionerStyles,z={open:S,side:L,align:I.align,anchorHidden:I.anchorHidden};No(()=>{b.set(`popupSide`,I.side)},[b,I.side]);let ee=cg(e,z,{styles:R,transitionStatus:A,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!C,inert:!S}),te=v.useRef(0),B=Lo(e=>{if(b.context.valuesRef.current.length===0)return;let t=te.current;te.current=e.size;let n=hl(el);if(t!==0&&!b.state.multiple&&T!==null&&Rm(b.context.valuesRef.current,T,k)===-1){let e=b.context.initialValueRef.current,t=e!=null&&Rm(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=>Rm(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:``};ag(D,e),ag(b.context.popupRef.current,e)}}),ne=v.useMemo(()=>({...I,side:L,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:P,scrollUpArrowRef:j,scrollDownArrowRef:M}),[I,L,F,P]);return(0,U.jsx)(jh,{elementsRef:b.context.listRef,labelsRef:b.context.labelsRef,onMapChange:B,children:(0,U.jsxs)(ng.Provider,{value:ne,children:[C&&w&&(0,U.jsx)(ig,{inert:Oh(!S),cutout:O}),ee]})})}),xg=`base-ui-disable-scrollbar`,Sg={className:xg,getElement(e){return(0,U.jsx)(`style`,{nonce:e,href:xg,precedence:`base-ui:low`,children:`.${xg}{scrollbar-width:none}.${xg}::-webkit-scrollbar{display:none}`})}},ree=v.createContext(void 0);function Cg(e){let t=v.useContext(ree);if(t===void 0&&!e)throw Error(Uo(69));return t}var wg=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Tg=v.createContext(void 0),Eg={disableStyleElements:!1};function Dg(){return v.useContext(Tg)??Eg}var Og=`--transform-origin`,kg={...Rc,...Tc},Ag=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=_m(),{multiple:c,readOnly:l,highlightItemOnHover:u}=vm(),d=ym(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=rg(),_=Cg(!0)!=null,y=zh(),{nonce:b,disableStyleElements:x}=Dg(),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=Hs(),F=Lo(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=Ng(k),i=Pg(k.getBoundingClientRect().height,`y`,r),a=Is(k),o=fs(k),c=o.getComputedStyle(k),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=jg(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=Mg(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=ah(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=ah(g,0,Mg(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]),mp({open:C,ref:s.context.popupRef,onComplete(){C&&s.context.onOpenChangeComplete(!0)}});let I={open:C,transitionStatus:D,side:f,align:p};No(()=>{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]),No(()=>{C||m||(M.current=!1,j.current=!1,ag(k,N.current))},[C,m,k]),No(()=>{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(Og),!m){P.request(()=>s.context.handleScrollArrowVisibility(A||e));return}let t=iee(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=fs(k),i=r.getComputedStyle(k),a=r.getComputedStyle(e),o=Is(O),c=Ng(O),l=Fg(O.getBoundingClientRect(),c),d=Fg(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=jg(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=Fg(n.getBoundingClientRect(),c);T=Fg(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=`${ah(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=Mg(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),te=(r.visualViewport?.scale??1)!==1&&rc;if(ee||te){ag(k,N.current),g(!1);return}let B=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=Mg(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=ah(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Og,`50% ${i}%`)}(B===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=fs(k);function t(e){s.context.setOpen(!1,hl(ml,e))}return Ls(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){_&&wg.has(e.key)&&e.stopPropagation()},onScroll(e){A||F(e.currentTarget)},...m&&{style:A?{height:`100%`}:og},className:!A&&m?Sg.className:void 0},R=pd(`div`,e,{ref:[t,s.context.popupRef],state:I,stateAttributesMapping:kg,props:[E,L,sg(D),o]});return(0,U.jsxs)(v.Fragment,{children:[!x&&Sg.getElement(b),(0,U.jsx)(Yd,{context:d,modal:!1,disabled:!T,openInteractionType:w,returnFocus:a,restoreFocus:!0,children:R})]})});function jg(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Mg(e){return oh(e.scrollHeight,e.clientHeight)}function Ng(e){return Bf.getScale(e)}function Pg(e,t,n){return e/n[t]}function Fg(e,t){return ql({x:Pg(e.x,`x`,t),y:Pg(e.y,`y`,t),width:Pg(e.width,`x`,t),height:Pg(e.height,`y`,t)})}var Ig=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function iee(e){let{style:t}=e,n={};for(let[e,r]of Ig)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Ig){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}function Lg(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Ah(),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 No(()=>{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 Rg=v.createContext(void 0);function zg(){let e=v.useContext(Rg);if(!e)throw Error(Uo(57));return e}var Bg=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=Lg({guess:!0,label:o,textRef:u}),f=_m(),{itemProps:p,multiple:m,disabled:h,readOnly:g}=vm(),_=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);No(()=>{let e=f.context.valuesRef.current;return e[w]=a,()=>{delete e[w]}},[w,a,f]),No(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=Vm(w,a,f.context.valuesRef.current,e,C,t),r=n===w,w===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&Fm(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}=_h({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?Hm(n,a,C):[...n,a];f.context.setValue(r,hl(al,e))}else f.context.setValue(a,hl(al,e)),f.context.setOpen(!1,hl(al,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&&cc(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=pd(`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)(Rg.Provider,{value:F,children:P})})),Vg=v.forwardRef(function(e,t){let{selected:n}=zg();return e.keepMounted||n?(0,U.jsx)(Hg,{...e,ref:t}):null}),Hg=v.memo(v.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=zg(),c=v.useRef(null),{transitionStatus:l,setMounted:u}=up(s),d=pd(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:Tc});return mp({batch:!0,enabled:!s,open:s,ref:c,onComplete(){s||u(!1)}}),d})),Ug=v.memo(v.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=zg(),a=_m(),{render:o,className:s,style:c,...l}=e;return pd(`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})})),Wg=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Gg(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Wg(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Kg=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},qg=e=>{let t=Kg(e);return t.charAt(0).toUpperCase()+t.slice(1)},Jg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Yg={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 Xg(e){return e!=null}function Zg(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Yg.width,a=e.size??e.height??Yg.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?Jg(...c):Jg(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Yg[`stroke-width`])*Number(e.size??e.width??Yg.width)/Number(t.size??t.width??Yg.width):t.strokeWidth??Yg[`stroke-width`];return[`svg`,{...Object.entries(Yg).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Xg(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Xg(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Xg(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 Qg(e,t={}){return Zg(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var $g=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},e_=(0,v.createContext)({}),t_=()=>(0,v.useContext)(e_),n_=(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=``}=t_()??{},b=!!c||$g(d),[x,S,C=[]]=Qg(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Jg(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 K(e,t=[],n=[]){let r=typeof e==`string`?Gg(e,t,n):e,i=(0,v.forwardRef)(({className:e,...t},n)=>(0,v.createElement)(n_,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=qg(r.name)),i}var r_={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`}]]};r_.node;var i_=K(r_),a_={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};a_.node;var o_=K(a_),s_={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};s_.node;var c_=K(s_),l_={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};l_.node;var u_=K(l_),d_={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};d_.node;var f_=K(d_),p_={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};p_.node;var m_=K(p_),h_={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`}]]};h_.node;var aee=K(h_),g_={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`}]]};g_.node;var oee=K(g_),__={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`}]]};__.node;var see=K(__),v_={name:`bed-double`,size:24,node:[[`path`,{d:`M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8`,key:`1k78r4`}],[`path`,{d:`M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4`,key:`fb3tl2`}],[`path`,{d:`M12 4v6`,key:`1dcgq2`}],[`path`,{d:`M2 18h20`,key:`ajqnye`}]]};v_.node;var y_=K(v_),b_={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`}]]};b_.node;var x_=K(b_),S_={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`}]]};S_.node;var C_=K(S_),w_={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`}]]};w_.node;var T_=K(w_),E_={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`}]]};E_.node;var D_=K(E_),O_={name:`bot-off`,size:24,node:[[`path`,{d:`M13.67 8H18a2 2 0 0 1 2 2v4.33`,key:`7az073`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M22 22 2 2`,key:`1r8tn9`}],[`path`,{d:`M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586`,key:`s09a7a`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}],[`path`,{d:`M9.67 4H12v2.33`,key:`110xot`}]]};O_.node;var k_=K(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_=K(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_=K(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_=K(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_=K(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_=K(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_=K(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_=K(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_=K(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_=K(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_=K(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_=K(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 $_=K(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=K(ev),nv={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};nv.node;var rv=K(nv),iv={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};iv.node;var av=K(iv),ov={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};ov.node;var sv=K(ov),cv={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};cv.node;var lv=K(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=K(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=K(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 cee=K(mv),hv={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`]};hv.node;var lee=K(hv),gv={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`}]]};gv.node;var uee=K(gv),_v={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};_v.node;var dee=K(_v),vv={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`}]]};vv.node;var fee=K(vv),yv={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`}]]};yv.node;var pee=K(yv),bv={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};bv.node;var mee=K(bv),xv={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`}]]};xv.node;var hee=K(xv),Sv={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`}]]};Sv.node;var Cv=K(Sv),wv={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`}]]};wv.node;var Tv=K(wv),Ev={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`}]]};Ev.node;var Dv=K(Ev),Ov={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`}]]};Ov.node;var kv=K(Ov),Av={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`}]]};Av.node;var jv=K(Av),Mv={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`}]]};Mv.node;var Nv=K(Mv),Pv={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`}]]};Pv.node;var Fv=K(Pv),Iv={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`}]]};Iv.node;var Lv=K(Iv),Rv={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`}]]};Rv.node;var zv=K(Rv),Bv={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`}]]};Bv.node;var Vv=K(Bv),Hv={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`}]]};Hv.node;var Uv=K(Hv),Wv={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`}]]};Wv.node;var Gv=K(Wv),Kv={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`]};Kv.node;var qv=K(Kv),Jv={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`}]]};Jv.node;var Yv=K(Jv),Xv={name:`face-slightly-smiling`,size:24,node:[[`path`,{d:`M15 10V9`,key:`4dkmfx`}],[`path`,{d:`M16.472 15a6 6 0 01-8.943 0`,key:`7qomzy`}],[`path`,{d:`M9 10V9`,key:`1lazqi`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`smile`]};Xv.node;var Zv=K(Xv),Qv={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`}]]};Qv.node;var $v=K(Qv),ey={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`}]]};ey.node;var ty=K(ey),ny={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`]};ny.node;var ry=K(ny),iy={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`}]]};iy.node;var ay=K(iy),oy={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`}]]};oy.node;var sy=K(oy),cy={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`}]]};cy.node;var ly=K(cy),uy={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`}]]};uy.node;var dy=K(uy),fy={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`}]]};fy.node;var py=K(fy),my={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`}]]};my.node;var hy=K(my),gy={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`}]]};gy.node;var _y=K(gy),vy={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`}]]};vy.node;var yy=K(vy),by={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`}]]};by.node;var xy=K(by),Sy={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`]};Sy.node;var Cy=K(Sy),wy={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`}]]};wy.node;var Ty=K(wy),Ey={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`}]]};Ey.node;var Dy=K(Ey),Oy={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`}]]};Oy.node;var ky=K(Oy),Ay={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`}]]};Ay.node;var jy=K(Ay),My={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`}]]};My.node;var Ny=K(My),Py={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`}]]};Py.node;var Fy=K(Py),Iy={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`}]]};Iy.node;var Ly=K(Iy),Ry={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`}]]};Ry.node;var zy=K(Ry),By={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};By.node;var Vy=K(By),Hy={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`}]]};Hy.node;var gee=K(Hy),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=K(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 _ee=K(Gy),Ky={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`]};Ky.node;var vee=K(Ky),qy={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`}]]};qy.node;var yee=K(qy),Jy={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`}]]};Jy.node;var Yy=K(Jy),Xy={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`}]]};Xy.node;var bee=K(Xy),Zy={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`}]]};Zy.node;var xee=K(Zy),Qy={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`}]]};Qy.node;var See=K(Qy),$y={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`}]]};$y.node;var Cee=K($y),eb={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`]};eb.node;var tb=K(eb),nb={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`}]]};nb.node;var wee=K(nb),rb={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`}]]};rb.node;var Tee=K(rb),ib={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`}]]};ib.node;var ab=K(ib),ob={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`}]]};ob.node;var sb=K(ob),cb={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`}]]};cb.node;var lb=K(cb),ub={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`}]]};ub.node;var db=K(ub),fb={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};fb.node;var pb=K(fb),mb={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`}]]};mb.node;var hb=K(mb),gb={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};gb.node;var _b=K(gb),vb={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`}]]};vb.node;var yb=K(vb),bb={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`}]]};bb.node;var xb=K(bb),Sb={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};Sb.node;var Cb=K(Sb),wb={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};wb.node;var Tb=K(wb),Eb={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`]};Eb.node;var Db=K(Eb),Ob={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`}]]};Ob.node;var kb=K(Ob),Ab={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`}]]};Ab.node;var jb=K(Ab),Mb={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`}]]};Mb.node;var Nb=K(Mb),Pb={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Pb.node;var Fb=K(Pb),Ib={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`}]]};Ib.node;var Lb=K(Ib),Rb={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`}]]};Rb.node;var zb=K(Rb),Bb={name:`mountain`,size:24,node:[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]};Bb.node;var Vb=K(Bb),Hb={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`}]]};Hb.node;var Ub=K(Hb),Wb={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`}]]};Wb.node;var Gb=K(Wb),Kb={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`}]]};Kb.node;var qb=K(Kb),Jb={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`}]]};Jb.node;var Yb=K(Jb),Xb={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`}]]};Xb.node;var Zb=K(Xb),Qb={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`}]]};Qb.node;var $b=K(Qb),ex={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`}]]};ex.node;var tx=K(ex),nx={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`]};nx.node;var rx=K(nx),ix={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`]};ix.node;var ax=K(ix),ox={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`}]]};ox.node;var sx=K(ox),cx={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`}]]};cx.node;var lx=K(cx),ux={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`}]]};ux.node;var dx=K(ux),fx={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`}]]};fx.node;var px=K(fx),mx={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`}]]};mx.node;var hx=K(mx),gx={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`}]]};gx.node;var _x=K(gx),vx={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`}]]};vx.node;var yx=K(vx),bx={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`}]]};bx.node;var xx=K(bx),Sx={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Sx.node;var Cx=K(Sx),wx={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`}]]};wx.node;var Tx=K(wx),Ex={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`}]]};Ex.node;var Dx=K(Ex),Ox={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`}]]};Ox.node;var kx=K(Ox),Ax={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`}]]};Ax.node;var jx=K(Ax),Mx={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`}]]};Mx.node;var Nx=K(Mx),Px={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`}]]};Px.node;var Fx=K(Px),Ix={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`}]]};Ix.node;var Lx=K(Ix),Rx={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`}]]};Rx.node;var zx=K(Rx),Bx={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`]};Bx.node;var Vx=K(Bx),Hx={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`}]]};Hx.node;var Ux=K(Hx),Wx={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`}]]};Wx.node;var Gx=K(Wx),Kx={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`}]]};Kx.node;var qx=K(Kx),Jx={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`}]]};Jx.node;var Yx=K(Jx),Xx={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`}]]};Xx.node;var Zx=K(Xx),Qx={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`}]]};Qx.node;var $x=K(Qx),eS={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`}]]};eS.node;var tS=K(eS),nS={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`}]]};nS.node;var rS=K(nS),iS={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};iS.node;var aS=K(iS),oS={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`}]]};oS.node;var sS=K(oS),cS={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`}]]};cS.node;var lS=K(cS),uS={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`}]]};uS.node;var dS=K(uS),fS={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`}]]};fS.node;var Eee=K(fS),pS={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`}]]};pS.node;var Dee=K(pS),mS={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`}]]};mS.node;var Oee=K(mS),hS={name:`shuffle`,size:24,node:[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]};hS.node;var kee=K(hS),gS={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`}]]};gS.node;var Aee=K(gS),_S={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`}]]};_S.node;var jee=K(_S),vS={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`}]]};vS.node;var Mee=K(vS),yS={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`]};yS.node;var bS=K(yS),xS={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`}]]};xS.node;var Nee=K(xS),SS={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`]};SS.node;var Pee=K(SS),CS={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`]};CS.node;var Fee=K(CS),wS={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`]};wS.node;var Iee=K(wS),TS={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`]};TS.node;var ES=K(TS),DS={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};DS.node;var OS=K(DS),kS={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`}]]};kS.node;var AS=K(kS),jS={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`}]]};jS.node;var MS=K(jS),NS={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`}]]};NS.node;var Lee=K(NS),PS={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`}]]};PS.node;var Ree=K(PS),FS={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`}]]};FS.node;var zee=K(FS),IS={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`}]]};IS.node;var Bee=K(IS),LS={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};LS.node;var RS=K(LS),zS={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`}]]};zS.node;var BS=K(zS),VS={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`]};VS.node;var HS=K(VS),US={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`}]]};US.node;var WS=K(US),GS={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`]};GS.node;var KS=K(GS),qS={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`}]]};qS.node;var JS=K(qS),YS={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`}]]};YS.node;var XS=K(YS),ZS={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`}]]};ZS.node;var QS=K(ZS),$S={name:`ungroup`,size:24,node:[[`rect`,{x:`11`,y:`14`,width:`10`,height:`7`,rx:`2`,key:`nfm8rk`}],[`rect`,{x:`3`,y:`3`,width:`10`,height:`7`,rx:`2`,key:`1ljebb`}]]};$S.node;var eC=K($S),tC={name:`user-minus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};tC.node;var nC=K(tC),rC={name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};rC.node;var iC=K(rC),aC={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`]};aC.node;var oC=K(aC),sC={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`}]]};sC.node;var cC=K(sC),lC={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`}]]};lC.node;var uC=K(lC),dC={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`}]]};dC.node;var fC=K(dC),pC={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`]};pC.node;var mC=K(pC),hC={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`}]]};hC.node;var gC=K(hC),_C={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`}]]};_C.node;var vC=K(_C),yC={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`}]]};yC.node;var bC=K(yC),xC={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`}]]};xC.node;var SC=K(xC),CC={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};CC.node;var wC=K(CC),TC={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`}]]};TC.node;var EC=K(TC),DC=({children:e})=>(0,U.jsx)(`div`,{className:`wd-root`,style:{display:`contents`},children:e}),OC=ch,kC=Th,AC=Ug,jC=({className:e,children:t,...n})=>(0,U.jsxs)(Ch,{"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)(Eh,{className:`text-fg-4`,children:(0,U.jsx)(dv,{className:`size-3.5`})})]}),MC=({className:e,align:t=`start`,alignItemWithTrigger:n=!1,side:r=`bottom`,sideOffset:i=6,...a})=>(0,U.jsx)(Dh,{children:(0,U.jsx)(DC,{children:(0,U.jsx)(nee,{align:t,alignItemWithTrigger:n,side:r,sideOffset:i,className:`isolate z-80 outline-none`,children:(0,U.jsx)(Ag,{"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})})})}),NC=({className:e,children:t,...n})=>(0,U.jsxs)(Bg,{"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)(Vg,{className:`mt-0.5 text-fg-1`,children:(0,U.jsx)(rv,{className:`size-3.5`})})]});function PC({label:e,value:t,options:n,onChange:r,className:i}){return(0,U.jsxs)(OC,{value:t,onValueChange:e=>r(e),children:[(0,U.jsx)(jC,{"aria-label":e,className:i,children:(0,U.jsx)(kC,{children:n.find(e=>e.value===t)?.label??e})}),(0,U.jsx)(MC,{children:n.map(e=>(0,U.jsx)(NC,{value:e.value,children:(0,U.jsx)(AC,{children:e.label})},e.value))})]})}function FC({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=nf(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=mc(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||pc(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return _g(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),No(()=>(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]),Dp(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var IC=v.createContext(void 0);function LC(e){let t=v.useContext(IC);if(!e&&t===void 0)throw Error(Uo(27));return t}var RC={...Ip,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},zC=class extends ls{constructor(e,t,n){let r=new kp,i=BC(e,r,t,n);super(i,VC(r),RC)}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(xp(this.state,e,t.trigger)))}};function BC(e,t,n,r=!1){return{...Ap(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 VC(e){return{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function HC(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=LC(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:_},x=_p((e,t)=>new zC({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`);Op(x,S),Tp(x);let{forceUnmount:T}=Ep(S,x);v.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,hl(pl))}),[T,x]);let E=S||C;return(0,U.jsxs)(IC.Provider,{value:x,children:[u&&(0,U.jsx)(vp,{handle:u,store:x}),E&&(0,U.jsx)(FC,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}function UC(e){return HC(`alert-dialog`,e)}var WC=v.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=LC(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return pd(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:zc,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),GC=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=LC(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=_h({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,hl(ol,e.nativeEvent))}return pd(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),KC=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=LC(),c=km(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),pd(`p`,e,{ref:t,props:[{id:c},o]})}),qC=v.createContext(void 0);function JC(){let e=v.useContext(qC);if(e===void 0)throw Error(Uo(26));return e}var YC=`--nested-dialogs`,XC=`data-nested-dialog-open`,ZC={...Rc,...Tc,nestedDialogOpen(e){return e?{[XC]:``}:null}},QC=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=LC(),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`);JC(),mp({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?gp(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=pd(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...hp,hidden:!m,onKeyDown(e){wg.has(e.key)&&e.stopPropagation()},style:{[YC]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:ZC});return(0,U.jsx)(Yd,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),$C=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=LC(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,U.jsx)(qC.Provider,{value:n,children:(0,U.jsxs)(Ad,{ref:t,...r,children:[a&&o===!0&&(0,U.jsx)(ig,{ref:i.context.internalBackdropRef,inert:Oh(!s)}),e.children]})}):null}),ew=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=LC(),c=km(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),pd(`h2`,e,{ref:t,props:[{id:c},o]})}),tw=Zo(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=LC(!0),f=Lp(l)??d;if(!f)throw Error(Uo(79));let p=km(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=v.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=wp(p,_,f,{payload:c}),{getButtonProps:x,buttonRef:S}=_h({disabled:a,native:o}),C=Xd(m),w=rh(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,b);return pd(`button`,e,{state:T,ref:[S,t,y,_],props:[C.reference,E,w,{[xd]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:Ic})}),nw=UC,rw=tw,iw=GC,aw=({className:e,children:t,...n})=>(0,U.jsx)($C,{children:(0,U.jsxs)(DC,{children:[(0,U.jsx)(WC,{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)(QC,{"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})]})}),ow=({className:e,...t})=>(0,U.jsx)(ew,{className:W(`text-heading-3 font-semibold text-text`,e),...t}),sw=({className:e,...t})=>(0,U.jsx)(KC,{className:W(`mt-1.5 text-body-sm text-muted-foreground`,e),...t}),cw=v.createContext(void 0);function lw(e){let t=v.useContext(cw);if(t===void 0&&!e)throw Error(Uo(33));return t}var uw=v.createContext(void 0);function dw(e){let t=v.useContext(uw);if(t===void 0&&!e)throw Error(Uo(36));return t}var fw=v.createContext(void 0);function pw(e=!0){let t=v.useContext(fw);if(t===void 0&&!e)throw Error(Uo(25));return t}function mw(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=pw(!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:al})},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&&!tc&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&gh(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var hw={type:`regular-item`};function gw(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}=_h({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=mw({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=v.useCallback(e=>$u(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=Co(u,f);return v.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var _w=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=Lg({guess:!0,label:a}),f=lw(!0),p=km(i),{store:m}=dw(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=gw({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:hw});return pd(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),vw=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=dw(),{side:c,align:l}=lw(),u=Cg(!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`;mp({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function e(e){s.setOpen(!1,hl(e.reason,e.domEvent))}return S.events.on(`close`,e),()=>{S.events.off(`close`,e)}},[S.events,s]),Jp(x,{enabled:w&&!T&&!D&&_.type!==`menubar`,closeDelay:C});let O=s.useStateSetter(`popupElement`),k=pd(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:zc,props:[p,{onKeyDown(e){u&&wg.has(e.key)&&e.stopPropagation()}},sg(f),o,{"data-rootownerid":b}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&y!==`outside-press`)&&(A=!0),(0,U.jsx)(Yd,{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})}),yw=v.createContext(void 0);function bw(){let e=v.useContext(yw);if(e===void 0)throw Error(Uo(32));return e}var xw=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=dw();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,U.jsx)(yw.Provider,{value:n,children:(0,U.jsx)(Ad,{ref:t,...r,portalOwnerRole:o})})}),Sw=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=Sd,style:g,..._}=e,{store:y}=dw(),b=bw(),x=pw(!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=pp(j),ee=n,te=c,B=l,ne=s,re=h;S.type===`context-menu`&&(ee=n??S.context?.anchor,ne??=`start`,!o&&ne!==`center`&&(B=e.alignOffset??2,te=e.sideOffset??-5));let V=o,ie=ne;S.type===`menu`?(V??=`inline-end`,ie??=`start`,re=e.collisionAvoidance??Cd):S.type===`menubar`&&(V??=S.context.orientation===`vertical`?`inline-end`:`bottom`,ie??=`start`);let ae=S.type===`context-menu`,H=$h({anchor:ee,floatingRootContext:C,positionMethod:x?`fixed`:r,mounted:T,side:V,sideOffset:te,align:ie,alignOffset:B,arrowPadding:ae?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:b,disableAnchorTracking:m,collisionAvoidance:re,shift:ae?{crossAxis:!(`side`in re&&re.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,hl(dl)))}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,hl(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,y]);let oe=Gs();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,hl(dl))}):y.setOpen(!1,hl(dl))}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]),No(()=>{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:H.side,align:H.align,anchorHidden:H.anchorHidden,nested:S.type===`menu`,instant:M},ce=S.type===`menubar`&&S.context.modal;yg(E&&(ce||D&&P!==`trigger-hover`),O===`touch`,j,k);let le=cg(e,se,{styles:H.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)(cw.Provider,{value:H,children:[ue&&(0,U.jsx)(ig,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:Oh(!E),cutout:de}),(0,U.jsx)(Rd,{id:F,children:(0,U.jsx)(jh,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:le})})]})}),Cw=v.createContext(null);function ww(e){let t=v.useContext(Cw);if(t===null&&!e)throw Error(Uo(5));return t}var Tw={...Ip,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`)}},Ew=class extends ls{constructor(e,t,n=!1){let r=new kp,i=Ow(r,t,n,e);super(i,Dw(r),Tw),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 Dw(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 Ow(e,t,n=!1,r){return{...Ap(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 Md,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:cs,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var kw=v.createContext(void 0);function Aw(){return v.useContext(kw)}var jw=Xo(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=pw(!0),_=dw(!0),y=ww(!0),b=Aw(),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=Ku(),C=Ku(),w=Fd(),T=x.type===`menu`?x.store:void 0,E=(n??a)&&T?.state.transitionStatus===`starting`,D=So(()=>E?T?.state.instantType:void 0).current,O=Mw({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=Ld(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`),te=v.useRef(null),B=v.useRef(L.type!==`context-menu`),ne=Gs(),re=v.useRef(!0),V=Gs(),ie=ee!=null,{openMethod:ae,triggerProps:H}=ih(j);O.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:L.type===void 0?s:void 0,openMethod:ae,rootId:S}),Tp(O);let{forceUnmount:oe,transitionStatus:se}=Ep(j,O,()=>{O.set(`allowMouseEnter`,!1)},E),ce=pp(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]),No(()=>{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||(te.current=null),L.type===`context-menu`){if(!j){ne.clear(),B.current=!1;return}ne.start(500,()=>{B.current=!0})}},[ne,j,L.type]),No(()=>{!j&&!P&&O.set(`hoverEnabled`,!0)},[j,P,O]);let le=Lo((e,t)=>{let n=t.reason;if(!e&&!O.select(`open`)||j===e&&t.trigger===M&&I===n)return;let i=Sp(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`&&!re.current)return;e&&n===`trigger-focus`?(re.current=!1,V.start(300,()=>{re.current=!0})):(re.current=!0,V.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);te.current=t.event;let c=xp(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=lp({popupStore:O,floatingRootContext:O.state.floatingRootContext,floatingId:C,nested:w!=null,onOpenChange:le}),de=ue.context.events;No(()=>{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,hl(pl))},[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=nf(ue,{enabled:!F,bubbles:{escapeKey:d&&L.type===`menu`},outsidePress(){return L.type!==`context-menu`||te.current?.type===`contextmenu`||B.current},externalTree:ie?k:void 0}),he=zh(),ge=v.useCallback(e=>{O.select(`activeIndex`)!==e&&O.set(`activeIndex`,e)},[O]),_e=im(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:ss,onNavigate:ge,openOnArrowKeyDown:L.type!==`context-menu`,externalTree:ie?k:void 0,focusItemOnHover:h}),ve=v.useCallback(e=>{O.context.typingRef.current=e},[O]),ye=am(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=$u(ye.reference,_e.reference,me.reference,{onMouseMove(){O.set(`allowMouseEnter`,!0)}},H);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=j,e},[O,ye.reference,_e.reference,me.reference,H,j]),xe=v.useMemo(()=>{let e=$u(_e.trigger,me.trigger,H);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[_e.trigger,me.trigger,H]);So(()=>(O.update({inactiveTriggerProps:xe}),null)),Dp(O,{floatingRootContext:ue,activeTriggerProps:be,inactiveTriggerProps:xe,popupProps:v.useMemo(()=>$u(hp,{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??cs});let Se=v.useMemo(()=>({store:O,parent:x}),[O,x]),Ce=(0,U.jsxs)(uw.Provider,{value:Se,children:[f&&(0,U.jsx)(vp,{handle:f,store:O}),typeof t==`function`?t({payload:z}):t]});return L.type===void 0||L.type===`context-menu`?(0,U.jsx)(zd,{externalTree:k,children:Ce}):Ce});function Mw(e,t,n){return So(()=>new Ew(e,t,n)).current}function Nw(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=mh(),{ref:i,index:a}=Lg(e),o=n===a,s=v.useRef(null),c=Co(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 Pw(e){let{render:t,className:n,style:r,state:i=cs,props:a=ss,refs:o=ss,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Nw({metadata:s});return pd(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Fw(e){if(gs(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Os(e))return Fw(js(e))}function Iw(e,t){let n=v.useRef(null);function r(t){Td.flushSync(()=>{e.setOpen(!1,hl(sl,t.nativeEvent,t.currentTarget))}),Su(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&Cu(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Td.flushSync(()=>{e.setOpen(!1,hl(sl,n.nativeEvent,n.currentTarget))});let i=xu(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&pc(r,i);){let e=i;if(i=vu(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Lw(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,Is(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:cs,[t,n,r])}var Rw=Zo(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=dw(!0),h=Lp(d)??m?.store;if(!h)throw Error(Uo(85));let g=km(s),_=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=v.useRef(null),C=Bw(),w=mh(!0),T=Id(),E=v.useMemo(()=>T??new Md,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=wp(g,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:Ld(E),floatingParentNodeId:Fd(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=_h({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=Gs(),I=Lo(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;pc(P.current,t)||pc(h.select(`positionerElement`),t)||t===P.current||(t==null||Fw(t)!==h.select(`rootId`))&&(dh(e,P.current)||E.events.emit(`close`,{domEvent:e,reason:ul}))});v.useEffect(()=>{b&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Is(P.current).addEventListener(`mouseup`,I,{once:!0})},[b,I,h]);let L=k&&C.context.hasSubmenuOpen,R=Xp(y,{enabled:(c??L)&&!j&&(!k||L&&!O),handleClose:pm({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=zw(b,h.select(`lastOpenChangeReason`)),ee=Xd(y,{enabled:!j,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&z}),te=Hp(y,{enabled:!j&&L}),B=Lw({open:b,enabled:k,mouseDownAction:`open`}),ne=v.useMemo(()=>$u(te.reference,ee.reference),[te.reference,ee.reference]),re=h.useState(`triggerProps`,O),{preFocusGuardRef:V,handlePreFocusGuardFocus:ie,handleFocusTargetFocus:ae}=Iw(h,S),H={disabled:j,open:b},oe=[P,t,N,D,S],se=[ne,R??cs,re,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Is(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},k?{role:`menuitem`}:{},B,p,M],ce=pd(`button`,e,{enabled:!k,stateAttributesMapping:Lc,state:H,ref:oe,props:se});return k?(0,U.jsx)(Pw,{tag:`button`,render:n,className:r,style:i,state:H,refs:oe,props:se,stateAttributesMapping:Lc}):b?(0,U.jsxs)(v.Fragment,{children:[(0,U.jsx)(bl,{ref:V,onFocus:ie},`${g}-pre-focus-guard`),(0,U.jsx)(v.Fragment,{children:ce},g),(0,U.jsx)(bl,{ref:h.context.triggerFocusTargetRef,onFocus:ae},`${g}-post-focus-guard`)]}):(0,U.jsx)(v.Fragment,{children:ce},g)});function zw(e,t){let n=Gs(),[r,i]=v.useState(!1);return No(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Bw(){let e=ww(!0);return v.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var Vw=v.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return pd(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),Hw=jw,Uw=Rw,Ww=({className:e,align:t=`end`,side:n=`bottom`,sideOffset:r=6,...i})=>(0,U.jsx)(xw,{children:(0,U.jsx)(DC,{children:(0,U.jsx)(Sw,{align:t,side:n,sideOffset:r,className:`isolate z-80 outline-none`,children:(0,U.jsx)(vw,{"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})})})}),Gw=({className:e,destructive:t,...n})=>(0,U.jsx)(_w,{"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}),Kw=({className:e,...t})=>(0,U.jsx)(Vw,{className:W(`my-1 h-px bg-border`,e),...t}),qw=v.createContext(void 0);function Jw(e){let t=v.useContext(qw);if(t===void 0&&!e)throw Error(Uo(47));return t}var Yw={...Ip,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Xw=class extends ls{constructor(e,t,n){let r=new kp;super(Zw(e,r,t,n),Qw(r),Yw)}setOpen=(e,t)=>{let n=t.reason===nl,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Sp(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=xp(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Td.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function Zw(e,t,n,r=!1){let i={...Ap(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function Qw(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),stickIfOpenTimeout:new Ws,triggerElements:e}}var $w=Xo(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=tT(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Op(u,d),Tp(u);let{forceUnmount:m}=Ep(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),v.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),v.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,hl(pl))}),[m,u]);let h=d||f;return(0,U.jsxs)(qw.Provider,{value:u,children:[s&&(0,U.jsx)(vp,{handle:s,store:u}),h&&(0,U.jsx)(nT,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function eT(e){return Jw(!0)?(0,U.jsx)($w,{props:e}):(0,U.jsx)(zd,{children:(0,U.jsx)($w,{props:e})})}function tT(e,t){let n=_p((e,n)=>new Xw(t,e,n));return v.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function nT({store:e,modal:t}){let n=nf(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Dp(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var rT=Zo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=Jw(!0),h=Lp(s)??m;if(!h)throw Error(Uo(74));let g=km(f),_=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=v.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=wp(g,S,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`openChangeReason`),E=h.useState(`stickIfOpen`),D=h.useState(`openMethod`),O=h.useState(`focusManagerModal`),k=Xp(y,{enabled:!a&&l&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:pm(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=Xd(y,{stickIfOpen:E}),j=rh(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:P}=_h({disabled:a,native:o}),F={open(e){return e&&T===`trigger-press`?Lc.open(e):Ic.open(e)}},{preFocusGuardRef:I,handlePreFocusGuardFocus:L,handleFocusTargetFocus:R}=Iw(h,S),z=pd(`button`,e,{state:{disabled:a,open:b},ref:[P,t,C,S],props:[A.reference,k,M,j,{[xd]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},p,N],stateAttributesMapping:F}),ee=(0,U.jsx)(v.Fragment,{children:z},g);return w&&!O?(0,U.jsxs)(v.Fragment,{children:[(0,U.jsx)(bl,{ref:I,onFocus:L}),ee,(0,U.jsx)(bl,{ref:h.context.triggerFocusTargetRef,onFocus:R})]}):ee}),iT=v.createContext(void 0);function aT(){let e=v.useContext(iT);if(e===void 0)throw Error(Uo(45));return e}var oT=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Jw().useState(`mounted`)||n?(0,U.jsx)(iT.Provider,{value:n,children:(0,U.jsx)(Ad,{ref:t,...r})}):null}),sT=v.createContext(void 0);function cT(){let e=v.useContext(sT);if(!e)throw Error(Uo(46));return e}var lT=v.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=Cd,..._}=e,y=Jw(),b=aT(),x=Ld(),S=y.useState(`floatingRootContext`),C=y.useState(`mounted`),w=y.useState(`open`),T=y.useState(`openChangeReason`),E=y.useState(`activeTriggerElement`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`positionerElement`),A=y.useState(`instantType`),j=y.useState(`transitionStatus`),M=y.useState(`adaptiveOrigin`),N=v.useRef(null),P=pp(k),F=$h({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:b,nodeId:x,collisionAvoidance:g,adaptiveOrigin:M}),I=S.useState(`domReferenceElement`);No(()=>{let e=I,t=N.current;if(e&&(N.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return P(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,P,y]);let L=D===!0&&T!==`trigger-hover`;yg(w&&L,O===`touch`,k,E);let R=y.useStateSetter(`positionerElement`),z=cg(e,{open:w,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:A},{styles:F.positionerStyles,transitionStatus:j,props:_,refs:[t,R],hidden:!C,inert:!w});return(0,U.jsxs)(sT.Provider,{value:F,children:[C&&L&&(0,U.jsx)(ig,{inert:Oh(!w),cutout:E}),(0,U.jsx)(Rd,{id:x,children:z})]})}),uT=v.createContext(void 0);function dT(){let[e,t]=v.useState(0),n=Lo(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:v.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var fT=v.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Jw(),l=cT(),u=Cg(!0)!=null,{context:d,hasClosePart:f}=dT(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);mp({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Jp(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?gp(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=pd(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...hp,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&wg.has(e.key)&&e.stopPropagation()}},sg(g),s],stateAttributesMapping:zc});return(0,U.jsx)(Yd,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:gs(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,U.jsx)(uT.Provider,{value:d,children:M})})}),pT=eT,mT=rT,hT=({className:e,align:t=`end`,side:n=`bottom`,sideOffset:r=6,...i})=>(0,U.jsx)(oT,{children:(0,U.jsx)(DC,{children:(0,U.jsx)(lT,{align:t,side:n,sideOffset:r,className:`isolate z-80 outline-none`,children:(0,U.jsx)(fT,{"data-slot":`popover-content`,className:W(`rounded-md border border-border bg-surface p-2 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})})})}),gT=Xo(function(e){return HC(`dialog`,e)}),_T=({className:e,children:t,size:n=`md`,...r})=>(0,U.jsx)($C,{children:(0,U.jsxs)(DC,{children:[(0,U.jsx)(WC,{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)(QC,{"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})]})}),vT=({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)(ew,{className:`truncate text-body-sm font-semibold text-text`,children:e}),t?(0,U.jsx)(KC,{className:`mt-0.5 text-label text-fg-4`,children:t}):null]}),n,(0,U.jsx)(GC,{"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)(wC,{className:`size-3.5`})})]}),yT=({className:e,...t})=>(0,U.jsx)(`div`,{className:W(`min-h-0 flex-1 overflow-y-auto p-4`,e),...t}),bT=({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})]}),xT=v.createContext(void 0);function ST(e){let t=v.useContext(xT);if(t===void 0&&!e)throw Error(Uo(72));return t}var CT={...Ip,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},wT=class extends ls{constructor(e,t,n){let r=new kp;super(TT(e,r,t,n),ET(r),CT)}setOpen=(e,t)=>{Cp(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,hl(tl,e))}};function TT(e,t,n,r=!1){return{...Ap(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 ET(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var DT=Xo(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=_p((e,t)=>new wT({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}),Tp(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=Ep(h,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=v.useRef(null);No(()=>{m&&t&&p.setOpen(!1,hl(fl))},[m,t,p]),No(()=>{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]),No(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),v.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,hl(pl))}),[b,p]);let E=h||_||!t&&a!==`none`;return(0,U.jsxs)(xT.Provider,{value:p,children:[l&&(0,U.jsx)(vp,{handle:l,store:p}),E&&(0,U.jsx)(OT,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function OT({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=nf(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=$d(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=v.useMemo(()=>$u(a.reference,i.reference),[a.reference,i.reference]);return Dp(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??cs}),null}var kT=v.createContext(void 0);function AT(){return v.useContext(kT)}var jT=`data-base-ui-tooltip-trigger`;function MT(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(hs(n))return n}}let t=e.target;return hs(t)?t:null}function NT(e){let t=e;for(;t;){let e=t.closest(`[${jT}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&hs(n.host)?n.host:null}return null}var PT=Zo(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=ST(!0),m=Lp(a)??p;if(!m)throw Error(Uo(82));let h=km(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}=wp(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),w=AT(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=yl(y,{open:_}),k=qp(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Bo(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=v.useRef(!1),I=Gs(),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=NT(e);return n!==null&&n!==t&&pc(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 te=Xp(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?pm():null,restMs:R,delay(){return u==null&&O?{close:Xc(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),B=Hp(y,{enabled:!j}).reference,ne=e=>{let t=F.current,n=MT(e),r=ee(n),i=b.current,a=i&&n&&pc(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,hl(nl,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&uc(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,hl(nl,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},re=m.useState(`triggerProps`,C);return pd(`button`,e,{state:{open:_},ref:[t,S,b],props:[te,B,C||N!==`none`?re:void 0,{onMouseOver(e){ne(e.nativeEvent)},onFocus(e){z(MT(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,[Bc]:j?``:void 0,[jT]:j?void 0:``},f],stateAttributesMapping:Ic})}),FT=v.createContext(void 0);function IT(){let e=v.useContext(FT);if(e===void 0)throw Error(Uo(70));return e}var LT=v.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=kd({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,U.jsxs)(v.Fragment,{children:[l,c&&Td.createPortal(n,c)]})}),RT=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return ST().useState(`mounted`)||n?(0,U.jsx)(FT.Provider,{value:n,children:(0,U.jsx)(LT,{ref:t,...r})}):null}),zT=v.createContext(void 0);function Vee(){let e=v.useContext(zT);if(e===void 0)throw Error(Uo(71));return e}var BT=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=Cd,style:g,..._}=e,y=ST(),b=IT(),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=$h({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=cg(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)(zT.Provider,{value:O,children:k})}),VT=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ST(),{side:s,align:c}=Vee(),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`);mp({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Jp(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return pd(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[hp,f,sg(d),a],stateAttributesMapping:zc})}),HT=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=v.useMemo(()=>({open:t,close:n}),[t,n]);return(0,U.jsx)(kT.Provider,{value:t,children:(0,U.jsx)(vl,{delay:i,timeoutMs:r,children:e.children})})},UT=({className:e,side:t=`top`,sideOffset:n=6,...r})=>(0,U.jsx)(RT,{children:(0,U.jsx)(DC,{children:(0,U.jsx)(BT,{side:t,sideOffset:n,className:`isolate z-90`,children:(0,U.jsx)(VT,{"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 WT({content:e,render:t,side:n,children:r}){return(0,U.jsxs)(DT,{children:[(0,U.jsx)(PT,{render:t??(0,U.jsx)(`span`,{className:`inline-flex`}),children:r}),(0,U.jsx)(UT,{side:n,children:e})]})}function GT(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 KT=e=>{switch(e){case`success`:return YT;case`info`:return ZT;case`warning`:return XT;case`error`:return QT;default:return null}},qT=Array(12).fill(0),JT=({visible:e,className:t})=>v.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},v.createElement(`div`,{className:`sonner-spinner`},qT.map((e,t)=>v.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),YT=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`})),XT=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`})),ZT=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`})),QT=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`})),$T=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`})),eE=()=>{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},tE=1,nE=100,rE=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:tE++,iE=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-nE;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=rE(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(oE(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=rE(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}},aE=(e,t)=>iE.message(e,t),oE=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,sE=Object.assign(aE,{success:iE.success,info:iE.info,warning:iE.warning,error:iE.error,custom:iE.custom,message:iE.message,promise:iE.promise,dismiss:iE.dismiss,loading:iE.loading},{getHistory:()=>iE.toasts,getToasts:()=>iE.getActiveToasts()});GT(`[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 cE(e){return e.label!==void 0}var lE=3,uE=`24px`,dE=`16px`,fE=4e3,pE=356,mE=14,hE=45,gE=200;function _E(...e){return e.filter(Boolean).join(` `)}function vE(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var yE=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),[te,B]=v.useState(0),[ne,re]=v.useState(0),V=v.useRef(n.duration||b||fE),ie=v.useRef(null),ae=v.useRef(null),H=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||fE,[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=eE(),Ce=v.useMemo(()=>e.swipeDirections??vE(x),[e.swipeDirections,x]),we=n.invert||t,Te=se===`loading`;ge.current=v.useMemo(()=>fe*S+xe,[fe,xe]),v.useEffect(()=>{V.current=me},[me]),v.useEffect(()=>{M(!0)},[]),v.useEffect(()=>{let e=ae.current;if(e){let t=e.getBoundingClientRect().height;return re(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=ae.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,re(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),B(ge.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},gE)},[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;V.current-=e}_e.current=new Date().getTime()})():V.current!==1/0&&(he.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ee()},V.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:_E(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":se===`loading`},T.loading):v.createElement(JT,{className:_E(w?.loader,n?.classNames?.loader),visible:se===`loading`})}let Oe=n.icon||T?.[se]||KT(se);return v.createElement(`li`,{tabIndex:0,ref:ae,className:_E(_,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":H,"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?te:ge.current}px`,"--initial-height":C?`auto`:`${ne}px`,...m,...n.style},onDragEnd:()=>{I(!1),O(null),ve.current=null},onPointerDown:e=>{e.button!==2&&!Te&&le&&(ie.current=new Date,B(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(ae.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ae.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ie.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)>=hE||a>.11)){B(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=ae.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ae.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=ae.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ae.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:_E(w?.closeButton,n?.classNames?.closeButton)},T?.close??$T):null,(se||n.icon||n.promise)&&n.icon!==null&&(T?.[se]!==null||n.icon)?v.createElement(`div`,{"data-icon":``,className:_E(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:_E(w?.content,n?.classNames?.content)},v.createElement(`div`,{"data-title":``,className:_E(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:_E(y,de,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),v.isValidElement(n.cancel)?n.cancel:n.cancel&&cE(n.cancel)?v.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{cE(n.cancel)&&le&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ee())},className:_E(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,v.isValidElement(n.action)?n.action:n.action&&cE(n.action)?v.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{cE(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ee())},className:_E(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function bE(){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 xE(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?dE:uE;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 SE=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=lE,toastOptions:g,dir:_=bE(),gap:y=mE,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||iE.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return v.useEffect(()=>iE.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Td.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`?bE():_,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":`${pE}px`,"--gap":`${y}px`,...m,...xE(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(yE,{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 CE(){return(0,U.jsx)(SE,{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 wE(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return TE(e)}function TE(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 EE({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)(G,{variant:r,size:i,"aria-label":`Copy`,className:W(`text-fg-3`,n),onClick:()=>{wE(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)(Nv,{className:`size-3.5`})})}function DE({className:e}){return(0,U.jsx)(pb,{"aria-label":`Loading`,className:W(`size-4 animate-spin text-fg-3`,e)})}function OE({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)(EE,{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)(EE,{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 kE({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 AE({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)(G,{variant:`outline`,size:`sm`,className:`mt-1`,onClick:i,children:r}):null]})}function jE({children:e}){return(0,U.jsx)(`span`,{className:`rounded border border-border px-1 font-mono text-fg-3`,children:e})}function ME({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 NE(e){return`${e.sigil??e.trigger}${e.displayText}`}function PE(e){return e.map(e=>e.type===`text`?e.text:NE(e)).join(``)}function FE(e){return e?[{type:`text`,text:e}]:[]}function IE(e,t){if(t<=0)return[];let n=[],r=0;for(let i of e){let e=i.type===`text`?i.text.length:NE(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 LE(e){return e===` `||e===`
12
+ `||e===` `}function RE(e){let t=new Map;for(let n of e)t.has(n.char)||t.set(n.char,n);return t}function zE(e,t,n){if(t===0)return!0;let r=e[t-1];return n===`start`?r===`
13
+ `:LE(r)}function BE(e,t,n){if(!e||t===0||n.length===0)return null;let r=RE(n);for(let n=t-1;n>=0;n--){let i=e[n];if(LE(i)){if(n+1<t){let i=e[n+1],a=r.get(i);if(a&&zE(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&&zE(e,n,a.position))return{config:a,startOffset:n,query:e.slice(n+1,t)}}return null}function VE(e,t,n,r=` `){let i=t.startOffset,a=i+1+t.query.length,o=[],s=0,c;for(let l of ZE(e))if(l.type===`chip`){let e=NE(l),t=s,n=s+e.length;(n<=i||t>=a)&&o.push(l),s=n}else{let e=s,u=s+l.text.length;if(u<=i)o.push(l);else if(e>=a)o.push(l);else{let s=l.text.slice(0,Math.max(0,i-e)),u=l.text.slice(Math.min(l.text.length,a-e));s&&o.push({type:`text`,text:s});let d={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(d),c=d,u?o.push({type:`text`,text:r+u.replace(/^\s/,``)}):o.push({type:`text`,text:r})}s=u}let l=ZE(o);return{segments:l,cursorOffset:c?i+NE(c).length+r.length:PE(l).length}}function HE(e,t,n){let r=t.startOffset,i=r+1+t.query.length,a=[],o=0,s=r+n.length;for(let t of ZE(e)){if(t.type===`chip`){let e=o+NE(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=ZE(a),l=PE(c).length;return s>l&&(s=l),{segments:c,cursorOffset:s}}function UE(e,t){return t<0||t>=e.length||e[t].type!==`chip`?e:ZE([...e.slice(0,t),...e.slice(t+1)])}function WE(e,t){if(t<0||t>=e.length)return null;let n=e[t];if(n.type!==`chip`||!n.autoResolved)return null;let r=NE(n);return{segments:ZE([...e.slice(0,t),{type:`text`,text:r},...e.slice(t+1)]),revertedText:r}}function GE(e,t){let n=t.filter(e=>e.resolveOnSpace);if(n.length===0)return e;let r=RE(n),i=[];for(let t of e){if(t.type===`chip`){i.push(t);continue}let e=KE(t.text,r);i.push(...e)}return ZE(i)}function KE(e,t){if(!e)return[];let n=[],r=0;for(;r<e.length;){let i=e[r];if(t.has(i)&&(r===0||LE(e[r-1]))){let a=t.get(i);if(a&&zE(e,r,a.position)){let t=r+1;for(;t<e.length&&!LE(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])&&LE(e[r-1]));)r++;n.push({type:`text`,text:e.slice(a,r)})}return n}function qE(e,t,n,r){let i=[],a=0,o=!1;for(let s of e)if(s.type===`chip`){let e=NE(s),c=a,l=a+e.length;!o&&t===n&&c===t&&(i.push({type:`text`,text:r}),o=!0),t===n?(i.push(s),!o&&c<t&&t<l&&(i.push({type:`text`,text:r}),o=!0)):l<=t||c>=n?i.push(s):o||=(i.push({type:`text`,text:r}),!0),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}),ZE(i)}function JE(e,t,n,r){if(t===n)return null;let i=PE(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:qE(qE(e,n,n+a,``),t-a,t,``),selectionStart:t-a,selectionEnd:n-a}:{segments:qE(qE(e,n,n,r),t,t,r),selectionStart:t+a,selectionEnd:n+a}}function YE(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.sigil!==i.sigil||r.autoResolved!==i.autoResolved)return!1}return!0}function XE(e,t){return YE(ZE(e),ZE(t))}function ZE(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 QE(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=QE(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 eD(e,t){let n=PE(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:qE(e,r,r+i.length,o),cursorOffset:r+o.length}}function tD(e,t){let n=PE(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:qE(e,r.lineStart,r.lineStart+2,``),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:qE(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:qE(e,t,t,s),cursorOffset:t+s.length}}function nD(e,t){if(t===0)return null;let n=e.lastIndexOf(`
18
+ `,t-2)+1,r=QE(e.slice(n,t-1));return r?r.indent:null}function rD(e,t){let n=PE(e),r=$E(n,t);if(!r)return null;let i=nD(n,r.lineStart),a=i===null?0:i+1;return r.indent>=a?null:{segments:qE(e,r.lineStart,r.lineStart,` `),cursorOffset:t+2}}function iD(e,t){let n=$E(PE(e),t);return!n||n.indent===0?null:{segments:qE(e,n.lineStart,n.lineStart+2,``),cursorOffset:Math.max(n.lineStart,t-2)}}function aD(e,t){let n=$E(PE(e),t);return!n||t>n.contentStart?null:{segments:qE(e,n.lineStart,n.contentStart,` `.repeat(n.indent)),cursorOffset:n.lineStart+n.indent*2}}var oD=/^\s*```/;function sD(e,t){return t?e.replace(/^(\s*)- /,`$1• `):e.replace(/^(\s*)• /,`$1- `)}function cD(e){let t=new Set,n=-1;return e.forEach((e,r)=>{if(oD.test(e)){if(n===-1)n=r;else{for(let e=n;e<=r;e++)t.add(e);n=-1}}}),t}function Hee(e,t){let n=e.split(`
19
+ `),r=cD(n);return n.map((e,n)=>r.has(n)?e:sD(e,t)).join(`
20
+ `)}function lD(e,t){let n=cD(PE(e).split(`
21
+ `)),r=0,i=!0,a=!1,o=e.map(e=>{if(e.type!==`text`)return i=!1,e;let o=e.text.split(`
22
+ `),s=o.map((e,a)=>(a>0||i)&&!n.has(r+a)?sD(e,t):e).join(`
23
+ `);return r+=o.length-1,(o.length>1||e.text!==``)&&(i=o[o.length-1]===``),s===e.text?e:(a=!0,{...e,text:s})});return a?o:e}function uD(e){let t=null,n=0,r=0,i=0,a=!0;for(let o of e.split(`
24
+ `)){let e=QE(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 dD(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=QE(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 fD(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 pD(e){let{edits:t}=dD(PE(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=qE(n,r.oldStart,r.oldEnd,r.newText)}return{segments:n,edits:t}}var mD=/https?:\/\/[^\s),]+/g,hD=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g,gD=/(^|\n)([ \t]*)•/g,_D=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function vD(e){return e instanceof HTMLElement}function yD(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function bD(e){return e instanceof HTMLBRElement}function xD(e){return e instanceof Text}function SD(e){return yD(e)&&e.dataset.chipAutoResolved===`true`}function Uee(e){return e instanceof HTMLAnchorElement&&e.dataset.url===`true`}function Wee(e){try{return JSON.parse(e)}catch{return}}function CD(e){try{return JSON.stringify(e)}catch{return}}function wD(e){if(yD(e))return e.dataset.chipTrigger}function Gee(e){if(yD(e))return e.dataset.chipValue}function TD(e){if(yD(e))return e.dataset.chipDisplay??e.textContent??void 0}function Kee(e){if(!yD(e))return;let t=e.dataset.chipData;if(t)return Wee(t)}function ED(e){if(yD(e))return e.dataset.chipSigil}function DD(e){let t=e.dataset.chipSigil??e.dataset.chipTrigger??``,n=e.dataset.chipDisplay??e.textContent??``;return t.length+n.length}function OD(e){if(!yD(e))return null;let t=wD(e),n=Gee(e),r=TD(e);if(!t||n===void 0||!r)return null;let i=ED(e),a=Kee(e),o=SD(e);return{type:`chip`,trigger:t,value:n,displayText:r,...i===void 0?{}:{sigil:i},...a===void 0?{}:{data:a},...o?{autoResolved:!0}:{}}}function kD(e,t){let n=e.childNodes;for(let e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function qee(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??``)!==``:bD(e)?!e.dataset.sentinel:yD(e)?OD(e)!==null:vD(e)?(e.textContent??``)!==``:!1}function AD(e,t){let n=0;for(let r=0;r<t;r++)qee(e.childNodes[r])&&n++;return n}function jD(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function Jee(e,t){let n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement(`br`)),e.replaceChild(n,t)}function MD(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))Jee(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 Yee(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];xD(r)&&r.textContent&&n.push(r)}for(let e of n){let n=e.textContent??``;mD.lastIndex=0;let r=[],i;for(;(i=mD.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 Xee(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];xD(r)&&r.textContent&&n.push(r)}for(let e of n){let n=e.textContent??``;hD.lastIndex=0;let r=[],i;for(;(i=hD.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 Zee(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];xD(r)&&r.textContent?.includes(`•`)&&n.push(r)}for(let e of n){let n=e.textContent??``;gD.lastIndex=0;let r=[],i;for(;(i=gD.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 Qee(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];xD(r)&&n.push(r)}for(let e of n){let n=e.textContent??``;_D.lastIndex=0;let r=[],i;for(;(i=_D.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 ND(e,t){t&&(Qee(e),Zee(e)),Yee(e),t&&Xee(e)}function PD(){let e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function FD(e){let t=PD();if(!t||!e.contains(t.startContainer))return null;let n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),RD(n)}function $ee(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 ete(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 ID(e){let t=window.getSelection();if(!t||t.rangeCount===0)return;let n=t.getRangeAt(0);if(!e.contains(n.startContainer))return;let r=ete(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 LD(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),ID(e);return}let i=document.createRange();i.selectNodeContents(e),i.collapse(!1),n.removeAllRanges(),n.addRange(i),ID(e)}function RD(e){let t=e.cloneContents(),n=0,r=e=>{if(e.nodeType===Node.TEXT_NODE)n+=(e.textContent??``).length;else if(yD(e))n+=DD(e);else if(vD(e)&&e.tagName===`BR`){if(e.dataset.sentinel)return;n+=1}else vD(e)&&e.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function zD(e){let t=PD();if(!t||!e.contains(t.startContainer))return null;let n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);let r=RD(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:RD(i)}}function BD(e,t,n){let r=window.getSelection();if(!r)return;if(t===n){LD(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(yD(r)){let i=DD(r);if(n<=i)return{node:e,offset:t+1};n-=i}else if(bD(r)){if(r.dataset.sentinel)continue;if(n<=1)return{node:e,offset:t+1};--n}else if(vD(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 tte(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function HD(e,t){let n=e=>{e.nodeType===Node.TEXT_NODE?t.onText(e.textContent??``):yD(e)?t.onChip(e):vD(e)&&e.tagName===`BR`?t.onBreak():e.childNodes.forEach(n)};e.childNodes.forEach(n)}function nte(e){let t=``;return HD(e,{onText:e=>{t+=e},onChip:e=>{t+=(ED(e)??wD(e)??``)+(TD(e)??``)},onBreak:()=>{t+=`
27
+ `}}),t}function rte(e){let t=[];return HD(e,{onText:e=>{e&&t.push({type:`text`,text:e})},onChip:e=>{let n=OD(e);n&&t.push(n)},onBreak:()=>{t.push({type:`text`,text:`
28
+ `})}}),t}function ite(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!tte(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 ate(e,t,n){let r=PD();if(!r)return[...e,...t];let i=document.createRange();i.selectNodeContents(n),i.setEnd(r.startContainer,r.startOffset);let a=RD(i),o=[],s=0,c=!1,l=()=>{c||=(o.push(...t),!0)};for(let t of e){if(t.type===`chip`){let e=NE(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(),ZE(o)}function UD(e,t){let n=RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,`i`).exec(e);return n?n[1].trim().toLowerCase():``}function ote(e){if(e===`bold`||e===`bolder`)return!0;let t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function ste(e){let t=e.tagName,n=e.getAttribute(`style`)??``,r=UD(n,`font-weight`),i=r?ote(r):t===`B`||t===`STRONG`,a=UD(n,`font-style`),o=a?a===`italic`||a===`oblique`:t===`I`||t===`EM`,s=UD(n,`text-decoration`),c=t===`S`||t===`DEL`||t===`STRIKE`||s.includes(`line-through`);return{prefix:(c?`~~`:``)+(i?`**`:``)+(o?`*`:``),suffix:(o?`*`:``)+(i?`**`:``)+(c?`~~`:``)}}function cte(e){return e.replace(/\s+/g,` `)}function lte(e){return e.replace(/\*/g,`\\*`)}function ute(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 dte(e){return`\n\n\`\`\`${ute(e)}\n${(e.textContent??``).replace(/\n$/,``)}\n\`\`\`\n\n`}function fte(e){let t=e.textContent??``;return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function WD(e){return/^(https?:|mailto:)/i.test(e)}function pte(e,t){let n=e.getAttribute(`href`)??``,r=KD(e,t).trim();return WD(n)?!r||r===n?n:`[${r}](${n})`:r}function mte(e){let t=e.getAttribute(`src`)??``;return!t||!WD(t)?``:`![${e.getAttribute(`alt`)??``}](${t})`}function hte(e,t){return`\n\n${KD(e,t).trim().split(`
29
+ `).map(e=>e?`> ${e}`:`>`).join(`
30
+ `)}\n\n`}function GD(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(!vD(r)||r.tagName!==`LI`)continue;let e=n?`${i}. `:`- `;i++;let s=``,c=``;for(let e of Array.from(r.childNodes))vD(e)&&(e.tagName===`UL`||e.tagName===`OL`)?c+=`\n${GD(e,t+1)}`:s+=qD(e,t);o.push(`${a}${e}${s.trim()}${c}`)}return o.join(`
31
+ `)}function gte(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=>KD(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 KD(e,t){let n=``;return e.childNodes.forEach(e=>{n+=qD(e,t)}),n}function qD(e,t){if(xD(e))return lte(cte(e.textContent??``));if(!vD(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]))} ${KD(e,t).trim()}\n\n`;case`P`:return`\n\n${KD(e,t).trim()}\n\n`;case`DIV`:return`\n${KD(e,t).trim()}\n`;case`BLOCKQUOTE`:return hte(e,t);case`UL`:case`OL`:return`\n\n${GD(e,t)}\n\n`;case`LI`:return`${KD(e,t).trim()}\n`;case`PRE`:return dte(e);case`CODE`:return fte(e);case`A`:return pte(e,t);case`IMG`:return mte(e);case`TABLE`:return`\n\n${gte(e,t)}\n\n`;default:{let{prefix:n,suffix:r}=ste(e);return n+KD(e,t)+r}}}function _te(e){return e.replace(/[ \t]+\n/g,`
38
+ `).replace(/\n[ \t]*\n[ \t\n]*/g,`
39
+
40
+ `).trim()}function vte(e){if(!e)return``;let t=new DOMParser().parseFromString(e,`text/html`);return t.body?_te(KD(t.body,0)):``}var yte=100;function bte(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>yte&&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=ite(g);if(e&&e.length>0){let t=PD();if(!t)return;t.deleteContents();let s=ate(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{_=vte(t)}catch{_=``}}}if(_||=e.clipboardData.getData(`text/plain`),!_)return;c&&l&&(_=Hee(_,!0)),c&&uD(_)&&(_=dD(_).text);let v=PD();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),MD(o);let C=n(),w=GE(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=PD();if(!t)return;let n=t.cloneContents(),r=nte(n);e.clipboardData.setData(`text/plain`,r);let i=rte(n);if(i.some(e=>e.type===`chip`)){let t=CD(i);t&&e.clipboardData.setData(`text/prompt-area-segments`,t)}},[]),C=(0,v.useCallback)(e=>{S(e);let i=PD();if(!i)return;let o=n();y(o),i.deleteContents();let s=t.current;s&&MD(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 xte({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=kD(e,t);if(r===-1)return!1;let i=AD(e,r),a=n[i],s=UE(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=kD(e,t);if(r===-1)return!1;let i=AD(e,r),a=n[i],s=WE(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+=NE(t).length}return d+=s.revertedText.length,o(s.segments),u(s.segments),LD(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=PD();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&&yD(e))return SD(e)?O(t,e):D(t,e)}if(r.nodeType===Node.TEXT_NODE&&i===0){let e=jD(t,r);if(!e)return!1;let n=e.previousSibling;for(;n&&n.nodeType===Node.TEXT_NODE&&n.textContent===``;)n=n.previousSibling;if(n&&yD(n))return SD(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=PD();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&&yD(e))return D(t,e)}if(r.nodeType===Node.TEXT_NODE&&i===(r.textContent??``).length){let e=jD(t,r);if(!e)return!1;let n=e.nextSibling;for(;n&&n.nodeType===Node.TEXT_NODE&&n.textContent===``;)n=n.nextSibling;if(n&&yD(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=VE(n,t,a);o(c.segments),u(c.segments),s?.({type:`chip`,trigger:t.config.char,...a});let d=e.current;d&&LD(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=pD(r);r=e.segments,i=fD(i,e.edits)}w.current=r,o(r),u(r),LD(e,i)},v=e=>{if(!n)return!1;let t=l(),r=FD(e);if(r===null||!$E(PE(t),r))return!1;let i=tD(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=zD(t);if(!n||n.start===n.end)return;let r=s.key===`b`?`**`:`*`,i=l();S(i);let a=JE(i,n.start,n.end,r);if(!a)return;w.current=a.segments,o(a.segments),u(a.segments),BD(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=FD(r);if(e!==null){let t=l(),r=PE(t),i=Math.min(e,r.length);if(zE(r,i,n.position)){s.preventDefault(),n.onActivate({text:r,cursorPosition:i,insertChip:p(qE(t,i,i,n.char),{config:n,startOffset:i,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=PE(e),r=FD(t);if(r!==null&&$E(n,r)){s.preventDefault();let n=s.shiftKey?iD(e,r):rD(e,r);n&&c(t,n);return}}}let D=e=>{let t=zD(e);if(!t)return;let n=l();S(n);let r=qE(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=zD(t);if(e&&e.start!==e.end){s.preventDefault();let n=l();S(n),c(t,{segments:qE(n,e.start,e.end,``),cursorOffset:e.start}),d();return}}}if(s.key===`Backspace`){let t=e.current;if(t){let e=l(),r=FD(t);if(n&&r!==null){let n=aD(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 JD({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(Uee(s)){if(r.metaKey||r.ctrlKey){r.preventDefault(),c?.(s.href),window.open(s.href,`_blank`,`noopener,noreferrer`);return}break}if(yD(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=OD(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=kD(o,s);h.current={chip:p,segIndex:AD(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(yD(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||CD(f.data)!==CD(e.data))&&(s?.(f),o?.(e)),LD(d,PE(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 YD(){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 XD=300,ZD=[];function QD({value:e,onChange:t,triggers:n=ZD,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}=YD(),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(yD(a)){let e=OD(a);e&&(t.push(e),n=!0)}else if(bD(a)){if(a.dataset.sentinel){r=!0;continue}t.push({type:`text`,text:`
43
+ `})}else if(vD(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=FD(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=CD(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=NE(r),e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`-1`),t.appendChild(e)}if(t.lastChild&&bD(t.lastChild)){let e=document.createElement(`br`);e.dataset.sentinel=`true`,t.appendChild(e)}ND(t,h),r!==null&&LD(t,r),N.current=e,M.current=!1},[n,h]),R=JD({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=VE(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&&LD(a,i.cursorOffset)},[t,L,s]),ee=(0,v.useCallback)(()=>{let e=b.current;if(!e)return;let t=I(),r=PE(t),i=FD(e);if(i===null)return;let a=BE(r,i,n);if(R.clear(),a){S(a),w(0);let n=$ee(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]),te=(0,v.useCallback)(()=>{R.clear(),S(null),w(0),j()},[j,R]),B=bte({editorRef:b,readSegmentsFromDOM:I,onChange:t,renderSegmentsToDOM:L,runTriggerDetection:ee,dismissTrigger:te,triggers:n,markdownEnabled:h,normalizeBullets:g,onPaste:u,onRawPaste:d,onUndo:f,onRedo:p,onChipAdd:s,onImagePaste:m});(0,v.useLayoutEffect)(()=>{if(!M.current&&!YE(e,N.current)){if(h&&g){let n=lD(e,!0);if(n!==e){t(n);return}}if(XE(I(),e)){N.current=e;return}L(e)}},[e,I,L,h,g,t]);let ne=(0,v.useRef)(h);(0,v.useLayoutEffect)(()=>{if(ne.current===h)return;ne.current=h;let n=g?lD(e,h):e;n===e?L(e):t(n)},[h,g,L,e,t]),(0,v.useEffect)(()=>()=>{P.current&&clearTimeout(P.current)},[]);let re=(0,v.useCallback)(()=>{if(M.current)return;if(B.isComposing.current){let e=I();N.current=e,t(e);return}let e=b.current,n=e?FD(e):null;e&&MD(e);let r=I();if(y!=null&&e&&PE(r).length>y){let n=FD(e),i=IE(r,y);N.current=i,t(i),L(i),LD(e,n==null?y:Math.min(n,y)),ee();return}if(h&&g&&e&&n!==null){let i=eD(r,n);if(i){N.current=i.segments,t(i.segments),L(i.segments),LD(e,i.cursorOffset),ee();return}}let i=r,a=null;if(h&&n!==null&&uD(PE(r))){let e=pD(r);e.edits.length>0&&(i=e.segments,a=fD(n,e.edits))}F.current||=N.current,N.current=i,t(i),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{F.current&&=(B.pushUndo(F.current),null),P.current=null},XD),e&&(a===null?(ND(e,h),n!==null&&LD(e,n)):(L(i),LD(e,a))),ee()},[t,I,ee,L,h,g,y,B]),V=(0,v.useCallback)(e=>{if(!x)return;let n=I(),r=x.config.insertAsText?.(e);if(r!==void 0){let e=HE(n,x,r);B.pushUndo(n),t(e.segments),L(e.segments);let i=b.current;i&&LD(i,e.cursorOffset),te(),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,B.pushUndo)){te(),setTimeout(()=>{b.current?.focus()},0);return}let c=VE(n,x,o,a?.trailingText);t(c.segments),L(c.segments),s?.({type:`chip`,trigger:x.config.char,...o});let l=b.current;l&&LD(l,c.cursorOffset),te(),setTimeout(()=>{b.current?.focus()},0)},[x,I,t,L,te,s,B,R]),ie=V,ae=xte({editorRef:b,triggers:n,markdownEnabled:h,submitOnEnter:_,onSubmit:i,onEscape:a,onChange:t,onChipAdd:s,onChipDelete:c,readSegmentsFromDOM:I,renderSegmentsToDOM:L,runTriggerDetection:ee,dismissTrigger:te,buildInsertChip:z,selectSuggestionInternal:V,activeTrigger:x,suggestions:D,suggestionsLoading:O,suggestionsError:k,selectedSuggestionIndex:C,setSelectedSuggestionIndex:w,pushUndo:B.pushUndo,handleKeyDownForUndoRedo:B.handleKeyDownForUndoRedo,lastRenderedValue:N,undoTimer:P,undoBaseState:F}),H=(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:()=>PE(I()),clear:()=>{t([]);let e=b.current;if(e)for(;e.firstChild;)e.removeChild(e.firstChild);B.resetUndoHistory(),P.current&&=(clearTimeout(P.current),null),F.current=null},setText:e=>{B.pushUndo(I());let n=FE(e);t(n),L(n);let r=b.current;r&&LD(r,e.length)},appendText:e=>{let n=I();B.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&&LD(a,PE(i).length)},getCursorPosition:()=>{let e=b.current;return e?FD(e):null},setCursorPosition:e=>{let t=b.current;t&&LD(t,e)},setCursorToEnd:()=>{let e=b.current;e&&LD(e,PE(I()).length)},getSelection:()=>{let e=b.current;return e?zD(e):null},setSelection:(e,t)=>{let n=b.current;n&&BD(n,e,t)}}),[I,t,L,s,B]),oe=(0,v.useMemo)(()=>({onPaste:B.handlePaste,onCopy:B.handleCopy,onCut:B.handleCut,onDrop:B.handleDrop,onDragOver:B.handleDragOver,onCompositionStart:B.handleCompositionStart,onCompositionEnd:B.handleCompositionEnd,onBlur:B.handleBlur}),[B.handlePaste,B.handleCopy,B.handleCut,B.handleDrop,B.handleDragOver,B.handleCompositionStart,B.handleCompositionEnd,B.handleBlur]);return{editorRef:b,activeTrigger:x,suggestions:D,suggestionsLoading:O,suggestionsError:k,selectedSuggestionIndex:C,handleInput:re,handleKeyDown:ae,handleClick:R.handleClick,handleMouseDown:R.handleMouseDown,selectSuggestion:ie,dismissTrigger:te,handle:H,triggerRect:T,eventHandlers:oe}}var $D=240;function eO({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<$D&&s.top>p,h={position:`fixed`,left:`${Math.max(8,f)}px`,zIndex:50,maxWidth:`${d}px`,maxHeight:`${$D}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 tO({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 nO({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 rO({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)(nO,{onClick:()=>t(e),label:`Remove ${e.alt??`image`}`})]},e.id))})}function iO({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 aO=(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 oO({className:e}){return(0,U.jsx)(iO,{className:e,children:aO})}function sO({className:e}){return(0,U.jsxs)(iO,{className:e,children:[aO,(0,U.jsx)(`path`,{d:`M10 9H8`}),(0,U.jsx)(`path`,{d:`M16 13H8`}),(0,U.jsx)(`path`,{d:`M16 17H8`})]})}function cO({className:e}){return(0,U.jsxs)(iO,{className:e,children:[aO,(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 lO({className:e}){return(0,U.jsxs)(iO,{className:e,children:[aO,(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 uO({className:e}){return(0,U.jsxs)(iO,{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 dO=3;function fO(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 pO={pdf:sO,spreadsheet:cO,code:lO,image:uO,default:oO};function mO(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 hO(e){let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function gO({file:e,compact:t,onRemove:n,onClick:r}){let i=[hO(e.name),e.size==null?null:mO(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=pO[fO(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)(nO,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function _O({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>dO,l=c,u=e.length-dO,d=e.slice(0,dO);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)(gO,{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(dO).map(e=>(0,U.jsx)(gO,{file:e,compact:l,onRemove:t,onClick:n},e.id))})})]})}function vO({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:te,activeTrigger:B,suggestions:ne,suggestionsLoading:re,suggestionsError:V,selectedSuggestionIndex:ie,handleInput:ae,handleKeyDown:H,handleClick:oe,handleMouseDown:se,selectSuggestion:ce,dismissTrigger:le,handle:ue,triggerRect:de,eventHandlers:fe}=QD({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&&te.current?.focus()},[b,te]);let[pe,me]=(0,v.useState)(!1),[he,ge]=(0,v.useState)(void 0),_e=(0,v.useCallback)(()=>{let e=te.current;if(!e)return;e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${t}px`,ge(t)},[te]),ve=(0,v.useCallback)(()=>{x&&(me(!0),_e())},[x,_e]),ye=(0,v.useCallback)(()=>{fe.onBlur(),x&&setTimeout(()=>{let e=te.current;if(!e)return;let t=document.activeElement;t&&e.parentElement?.contains(t)||(me(!1),ge(void 0))},150)},[fe,x,te]),be=(0,v.useCallback)(()=>{ae(),x&&pe&&_e()},[ae,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=te.current;e&&Se(e.scrollHeight>e.clientHeight)},pe?0:160),()=>{Ce.current!==null&&clearTimeout(Ce.current)}):void 0,[x,pe,e,te]);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&&H(e)},[N,H]),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)(rO,{images:w,onRemove:D,onClick:O,className:T===`above`?`pb-2`:`pt-2`}):null,ke=k.length>0?(0,U.jsx)(_O,{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:te,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:ae,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:()=>te.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)(tO,{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,B&&B.config.mode===`dropdown`&&(0,U.jsx)(eO,{suggestions:ne,loading:re,error:V,emptyMessage:B.config.emptyMessage,selectedIndex:ie,onSelect:ce,onDismiss:le,triggerRect:de,triggerChar:B.config.char})]})}function yO(e={}){let{initialValue:t=[]}=e,[n,r]=(0,v.useState)(t),i=(0,v.useRef)(null),a=(0,v.useMemo)(()=>PE(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 bO(e={}){let{char:t=`@`,...n}=e;return{char:t,position:`any`,mode:`dropdown`,chipStyle:`pill`,accessibilityLabel:`mention`,...n}}function xO(e={}){let{char:t=`/`,position:n=`any`,...r}=e;return{char:t,position:n,mode:`dropdown`,chipStyle:`inline`,accessibilityLabel:`command`,...r}}function SO(e={}){let{char:t=`#`,...n}=e;return{char:t,position:`any`,mode:`dropdown`,chipStyle:`pill`,resolveOnSpace:!0,accessibilityLabel:`tag`,...n}}function CO(e){let{char:t,...n}=e;return{char:t,position:`start`,mode:`launch`,...n}}var wO=9e5,TO=[`#497eae`,`#8a6bb8`,`#3f8f6b`,`#b0794a`,`#a85a6e`,`#4f8f96`,`#7c8a3f`,`#6b72b8`];function EO(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return TO[(t>>>0)%TO.length]}var DO=[`attention`,`working`,`idle`,`ended`],OO={attention:`Needs attention`,working:`Working`,idle:`Idle`,ended:`Ended`};function kO(e){return e.pendingPermissionCount>0||e.status===`awaiting_approval`?`attention`:e.status===`failed`||e.status===`closed`?`ended`:e.status===`running`||e.status===`starting`||AO(e).length>0?`working`:`idle`}function AO(e){return(e.subagents??[]).filter(e=>e.status===`running`)}function jO(e,t){if(t===`none`)return[];let n=e.subagents??[];return t===`all`?[...n]:n.filter(e=>e.status===`running`)}function MO(e){return e.isAgent===!0||(e.agentType?.trim()??``)!==``}function NO(e){let t=e.agentType?.trim(),n=e.description?.trim();return t&&n?`${t} · ${n}`:t||n||`Sub-agent`}var PO=[`none`,`state`,`adapter`,`project`,`custom`],FO={search:``,gateways:[],adapters:[],states:[],projects:[],scoped:!0,groupBy:`state`,sortBy:`recent`,subagents:`active`,shells:`active`,tasks:`active`},IO=`custom:ungrouped`;function LO(e){return`${e.hostId}:${e.info.id}`}function RO(e){let t={...FO,...e},n=t.groupBy;return PO.includes(n)?t:{...t,groupBy:n===`gateway`?`project`:FO.groupBy}}function zO(e){return[...new Set(e.map(e=>e.adapter))].sort()}function BO(e){let t=new Map;for(let n of e)t.set(HO(n),UO(n));return[...t].map(([e,t])=>({key:e,label:t})).sort((e,t)=>e.label.toLowerCase().localeCompare(t.label.toLowerCase()))}function VO(e){return e.title??e.id.slice(0,8)}function HO(e){return`${e.hostId}:${YO(e.info.project?.root??e.info.cwd)}`}function UO(e){return e.info.project?.shortcode||WO(e)}function WO(e){let t=e.info.project?.name;if(t)return t;let n=YO(e.info.cwd);return n.slice(n.lastIndexOf(`/`)+1)||`No project`}function GO(e){let t=e.info.project?.root;if(t===void 0||!e.info.cwd)return;let n=YO(t),r=YO(e.info.cwd);if(r!==n&&r.startsWith(`${n}/`))return r.slice(n.length+1)||void 0}function KO(e){return typeof e.meta?.jobId==`string`}function qO(e,t,n){if(t===`none`)return[];let r=(e.shells??[]).filter(e=>e.status!==`running`||n-e.startedAt>=3e3);return t===`active`?r.filter(e=>e.status===`running`):r}function JO(e,t){return!t||VO(e.info).toLowerCase().includes(t)||(e.info.agent?.name.toLowerCase().includes(t)??!1)||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 YO(e){return e.replace(/\\/g,`/`).replace(/\/+$/,``)}function XO(e,t){let n=YO(e),r=YO(t);return r===n||r.startsWith(`${n}/`)}function ZO(e,t){return t.roots.some(t=>(t.hostId?t.hostId.toLowerCase()===e.hostId.toLowerCase():e.local)&&XO(t.path,e.info.cwd))}function QO(e,t){return e.scoped&&t!==void 0}function $O(e,t,n){let r=t.search.trim().toLowerCase(),i=QO(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(HO(e)))&&(!i||ZO(e,i))&&JO(e,r))}function ek(e,t){return t===`gateway`?e.hostId:t===`adapter`?e.adapter:t===`project`?HO(e):tk(e)}function tk(e){return e.teamState??e.state}function nk(e,t,n=!1){return t===`project`?n?`${e.hostName} ${UO(e)}`:UO(e):t===`gateway`?e.hostName:t===`adapter`?e.adapter:OO[tk(e)]}function rk(e,t,n=!1){return t===`state`?String(DO.indexOf(tk(e))):t===`project`&&n?`${e.hostName.toLowerCase()}\u0000${UO(e).toLowerCase()}`:nk(e,t).toLowerCase()}function ik(e,t){return(t.info.lastActivityAt??t.info.createdAt)-(e.info.lastActivityAt??e.info.createdAt)}function ak(e,t,n){return n===`recent`?ik(e,t):n===`name`?VO(e.info).localeCompare(VO(t.info),void 0,{sensitivity:`base`})||ik(e,t):rk(e,n).localeCompare(rk(t,n))||ik(e,t)}function ok(e,t,n={}){let r=uk(e,n.all??e).sort((e,n)=>ak(e,n,t.sortBy)),i=t.groupBy!==`state`&&t.groupBy!==`custom`?r.filter(lk):[],a=i.length?r.filter(e=>!lk(e)):r,o=i.length?[{key:`earlier`,label:`Earlier`,rows:i,earlier:!0}]:[];if(t.groupBy===`none`)return[...a.length?[{key:`all`,rows:a}]:[],...o];if(t.groupBy===`custom`)return _k(a,t.customGroups??[]);let s=t.groupBy,c=(n.gatewayCount??new Set(e.map(e=>e.hostId)).size)>1,l=new Map,u=new Map;for(let e of a){let t=ek(e,s),n=l.get(t);n?n.rows.push(e):(u.set(t,rk(e,s,c)),l.set(t,{key:t,label:nk(e,s,c),rows:[e],...s===`project`?gk(e):{},...s===`project`&&c?{gateway:e.hostName,project:UO(e)}:{}}))}return[...[...l.values()].sort((e,t)=>u.get(e.key).localeCompare(u.get(t.key))),...o]}function sk(e){let t=e.info.agent;return t?`${e.hostId}:${t.id}`:void 0}function ck(e){let t=e.info.agent?.lead;return t===void 0?void 0:`${e.hostId}:${t}`}function lk(e){return e.info.agent===void 0&&e.state===`ended`}function uk(e,t){let n=new Map;for(let e of t){let t=sk(e);t!==void 0&&e.info.agent?.lead===void 0&&n.set(t,e)}let r=new Set(e.map(e=>LO(e))),i=new Map,a=[];for(let t of e){let e=ck(t);e!==void 0&&n.has(e)?i.set(e,[...i.get(e)??[],t]):a.push(t)}for(let e of i.keys()){let t=n.get(e);r.has(LO(t))||a.push({...t,context:!0})}return a.map(e=>{let t=sk(e),n=t===void 0?void 0:i.get(t);if(!n)return e;let r=[...n].sort(dk);return{...e,members:r,teamState:fk([e,...r])}})}function dk(e,t){return(e.info.agent?.order??2**53-1)-(t.info.agent?.order??2**53-1)||e.info.createdAt-t.info.createdAt}function fk(e){let t=DO.length-1;for(let n of e)t=Math.min(t,DO.indexOf(n.state));return DO[t]}function pk(e,t){let n=sk(t);return n!==void 0&&(e.collapsedTeams??[]).includes(n)}function mk(e,t){let n=sk(t);if(n===void 0)return e;let r=e.collapsedTeams??[];return{...e,collapsedTeams:r.includes(n)?r.filter(e=>e!==n):[...r,n]}}function hk(e){let t=e.members??[];return{members:t.length,working:t.filter(e=>e.state===`working`).length,attention:t.filter(e=>e.state===`attention`).length,unseen:t.reduce((e,t)=>e+t.unseen,0)}}function gk(e){let t=e.info.project?.root??e.info.cwd;return t?{hostId:e.hostId,cwd:t}:{hostId:e.hostId}}function _k(e,t){let n=new Map(e.map(e=>[LO(e),e])),r=new Set,i=t.map(e=>{let t=[];for(let i of e.members){let e=n.get(i);e&&!r.has(i)&&(r.add(i),t.push(e))}return{key:`custom:${e.id}`,label:e.name,rows:t,custom:e.id}}),a=e.filter(e=>!r.has(LO(e)));return a.length?[...i,{key:IO,label:`Ungrouped`,rows:a}]:i}function vk(){return`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function yk(e,t,n=vk()){return[...e,{id:n,name:t,members:[]}]}function bk(e,t,n){return e.map(e=>e.id===t?{...e,name:n}:e)}function xk(e){return e.color??EO(`group:${e.id}`)}function Sk(e,t,n){return e.map(e=>{if(e.id!==t)return e;let r={...e};return n.color===null?delete r.color:n.color!==void 0&&(r.color=n.color),n.icon===null?delete r.icon:n.icon!==void 0&&n.icon.startsWith(`data:image/`)&&n.icon.length<=48e3&&(r.icon=n.icon),r})}function Ck(e,t){return e.filter(e=>e.id!==t)}function wk(e,t,n,r){return e.map(e=>{let i=e.members.filter(e=>e!==t);if(e.id!==n)return i.length===e.members.length?e:{...e,members:i};let a=r===void 0?-1:i.indexOf(r);return{...e,members:a<0?[...i,t]:[...i.slice(0,a),t,...i.slice(a)]}})}function Tk(e,t,n){let r=e.find(e=>e.id===t);if(!r||t===n)return[...e];let i=e.filter(e=>e.id!==t),a=n===void 0?-1:i.findIndex(e=>e.id===n);return a<0?[...i,r]:[...i.slice(0,a),r,...i.slice(a)]}function Ek(e,t,n,r){if(n>=r)return;let i=[];t&&QO(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 Dk(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 Ok(e){return[e.gateways,e.adapters,e.states,e.projects??[]].filter(e=>e.length>0).length}function kk(e){return e.subagents!==FO.subagents||(e.shells??FO.shells)!==FO.shells||(e.tasks??FO.tasks)!==FO.tasks}function Ak(e){return{...FO,scoped:!1,groupBy:e.groupBy,sortBy:e.sortBy,subagents:e.subagents,shells:e.shells,tasks:e.tasks,customGroups:e.customGroups}}function jk(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 Mk(e){let t=e?.todos;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=jk(e);if(t===void 0)return;n.push(t)}return n}function Nk(e){switch(e){case`in_progress`:return`running`;case`completed`:return`done`;default:return`pending`}}function Pk(e){let t=(e.checklist??[]).map((e,t)=>({key:`checklist:${t}`,label:e.text,source:`checklist`,state:Nk(e.status)})),n=(e.subagents??[]).filter(e=>!MO(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,stoppable:e.status===`running`&&e.stoppable===!0||void 0}));return[...t,...n]}function Fk(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 Ik(e){return e.total===0?void 0:`${e.done}/${e.total}`}function Lk(e,t){if(t===`none`)return[];let n=Pk(e);return t===`all`?n:n.filter(e=>e.state===`running`||e.state===`pending`)}function Rk(e,t){return e instanceof Error?e.message:t??String(e)}function zk(e,t){return e.startsWith(`/`)?Bk(e):t?Bk(`${t}/${e}`):void 0}function Bk(e){let t=[];for(let n of e.split(`/`))n!==``&&n!==`.`&&(n===`..`?t.pop():t.push(n));return`/${t.join(`/`)}`}var Vk=`2026-09-29`,Hk=`List rates as of ${Vk}. 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.`,Uk=.005,Wk=1e6,Gk=864e5,Kk=[`input`,`output`,`cacheWrite5m`,`cacheWrite1h`,`cacheRead`];function qk(e,t,n){return{input:e,output:t,cacheWrite5m:e*1.25,cacheWrite1h:e*2,cacheRead:n??e*.1}}function Jk(e,t,n){return{input:e,output:t,cacheWrite5m:e,cacheWrite1h:e,cacheRead:n}}var Yk={"claude-fable-5-1":qk(10,50,.25),"claude-fable-5":qk(10,50),"claude-mythos-5-1":qk(10,50,.25),"claude-mythos-5":qk(10,50),"claude-opus-5-5":qk(4,20,.2),"claude-opus-5":qk(5,25),"claude-opus-4-8":qk(5,25),"claude-opus-4-7":qk(5,25),"claude-opus-4-6":qk(5,25),"claude-opus-4-5":qk(5,25),"claude-sonnet-5-5":qk(2,10),"claude-sonnet-5":qk(2,10),"claude-sonnet-4-6":qk(3,15),"claude-sonnet-4-5":qk(3,15),"claude-haiku-4-5":qk(1,5),"gpt-6-astra":Jk(10,50,1),"gpt-6-sol":Jk(2,10,.2),"gpt-6-luna":Jk(.1,.5,.01),"gpt-5.6-sol":Jk(4,20,.4),"gpt-5.6-terra":Jk(2,12,.2),"gpt-5.6-luna":Jk(.2,1.2,.02),"gpt-5.5":Jk(5,30,.5),"gpt-5.4":Jk(2.5,15,.25),"gpt-5.2":Jk(1.75,14,.175),"gpt-5.1":Jk(1.25,10,.125),"gpt-5":Jk(1.25,10,.125)},Xk=Yk;function Zk(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 Kk){let r=t[e];if(typeof r!=`number`||!Number.isFinite(r)||r<0)return;n[e]=r}return n}function Qk(e,t=Yk){let n={},r=[];if(typeof e==`object`&&e)for(let[t,i]of Object.entries(e)){let e=Zk(i),a=nA(t);if(!e||a===``){r.push(t);continue}n[a]=e}return{pricing:{...t,...n},overrides:n,dropped:r}}function $k(){return Xk}function eA(e,t=Vk){let n=Date.parse(t);return Number.isFinite(n)?Math.floor((e-n)/Gk):0}function tA(e,t=Vk){let n=eA(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 nA(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 rA(e,t=$k()){return e?t[nA(e)]:void 0}function iA(e){return e.input+e.output+e.cacheWrite5m+e.cacheWrite1h+e.cacheRead}function aA(e){return Object.entries(e).filter(([,e])=>e.costBasis===`unknown`).map(([e])=>nA(e))}function oA(e){return{input:0,output:0,cacheWrite:0,cacheRead:0,total:0,unpriced:!0,unpricedTokens:e,unpricedShare:+(e>0)}}function sA(e,t,n=$k()){let r=rA(t,n);if(!r)return oA(iA(e));let i=e.input/Wk*r.input,a=e.output/Wk*r.output,o=e.cacheWrite5m/Wk*r.cacheWrite5m+e.cacheWrite1h/Wk*r.cacheWrite1h,s=e.cacheRead/Wk*r.cacheRead;return{input:i,output:a,cacheWrite:o,cacheRead:s,total:i+a+o+s,unpriced:!1,unpricedTokens:0,unpricedShare:0}}function cA(e,t=$k()){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+=iA(o);let r=sA(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 lA=new Set([`.`,`,`,`;`,`:`,`!`,`?`,`)`,`]`,`}`,`"`,`'`]),uA=/^[\p{L}\p{N}][\p{L}\p{N}\-_]*$/u;function dA(e,t){return(e??``).normalize(`NFKC`).replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-+|-+$/g,``).slice(0,64).replace(/^-+|-+$/g,``)||t.slice(t.indexOf(`:`)+1,t.indexOf(`:`)+9)}function fA(e){return e.normalize(`NFKC`).toLowerCase().replace(/[_\s]+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``)}function pA(e){return e.length>0&&e.length<=64&&uA.test(e)}var mA={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`,session_info:`Checking session info`,mcp__workerdeck__session_info:`Checking session info`,set_status:`Setting status`,mcp__workerdeck__set_status:`Setting status`,change_avatar:`Changing avatar`,mcp__workerdeck__change_avatar:`Changing avatar`};function hA(e,t){return gA(t?.[e]??mA[e],e)}function gA(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 _A=[`peers_send`,`mcp__workerdeck__peers_send`];function vA(e){return _A.includes(e)}function yA(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 bA=9e5;function xA(e,t){return e.inferredReset||e.updatedAt===void 0?!1:t-e.updatedAt>bA}function SA(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 CA(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))t[n]=r.info;return t}var wA=2592e6,TA=6e4;function EA(e,t){return`${e}:${t}`}var DA=class{#e;#t;constructor(e){this.#e=e,this.#t={...e.read()}}get(e,t){return this.#t[EA(e,t)]}all(){return this.#t}mark(e,t,n,r=Date.now()){let i=EA(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<TA?!1:(this.#t[i]=o,this.#e.write(this.#n(r)),!0)}forget(e,t){let n=EA(e,t);n in this.#t&&(delete this.#t[n],this.#e.write(this.#t))}#n(e){let t=e-wA;for(let[e,n]of Object.entries(this.#t))n.seenAt<t&&delete this.#t[e];return this.#t}};function OA(e,t){return!e||t.proseCount===void 0?0:Math.max(0,t.proseCount-(e.prose??t.proseCount))}function kA(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 AA=`interactive output, no preview`,jA={claude:{interactiveApprovals:!0,permissionModes:[`default`,`acceptEdits`,`bypassPermissions`,`plan`,`dontAsk`,`auto`],defaultPermissionMode:`default`,resume:!0,resumeBackfill:!0,forkSession:!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,engineSleep:!0,backgroundTasks:!0,streaming:`token`},codex:{interactiveApprovals:!0,permissionModes:[`default`,`acceptEdits`,`bypassPermissions`,`auto`],defaultPermissionMode:`default`,resume:!0,resumeBackfill:!0,forkSession:!1,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,engineSleep:!0,streaming:`token`},provider:{interactiveApprovals:!1,permissionModes:[`default`,`bypassPermissions`,`dontAsk`],defaultPermissionMode:`default`,resume:!1,resumeBackfill:!1,forkSession:!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,engineSleep:!1,streaming:`token`}};function MA(e){let t=e.indexOf(`:`);return t>0?`${e.slice(0,t)}:${e.slice(t+1,t+9)}`:e.slice(0,8)}function NA(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 PA=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 FA(e){return Math.min(500*2**e,1e4)}var IA=class{sessionId;#e;#t;#n;#r=new PA;#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`})}sleep(){this.#l({type:`sleep`})}backgroundTask(e){this.#l({type:`background_task`,toolUseId:e})}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})}setEffort(e){this.#l({type:`set_effort`,effort: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=FA(this.#o++);this.#r.emit(`reconnectAttempt`,this.#o),this.#c=setTimeout(()=>this.#u(),e)},e.onerror=()=>{}}},LA=class{#e;#t;#n;#r=new PA;#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=FA(this.#a++);this.#o=setTimeout(()=>this.#s(),e)},e.onerror=()=>{}}};function RA(e,t,n,r=!1,i=!1){let a=`afterSeq=${n}`+(r?`&truncateResults=1`:``)+(i?`&imageRefs=1`:``);return`${e.replace(/^http/,`ws`)}/sessions/${encodeURIComponent(t)}/ws?${a}`}function zA(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 BA(e){let t=zA(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 VA(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,n,r,a)=>i(RA(t,e,n,r,a)),buildQueueWsUrl:()=>i(`${r}/queue/ws`)}}var HA=class extends Error{status;constructor(e,t){super(e),this.name=`WorkerDeckError`,this.status=t}},UA=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.#c(`POST`,`/sessions`,`session`,e)}async listSessions(){return await this.#c(`GET`,`/sessions`,`sessions`)}async getSession(e){return await this.#c(`GET`,this.#i(e),`session`)}async updateSession(e,t){return await this.#c(`PATCH`,this.#i(e),`session`,t)}async sleepSession(e){return await this.#c(`POST`,this.#i(e,`/sleep`),`session`)}async deleteSession(e){return await this.#c(`DELETE`,this.#i(e),`session`)}async listSessionFiles(e){return await this.#c(`GET`,this.#i(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}${this.#i(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}${this.#i(e,`/attachments/${encodeURIComponent(t)}`)}`}producedFileUrl(e,t){return`${this.#e.baseUrl}${this.#i(e,`/produced/${encodeURIComponent(t)}`)}`}async readProducedFile(e,t){return await this.#s(this.producedFileUrl(e,t),`produced file request failed`)}projectIconUrl(e){return`${this.#e.baseUrl}${this.#i(e,`/project/icon`)}`}async projectIcon(e){return await this.#s(this.projectIconUrl(e),`project icon request failed`)}async listAgents(){return await this.#c(`GET`,`/agents`,`agents`)}async createAgent(e){return await this.#l(`POST`,`/agents`,e)}async updateAgent(e,t){return await this.#l(`PATCH`,this.#a(e),t)}async restartAgent(e,t){return await this.#l(`POST`,this.#a(e,`/restart`),t===void 0?{}:{prompt:t})}async retireAgent(e,t={}){return await this.#l(`DELETE`,this.#a(e),t)}async changeAgentAvatar(e,t){return await this.#l(`POST`,this.#a(e,`/avatar`),t===void 0?{}:{seed:t})}agentAvatarPreviewUrl(e,t){return`${this.#e.baseUrl}${this.#a(e,`/avatar-preview.png?seed=${encodeURIComponent(t)}`)}`}async agentAvatarPreview(e,t){return await(await this.#r(this.agentAvatarPreviewUrl(e,t),{headers:{...this.#e.headers}},`avatar preview request failed`)).blob()}agentAvatarUrl(e,t=!1){return`${this.#e.baseUrl}${this.#a(e,t?`/avatar-busy.png`:`/avatar.png`)}`}async agentAvatar(e,t=!1){let n=await this.#r(this.agentAvatarUrl(e,t),{headers:{...this.#e.headers}},`agent avatar request failed`),r=n.headers.get(`x-frame-durations`),i=r?r.split(`,`).map(Number).filter(e=>Number.isFinite(e)&&e>0):void 0;return i?.length?{blob:await n.blob(),durations:i}:{blob:await n.blob()}}async listPeers(e){return await this.#c(`GET`,this.#i(e,`/peers`),`peers`)}async listMcpServers(e){return await this.#c(`GET`,this.#i(e,`/mcp`),`servers`)}async mcpServerAction(e,t,n){let r=this.#i(e,`/mcp/${encodeURIComponent(t)}`);return await this.#c(`POST`,r,`servers`,{action:n})}sessionFileUrl(e,t){let n=t.split(`/`).filter(Boolean).map(encodeURIComponent).join(`/`);return`${this.#e.baseUrl}${this.#i(e,`/files/${n}`)}`}async resolvePermission(e,t,n){await this.#l(`POST`,this.#i(e,`/permissions/${encodeURIComponent(t)}`),n)}async submitExecutionResult(e,t){return await this.#l(`POST`,`/executions/${encodeURIComponent(e)}/result`,t)}async listProfiles(){return await this.#l(`GET`,`/profiles`)}async getProfile(e){return await this.#l(`GET`,`/profiles/${encodeURIComponent(e)}`)}async createProfile(e){return await this.#c(`POST`,`/profiles`,`profile`,e)}async updateProfile(e,t){return await this.#c(`PATCH`,`/profiles/${encodeURIComponent(e)}`,`profile`,t)}async deleteProfile(e){await this.#l(`DELETE`,`/profiles/${encodeURIComponent(e)}`)}async listSdkSessions(e){let t=WA({dir:e?.dir||void 0,limit:e?.limit,offset:e?.offset,profile:e?.profile||void 0});return await this.#c(`GET`,`/sdk-sessions${t}`,`sdkSessions`)}async listHostRoots(){return await this.#l(`GET`,`/fs/roots`)}async meta(){return await this.#l(`GET`,`/meta`)}async listHostDir(e){return await this.#l(`GET`,`/fs/list${WA({path:e})}`)}async findHostFiles(e,t=``,n){return await this.#l(`GET`,`/fs/find${WA({path:e,q:t,limit:n})}`)}async readHostFile(e){return await this.#l(`GET`,`/fs/read${WA({path:e})}`)}async writeHostFile(e){return await this.#l(`PUT`,`/fs/write`,e)}async createJob(e){return await this.#c(`POST`,`/jobs`,`job`,e)}async listJobs(){return await this.#c(`GET`,`/jobs`,`jobs`)}async getJob(e){return await this.#c(`GET`,`/jobs/${encodeURIComponent(e)}`,`job`)}async cancelJob(e){return await this.#c(`DELETE`,`/jobs/${encodeURIComponent(e)}`,`job`)}async queueStats(){return await this.#c(`GET`,`/queue`,`stats`)}async listShells(e){return await this.#c(`GET`,this.#i(e,`/shells`),`shells`)}async getShell(e,t){return await this.#c(`GET`,this.#o(e,t),`shell`)}async shellOutput(e,t,n){let r=WA({view:n?.view||void 0,tail:n?.tail});return await(await this.#r(`${this.#e.baseUrl}${this.#o(e,t,`/output${r}`)}`,{headers:{...this.#e.headers}},`shell output request failed`)).text()}async killShell(e,t){return await this.#c(`POST`,this.#o(e,t,`/kill`),`shell`)}async stopTask(e,t){await this.#l(`POST`,this.#i(e,`/tasks/${encodeURIComponent(t)}/stop`))}async backgroundTask(e,t){let n=t===void 0?`/tasks/background`:`/tasks/${encodeURIComponent(t)}/background`;await this.#l(`POST`,this.#i(e,n))}async setShellAgentWrite(e,t,n){return await this.#c(`POST`,this.#o(e,t,`/agent-write`),`shell`,{enabled:n})}attach(e,t){return new IA(this,e,t)}attachQueue(e){return new LA(this,e)}openSocket(e,t,n=!1,r=!1){let i=this.#e.buildWsUrl?.(e,t,n,r)??RA(this.#e.baseUrl,e,t,n,r);return new this.#n(i)}async toolResult(e,t,n,r){return await this.#l(`GET`,this.#i(e,`/events/${t}/result${WA({toolUseId:n,imageRefs:r?.imageRefs?1:void 0})}`))}async toolResultImage(e,t,n,r){let i=`${this.#e.baseUrl}${this.#i(e,`/events/${t}/result${WA({toolUseId:n,part:r})}`)}`;return await this.#s(i,`image part request failed`)}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 HA((await r.json().catch(()=>({}))).error??`${n} with ${r.status}`,r.status);return r}#i(e,t=``){return`/sessions/${encodeURIComponent(e)}${t}`}#a(e,t=``){return`/agents/${encodeURIComponent(e)}${t}`}#o(e,t,n=``){return this.#i(e,`/shells/${encodeURIComponent(t)}${n}`)}async#s(e,t){return await(await this.#r(e,{headers:{...this.#e.headers}},t)).blob()}async#c(e,t,n,r){return(await this.#l(e,t,r))[n]}async#l(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 HA(i.error??`${e} ${t} failed with ${r.status}`,r.status);return i}};function WA(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));return t.size>0?`?${t.toString()}`:``}var GA={status:`starting`,capabilities:jA.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},KA=`streaming`,qA=`streaming-thinking`,JA=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/,YA=/<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>/g,XA=`<local-command-caveat>`,ZA=/^\[\.\.\. more output \.\.\.\]$/,QA=/^\[(exit -?\d+|killed|timed out|ended|failed to start)[^\]]*\]$/;function $A(e,t){let n=(JA.exec(t.trim())?.[2]??t).split(`
45
+ `);n[0]?.startsWith(`$ `)&&n.shift(),e.status===`exited`&&n.length>0&&QA.test(n[n.length-1])&&n.pop();let r=!1;return{text:n.filter(e=>!ZA.test(e)||(r=!0,!1)).join(`
46
+ `).trimEnd(),truncated:r}}function ej(e,t,n,r){let i=$A(t,n);return{kind:`shell`,id:e,shell:t,text:i.text,truncated:i.truncated,...r?.expanded!==void 0&&{expanded:r.expanded}}}function tj(e,t){return e.find(e=>e.kind===`shell`&&e.shell.id===t)}var nj=/<command-name>([\s\S]*?)<\/command-name>/,rj=/<command-args>([\s\S]*?)<\/command-args>/;function ij(e){return uj(e).some(e=>e.type===`text`&&e.text.trimStart().startsWith(XA))}function aj(e){return e==null?KA:`${KA}:${e}`}function oj(e){return e==null?qA:`${qA}:${e}`}function sj(e){return e.kind===`assistant_text`&&e.id.startsWith(KA)||e.kind===`thinking`&&e.id.startsWith(qA)}function cj(e){return e===void 0?``:typeof e==`string`?e:e.map(e=>typeof e.text==`string`?e.text:``).filter(Boolean).join(`
47
+ `)}function lj(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 uj(e){return typeof e==`string`?[{type:`text`,text:e}]:e}function dj(e){if(e.type===`text`)return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}function fj(e){let t=nj.exec(e)?.[1]?.trim();if(!t)return;let n=rj.exec(e)?.[1]?.trim();return n?`${t} ${n}`:t}function pj(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];if(i?.id===n&&i.kind===t)return r}return-1}function mj(e,t,n){if(t===-1)return[...e,n];let r=[...e];return r[t]=n,r}function hj(e,t){return mj(e,e.findIndex(e=>e.id===t.id&&e.kind===t.kind),t)}function gj(e,t){let n=t.engine??e.engine;return{...e,status:e.lastSeq===0?t.status:e.status,engineAsleep:e.lastSeq===0?t.engineAsleep:e.engineAsleep,model:e.model??t.model,effort:e.effort===void 0?t.effort:e.effort,permissionMode:e.permissionMode??t.permissionMode,cwd:e.cwd??t.cwd,sdkSessionId:e.sdkSessionId??t.sdkSessionId,engine:n,capabilities:t.capabilities??jA[n??`claude`],totalCostUsd:e.totalCostUsd||(t.totalCostUsd??0),costUsd:e.costUsd??t.costUsd,usageByModel:e.usageByModel??t.usageByModel,session:t}}function _j(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 vj(e,t,n){let r=tj(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 yj(e,t,n){let r=tj(e.items,t);return r?{...e,items:e.items.map(e=>e===r?{...r,expanded:n,missing:void 0}:e)}:e}function bj(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`engine_sleep`:return{...n,engineAsleep:t.asleep||void 0};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`effort_changed`:return{...n,effort:t.effort};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:t.agentReason===void 0?[]:[{kind:`notice`,id:`reset-${t.seq}`,level:`info`,text:xj(t.agentReason)}],contextUsage:void 0,checklist:void 0,sdkSessionId:t.sdkSessionId??n.sdkSessionId};case`context_compacted`:return{...n,items:hj(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 uj(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,liveTail:void 0,status:i?`failed`:`settled`,result:{text:cj(r.content),isError:i,...r.truncated&&{truncated:!0,totalChars:r.total_chars,sourceSeq:t.seq},...lj(r.content,t.seq)&&{images:lj(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=JA.exec(r.trim());if(t.shell){let n=e.find(e=>e.kind===`shell`&&e.id===i);e=hj(e,ej(i,t.shell,r,n))}else if(a)e=hj(e,{kind:`notice`,id:i,level:a[1]===`stderr`?`error`:`info`,text:a[2].trim()});else if(r.trimStart().startsWith(XA)){let t=0;for(let n of r.matchAll(YA))e=hj(e,{kind:`notice`,id:`${i}#${t++}`,level:n[1]===`stderr`?`error`:`info`,text:n[2].trim()})}else(!t.synthetic||ij(t.message.content))&&(e=hj(e,{kind:`user`,id:t.uuid??`user-${t.seq}`,text:fj(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=aj(t.parentToolUseId),r=oj(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 uj(t.message.content).forEach((e,n)=>{let r=`${t.uuid}-${n}`;if(e.type===`text`)a=hj(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=hj(a,{kind:`thinking`,id:r,text:n,parentToolUseId:t.parentToolUseId})}else if(e.type===`tool_use`){let n=e;a=hj(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=aj(t.parentToolUseId),i=pj(n.items,`assistant_text`,r),a={kind:`assistant_text`,id:r,text:((i===-1?void 0:n.items[i])?.text??``)+(e.delta.text??``),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:mj(n.items,i,a)}}if(e.delta?.type===`thinking_delta`){let r=oj(t.parentToolUseId),i=pj(n.items,`thinking`,r),a=((i===-1?void 0:n.items[i])?.text??``)+(e.delta.thinking??``);if(a.trim()===``)return n;let o={kind:`thinking`,id:r,text:a,parentToolUseId:t.parentToolUseId};return{...n,items:mj(n.items,i,o)}}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(!sj(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`tool_output`:{let e=n.items.findIndex(e=>e.kind===`tool_call`&&e.id===t.toolUseId),r=n.items[e];if(r?.kind!==`tool_call`||r.status!==`running`&&r.status!==`pending`||r.liveTail===t.tail)return n;let i=n.items.slice();return i[e]={...r,liveTail:t.tail},{...n,items:i}}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:dj(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}}function xj(e){return`The agent cleared its context: ${e}`}var Sj=5,Cj=new Map;function wj(e,t){return`${e.identityKey}\u0000${t}`}function Tj(e){return Cj.get(e)}function Ej(e,t){if(Cj.delete(e),Cj.set(e,t),Cj.size>Sj){let e=Cj.keys().next().value;e!==void 0&&Cj.delete(e)}}function Dj(e){Cj.delete(e)}function Oj(e,t){return`${e}:${t}`}function kj(e){let t=Oj(e.resyncSeq,e.key),n=e.cacheEnabled&&!e.skipCache?e.warm:void 0,r=e.seededFor!==t,i=r?n??GA:e.current;return{held:i,seed:r,seedToken:t,...i.lastSeq>0?{afterSeq:i.lastSeq}:{}}}function Aj(e){return e.cacheEnabled&&!e.skipCache&&e.parting.lastSeq>0&&e.parting.session!==void 0}function jj(e,t){return t.type===`transcript_seed`?t.state:t.type===`transcript_hydrate_result`?_j(e,t.toolUseId,t.text):t.type===`transcript_hydrate_shell`?vj(e,t.shellId,t.shell):t.type===`transcript_hydrate_shell_output`?yj(e,t.shellId,t.text):t.type===`attached`?gj(e,t.session):bj(e,t)}var Mj=3;function Nj(e){return e.replayingFrom===0&&e.session.lastSeq>0?e.session.lastSeq:void 0}function Pj(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 Fj=1500;function Ij(e,t,n){let[r,i]=(0,v.useReducer)(jj,void 0,()=>(n?.cacheTranscript!==!1&&t!==void 0?Tj(wj(e,t)):void 0)??GA),[a,o]=(0,v.useState)(`reconnecting`),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(Yk),[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)(Oj(0,t===void 0?``:wj(e,t))),w=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!t)return;let n=x.current?.cacheTranscript!==!1,r=wj(e,t),a=kj({resyncSeq:h,key:r,seededFor:C.current,current:S.current,cacheEnabled:n,skipCache:w.current,warm:Tj(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(Pj(e,S.current)){l(),Dj(r),w.current=!0,g(e=>e+1);return}i(e),m(Nj(e)),c(e.protocolVersion===1?void 0:e.protocolVersion),u(e.shell===!0),f(Qk(e.pricingOverrides).pricing)}),p=s.on(`connectionChange`,e=>o(e?`live`:`reconnecting`)),_=s.on(`reconnectAttempt`,e=>o(e>=Mj?`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;Aj({cacheEnabled:n,skipCache:w.current,parting:e})&&Ej(r,e)}},[e,t,h]),(0,v.useEffect)(()=>{if(p===void 0)return;let e=setTimeout(()=>m(void 0),Fj);return()=>clearTimeout(e)},[p]),(0,v.useEffect)(()=>{p!==void 0&&r.lastSeq>=p&&m(void 0)},[p,r.lastSeq]);let T=Rj(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:cj(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(e){return Lj(e)&&i({type:`transcript_hydrate_shell`,shellId:n,shell:void 0}),!1}},[e,t]),M=(0,v.useCallback)(async n=>{let r=A.current;if(!t||r.has(n))return!1;r.add(n);try{let r=await e.getShell(t,n);return i({type:`transcript_hydrate_shell`,shellId:n,shell:r}),!0}catch(e){return Lj(e)?i({type:`transcript_hydrate_shell`,shellId:n,shell:void 0}):r.delete(n),!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]),P=(0,v.useCallback)(async(n,r)=>{if(!t)return!1;try{let a=await e.setShellAgentWrite(t,n,r);return i({type:`transcript_hydrate_shell`,shellId:n,shell:a}),!0}catch{return!1}},[e,t]),F=(0,v.useMemo)(()=>({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(),backgroundTask:e=>b.current?.backgroundTask(e),clearContext:()=>b.current?.clearContext(),runShell:e=>b.current?.runShell(e),setPermissionMode:e=>b.current?.setPermissionMode(e),setModel:e=>b.current?.setModel(e),setEffort:e=>b.current?.setEffort(e),closeSession:()=>b.current?.closeSession()}),[]);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:_,...F,reconnectNow:O,loadFullResult:k,loadShellOutput:j,verifyShell:M,killShell:N,setShellAgentWrite:P}),[r,E,a,D,s,l,d,T,_,F,O,k,j,M,N,P])}function Lj(e){return e instanceof HA&&e.status===404}function Rj(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 zj=new Map;function Bj(e,t){return`${e.identityKey}\u0000${t}`}function Vj(e){return zj.get(e)}function Hj(e,t){t!==void 0&&zj.set(e,t)}var Uj=`workerdeck.drafts.v1`,Wj=20,Gj;function Kj(){try{return globalThis.localStorage}catch{return}}function qj(){if(Gj)return Gj;Gj={};let e=Kj()?.getItem(Uj);if(e)try{let t=JSON.parse(e);for(let[e,n]of Object.entries(t))typeof n?.text==`string`&&typeof n.savedAt==`number`&&(Gj[e]=n)}catch{}return Gj}function Jj(e){let t=Object.entries(e);if(t.length>Wj){t.sort((e,t)=>t[1].savedAt-e[1].savedAt);for(let[n]of t.slice(Wj))delete e[n]}try{Kj()?.setItem(Uj,JSON.stringify(e))}catch{}}function Yj(e,t){return`${e.identityKey}\u0000${t}`}function Xj(e){return qj()[e]?.text??``}function Zj(e,t,n=Date.now()){let r=qj();if(t.trim()===``){if(r[e]===void 0)return;delete r[e]}else r[e]={text:t,savedAt:n};Jj(r)}var Qj=new Set([`application/json`,`application/xml`,`application/yaml`,`application/x-yaml`,`application/toml`,`application/javascript`,`application/typescript`,`application/x-sh`,`application/sql`]),$j=1568;function eM(e){let t=e.split(`;`)[0].trim().toLowerCase();if(t.startsWith(`image/`))return`image`;if(t===`application/pdf`)return`pdf`;if(t.startsWith(`text/`)||Qj.has(t))return`text`}function tM(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 iM(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:Rk(e,`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=eM(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:nM(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 nM(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 rM=globalThis;async function iM(e){let t=e.type||`application/octet-stream`,{createImageBitmap:n,document:r}=rM;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<=$j)return i.close(),{body:e,mediaType:t};let o=$j/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 aM=/^[A-Za-z0-9\-_.:]+$/,oM=lA;function sM(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&&oM.has(e[s-1]);)s--;let c=e.slice(o.index+1,s);c&&(a!==`command`||aM.test(c))&&(a!==`skill`||r.has(c))&&(a!==`session`||pA(c)&&i.has(fA(c)))&&n.push({kind:a,start:o.index,end:s,text:e.slice(o.index,s)})}return n}function cM(){let e=(0,v.useRef)(!0);return(0,v.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function lM(e){return e instanceof HA&&e.status===404}function uM(e,t,{enabled:n=!0,pollMs:r}={}){let[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(n),u=(0,v.useRef)(0),d=(0,v.useRef)(e);d.current=e;let f=(0,v.useCallback)(async()=>{let e=++u.current;l(!0);try{let t=await d.current();e===u.current&&(a(()=>t),s(void 0))}catch(t){e===u.current&&s(t)}finally{e===u.current&&l(!1)}},[]);return(0,v.useEffect)(()=>{a(void 0),s(void 0)},t),(0,v.useEffect)(()=>{if(!n){u.current++,l(!1);return}f();let e=r?setInterval(()=>void f(),r):void 0;return()=>{u.current++,clearInterval(e)}},[n,r,f,...t]),{data:i,error:o,loading:c,reload:f,setData:a}}function dM(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 fM(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 pM(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 lM(e)&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function mM(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 hM(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=cM(),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),lM(e)){s(!0);return}l(Rk(e,`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=fM(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?dM(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}}function gM(e){let t=e.agent??e.title;return{id:e.id,slug:dA(t,e.id),label:t??dA(void 0,e.id),gateway:e.gateway,engine:e.engine,status:e.status,cwd:e.cwd,project:e.project,lastActivityAt:e.lastActivityAt}}var _M={available:!1,peers:[],names:[]},vM=2e4;function yM(e,t,n=!0){let[r,i]=(0,v.useState)(void 0),[a,o]=(0,v.useState)(!1),s=cM();return(0,v.useEffect)(()=>{if(i(void 0),!n||a||!t)return;let r,c=()=>{e.listPeers(t).then(e=>{s.current&&i(e)}).catch(e=>{s.current&&lM(e)&&o(!0)}).finally(()=>{s.current&&(r=setTimeout(c,vM))})};return c(),()=>{r&&clearTimeout(r)}},[e,n,t,a]),(0,v.useMemo)(()=>{if(!n||a||!r)return _M;let e=r.map(gM);return{available:e.length>0,peers:e,names:e.map(e=>fA(e.slug))}},[n,r,a])}var bM=new Map,xM=new Set,SM=new Set;function CM(e,t){let[n,r]=(0,v.useState)(()=>Object.fromEntries(bM));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(bM.has(a)||xM.has(a)||SM.has(a))continue;let o=t(i.hostId);o&&(xM.add(a),o.projectIcon(i.info.id).then(e=>{bM.set(a,URL.createObjectURL(e)),n&&r(Object.fromEntries(bM))}).catch(()=>{SM.add(a)}).finally(()=>xM.delete(a)))}return()=>{n=!1}},[e,t]),n}var wM=`workerdeck.bookmarks.v1`,TM=Object.freeze([]),EM=new Set,DM,OM;function kM(){try{return globalThis.localStorage??void 0}catch{return}}function AM(){let e=globalThis.window;return typeof e?.addEventListener==`function`?e:void 0}function jM(){try{let e=kM()?.getItem(wM);if(e==null)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return{};let n={};for(let[e,r]of Object.entries(t))Array.isArray(r)&&(n[e]=r.filter(e=>typeof e==`string`));return n}catch{return}}function MM(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function NM(e){let t=DM??{},n={};for(let[r,i]of Object.entries(e)){let e=t[r];n[r]=e&&MM(e,i)?e:i}DM=n}function PM(){return DM===void 0&&NM(jM()??{}),DM??{}}function FM(){for(let e of EM)e()}function IM(e){return PM()[e]??TM}function LM(e,t){let n=jM()??PM(),r=n[e]??TM,i=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...n,[e]:i};i.length===0&&delete a[e];try{kM()?.setItem(wM,JSON.stringify(a))}catch{}NM(a),FM()}function RM(e){if(e.key!==null&&e.key!==`workerdeck.bookmarks.v1`)return;let t=jM();t&&(NM(t),FM())}function zM(e){EM.add(e);let t=AM();return EM.size===1&&t&&(t.addEventListener(`storage`,RM),OM=()=>t.removeEventListener(`storage`,RM)),()=>{EM.delete(e),EM.size===0&&(OM?.(),OM=void 0)}}var BM=Object.freeze([]);function VM(e){let t=(0,v.useCallback)(()=>e?IM(e):BM,[e]),n=(0,v.useSyncExternalStore)(zM,t,()=>BM),r=(0,v.useCallback)(t=>{e&&LM(e,t)},[e]);return(0,v.useMemo)(()=>({bookmarks:n,toggle:r}),[n,r])}function HM(e,t){let n=t?Yj(e,t):void 0;return{initialText:(0,v.useMemo)(()=>n?Xj(n):``,[n]),save:(0,v.useCallback)(e=>{n&&Zj(n,e)},[n]),clear:(0,v.useCallback)(()=>{n&&Zj(n,``)},[n])}}function UM(e,t,n={}){let{intervalMs:r=6e4,enabled:i=!0}=n,a=t?Bj(e,t):void 0,[o,s]=(0,v.useState)(()=>a?Vj(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?Vj(a):void 0),l(void 0)},[a]);let h=cM();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&&Hj(a,i),s(i),l(r?.spend)}).catch(e=>{!n&&h.current&&lM(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 WM(e,t){let{data:n,error:r,loading:i}=uM(()=>e.getSession(t),[e,t],{enabled:!!t});return{info:n,loading:i,error:r===void 0?void 0:Rk(r,`Session not found`)}}function GM(e){return e.draft!==void 0&&e.draft!==e.content}function KM(e){return e.draft??e.content??``}var qM={files:[]};function JM(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:XM(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 qM;case`activate`:return e.files.some(e=>e.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case`loaded`:return YM(e,t.path,()=>({path:t.path,name:XM(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 YM(e,t.path,e=>({...e,status:`error`,error:t.error}));case`edit`:return YM(e,t.path,e=>e.status===`ready`?{...e,draft:t.content}:e);case`revert`:return YM(e,t.path,e=>({...e,draft:void 0,saveError:void 0,conflict:!1}));case`saveStart`:return YM(e,t.path,e=>({...e,saving:!0,saveError:void 0,conflict:!1}));case`saved`:return YM(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 YM(e,t.path,e=>({...e,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case`dismissConflict`:return YM(e,t.path,e=>({...e,conflict:!1,saveError:void 0}))}}function YM(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 XM(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;return t.slice(t.lastIndexOf(`/`)+1)||t||e}function ZM(e){let[t,n]=(0,v.useReducer)(JM,qM),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:Rk(t,`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:Rk(t,`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 HA&&e.status===409;n({type:`saveFailed`,path:t,conflict:r,error:r?`This file changed on disk since you opened it.`:Rk(e,`Could not save that file`)})}},[e]),_=(0,v.useCallback)(async e=>{let t=a.current.files.find(t=>t.path===e);t&&!t.saving&&GM(t)&&(n({type:`saveStart`,path:e}),await g(e,KM(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=KM(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:Rk(e,`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(GM),[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 QM=`modulepreload`,$M=function(e){return`/`+e},eN={},tN=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=$M(t,n),t=s(t),t in eN)return;eN[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`:QM,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 nN(e,t={}){let n=new Map,r,i=!1,a=e=>t.onExecution?.(e),o=(t,n,r)=>{let{executionId:i,toolName:o}=t;r.ok?(e.sendToolCallResult(i,{type:`json`,value:r.value},r.logs),a({executionId:i,toolName:o,status:`settled`,startedAt:n,endedAt:Date.now()})):(e.sendToolCallError(i,r.reason,r.error,r.logs),a({executionId:i,toolName:o,status:`failed`,reason:r.reason,startedAt:n,endedAt:Date.now()}))},s=async(e,t,r)=>{let s=new AbortController;n.set(e.executionId,s),a({executionId:e.executionId,toolName:e.toolName,status:`running`,startedAt:t});let c;try{c=await r(s.signal)}catch(e){c={ok:!1,reason:`host_error`,error:Rk(e)}}try{!i&&n.has(e.executionId)&&o(e,t,c)}finally{n.delete(e.executionId)}},c=(e,t,n)=>s(e,n,async n=>{let r=await t(e.input,{executionId:e.executionId,signal:n});return`error`in r?{ok:!1,reason:r.reason??`client_error`,error:r.error}:{ok:!0,value:r.value}}),l=(e,n,i)=>s(e,i,async i=>{let a=await tN(()=>import(`./src-_0MG5Juv.js`),[]),o=a.createVfs(e.vfsSeed),s=Math.min(e.limits?.timeoutMs??1/0,t.timeoutMs??5e3),c=Math.min(e.limits?.memoryLimitBytes??1/0,t.memoryLimitBytes??67108864),l;t.execute?l=await t.execute({script:n,vfs:o,timeoutMs:s,memoryLimitBytes:c,signal:i}):(r??=(t.loadEngine??rN)(),l=await a.runScript(await r,{script:n,vfs:o,timeoutMs:s,memoryLimitBytes:c,signal:i,fetchText:t.fetchText}));let u=l.logs.map(e=>`[${e.level}] ${e.text}`);return l.ok?{ok:!0,value:l.value,logs:u}:{ok:!1,reason:l.reason,error:l.error,logs:u}}),u=async e=>{let n=Date.now(),r=t.clientTools?.[e.toolName];if(r)return c(e,r,n);if(!(t.tools??[`eval_script`]).includes(e.toolName)){o(e,n,{ok:!1,reason:`unsupported_tool`,error:`this client does not execute '${e.toolName}'`});return}let i=e.input?.script;if(typeof i!=`string`){o(e,n,{ok:!1,reason:`invalid_input`,error:"expected a string `script` input"});return}return l(e,i,n)},d=e.on(`toolCallRequest`,e=>void u(e)),f=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,d(),f();for(let e of n.values())e.abort();n.clear()}}}async function rN(){let[e,t]=await Promise.all([tN(()=>import(`./src-_0MG5Juv.js`),[]),tN(()=>import(`./dist-Bx14-w0g.js`),[])]);return e.loadEngine(t)}function iN(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=nN(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 aN(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 oN(e){if(!e.any)return;let t=[];if(e.turns>0?t.push(sN(e.turns,`turn`)):e.replies>0&&t.push(sN(e.replies,`reply`,`replies`)),e.tools>0){let n=e.toolNames.slice(0,3).join(`, `),r=e.toolNames.length-3;t.push(`${sN(e.tools,`tool call`)}${n?` (${n}${r>0?`, +${r}`:``})`:``}`)}return e.files>0&&t.push(sN(e.files,`file`)),e.errors>0&&t.push(sN(e.errors,`error`)),e.pending>0&&t.push(`${sN(e.pending,`approval`)} waiting`),t.join(` · `)}function sN(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function cN(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 lN={command:0,client:1,skill:2};function uN(e){return e.replace(/\s*\(MCP\)$/i,``)}function dN(e){return`$${e.name}`}function fN(e){let t=dN(e),n=(e.defaultPrompt??``).split(t).join(` `).replace(/\s+/g,` `).trim();return n?` ${n} `:` `}function pN(e){return dN(e)+fN(e)}function mN(e){let t=[],n=new Set;for(let r of e.commands??[]){let e=uN(r.name);if(!n.has(e)){n.add(e);for(let e of r.aliases??[])n.add(uN(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 hN(e){return e.kind===`skill`?[e.name,e.label,...e.name.split(/[-:_]/)]:[e.name,...e.kind===`command`?e.aliases??[]:[],...e.name.split(`:`)]}function gN(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 _N(e,t){let n=[];return t.forEach((t,r)=>{if(t.kind===`skill`&&!t.enabled)return;let i=gN(e,hN(t));i>0&&n.push({score:i,index:r,row:t})}),n.sort((e,t)=>t.score-e.score||lN[e.row.kind]-lN[t.row.kind]||e.index-t.index),n.map(({row:e})=>e)}function vN(e,t){let n=e.trim();if(!n)return[...t];let r=[];return t.forEach((e,t)=>{let i=gN(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 yN(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 bN(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:pN(e.skill)}:{kind:e.kind,name:e.name,label:`/${e.name}`,description:e.description,enabled:!0,insertText:`/${e.name} `})}function xN({capabilities:e,hasModels:t,efforts:n=[],setModel:r,setEffort:i,setPermissionMode:a,clearContext:o,openPanel:s}){let c=e.permissionModes,l=[];return t&&l.push({name:`model`,description:`Switch the model for this session`,argumentHint:`<model>`,requiresArgs:!0,run:e=>{let t=e.split(/\s+/)[0];return t?(r(t),!0):!1}}),n.length&&i&&l.push({name:`effort`,description:`Set the reasoning effort (${n.join(`, `)}, default)`,argumentHint:`<level>`,requiresArgs:!0,run:e=>{let t=e.split(/\s+/)[0];return t==="default"?(i(void 0),!0):!t||!n.includes(t)?!1:(i(t),!0)}}),c.length>1&&l.push({name:`permissions`,description:`Set the permission mode (${c.join(`, `)})`,argumentHint:`<mode>`,requiresArgs:!0,run:e=>{let t=e.split(/\s+/)[0];return c.includes(t)?(a(t),!0):!1}}),e.clearContext&&l.push({name:`clear`,description:`Clear the conversation - the session keeps running and the old one stays resumable`,run:()=>(o(),!0)}),e.mcpStatus&&l.push({name:`mcp`,description:`MCP servers and their status`,run:()=>(s(`mcp`),!0)}),e.contextUsage&&l.push({name:`context`,description:`Context window usage`,run:()=>(s(`context`),!0)}),l.push({name:`status`,description:`Session details`,run:()=>(s(`info`),!0)}),e.rateLimits&&l.push({name:`usage`,description:`Rate limits and spend`,run:()=>(s(`usage`),!0)}),e.skillsList&&l.push({name:`skills`,description:`Browse the skills this session can use`,run:()=>(s(`skills`),!0)}),l}var SN=(0,v.createContext)(`cards`);function CN({value:e,children:t}){return(0,U.jsx)(SN.Provider,{value:e,children:t})}function wN(){return(0,v.useContext)(SN)}var TN={terminal:{className:`term-row-gap`,px:18},cards:{className:`pt-5`,px:20}},EN=`context compacted · earlier turns summarised to fit the window`;function DN(e){return e.error?`context compaction failed · ${e.error}`:e.pending?`compacting context · summarising earlier turns to fit the window`:[EN,e.preTokens===void 0?void 0:e.postTokens===void 0?`from ${AN(e.preTokens)}`:`${AN(e.preTokens)} → ${AN(e.postTokens)}`,e.trigger===`auto`?`automatic`:void 0].filter(Boolean).join(` · `)}function ON(e){return e===void 0||Number.isNaN(e)?`-`:e===0?`$0.00`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function kN(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 AN(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function jN(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function MN(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 NN(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 PN(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 FN(e){if(e===`five_hour`)return 18e3;if(e.startsWith(`seven_day`))return 604800}function IN(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 LN(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 RN={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 zN(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=RN[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 BN(e){switch(e){case`Bash`:case`BashOutput`:case`KillShell`:case`shell_list`:case`shell_read`:case`shell_run`:case`shell_write`:case`shell_kill`:case`shell_request_write`:case`mcp__workerdeck__shell_list`:case`mcp__workerdeck__shell_read`:case`mcp__workerdeck__shell_run`:case`mcp__workerdeck__shell_write`:case`mcp__workerdeck__shell_kill`:case`mcp__workerdeck__shell_request_write`:return RS;case`Read`:return ay;case`Write`:return Fee;case`Edit`:case`MultiEdit`:case`NotebookEdit`:return dx;case`Glob`:return _y;case`Grep`:return aS;case`WebFetch`:return cee;case`WebSearch`:return Ly;case`Task`:case`Agent`:return oC;case`TodoWrite`:case`TaskCreate`:case`TaskUpdate`:case`TaskGet`:case`TaskList`:return Pee;case`Skill`:return bS;case`AskUserQuestion`:return Db;case`CodexCommand`:return RS;case`CodexFileChange`:return ty;case`CodexWebSearch`:return Ly;case`CodexImageGeneration`:case`CodexImageView`:return Yy;default:return e.startsWith(`mcp__`)?kx:SC}}function VN(e){return e===`Bash`||e===`CodexCommand`}function HN(e){switch(e){case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:case`Update`:case`CodexFileChange`:return!0;default:return!1}}var UN=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`],WN=new Set,GN,KN=`⠿`;function qN(e){return UN[Math.floor(e/90)%UN.length]}function JN(){let e=qN(Date.now());if(e!==KN){KN=e;for(let e of WN)e()}}function YN(e){return WN.add(e),GN===void 0&&(KN=qN(Date.now()),GN=setInterval(JN,90)),()=>{WN.delete(e),WN.size===0&&GN!==void 0&&(clearInterval(GN),GN=void 0)}}function XN(){return ZN}function ZN(){}function QN(){return KN}function $N(){return`⠿`}function eP(){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 tP(e){let t=eP(),n=e&&!t;return(0,v.useSyncExternalStore)(n?YN:XN,n?QN:$N,$N)}var nP=(0,v.createContext)(void 0),rP=(0,v.createContext)(void 0);function iP({names:e,children:t}){return(0,U.jsx)(nP.Provider,{value:e,children:t})}function aP({names:e,children:t}){return(0,U.jsx)(rP.Provider,{value:e,children:t})}function oP({text:e,className:t}){let n=sM(e,{skills:(0,v.useContext)(nP),sessions:(0,v.useContext)(rP)});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 sP={hover:!0,actions:!0,labels:!1},cP=(0,v.createContext)(sP);function lP(){return(0,v.useContext)(cP)}function uP(e){return e===!1?{hover:!1,actions:!1,labels:!1}:e===!0||e===void 0?sP:{...sP,...e}}function dP({value:e,children:t}){return(0,U.jsx)(cP.Provider,{value:e,children:t})}var fP=(0,v.createContext)(`below`);function pP({value:e,children:t}){return(0,U.jsx)(fP.Provider,{value:e,children:t})}function mP({actions:e,children:t,className:n,placement:r}){let{actions:i}=lP(),a=(0,v.useContext)(fP);return i?(0,U.jsxs)(`div`,{className:W(`term-hoverable`,n),"data-placement":r??a,children:[(0,U.jsx)(fP.Provider,{value:`below`,children:t}),(0,U.jsx)(`div`,{className:`term-actions`,children:e})]}):(0,U.jsx)(U.Fragment,{children:t})}function hP({icon:e,word:t,label:n,tone:r,pressed:i,filled:a,onPress:o}){let{labels:s}=lP();return(0,U.jsxs)(`button`,{type:`button`,className:`term-action`,title:n,"aria-label":n,"aria-pressed":i,"data-tone":r,onClick:e=>{e.stopPropagation(),o()},children:[(0,U.jsx)(e,{"aria-hidden":!0,className:`term-action-icon`,fill:a?`currentColor`:`none`}),s?(0,U.jsx)(`span`,{className:`term-action-word`,children:t}):null]})}var gP=(0,v.createContext)(void 0);function _P({value:e,children:t}){return(0,U.jsx)(gP.Provider,{value:e,children:t})}function vP({id:e}){let t=(0,v.useContext)(gP);if(!t)return null;let n=t.has(e);return(0,U.jsx)(hP,{icon:AS,filled:!0,word:n?`bookmarked`:`bookmark`,label:n?`Remove bookmark`:`Bookmark`,tone:n?`yellow`:void 0,pressed:n,onPress:()=>t.toggle(e)})}var yP=(0,v.createContext)(void 0);function bP({value:e,children:t}){return(0,U.jsx)(yP.Provider,{value:e,children:t})}function xP({toolUseId:e}){let t=(0,v.useContext)(yP);return t?(0,U.jsx)(hP,{icon:o_,word:`background`,label:`Move to background (the command keeps running, the agent continues)`,onPress:()=>t.background(e)}):null}function SP({onOpen:e,label:t=`Open sub-agent`}){return(0,U.jsx)(hP,{icon:Cb,word:`open`,label:t,onPress:e})}function CP({onOpen:e,label:t=`Open terminal`}){return(0,U.jsx)(hP,{icon:ES,word:`enter shell`,label:t,tone:`magenta`,onPress:e})}function wP({onKill:e,label:t=`Kill this shell`}){return(0,U.jsx)(hP,{icon:wC,word:`kill`,label:t,tone:`danger`,onPress:e})}function TP({granted:e,label:t,onToggle:n}){return(0,U.jsx)(hP,{icon:e?j_:k_,word:e?`agent can type`:`agent read-only`,label:t,tone:e?`yellow`:void 0,pressed:e,onPress:n})}function EP({text:e,label:t=`Copy`}){let[n,r]=(0,v.useState)(!1);return(0,U.jsx)(hP,{icon:n?rv:Nv,word:n?`copied`:`copy`,label:t,onPress:()=>{wE(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),1200))})}})}function DP({granted:e,className:t}){return(0,U.jsx)(e?j_:k_,{"aria-hidden":!0,className:t})}var OP=` ·\xA059m\xA059s`,kP=new Set([`Bash`,`Task`,`Agent`]);function AP(e){let t=e.status??(e.result===void 0?`running`:`settled`);return t===`running`||t===`pending`}function jP(e){return!e.liveTail||!AP(e)?[]:e.liveTail.split(`
50
+ `).slice(-5)}function MP(e,t){if(!(e===void 0||t-e<5e3))return kN(Math.floor((t-e)/1e3)*1e3).replace(` `,`\xA0`)}function NP(e){let t;for(let n of e)AP(n)&&n.ts!==void 0&&(t===void 0||n.ts<t)&&(t=n.ts);return t}function PP(e){return kP.has(e.name)&&e.parentToolUseId==null&&AP(e)}function FP(e){for(let t=e.length-1;t>=0;t--){let n=jP(e[t]);if(n.length>0)return n}return[]}function IP(e){let t;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.kind===`user`&&r.parentToolUseId==null)break;if(r.kind===`tool_call`&&PP(r)){let e=r.ts??0;t=t===void 0?e:Math.min(t,e)}}return t}function LP({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 RP(){return(0,U.jsx)(`div`,{className:`term-blank`,"aria-hidden":!0})}function zP({className:e,...t}){return(0,U.jsx)(`div`,{className:W(`term-band`,e),...t})}function BP({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 VP(e){return e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`}function HP(e){let t=e.oldStart,n=e.newStart,r=[];for(let i of e.lines){let e=VP(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 UP={context:` `,add:`+`,remove:`-`};function WP(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(`
51
+ `).map(e=>`-${e}`):[],...r?r.split(`
52
+ `).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 GP({patch:e}){let t=e.hunks.map(HP),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)(LP,{columns:i,glyph:` `.repeat(r)+` ⋮`,tone:`faint`}):null,e.map((e,t)=>(0,U.jsx)(LP,{columns:i,"data-diff":e.kind,glyph:n?`${String(e.number).padStart(r)} ${UP[e.kind]}`:UP[e.kind],children:e.text||` `},t))]},t)),e.truncated?(0,U.jsx)(LP,{columns:i,tone:`faint`,children:`… diff truncated`}):null]})}var KP=(function(e){if(e==null)return ZP;if(typeof e==`function`)return XP(e);if(typeof e==`object`)return Array.isArray(e)?qP(e):JP(e);if(typeof e==`string`)return YP(e);throw Error(`Expected function, string, or object as test`)});function qP(e){let t=[],n=-1;for(;++n<e.length;)t[n]=KP(e[n]);return XP(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function JP(e){let t=e;return XP(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function YP(e){return XP(t);function t(t){return t&&t.type===e}}function XP(e){return t;function t(t,n,r){return!!(QP(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ZP(){return!0}function QP(e){return typeof e==`object`&&!!e&&`type`in e}function $P(e){return e}var eF=[],tF=`skip`;function nF(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=KP(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 (`+$P(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=eF,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=rF(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 rF(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?eF:[e]}function iF(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),nF(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 aF={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function oF({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=aF.indicator,imageBlockPolicy:c=aF.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=gF(e,t,n,r,i,a,o,s,c);fF(l),iF(l,u)}}function sF(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 cF(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var lF=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),uF=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function dF(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=sF(e,n);if(!o||uF.has(o.protocol)||!(lF.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=cF(e);return o&&t.some(e=>{let t=sF(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 fF(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)fF(t)}}var pF=Symbol(`node-seen`);function mF(e,t,n){return t===aF.remove?{type:`remove`}:t===aF.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 hF(e,t,n){if(t===aF.remove)return{type:`remove`};if(t===aF.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 gF=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[pF])return!0;if(u.tagName===`a`){let n=dF(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[pF]=!0,iF(u,l),f&&typeof d==`number`){let e=mF(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[tF,d];f.children[d]=e.element}return tF}return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=dF(u.properties.src,n,e,r,!0,i);if(t===null){if(u[pF]=!0,iF(u,l),f&&typeof d==`number`){let e=hF(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[tF,d];f.children[d]=e.element}return tF}return u.properties.src=t,!0}return!0};return l},{defineProperty:_F}=Object,vF=typeof self==`object`?self:globalThis,yF=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new vF[e](t)},bF=(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__`?_F(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 vF[e]==`function`?yF(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(yF(a,o),i)};return r},xF=e=>bF(new Map,e)(0),SF=``,{toString:CF}={},{keys:wF,is:TF}=Object,EF=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=CF.call(e).slice(8,-1);switch(n){case`Array`:return[1,SF];case`Object`:return[2,SF];case`Date`:return[3,SF];case`RegExp`:return[4,SF];case`Map`:return[5,SF];case`Set`:return[6,SF];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},DF=([e,t])=>e===0&&(t===`function`||t===`symbol`),OF=(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]=EF(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&TF(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 wF(o))(e||!DF(EF(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?SF: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||!(DF(EF(n))||DF(EF(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!DF(EF(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},kF=(e,{json:t,lossy:n}={})=>{let r=[];return OF(!(t||n),!!t,new Map,r)(e),r},AF=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?xF(kF(e,t)):structuredClone(e):(e,t)=>xF(kF(e,t)),jF=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};jF.prototype.normal={},jF.prototype.property={},jF.prototype.space=void 0;function MF(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new jF(n,r,t)}function NF(e){return e.toLowerCase()}var PF=class{constructor(e,t){this.attribute=t,this.property=e}};PF.prototype.attribute=``,PF.prototype.booleanish=!1,PF.prototype.boolean=!1,PF.prototype.commaOrSpaceSeparated=!1,PF.prototype.commaSeparated=!1,PF.prototype.defined=!1,PF.prototype.mustUseProperty=!1,PF.prototype.number=!1,PF.prototype.overloadedBoolean=!1,PF.prototype.property=``,PF.prototype.spaceSeparated=!1,PF.prototype.space=void 0;var FF=s({boolean:()=>LF,booleanish:()=>RF,commaOrSpaceSeparated:()=>UF,commaSeparated:()=>HF,number:()=>BF,overloadedBoolean:()=>zF,spaceSeparated:()=>VF}),IF=0,LF=WF(),RF=WF(),zF=WF(),BF=WF(),VF=WF(),HF=WF(),UF=WF();function WF(){return 2**++IF}var GF=Object.keys(FF),KF=class extends PF{constructor(e,t,n,r){let i=-1;if(super(e,t),qF(this,`space`,r),typeof n==`number`)for(;++i<GF.length;){let e=GF[i];qF(this,GF[i],(n&FF[e])===FF[e])}}};KF.prototype.defined=!0;function qF(e,t,n){n&&(e[t]=n)}function JF(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new KF(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[NF(r)]=r,n[NF(a.attribute)]=r}return new jF(t,n,e.space)}var YF=JF({properties:{ariaActiveDescendant:null,ariaAtomic:RF,ariaAutoComplete:null,ariaBusy:RF,ariaChecked:RF,ariaColCount:BF,ariaColIndex:BF,ariaColSpan:BF,ariaControls:VF,ariaCurrent:null,ariaDescribedBy:VF,ariaDetails:null,ariaDisabled:RF,ariaDropEffect:VF,ariaErrorMessage:null,ariaExpanded:RF,ariaFlowTo:VF,ariaGrabbed:RF,ariaHasPopup:null,ariaHidden:RF,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:VF,ariaLevel:BF,ariaLive:null,ariaModal:RF,ariaMultiLine:RF,ariaMultiSelectable:RF,ariaOrientation:null,ariaOwns:VF,ariaPlaceholder:null,ariaPosInSet:BF,ariaPressed:RF,ariaReadOnly:RF,ariaRelevant:null,ariaRequired:RF,ariaRoleDescription:VF,ariaRowCount:BF,ariaRowIndex:BF,ariaRowSpan:BF,ariaSelected:RF,ariaSetSize:BF,ariaSort:null,ariaValueMax:BF,ariaValueMin:BF,ariaValueNow:BF,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function XF(e,t){return t in e?e[t]:t}function ZF(e,t){return XF(e,t.toLowerCase())}var QF=JF({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:HF,acceptCharset:VF,accessKey:VF,action:null,allow:null,allowFullScreen:LF,allowPaymentRequest:LF,allowUserMedia:LF,alpha:LF,alt:null,as:null,async:LF,autoCapitalize:null,autoComplete:VF,autoFocus:LF,autoPlay:LF,blocking:VF,capture:null,charSet:null,checked:LF,cite:null,className:VF,closedBy:null,colorSpace:null,cols:BF,colSpan:BF,command:null,commandFor:null,content:null,contentEditable:RF,controls:LF,controlsList:VF,coords:BF|HF,crossOrigin:null,data:null,dateTime:null,decoding:null,default:LF,defer:LF,dir:null,dirName:null,disabled:LF,download:zF,draggable:RF,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:LF,formTarget:null,headers:VF,height:BF,hidden:zF,high:BF,href:null,hrefLang:null,htmlFor:VF,httpEquiv:VF,id:null,imageSizes:null,imageSrcSet:null,inert:LF,inputMode:null,integrity:null,is:null,isMap:LF,itemId:null,itemProp:VF,itemRef:VF,itemScope:LF,itemType:VF,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:LF,low:BF,manifest:null,max:null,maxLength:BF,media:null,method:null,min:null,minLength:BF,multiple:LF,muted:LF,name:null,nonce:null,noModule:LF,noValidate:LF,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:LF,optimum:BF,pattern:null,ping:VF,placeholder:null,playsInline:LF,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:LF,referrerPolicy:null,rel:VF,required:LF,reversed:LF,rows:BF,rowSpan:BF,sandbox:VF,scope:null,scoped:LF,seamless:LF,selected:LF,shadowRootClonable:LF,shadowRootCustomElementRegistry:LF,shadowRootDelegatesFocus:LF,shadowRootMode:null,shadowRootSerializable:LF,shape:null,size:BF,sizes:null,slot:null,span:BF,spellCheck:RF,src:null,srcDoc:null,srcLang:null,srcSet:null,start:BF,step:null,style:null,tabIndex:BF,target:null,title:null,translate:null,type:null,typeMustMatch:LF,useMap:null,value:RF,width:BF,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:VF,axis:null,background:null,bgColor:null,border:BF,borderColor:null,bottomMargin:BF,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:LF,declare:LF,event:null,face:null,frame:null,frameBorder:null,hSpace:BF,leftMargin:BF,link:null,longDesc:null,lowSrc:null,marginHeight:BF,marginWidth:BF,noResize:LF,noHref:LF,noShade:LF,noWrap:LF,object:null,profile:null,prompt:null,rev:null,rightMargin:BF,rules:null,scheme:null,scrolling:RF,standby:null,summary:null,text:null,topMargin:BF,valueType:null,version:null,vAlign:null,vLink:null,vSpace:BF,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:LF,disablePictureInPicture:LF,disableRemotePlayback:LF,exportParts:HF,part:VF,prefix:null,property:null,results:BF,security:null,unselectable:null},space:`html`,transform:ZF}),$F=JF({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:UF,accentHeight:BF,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:BF,amplitude:BF,arabicForm:null,ascent:BF,attributeName:null,attributeType:null,azimuth:BF,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:BF,by:null,calcMode:null,capHeight:BF,className:VF,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:BF,diffuseConstant:BF,direction:null,display:null,dur:null,divisor:BF,dominantBaseline:null,download:LF,dx:null,dy:null,edgeMode:null,editable:null,elevation:BF,enableBackground:null,end:null,event:null,exponent:BF,externalResourcesRequired:null,fill:null,fillOpacity:BF,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:HF,g2:HF,glyphName:HF,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:BF,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:BF,horizOriginX:BF,horizOriginY:BF,id:null,ideographic:BF,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:BF,k:BF,k1:BF,k2:BF,k3:BF,k4:BF,kernelMatrix:UF,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:BF,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:BF,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:BF,overlineThickness:BF,paintOrder:null,panose1:null,path:null,pathLength:BF,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:VF,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:BF,pointsAtY:BF,pointsAtZ:BF,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:UF,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:UF,rev:UF,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:UF,requiredFeatures:UF,requiredFonts:UF,requiredFormats:UF,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:BF,specularExponent:BF,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:BF,strikethroughThickness:BF,string:null,stroke:null,strokeDashArray:UF,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:BF,strokeOpacity:BF,strokeWidth:null,style:null,surfaceScale:BF,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:UF,tabIndex:BF,tableValues:null,target:null,targetX:BF,targetY:BF,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:UF,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:BF,underlineThickness:BF,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:BF,values:null,vAlphabetic:BF,vMathematical:BF,vectorEffect:null,vHanging:BF,vIdeographic:BF,version:null,vertAdvY:BF,vertOriginX:BF,vertOriginY:BF,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:BF,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:XF}),eI=JF({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()}}),tI=JF({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ZF}),nI=JF({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),rI={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`},iI=/[A-Z]/g,aI=/-[a-z]/g,oI=/^data[-\w.:]+$/i;function sI(e,t){let n=NF(t),r=t,i=PF;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&oI.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(aI,lI);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!aI.test(e)){let n=e.replace(iI,cI);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=KF}return new i(r,t)}function cI(e){return`-`+e.toLowerCase()}function lI(e){return e.charAt(1).toUpperCase()}var uI=MF([YF,QF,eI,tI,nI],`html`),dI=MF([YF,$F,eI,tI,nI],`svg`);function fI(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 pI(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var mI=/[#.]/g;function hI(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){mI.lastIndex=i;let e=mI.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 gI(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function _I(e){return e.join(` `).trim()}function vI(e,t,n){let r=n?wI(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=hI(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,yI(i))a.unshift(i);else for(let[t,n]of Object.entries(i))bI(e,o.properties,t,n)}for(let e of a)xI(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function yI(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 bI(e,t,n,r){let i=sI(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?gI(r):i.commaSeparated?fI(r):i.commaOrSpaceSeparated?gI(fI(r).join(` `)):SI(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?CI(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(SI(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function xI(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)xI(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?xI(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function SI(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||NF(n)===NF(t)))return!0}return n}function CI(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function wI(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var TI=`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(`.`),EI=vI(uI,`div`),DI=vI(dI,`g`,TI);function OI(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=kI(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=kI(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 kI(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
53
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var AI={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/`},jI={}.hasOwnProperty,MI=Object.prototype;function NI(e,t){let n=t||{};return PI({file:n.file||void 0,location:!1,schema:n.space===`svg`?dI:uI,verbose:n.verbose||!1},e)}function PI(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},LI(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:FI(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=OI(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`},LI(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},LI(e,r,n),n}default:return n=II(e,t),n}}function FI(e,t){let n=-1,r=[];for(;++n<t.length;){let i=PI(e,t[n]);r.push(i)}return r}function II(e,t){let n=e.schema;e.schema=t.namespaceURI===AI.svg?dI:uI;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;jI.call(MI,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?DI:EI)(t.tagName,i,FI(e,t.childNodes));if(LI(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&zI(r.startTag),o=r&&r.endTag&&zI(r.endTag),s=PI(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function LI(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=RI(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function RI(e,t,n){let r=zI(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)jI.call(n.attrs,i)&&(r[sI(e.schema,i).property]=zI(n.attrs[i]));n.startTag;let a=zI(n.startTag),o=n.endTag?zI(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function zI(e){let t=BI({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=BI({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function BI(e){return e.line&&e.column?e:void 0}var VI={}.hasOwnProperty;function HI(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&VI.call(t,e)){let n=String(t[e]);i=VI.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 UI={},WI={}.hasOwnProperty,GI=HI(`type`,{handlers:{root:qI,element:wte,text:Ste,comment:Cte,doctype:YI}});function KI(e,t){let n=(t||UI).space;return GI(e,n===`svg`?dI:uI)}function qI(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=XI(e.children,n,t),ZI(e,n),n}function JI(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=XI(e.children,n,t),ZI(e,n),n}function YI(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return ZI(e,t),t}function Ste(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return ZI(e,t),t}function Cte(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return ZI(e,t),t}function wte(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=dI);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&WI.call(e.properties,a)){let t=Tte(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:AI[o],childNodes:[],parentNode:null};return s.childNodes=XI(e.children,s,r),ZI(e,s),e.tagName===`template`&&e.content&&(s.content=JI(e.content,r)),s}function Tte(e,t,n){let r=sI(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?pI(n):_I(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=AI[r.space]}return i}function XI(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=GI(e[r],n);a.parentNode=t,i.push(a)}return i}function ZI(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 Ete=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Dte=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]),q;(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`})(q||={});var QI={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function $I(e){return e>=55296&&e<=57343}function Ote(e){return e>=56320&&e<=57343}function kte(e,t){return(e-55296)*1024+9216+t}function eL(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function tL(e){return e>=64976&&e<=65007||Dte.has(e)}var J;(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`})(J||={});var Ate=65536,jte=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=Ate,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(Ote(t))return this.pos++,this._addGap(),kte(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,q.EOF;return this._err(J.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,q.EOF;let n=this.html.charCodeAt(t);return n===q.CARRIAGE_RETURN?q.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,q.EOF;let e=this.html.charCodeAt(this.pos);return e===q.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,q.LINE_FEED):e===q.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,$I(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===q.LINE_FEED||e===q.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){eL(e)?this._err(J.controlCharacterInInputStream):tL(e)&&this._err(J.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},nL;(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`})(nL||={});function rL(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 Mte=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0⹻m;櫳;櫽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))),Nte=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 Pte(e){return e>=55296&&e<=57343||e>1114111?65533:Nte.get(e)??e}var iL;(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`})(iL||={});var Fte=32,aL;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(aL||={});function oL(e){return e>=iL.ZERO&&e<=iL.NINE}function Ite(e){return e>=iL.UPPER_A&&e<=iL.UPPER_F||e>=iL.LOWER_A&&e<=iL.LOWER_F}function Lte(e){return e>=iL.UPPER_A&&e<=iL.UPPER_Z||e>=iL.LOWER_A&&e<=iL.LOWER_Z||oL(e)}function Rte(e){return e===iL.EQUALS||Lte(e)}var sL;(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`})(sL||={});var cL;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(cL||={});var zte=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=sL.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=cL.Strict}startEntity(e){this.decodeMode=e,this.state=sL.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case sL.EntityStart:return e.charCodeAt(t)===iL.NUM?(this.state=sL.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=sL.NamedEntity,this.stateNamedEntity(e,t));case sL.NumericStart:return this.stateNumericStart(e,t);case sL.NumericDecimal:return this.stateNumericDecimal(e,t);case sL.NumericHex:return this.stateNumericHex(e,t);case sL.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Fte)===iL.LOWER_X?(this.state=sL.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=sL.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(oL(r)||Ite(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(oL(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===iL.SEMI)this.consumed+=1;else if(this.decodeMode===cL.Strict)return 0;return this.emitCodePoint(Pte(this.result),this.consumed),this.errors&&(e!==iL.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&aL.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Bte(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===cL.Attribute&&(i===0||Rte(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&aL.VALUE_LENGTH)>>14,i!==0){if(a===iL.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==cL.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]&aL.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]&~aL.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case sL.NamedEntity:return this.result!==0&&(this.decodeMode!==cL.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case sL.NumericDecimal:return this.emitNumericEntity(0,2);case sL.NumericHex:return this.emitNumericEntity(0,3);case sL.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case sL.EntityStart:return 0}}};function Bte(e,t,n,r){let i=(t&aL.BRANCH_LENGTH)>>7,a=t&aL.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 Y;(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/`})(Y||={});var lL;(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`})(lL||={});var uL;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(uL||={});var X;(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`})(X||={});var Z;(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`})(Z||={});var Vte=new Map([[X.A,Z.A],[X.ADDRESS,Z.ADDRESS],[X.ANNOTATION_XML,Z.ANNOTATION_XML],[X.APPLET,Z.APPLET],[X.AREA,Z.AREA],[X.ARTICLE,Z.ARTICLE],[X.ASIDE,Z.ASIDE],[X.B,Z.B],[X.BASE,Z.BASE],[X.BASEFONT,Z.BASEFONT],[X.BGSOUND,Z.BGSOUND],[X.BIG,Z.BIG],[X.BLOCKQUOTE,Z.BLOCKQUOTE],[X.BODY,Z.BODY],[X.BR,Z.BR],[X.BUTTON,Z.BUTTON],[X.CAPTION,Z.CAPTION],[X.CENTER,Z.CENTER],[X.CODE,Z.CODE],[X.COL,Z.COL],[X.COLGROUP,Z.COLGROUP],[X.DD,Z.DD],[X.DESC,Z.DESC],[X.DETAILS,Z.DETAILS],[X.DIALOG,Z.DIALOG],[X.DIR,Z.DIR],[X.DIV,Z.DIV],[X.DL,Z.DL],[X.DT,Z.DT],[X.EM,Z.EM],[X.EMBED,Z.EMBED],[X.FIELDSET,Z.FIELDSET],[X.FIGCAPTION,Z.FIGCAPTION],[X.FIGURE,Z.FIGURE],[X.FONT,Z.FONT],[X.FOOTER,Z.FOOTER],[X.FOREIGN_OBJECT,Z.FOREIGN_OBJECT],[X.FORM,Z.FORM],[X.FRAME,Z.FRAME],[X.FRAMESET,Z.FRAMESET],[X.H1,Z.H1],[X.H2,Z.H2],[X.H3,Z.H3],[X.H4,Z.H4],[X.H5,Z.H5],[X.H6,Z.H6],[X.HEAD,Z.HEAD],[X.HEADER,Z.HEADER],[X.HGROUP,Z.HGROUP],[X.HR,Z.HR],[X.HTML,Z.HTML],[X.I,Z.I],[X.IMG,Z.IMG],[X.IMAGE,Z.IMAGE],[X.INPUT,Z.INPUT],[X.IFRAME,Z.IFRAME],[X.KEYGEN,Z.KEYGEN],[X.LABEL,Z.LABEL],[X.LI,Z.LI],[X.LINK,Z.LINK],[X.LISTING,Z.LISTING],[X.MAIN,Z.MAIN],[X.MALIGNMARK,Z.MALIGNMARK],[X.MARQUEE,Z.MARQUEE],[X.MATH,Z.MATH],[X.MENU,Z.MENU],[X.META,Z.META],[X.MGLYPH,Z.MGLYPH],[X.MI,Z.MI],[X.MO,Z.MO],[X.MN,Z.MN],[X.MS,Z.MS],[X.MTEXT,Z.MTEXT],[X.NAV,Z.NAV],[X.NOBR,Z.NOBR],[X.NOFRAMES,Z.NOFRAMES],[X.NOEMBED,Z.NOEMBED],[X.NOSCRIPT,Z.NOSCRIPT],[X.OBJECT,Z.OBJECT],[X.OL,Z.OL],[X.OPTGROUP,Z.OPTGROUP],[X.OPTION,Z.OPTION],[X.P,Z.P],[X.PARAM,Z.PARAM],[X.PLAINTEXT,Z.PLAINTEXT],[X.PRE,Z.PRE],[X.RB,Z.RB],[X.RP,Z.RP],[X.RT,Z.RT],[X.RTC,Z.RTC],[X.RUBY,Z.RUBY],[X.S,Z.S],[X.SCRIPT,Z.SCRIPT],[X.SEARCH,Z.SEARCH],[X.SECTION,Z.SECTION],[X.SELECT,Z.SELECT],[X.SOURCE,Z.SOURCE],[X.SMALL,Z.SMALL],[X.SPAN,Z.SPAN],[X.STRIKE,Z.STRIKE],[X.STRONG,Z.STRONG],[X.STYLE,Z.STYLE],[X.SUB,Z.SUB],[X.SUMMARY,Z.SUMMARY],[X.SUP,Z.SUP],[X.TABLE,Z.TABLE],[X.TBODY,Z.TBODY],[X.TEMPLATE,Z.TEMPLATE],[X.TEXTAREA,Z.TEXTAREA],[X.TFOOT,Z.TFOOT],[X.TD,Z.TD],[X.TH,Z.TH],[X.THEAD,Z.THEAD],[X.TITLE,Z.TITLE],[X.TR,Z.TR],[X.TRACK,Z.TRACK],[X.TT,Z.TT],[X.U,Z.U],[X.UL,Z.UL],[X.SVG,Z.SVG],[X.VAR,Z.VAR],[X.WBR,Z.WBR],[X.XMP,Z.XMP]]);function dL(e){return Vte.get(e)??Z.UNKNOWN}var fL=Z,Hte={[Y.HTML]:new Set([fL.ADDRESS,fL.APPLET,fL.AREA,fL.ARTICLE,fL.ASIDE,fL.BASE,fL.BASEFONT,fL.BGSOUND,fL.BLOCKQUOTE,fL.BODY,fL.BR,fL.BUTTON,fL.CAPTION,fL.CENTER,fL.COL,fL.COLGROUP,fL.DD,fL.DETAILS,fL.DIR,fL.DIV,fL.DL,fL.DT,fL.EMBED,fL.FIELDSET,fL.FIGCAPTION,fL.FIGURE,fL.FOOTER,fL.FORM,fL.FRAME,fL.FRAMESET,fL.H1,fL.H2,fL.H3,fL.H4,fL.H5,fL.H6,fL.HEAD,fL.HEADER,fL.HGROUP,fL.HR,fL.HTML,fL.IFRAME,fL.IMG,fL.INPUT,fL.LI,fL.LINK,fL.LISTING,fL.MAIN,fL.MARQUEE,fL.MENU,fL.META,fL.NAV,fL.NOEMBED,fL.NOFRAMES,fL.NOSCRIPT,fL.OBJECT,fL.OL,fL.P,fL.PARAM,fL.PLAINTEXT,fL.PRE,fL.SCRIPT,fL.SECTION,fL.SELECT,fL.SOURCE,fL.STYLE,fL.SUMMARY,fL.TABLE,fL.TBODY,fL.TD,fL.TEMPLATE,fL.TEXTAREA,fL.TFOOT,fL.TH,fL.THEAD,fL.TITLE,fL.TR,fL.TRACK,fL.UL,fL.WBR,fL.XMP]),[Y.MATHML]:new Set([fL.MI,fL.MO,fL.MN,fL.MS,fL.MTEXT,fL.ANNOTATION_XML]),[Y.SVG]:new Set([fL.TITLE,fL.FOREIGN_OBJECT,fL.DESC]),[Y.XLINK]:new Set,[Y.XML]:new Set,[Y.XMLNS]:new Set},pL=new Set([fL.H1,fL.H2,fL.H3,fL.H4,fL.H5,fL.H6]);X.STYLE,X.SCRIPT,X.XMP,X.IFRAME,X.NOEMBED,X.NOFRAMES,X.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 mL={DATA:Q.DATA,RCDATA:Q.RCDATA,RAWTEXT:Q.RAWTEXT,SCRIPT_DATA:Q.SCRIPT_DATA,PLAINTEXT:Q.PLAINTEXT,CDATA_SECTION:Q.CDATA_SECTION};function Ute(e){return e>=q.DIGIT_0&&e<=q.DIGIT_9}function hL(e){return e>=q.LATIN_CAPITAL_A&&e<=q.LATIN_CAPITAL_Z}function Wte(e){return e>=q.LATIN_SMALL_A&&e<=q.LATIN_SMALL_Z}function gL(e){return Wte(e)||hL(e)}function _L(e){return gL(e)||Ute(e)}function vL(e){return e+32}function yL(e){return e===q.SPACE||e===q.LINE_FEED||e===q.TABULATION||e===q.FORM_FEED}function bL(e){return yL(e)||e===q.SOLIDUS||e===q.GREATER_THAN_SIGN}function Gte(e){return e===q.NULL?J.nullCharacterReference:e>1114111?J.characterReferenceOutsideUnicodeRange:$I(e)?J.surrogateCharacterReference:tL(e)?J.noncharacterCharacterReference:eL(e)||e===q.CARRIAGE_RETURN?J.controlCharacterReference:null}var Kte=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 jte(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new zte(Mte,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(J.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(J.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=Gte(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:nL.START_TAG,tagName:``,tagID:Z.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:nL.END_TAG,tagName:``,tagID:Z.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:nL.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:nL.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(rL(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(J.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=dL(e.tagName),e.type===nL.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(J.endTagWithAttributes),e.selfClosing&&this._err(J.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 nL.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case nL.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case nL.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:nL.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=yL(e)?nL.WHITESPACE_CHARACTER:e===q.NULL?nL.NULL_CHARACTER:nL.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(nL.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?cL.Attribute:cL.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 q.LESS_THAN_SIGN:this.state=Q.TAG_OPEN;break;case q.AMPERSAND:this._startCharacterReference();break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitCodePoint(e);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case q.AMPERSAND:this._startCharacterReference();break;case q.LESS_THAN_SIGN:this.state=Q.RCDATA_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case q.LESS_THAN_SIGN:this.state=Q.RAWTEXT_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(gL(e))this._createStartTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case q.EXCLAMATION_MARK:this.state=Q.MARKUP_DECLARATION_OPEN;break;case q.SOLIDUS:this.state=Q.END_TAG_OPEN;break;case q.QUESTION_MARK:this._err(J.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e);break;case q.EOF:this._err(J.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(J.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=Q.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(gL(e))this._createEndTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case q.GREATER_THAN_SIGN:this._err(J.missingEndTagName),this.state=Q.DATA;break;case q.EOF:this._err(J.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(J.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case q.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case q.NULL:this._err(J.unexpectedNullCharacter),t.tagName+=`�`;break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(hL(e)?vL(e):e)}}_stateRcdataLessThanSign(e){e===q.SOLIDUS?this.state=Q.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){gL(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 q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Q.BEFORE_ATTRIBUTE_NAME,!1;case q.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Q.SELF_CLOSING_START_TAG,!1;case q.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===q.SOLIDUS?this.state=Q.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){gL(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 q.SOLIDUS:this.state=Q.SCRIPT_DATA_END_TAG_OPEN;break;case q.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){gL(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===q.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===q.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 q.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case q.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case q.HYPHEN_MINUS:this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case q.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case q.NULL:this._err(J.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===q.SOLIDUS?this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gL(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){gL(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(QI.SCRIPT,!1)&&bL(this.preprocessor.peek(QI.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<QI.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 q.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case q.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case q.NULL:this._err(J.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case q.HYPHEN_MINUS:this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case q.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case q.NULL:this._err(J.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===q.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(QI.SCRIPT,!1)&&bL(this.preprocessor.peek(QI.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<QI.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 q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.SOLIDUS:case q.GREATER_THAN_SIGN:case q.EOF:this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case q.EQUALS_SIGN:this._err(J.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 q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:case q.SOLIDUS:case q.GREATER_THAN_SIGN:case q.EOF:this._leaveAttrName(),this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case q.EQUALS_SIGN:this._leaveAttrName(),this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case q.QUOTATION_MARK:case q.APOSTROPHE:case q.LESS_THAN_SIGN:this._err(J.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case q.NULL:this._err(J.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(hL(e)?vL(e):e)}}_stateAfterAttributeName(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case q.EQUALS_SIGN:this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.QUOTATION_MARK:this.state=Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case q.APOSTROPHE:this.state=Q.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingAttributeValue),this.state=Q.DATA,this.emitCurrentTagToken();break;default:this.state=Q.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case q.QUOTATION_MARK:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case q.AMPERSAND:this._startCharacterReference();break;case q.NULL:this._err(J.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case q.APOSTROPHE:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case q.AMPERSAND:this._startCharacterReference();break;case q.NULL:this._err(J.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case q.AMPERSAND:this._startCharacterReference();break;case q.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case q.NULL:this._err(J.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case q.QUOTATION_MARK:case q.APOSTROPHE:case q.LESS_THAN_SIGN:case q.EQUALS_SIGN:case q.GRAVE_ACCENT:this._err(J.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case q.SOLIDUS:this._leaveAttrValue(),this.state=Q.SELF_CLOSING_START_TAG;break;case q.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this._err(J.missingWhitespaceBetweenAttributes),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case q.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=Q.DATA,this.emitCurrentTagToken();break}case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this._err(J.unexpectedSolidusInTag),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case q.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case q.NULL:this._err(J.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(QI.DASH_DASH,!0)?(this._createCommentToken(QI.DASH_DASH.length+1),this.state=Q.COMMENT_START):this._consumeSequenceIfMatch(QI.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(QI.DOCTYPE.length+1),this.state=Q.DOCTYPE):this._consumeSequenceIfMatch(QI.CDATA_START,!0)?this.inForeignNode?this.state=Q.CDATA_SECTION:(this._err(J.cdataInHtmlContent),this._createCommentToken(QI.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=Q.BOGUS_COMMENT):this._ensureHibernation()||(this._err(J.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case q.HYPHEN_MINUS:this.state=Q.COMMENT_START_DASH;break;case q.GREATER_THAN_SIGN:{this._err(J.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 q.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case q.GREATER_THAN_SIGN:this._err(J.abruptClosingOfEmptyComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case q.EOF:this._err(J.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 q.HYPHEN_MINUS:this.state=Q.COMMENT_END_DASH;break;case q.LESS_THAN_SIGN:t.data+=`<`,this.state=Q.COMMENT_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.data+=`�`;break;case q.EOF:this._err(J.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case q.EXCLAMATION_MARK:t.data+=`!`,this.state=Q.COMMENT_LESS_THAN_SIGN_BANG;break;case q.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===q.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Q.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===q.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Q.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==q.GREATER_THAN_SIGN&&e!==q.EOF&&this._err(J.nestedComment),this.state=Q.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case q.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case q.EOF:this._err(J.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 q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case q.EXCLAMATION_MARK:this.state=Q.COMMENT_END_BANG;break;case q.HYPHEN_MINUS:t.data+=`-`;break;case q.EOF:this._err(J.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 q.HYPHEN_MINUS:t.data+=`--!`,this.state=Q.COMMENT_END_DASH;break;case q.GREATER_THAN_SIGN:this._err(J.incorrectlyClosedComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case q.EOF:this._err(J.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=Q.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_NAME;break;case q.GREATER_THAN_SIGN:this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case q.EOF:{this._err(J.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(J.missingWhitespaceBeforeDoctypeName),this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(hL(e))this._createDoctypeToken(String.fromCharCode(vL(e))),this.state=Q.DOCTYPE_NAME;else switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.NULL:this._err(J.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=Q.DOCTYPE_NAME;break;case q.GREATER_THAN_SIGN:{this._err(J.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Q.DATA;break}case q.EOF:{this._err(J.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 q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.AFTER_DOCTYPE_NAME;break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.NULL:this._err(J.unexpectedNullCharacter),t.name+=`�`;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(hL(e)?vL(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(QI.PUBLIC,!1)?this.state=Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(QI.SYSTEM,!1)?this.state=Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(J.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case q.QUOTATION_MARK:this._err(J.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:this._err(J.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.QUOTATION_MARK:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case q.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.publicId+=`�`;break;case q.GREATER_THAN_SIGN:this._err(J.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.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 q.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.publicId+=`�`;break;case q.GREATER_THAN_SIGN:this._err(J.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.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 q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.QUOTATION_MARK:this._err(J.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:this._err(J.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case q.QUOTATION_MARK:this._err(J.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:this._err(J.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case q.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.systemId+=`�`;break;case q.GREATER_THAN_SIGN:this._err(J.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.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 q.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.systemId+=`�`;break;case q.GREATER_THAN_SIGN:this._err(J.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.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 q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case q.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.NULL:this._err(J.unexpectedNullCharacter);break;case q.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case q.RIGHT_SQUARE_BRACKET:this.state=Q.CDATA_SECTION_BRACKET;break;case q.EOF:this._err(J.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===q.RIGHT_SQUARE_BRACKET?this.state=Q.CDATA_SECTION_END:(this._emitChars(`]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case q.GREATER_THAN_SIGN:this.state=Q.DATA;break;case q.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(q.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&_L(this.preprocessor.peek(1))?Q.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){_L(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===q.SEMICOLON&&this._err(J.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},xL=new Set([Z.DD,Z.DT,Z.LI,Z.OPTGROUP,Z.OPTION,Z.P,Z.RB,Z.RP,Z.RT,Z.RTC]),SL=new Set([...xL,Z.CAPTION,Z.COLGROUP,Z.TBODY,Z.TD,Z.TFOOT,Z.TH,Z.THEAD,Z.TR]),CL=new Set([Z.APPLET,Z.CAPTION,Z.HTML,Z.MARQUEE,Z.OBJECT,Z.TABLE,Z.TD,Z.TEMPLATE,Z.TH]),qte=new Set([...CL,Z.OL,Z.UL]),Jte=new Set([...CL,Z.BUTTON]),wL=new Set([Z.ANNOTATION_XML,Z.MI,Z.MN,Z.MO,Z.MS,Z.MTEXT]),TL=new Set([Z.DESC,Z.FOREIGN_OBJECT,Z.TITLE]),Yte=new Set([Z.TR,Z.TEMPLATE,Z.HTML]),Xte=new Set([Z.TBODY,Z.TFOOT,Z.THEAD,Z.TEMPLATE,Z.HTML]),Zte=new Set([Z.TABLE,Z.TEMPLATE,Z.HTML]),Qte=new Set([Z.TD,Z.TH]),$te=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=Z.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===Z.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Y.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])!==Y.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(pL,Y.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Qte,Y.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(Zte,Y.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Xte,Y.HTML)}clearBackToTableRowContext(){this.clearBackTo(Yte,Y.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]===Z.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]===Z.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 Y.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case Y.SVG:if(TL.has(r))return!1;break;case Y.MATHML:if(wL.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,CL)}hasInListItemScope(e){return this.hasInDynamicScope(e,qte)}hasInButtonScope(e){return this.hasInDynamicScope(e,Jte)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case Y.HTML:if(pL.has(t))return!0;if(CL.has(t))return!1;break;case Y.SVG:if(TL.has(t))return!1;break;case Y.MATHML:if(wL.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Y.HTML)switch(this.tagIDs[t]){case e:return!0;case Z.TABLE:case Z.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===Y.HTML)switch(this.tagIDs[e]){case Z.TBODY:case Z.THEAD:case Z.TFOOT:return!0;case Z.TABLE:case Z.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Y.HTML)switch(this.tagIDs[t]){case e:return!0;case Z.OPTION:case Z.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&xL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&SL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&SL.has(this.currentTagId);)this.pop()}},EL=3,DL;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(DL||={});var OL={type:DL.Marker},ene=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===DL.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<EL)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<EL)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>=EL&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(OL)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:DL.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:DL.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(OL);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===DL.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===DL.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===DL.Element&&t.element===e)}},kL={createDocument(){return{nodeName:`#document`,mode:uL.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};kL.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(kL.isTextNode(n)){n.value+=t;return}}kL.appendChild(e,kL.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&kL.isTextNode(r)?r.value+=t:kL.insertBefore(e,kL.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}}},AL=`html`,tne=`about:legacy-compat`,nne=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,jL=`+//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(`,`),rne=[...jL,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],ine=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),ML=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],ane=[...ML,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function NL(e,t){return t.some(t=>e.startsWith(t))}function one(e){return e.name===AL&&e.publicId===null&&(e.systemId===null||e.systemId===tne)}function sne(e){if(e.name!==AL)return uL.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===nne)return uL.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),ine.has(n))return uL.QUIRKS;let e=t===null?rne:jL;if(NL(n,e))return uL.QUIRKS;if(e=t===null?ML:ane,NL(n,e))return uL.LIMITED_QUIRKS}return uL.NO_QUIRKS}var PL={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},cne=`definitionurl`,lne=`definitionURL`,une=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])),dne=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:Y.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:Y.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:Y.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:Y.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:Y.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:Y.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:Y.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:Y.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:Y.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:Y.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:Y.XMLNS}]]),fne=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])),pne=new Set([Z.B,Z.BIG,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.CENTER,Z.CODE,Z.DD,Z.DIV,Z.DL,Z.DT,Z.EM,Z.EMBED,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HR,Z.I,Z.IMG,Z.LI,Z.LISTING,Z.MENU,Z.META,Z.NOBR,Z.OL,Z.P,Z.PRE,Z.RUBY,Z.S,Z.SMALL,Z.SPAN,Z.STRONG,Z.STRIKE,Z.SUB,Z.SUP,Z.TABLE,Z.TT,Z.U,Z.UL,Z.VAR]);function mne(e){let t=e.tagID;return t===Z.FONT&&e.attrs.some(({name:e})=>e===lL.COLOR||e===lL.SIZE||e===lL.FACE)||pne.has(t)}function FL(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===cne){e.attrs[t].name=lne;break}}function IL(e){for(let t=0;t<e.attrs.length;t++){let n=une.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function LL(e){for(let t=0;t<e.attrs.length;t++){let n=dne.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 hne(e){let t=fne.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=dL(e.tagName))}function gne(e,t){return t===Y.MATHML&&(e===Z.MI||e===Z.MO||e===Z.MN||e===Z.MS||e===Z.MTEXT)}function _ne(e,t,n){if(t===Y.MATHML&&e===Z.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===lL.ENCODING){let t=n[e].value.toLowerCase();return t===PL.TEXT_HTML||t===PL.APPLICATION_XML}}return t===Y.SVG&&(e===Z.FOREIGN_OBJECT||e===Z.DESC||e===Z.TITLE)}function vne(e,t,n,r){return(!r||r===Y.HTML)&&_ne(e,t,n)||(!r||r===Y.MATHML)&&gne(e,t)}var yne=`hidden`,bne=8,xne=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 Sne={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},RL=new Set([Z.TABLE,Z.TBODY,Z.TFOOT,Z.THEAD,Z.TR]),zL={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:kL,onParseError:null},BL=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={...zL,...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 Kte(this.options,this),this.activeFormattingElements=new ene(this.treeAdapter),this.fragmentContextID=n?dL(this.treeAdapter.getTagName(n)):Z.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new $te(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={...zL,...t};e??=n.treeAdapter.createElement(X.TEMPLATE,Y.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,Y.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===Z.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??Sne,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)===Y.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,Y.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=$.TEXT}switchToPlaintextParsing(){this.insertionMode=$.TEXT,this.originalInsertionMode=$.IN_BODY,this.tokenizer.state=mL.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)===X.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===Y.HTML)switch(this.fragmentContextID){case Z.TITLE:case Z.TEXTAREA:this.tokenizer.state=mL.RCDATA;break;case Z.STYLE:case Z.XMP:case Z.IFRAME:case Z.NOEMBED:case Z.NOFRAMES:case Z.NOSCRIPT:this.tokenizer.state=mL.RAWTEXT;break;case Z.SCRIPT:this.tokenizer.state=mL.SCRIPT_DATA;break;case Z.PLAINTEXT:this.tokenizer.state=mL.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,Y.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,Y.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(X.HTML,Y.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,Z.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===nL.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===Z.SVG&&this.treeAdapter.getTagName(t)===X.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===Y.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===Z.MGLYPH||e.tagID===Z.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,Y.HTML)}_processToken(e){switch(e.type){case nL.CHARACTER:this.onCharacter(e);break;case nL.NULL_CHARACTER:this.onNullCharacter(e);break;case nL.COMMENT:this.onComment(e);break;case nL.DOCTYPE:this.onDoctype(e);break;case nL.START_TAG:this._processStartTag(e);break;case nL.END_TAG:this.onEndTag(e);break;case nL.EOF:this.onEof(e);break;case nL.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return vne(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===DL.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(Z.P),this.openElements.popUntilTagNamePopped(Z.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case Z.TR:this.insertionMode=$.IN_ROW;return;case Z.TBODY:case Z.THEAD:case Z.TFOOT:this.insertionMode=$.IN_TABLE_BODY;return;case Z.CAPTION:this.insertionMode=$.IN_CAPTION;return;case Z.COLGROUP:this.insertionMode=$.IN_COLUMN_GROUP;return;case Z.TABLE:this.insertionMode=$.IN_TABLE;return;case Z.BODY:this.insertionMode=$.IN_BODY;return;case Z.FRAMESET:this.insertionMode=$.IN_FRAMESET;return;case Z.SELECT:this._resetInsertionModeForSelect(e);return;case Z.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case Z.HTML:this.insertionMode=this.headElement?$.AFTER_HEAD:$.BEFORE_HEAD;return;case Z.TD:case Z.TH:if(e>0){this.insertionMode=$.IN_CELL;return}break;case Z.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===Z.TEMPLATE)break;if(e===Z.TABLE){this.insertionMode=$.IN_SELECT_IN_TABLE;return}}this.insertionMode=$.IN_SELECT}_isElementCausesFosterParenting(e){return RL.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 Z.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===Y.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case Z.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 Hte[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){ez(this,e);return}switch(this.insertionMode){case $.INITIAL:WL(this,e);break;case $.BEFORE_HTML:GL(this,e);break;case $.BEFORE_HEAD:KL(this,e);break;case $.IN_HEAD:YL(this,e);break;case $.IN_HEAD_NO_SCRIPT:XL(this,e);break;case $.AFTER_HEAD:ZL(this,e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:eR(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:lR(this,e);break;case $.IN_TABLE_TEXT:SR(this,e);break;case $.IN_COLUMN_GROUP:kR(this,e);break;case $.AFTER_BODY:GR(this,e);break;case $.AFTER_AFTER_BODY:ZR(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){$R(this,e);return}switch(this.insertionMode){case $.INITIAL:WL(this,e);break;case $.BEFORE_HTML:GL(this,e);break;case $.BEFORE_HEAD:KL(this,e);break;case $.IN_HEAD:YL(this,e);break;case $.IN_HEAD_NO_SCRIPT:XL(this,e);break;case $.AFTER_HEAD:ZL(this,e);break;case $.TEXT:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:lR(this,e);break;case $.IN_COLUMN_GROUP:kR(this,e);break;case $.AFTER_BODY:GR(this,e);break;case $.AFTER_AFTER_BODY:ZR(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){HL(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:HL(this,e);break;case $.IN_TABLE_TEXT:CR(this,e);break;case $.AFTER_BODY:kne(this,e);break;case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:Ane(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case $.INITIAL:jne(this,e);break;case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:this._err(e,J.misplacedDoctype);break;case $.IN_TABLE_TEXT:CR(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,J.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?nz(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:WL(this,e);break;case $.BEFORE_HTML:Mne(this,e);break;case $.BEFORE_HEAD:Pne(this,e);break;case $.IN_HEAD:qL(this,e);break;case $.IN_HEAD_NO_SCRIPT:Lne(this,e);break;case $.AFTER_HEAD:zne(this,e);break;case $.IN_BODY:aR(this,e);break;case $.IN_TABLE:vR(this,e);break;case $.IN_TABLE_TEXT:CR(this,e);break;case $.IN_CAPTION:TR(this,e);break;case $.IN_COLUMN_GROUP:DR(this,e);break;case $.IN_TABLE_BODY:AR(this,e);break;case $.IN_ROW:MR(this,e);break;case $.IN_CELL:PR(this,e);break;case $.IN_SELECT:IR(this,e);break;case $.IN_SELECT_IN_TABLE:RR(this,e);break;case $.IN_TEMPLATE:BR(this,e);break;case $.AFTER_BODY:UR(this,e);break;case $.IN_FRAMESET:KR(this,e);break;case $.AFTER_FRAMESET:JR(this,e);break;case $.AFTER_AFTER_BODY:XR(this,e);break;case $.AFTER_AFTER_FRAMESET:QR(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?rz(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:WL(this,e);break;case $.BEFORE_HTML:Nne(this,e);break;case $.BEFORE_HEAD:Fne(this,e);break;case $.IN_HEAD:Ine(this,e);break;case $.IN_HEAD_NO_SCRIPT:Rne(this,e);break;case $.AFTER_HEAD:Bne(this,e);break;case $.IN_BODY:sR(this,e);break;case $.TEXT:Tre(this,e);break;case $.IN_TABLE:yR(this,e);break;case $.IN_TABLE_TEXT:CR(this,e);break;case $.IN_CAPTION:ER(this,e);break;case $.IN_COLUMN_GROUP:OR(this,e);break;case $.IN_TABLE_BODY:jR(this,e);break;case $.IN_ROW:NR(this,e);break;case $.IN_CELL:FR(this,e);break;case $.IN_SELECT:LR(this,e);break;case $.IN_SELECT_IN_TABLE:zR(this,e);break;case $.IN_TEMPLATE:VR(this,e);break;case $.AFTER_BODY:WR(this,e);break;case $.IN_FRAMESET:qR(this,e);break;case $.AFTER_FRAMESET:YR(this,e);break;case $.AFTER_AFTER_BODY:ZR(this,e)}}onEof(e){switch(this.insertionMode){case $.INITIAL:WL(this,e);break;case $.BEFORE_HTML:GL(this,e);break;case $.BEFORE_HEAD:KL(this,e);break;case $.IN_HEAD:YL(this,e);break;case $.IN_HEAD_NO_SCRIPT:XL(this,e);break;case $.AFTER_HEAD:ZL(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:cR(this,e);break;case $.TEXT:Ere(this,e);break;case $.IN_TABLE_TEXT:CR(this,e);break;case $.IN_TEMPLATE:HR(this,e);break;case $.AFTER_BODY:case $.IN_FRAMESET:case $.AFTER_FRAMESET:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:UL(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===q.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:$L(this,e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:lR(this,e);break;case $.IN_TABLE_TEXT:xR(this,e)}}};function Cne(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):oR(e,t),n}function wne(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 Tne(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>=xne;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Ene(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Ene(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 Dne(e,t,n){let r=dL(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===Z.TEMPLATE&&i===Y.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function One(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 VL(e,t){for(let n=0;n<bne;n++){let n=Cne(e,t);if(!n)break;let r=wne(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=Tne(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&Dne(e,a,i),One(e,r,n)}}function HL(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function kne(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Ane(e,t){e._appendCommentNode(t,e.document)}function UL(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 jne(e,t){e._setDocumentType(t);let n=t.forceQuirks?uL.QUIRKS:sne(t);one(t)||e._err(t,J.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=$.BEFORE_HTML}function WL(e,t){e._err(t,J.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,uL.QUIRKS),e.insertionMode=$.BEFORE_HTML,e._processToken(t)}function Mne(e,t){t.tagID===Z.HTML?(e._insertElement(t,Y.HTML),e.insertionMode=$.BEFORE_HEAD):GL(e,t)}function Nne(e,t){let n=t.tagID;(n===Z.HTML||n===Z.HEAD||n===Z.BODY||n===Z.BR)&&GL(e,t)}function GL(e,t){e._insertFakeRootElement(),e.insertionMode=$.BEFORE_HEAD,e._processToken(t)}function Pne(e,t){switch(t.tagID){case Z.HTML:aR(e,t);break;case Z.HEAD:e._insertElement(t,Y.HTML),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD;break;default:KL(e,t)}}function Fne(e,t){let n=t.tagID;n===Z.HEAD||n===Z.BODY||n===Z.HTML||n===Z.BR?KL(e,t):e._err(t,J.endTagWithoutMatchingOpenElement)}function KL(e,t){e._insertFakeElement(X.HEAD,Z.HEAD),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD,e._processToken(t)}function qL(e,t){switch(t.tagID){case Z.HTML:aR(e,t);break;case Z.BASE:case Z.BASEFONT:case Z.BGSOUND:case Z.LINK:case Z.META:e._appendElement(t,Y.HTML),t.ackSelfClosing=!0;break;case Z.TITLE:e._switchToTextParsing(t,mL.RCDATA);break;case Z.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,mL.RAWTEXT):(e._insertElement(t,Y.HTML),e.insertionMode=$.IN_HEAD_NO_SCRIPT);break;case Z.NOFRAMES:case Z.STYLE:e._switchToTextParsing(t,mL.RAWTEXT);break;case Z.SCRIPT:e._switchToTextParsing(t,mL.SCRIPT_DATA);break;case Z.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=$.IN_TEMPLATE,e.tmplInsertionModeStack.unshift($.IN_TEMPLATE);break;case Z.HEAD:e._err(t,J.misplacedStartTagForHeadElement);break;default:YL(e,t)}}function Ine(e,t){switch(t.tagID){case Z.HEAD:e.openElements.pop(),e.insertionMode=$.AFTER_HEAD;break;case Z.BODY:case Z.BR:case Z.HTML:YL(e,t);break;case Z.TEMPLATE:JL(e,t);break;default:e._err(t,J.endTagWithoutMatchingOpenElement)}}function JL(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==Z.TEMPLATE&&e._err(t,J.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(Z.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,J.endTagWithoutMatchingOpenElement)}function YL(e,t){e.openElements.pop(),e.insertionMode=$.AFTER_HEAD,e._processToken(t)}function Lne(e,t){switch(t.tagID){case Z.HTML:aR(e,t);break;case Z.BASEFONT:case Z.BGSOUND:case Z.HEAD:case Z.LINK:case Z.META:case Z.NOFRAMES:case Z.STYLE:qL(e,t);break;case Z.NOSCRIPT:e._err(t,J.nestedNoscriptInHead);break;default:XL(e,t)}}function Rne(e,t){switch(t.tagID){case Z.NOSCRIPT:e.openElements.pop(),e.insertionMode=$.IN_HEAD;break;case Z.BR:XL(e,t);break;default:e._err(t,J.endTagWithoutMatchingOpenElement)}}function XL(e,t){let n=t.type===nL.EOF?J.openElementsLeftAfterEof:J.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=$.IN_HEAD,e._processToken(t)}function zne(e,t){switch(t.tagID){case Z.HTML:aR(e,t);break;case Z.BODY:e._insertElement(t,Y.HTML),e.framesetOk=!1,e.insertionMode=$.IN_BODY;break;case Z.FRAMESET:e._insertElement(t,Y.HTML),e.insertionMode=$.IN_FRAMESET;break;case Z.BASE:case Z.BASEFONT:case Z.BGSOUND:case Z.LINK:case Z.META:case Z.NOFRAMES:case Z.SCRIPT:case Z.STYLE:case Z.TEMPLATE:case Z.TITLE:e._err(t,J.abandonedHeadElementChild),e.openElements.push(e.headElement,Z.HEAD),qL(e,t),e.openElements.remove(e.headElement);break;case Z.HEAD:e._err(t,J.misplacedStartTagForHeadElement);break;default:ZL(e,t)}}function Bne(e,t){switch(t.tagID){case Z.BODY:case Z.HTML:case Z.BR:ZL(e,t);break;case Z.TEMPLATE:JL(e,t);break;default:e._err(t,J.endTagWithoutMatchingOpenElement)}}function ZL(e,t){e._insertFakeElement(X.BODY,Z.BODY),e.insertionMode=$.IN_BODY,QL(e,t)}function QL(e,t){switch(t.type){case nL.CHARACTER:eR(e,t);break;case nL.WHITESPACE_CHARACTER:$L(e,t);break;case nL.COMMENT:HL(e,t);break;case nL.START_TAG:aR(e,t);break;case nL.END_TAG:sR(e,t);break;case nL.EOF:cR(e,t)}}function $L(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function eR(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Vne(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Hne(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Une(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_FRAMESET)}function Wne(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML)}function Gne(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&pL.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Y.HTML)}function Kne(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function qne(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML),n||(e.formElement=e.openElements.current))}function Jne(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===Z.LI&&r===Z.LI||(n===Z.DD||n===Z.DT)&&(r===Z.DD||r===Z.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==Z.ADDRESS&&r!==Z.DIV&&r!==Z.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML)}function Yne(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML),e.tokenizer.state=mL.PLAINTEXT}function Xne(e,t){e.openElements.hasInScope(Z.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Z.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML),e.framesetOk=!1}function Zne(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(X.A);n&&(VL(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Qne(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function $ne(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(Z.NOBR)&&(VL(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Y.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function ere(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function tre(e,t){e.treeAdapter.getDocumentMode(e.document)!==uL.QUIRKS&&e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML),e.framesetOk=!1,e.insertionMode=$.IN_TABLE}function tR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Y.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function nR(e){let t=rL(e,lL.TYPE);return t!=null&&t.toLowerCase()===yne}function nre(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Y.HTML),nR(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function rre(e,t){e._appendElement(t,Y.HTML),t.ackSelfClosing=!0}function ire(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._appendElement(t,Y.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function are(e,t){t.tagName=X.IMG,t.tagID=Z.IMG,tR(e,t)}function ore(e,t){e._insertElement(t,Y.HTML),e.skipNextNewLine=!0,e.tokenizer.state=mL.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=$.TEXT}function sre(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,mL.RAWTEXT)}function cre(e,t){e.framesetOk=!1,e._switchToTextParsing(t,mL.RAWTEXT)}function rR(e,t){e._switchToTextParsing(t,mL.RAWTEXT)}function lre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Y.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 ure(e,t){e.openElements.currentTagId===Z.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML)}function dre(e,t){e.openElements.hasInScope(Z.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Y.HTML)}function fre(e,t){e.openElements.hasInScope(Z.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(Z.RTC),e._insertElement(t,Y.HTML)}function pre(e,t){e._reconstructActiveFormattingElements(),FL(t),LL(t),t.selfClosing?e._appendElement(t,Y.MATHML):e._insertElement(t,Y.MATHML),t.ackSelfClosing=!0}function mre(e,t){e._reconstructActiveFormattingElements(),IL(t),LL(t),t.selfClosing?e._appendElement(t,Y.SVG):e._insertElement(t,Y.SVG),t.ackSelfClosing=!0}function iR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML)}function aR(e,t){switch(t.tagID){case Z.I:case Z.S:case Z.B:case Z.U:case Z.EM:case Z.TT:case Z.BIG:case Z.CODE:case Z.FONT:case Z.SMALL:case Z.STRIKE:case Z.STRONG:Qne(e,t);break;case Z.A:Zne(e,t);break;case Z.H1:case Z.H2:case Z.H3:case Z.H4:case Z.H5:case Z.H6:Gne(e,t);break;case Z.P:case Z.DL:case Z.OL:case Z.UL:case Z.DIV:case Z.DIR:case Z.NAV:case Z.MAIN:case Z.MENU:case Z.ASIDE:case Z.CENTER:case Z.FIGURE:case Z.FOOTER:case Z.HEADER:case Z.HGROUP:case Z.DIALOG:case Z.DETAILS:case Z.ADDRESS:case Z.ARTICLE:case Z.SEARCH:case Z.SECTION:case Z.SUMMARY:case Z.FIELDSET:case Z.BLOCKQUOTE:case Z.FIGCAPTION:Wne(e,t);break;case Z.LI:case Z.DD:case Z.DT:Jne(e,t);break;case Z.BR:case Z.IMG:case Z.WBR:case Z.AREA:case Z.EMBED:case Z.KEYGEN:tR(e,t);break;case Z.HR:ire(e,t);break;case Z.RB:case Z.RTC:dre(e,t);break;case Z.RT:case Z.RP:fre(e,t);break;case Z.PRE:case Z.LISTING:Kne(e,t);break;case Z.XMP:sre(e,t);break;case Z.SVG:mre(e,t);break;case Z.HTML:Vne(e,t);break;case Z.BASE:case Z.LINK:case Z.META:case Z.STYLE:case Z.TITLE:case Z.SCRIPT:case Z.BGSOUND:case Z.BASEFONT:case Z.TEMPLATE:qL(e,t);break;case Z.BODY:Hne(e,t);break;case Z.FORM:qne(e,t);break;case Z.NOBR:$ne(e,t);break;case Z.MATH:pre(e,t);break;case Z.TABLE:tre(e,t);break;case Z.INPUT:nre(e,t);break;case Z.PARAM:case Z.TRACK:case Z.SOURCE:rre(e,t);break;case Z.IMAGE:are(e,t);break;case Z.BUTTON:Xne(e,t);break;case Z.APPLET:case Z.OBJECT:case Z.MARQUEE:ere(e,t);break;case Z.IFRAME:cre(e,t);break;case Z.SELECT:lre(e,t);break;case Z.OPTION:case Z.OPTGROUP:ure(e,t);break;case Z.NOEMBED:case Z.NOFRAMES:rR(e,t);break;case Z.FRAMESET:Une(e,t);break;case Z.TEXTAREA:ore(e,t);break;case Z.NOSCRIPT:e.options.scriptingEnabled?rR(e,t):iR(e,t);break;case Z.PLAINTEXT:Yne(e,t);break;case Z.COL:case Z.TH:case Z.TD:case Z.TR:case Z.HEAD:case Z.FRAME:case Z.TBODY:case Z.TFOOT:case Z.THEAD:case Z.CAPTION:case Z.COLGROUP:break;default:iR(e,t)}}function hre(e,t){if(e.openElements.hasInScope(Z.BODY)&&(e.insertionMode=$.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function gre(e,t){e.openElements.hasInScope(Z.BODY)&&(e.insertionMode=$.AFTER_BODY,WR(e,t))}function _re(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function vre(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(Z.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(Z.FORM):n&&e.openElements.remove(n))}function yre(e){e.openElements.hasInButtonScope(Z.P)||e._insertFakeElement(X.P,Z.P),e._closePElement()}function bre(e){e.openElements.hasInListItemScope(Z.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(Z.LI),e.openElements.popUntilTagNamePopped(Z.LI))}function xre(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Sre(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Cre(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function wre(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(X.BR,Z.BR),e.openElements.pop(),e.framesetOk=!1}function oR(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!==Z.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 sR(e,t){switch(t.tagID){case Z.A:case Z.B:case Z.I:case Z.S:case Z.U:case Z.EM:case Z.TT:case Z.BIG:case Z.CODE:case Z.FONT:case Z.NOBR:case Z.SMALL:case Z.STRIKE:case Z.STRONG:VL(e,t);break;case Z.P:yre(e);break;case Z.DL:case Z.UL:case Z.OL:case Z.DIR:case Z.DIV:case Z.NAV:case Z.PRE:case Z.MAIN:case Z.MENU:case Z.ASIDE:case Z.BUTTON:case Z.CENTER:case Z.FIGURE:case Z.FOOTER:case Z.HEADER:case Z.HGROUP:case Z.DIALOG:case Z.ADDRESS:case Z.ARTICLE:case Z.DETAILS:case Z.SEARCH:case Z.SECTION:case Z.SUMMARY:case Z.LISTING:case Z.FIELDSET:case Z.BLOCKQUOTE:case Z.FIGCAPTION:_re(e,t);break;case Z.LI:bre(e);break;case Z.DD:case Z.DT:xre(e,t);break;case Z.H1:case Z.H2:case Z.H3:case Z.H4:case Z.H5:case Z.H6:Sre(e);break;case Z.BR:wre(e);break;case Z.BODY:hre(e,t);break;case Z.HTML:gre(e,t);break;case Z.FORM:vre(e);break;case Z.APPLET:case Z.OBJECT:case Z.MARQUEE:Cre(e,t);break;case Z.TEMPLATE:JL(e,t);break;default:oR(e,t)}}function cR(e,t){e.tmplInsertionModeStack.length>0?HR(e,t):UL(e,t)}function Tre(e,t){var n;t.tagID===Z.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Ere(e,t){e._err(t,J.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function lR(e,t){if(e.openElements.currentTagId!==void 0&&RL.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=$.IN_TABLE_TEXT,t.type){case nL.CHARACTER:SR(e,t);break;case nL.WHITESPACE_CHARACTER:xR(e,t)}else bR(e,t)}function uR(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_CAPTION}function dR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_COLUMN_GROUP}function fR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(X.COLGROUP,Z.COLGROUP),e.insertionMode=$.IN_COLUMN_GROUP,DR(e,t)}function pR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_TABLE_BODY}function mR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(X.TBODY,Z.TBODY),e.insertionMode=$.IN_TABLE_BODY,AR(e,t)}function hR(e,t){e.openElements.hasInTableScope(Z.TABLE)&&(e.openElements.popUntilTagNamePopped(Z.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function gR(e,t){nR(t)?e._appendElement(t,Y.HTML):bR(e,t),t.ackSelfClosing=!0}function _R(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Y.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function vR(e,t){switch(t.tagID){case Z.TD:case Z.TH:case Z.TR:mR(e,t);break;case Z.STYLE:case Z.SCRIPT:case Z.TEMPLATE:qL(e,t);break;case Z.COL:fR(e,t);break;case Z.FORM:_R(e,t);break;case Z.TABLE:hR(e,t);break;case Z.TBODY:case Z.TFOOT:case Z.THEAD:pR(e,t);break;case Z.INPUT:gR(e,t);break;case Z.CAPTION:uR(e,t);break;case Z.COLGROUP:dR(e,t);break;default:bR(e,t)}}function yR(e,t){switch(t.tagID){case Z.TABLE:e.openElements.hasInTableScope(Z.TABLE)&&(e.openElements.popUntilTagNamePopped(Z.TABLE),e._resetInsertionMode());break;case Z.TEMPLATE:JL(e,t);break;case Z.BODY:case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.HTML:case Z.TBODY:case Z.TD:case Z.TFOOT:case Z.TH:case Z.THEAD:case Z.TR:break;default:bR(e,t)}}function bR(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,QL(e,t),e.fosterParentingEnabled=n}function xR(e,t){e.pendingCharacterTokens.push(t)}function SR(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function CR(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)bR(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var wR=new Set([Z.CAPTION,Z.COL,Z.COLGROUP,Z.TBODY,Z.TD,Z.TFOOT,Z.TH,Z.THEAD,Z.TR]);function TR(e,t){let n=t.tagID;wR.has(n)?e.openElements.hasInTableScope(Z.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Z.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,vR(e,t)):aR(e,t)}function ER(e,t){let n=t.tagID;switch(n){case Z.CAPTION:case Z.TABLE:e.openElements.hasInTableScope(Z.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Z.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,n===Z.TABLE&&yR(e,t));break;case Z.BODY:case Z.COL:case Z.COLGROUP:case Z.HTML:case Z.TBODY:case Z.TD:case Z.TFOOT:case Z.TH:case Z.THEAD:case Z.TR:break;default:sR(e,t)}}function DR(e,t){switch(t.tagID){case Z.HTML:aR(e,t);break;case Z.COL:e._appendElement(t,Y.HTML),t.ackSelfClosing=!0;break;case Z.TEMPLATE:qL(e,t);break;default:kR(e,t)}}function OR(e,t){switch(t.tagID){case Z.COLGROUP:e.openElements.currentTagId===Z.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case Z.TEMPLATE:JL(e,t);break;case Z.COL:break;default:kR(e,t)}}function kR(e,t){e.openElements.currentTagId===Z.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE,e._processToken(t))}function AR(e,t){switch(t.tagID){case Z.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_ROW;break;case Z.TH:case Z.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(X.TR,Z.TR),e.insertionMode=$.IN_ROW,MR(e,t);break;case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.TBODY:case Z.TFOOT:case Z.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,vR(e,t));break;default:vR(e,t)}}function jR(e,t){let n=t.tagID;switch(t.tagID){case Z.TBODY:case Z.TFOOT:case Z.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case Z.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,yR(e,t));break;case Z.BODY:case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.HTML:case Z.TD:case Z.TH:case Z.TR:break;default:yR(e,t)}}function MR(e,t){switch(t.tagID){case Z.TH:case Z.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_CELL,e.activeFormattingElements.insertMarker();break;case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.TBODY:case Z.TFOOT:case Z.THEAD:case Z.TR:e.openElements.hasInTableScope(Z.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,AR(e,t));break;default:vR(e,t)}}function NR(e,t){switch(t.tagID){case Z.TR:e.openElements.hasInTableScope(Z.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY);break;case Z.TABLE:e.openElements.hasInTableScope(Z.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,jR(e,t));break;case Z.TBODY:case Z.TFOOT:case Z.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(Z.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,jR(e,t));break;case Z.BODY:case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.HTML:case Z.TD:case Z.TH:break;default:yR(e,t)}}function PR(e,t){let n=t.tagID;wR.has(n)?(e.openElements.hasInTableScope(Z.TD)||e.openElements.hasInTableScope(Z.TH))&&(e._closeTableCell(),MR(e,t)):aR(e,t)}function FR(e,t){let n=t.tagID;switch(n){case Z.TD:case Z.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_ROW);break;case Z.TABLE:case Z.TBODY:case Z.TFOOT:case Z.THEAD:case Z.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),NR(e,t));break;case Z.BODY:case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.HTML:break;default:sR(e,t)}}function IR(e,t){switch(t.tagID){case Z.HTML:aR(e,t);break;case Z.OPTION:e.openElements.currentTagId===Z.OPTION&&e.openElements.pop(),e._insertElement(t,Y.HTML);break;case Z.OPTGROUP:e.openElements.currentTagId===Z.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Z.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Y.HTML);break;case Z.HR:e.openElements.currentTagId===Z.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Z.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Y.HTML),t.ackSelfClosing=!0;break;case Z.INPUT:case Z.KEYGEN:case Z.TEXTAREA:case Z.SELECT:e.openElements.hasInSelectScope(Z.SELECT)&&(e.openElements.popUntilTagNamePopped(Z.SELECT),e._resetInsertionMode(),t.tagID!==Z.SELECT&&e._processStartTag(t));break;case Z.SCRIPT:case Z.TEMPLATE:qL(e,t)}}function LR(e,t){switch(t.tagID){case Z.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===Z.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===Z.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===Z.OPTGROUP&&e.openElements.pop();break;case Z.OPTION:e.openElements.currentTagId===Z.OPTION&&e.openElements.pop();break;case Z.SELECT:e.openElements.hasInSelectScope(Z.SELECT)&&(e.openElements.popUntilTagNamePopped(Z.SELECT),e._resetInsertionMode());break;case Z.TEMPLATE:JL(e,t)}}function RR(e,t){let n=t.tagID;n===Z.CAPTION||n===Z.TABLE||n===Z.TBODY||n===Z.TFOOT||n===Z.THEAD||n===Z.TR||n===Z.TD||n===Z.TH?(e.openElements.popUntilTagNamePopped(Z.SELECT),e._resetInsertionMode(),e._processStartTag(t)):IR(e,t)}function zR(e,t){let n=t.tagID;n===Z.CAPTION||n===Z.TABLE||n===Z.TBODY||n===Z.TFOOT||n===Z.THEAD||n===Z.TR||n===Z.TD||n===Z.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(Z.SELECT),e._resetInsertionMode(),e.onEndTag(t)):LR(e,t)}function BR(e,t){switch(t.tagID){case Z.BASE:case Z.BASEFONT:case Z.BGSOUND:case Z.LINK:case Z.META:case Z.NOFRAMES:case Z.SCRIPT:case Z.STYLE:case Z.TEMPLATE:case Z.TITLE:qL(e,t);break;case Z.CAPTION:case Z.COLGROUP:case Z.TBODY:case Z.TFOOT:case Z.THEAD:e.tmplInsertionModeStack[0]=$.IN_TABLE,e.insertionMode=$.IN_TABLE,vR(e,t);break;case Z.COL:e.tmplInsertionModeStack[0]=$.IN_COLUMN_GROUP,e.insertionMode=$.IN_COLUMN_GROUP,DR(e,t);break;case Z.TR:e.tmplInsertionModeStack[0]=$.IN_TABLE_BODY,e.insertionMode=$.IN_TABLE_BODY,AR(e,t);break;case Z.TD:case Z.TH:e.tmplInsertionModeStack[0]=$.IN_ROW,e.insertionMode=$.IN_ROW,MR(e,t);break;default:e.tmplInsertionModeStack[0]=$.IN_BODY,e.insertionMode=$.IN_BODY,aR(e,t)}}function VR(e,t){t.tagID===Z.TEMPLATE&&JL(e,t)}function HR(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(Z.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):UL(e,t)}function UR(e,t){t.tagID===Z.HTML?aR(e,t):GR(e,t)}function WR(e,t){if(t.tagID===Z.HTML){if(e.fragmentContext||(e.insertionMode=$.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===Z.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 GR(e,t)}function GR(e,t){e.insertionMode=$.IN_BODY,QL(e,t)}function KR(e,t){switch(t.tagID){case Z.HTML:aR(e,t);break;case Z.FRAMESET:e._insertElement(t,Y.HTML);break;case Z.FRAME:e._appendElement(t,Y.HTML),t.ackSelfClosing=!0;break;case Z.NOFRAMES:qL(e,t)}}function qR(e,t){t.tagID===Z.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==Z.FRAMESET&&(e.insertionMode=$.AFTER_FRAMESET))}function JR(e,t){switch(t.tagID){case Z.HTML:aR(e,t);break;case Z.NOFRAMES:qL(e,t)}}function YR(e,t){t.tagID===Z.HTML&&(e.insertionMode=$.AFTER_AFTER_FRAMESET)}function XR(e,t){t.tagID===Z.HTML?aR(e,t):ZR(e,t)}function ZR(e,t){e.insertionMode=$.IN_BODY,QL(e,t)}function QR(e,t){switch(t.tagID){case Z.HTML:aR(e,t);break;case Z.NOFRAMES:qL(e,t)}}function $R(e,t){t.chars=`�`,e._insertCharacters(t)}function ez(e,t){e._insertCharacters(t),e.framesetOk=!1}function tz(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Y.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function nz(e,t){if(mne(t))tz(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Y.MATHML?FL(t):r===Y.SVG&&(hne(t),IL(t)),LL(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function rz(e,t){if(t.tagID===Z.P||t.tagID===Z.BR){tz(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)===Y.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}X.AREA,X.BASE,X.BASEFONT,X.BGSOUND,X.BR,X.COL,X.EMBED,X.FRAME,X.HR,X.IMG,X.INPUT,X.KEYGEN,X.LINK,X.META,X.PARAM,X.SOURCE,X.TRACK,X.WBR;var iz=oz(`end`),az=oz(`start`);function oz(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 sz(e){let t=az(e),n=iz(e);if(t&&n)return{start:t,end:n}}var cz=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,lz=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),uz={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function dz(e,t){let n=Tz(e),r=HI(`type`,{handlers:{root:pz,element:mz,text:hz,comment:vz,doctype:gz,raw:yz},unknown:bz}),i={parser:n?new BL(uz):BL.getFragmentParser(void 0,uz),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),xz(i,az());let a=NI(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&iF(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 fz(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function pz(e,t){fz(e.children,t)}function mz(e,t){Cz(e,t),fz(e.children,t),wz(e,t)}function hz(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:nL.CHARACTER,chars:e.value,location:Ez(e)};xz(t,az(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function gz(e,t){let n={type:nL.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:Ez(e)};xz(t,az(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function _z(e,t){t.stitches=!0;let n=Dz(e);`children`in e&&`children`in n&&(n.children=dz({type:`root`,children:e.children},t.options).children),vz({type:`comment`,value:{stitch:n}},t)}function vz(e,t){let n=e.value,r={type:nL.COMMENT,data:n,location:Ez(e)};xz(t,az(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function yz(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,Sz(t,az(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(cz,`&lt;$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 bz(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))_z(n,t);else{let e=``;throw lz.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 xz(e,t){Sz(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=mL.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 Sz(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 Cz(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===mL.PLAINTEXT)return;xz(t,az(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:AI.html;i===AI.html&&n===`svg`&&(i=AI.svg);let a=KI({...e,children:[]},{space:i===AI.svg?`svg`:`html`}),o={type:nL.START_TAG,tagName:n,tagID:dL(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:Ez(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function wz(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Ete.includes(n)||t.parser.tokenizer.state===mL.PLAINTEXT)return;xz(t,iz(e));let r={type:nL.END_TAG,tagName:n,tagID:dL(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ez(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===mL.RCDATA||t.parser.tokenizer.state===mL.RAWTEXT||t.parser.tokenizer.state===mL.SCRIPT_DATA)&&(t.parser.tokenizer.state=mL.DATA)}function Tz(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function Ez(e){let t=az(e)||{line:void 0,column:void 0,offset:void 0},n=iz(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 Dz(e){return`children`in e?AF({...e,children:[]}):AF(e)}function Oz(e){return function(t,n){return dz(t,{...e,file:n})}}var kz=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],Az={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...kz,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...kz],h2:[[`className`,`sr-only`]],img:[...kz,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...kz,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...kz],table:[...kz],ul:[...kz,[`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(`.`)},jz={}.hasOwnProperty;function Mz(e,t){let n={type:`root`,children:[]},r=Nz({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 Nz(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Pz(e,n);case`doctype`:return Fz(e,n);case`element`:return Iz(e,n);case`root`:return Lz(e,n);case`text`:return Rz(e,n)}}}function Pz(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 Gz(r,t),r}}function Fz(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return Gz(e,t),e}}function Iz(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=zz(e,t.children),i=Bz(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&&jz.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 Gz(o,t),o}function Lz(e,t){let n={type:`root`,children:zz(e,t.children)};return Gz(n,t),n}function Rz(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return Gz(n,t),n}function zz(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=Nz(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Bz(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&jz.call(r,n)?r[n]:void 0,o=r&&jz.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(jz.call(s,l)){let t=s[l],n=Vz(e,Kz(a,l),l,t);n??=Vz(e,Kz(o,l),l,t),n!=null&&(c[l]=n)}if(i&&jz.call(i,n)){let e=i[n];for(l in e)jz.call(e,l)&&!jz.call(c,l)&&(c[l]=e[l])}return c}function Vz(e,t,n,r){return t?Array.isArray(r)?Hz(e,t,n,r):Uz(e,t,n,r):void 0}function Hz(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=Uz(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function Uz(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&Wz(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 Wz(e,t,n){let r=e.schema.protocols&&jz.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 Gz(e,t){let n=sz(t);t.data&&(e.data=AF(t.data)),n&&(e.position=n)}function Kz(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 qz(e){return function(t){return Mz(t,e)}}function Jz(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 Yz=sB(/[A-Za-z]/),Xz=sB(/[\dA-Za-z]/),Zz=sB(/[#-'*+\--9=?A-Z^-~]/);function Qz(e){return e!==null&&(e<32||e===127)}var $z=sB(/\d/),eB=sB(/[\dA-Fa-f]/),tB=sB(/[!-/:-@[-`{-~]/);function nB(e){return e!==null&&e<-2}function rB(e){return e!==null&&(e<0||e===32)}function iB(e){return e===-2||e===-1||e===32}var aB=sB(/\p{P}|\p{S}/u),oB=sB(/\s/);function sB(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function cB(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function lB(e,t,n){let r=KP((n||{}).ignore||[]),i=uB(t),a=-1;for(;++a<i.length;)nF(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 uB(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([dB(e[0]),fB(e[1])])}return t}function dB(e){return typeof e==`string`?new RegExp(cB(e),`g`):e}function fB(e){return typeof e==`function`?e:function(){return e}}var pB=`phrasing`,mB=[`autolink`,`link`,`image`,`label`];function hB(){return{transforms:[CB],enter:{literalAutolink:_B,literalAutolinkEmail:vB,literalAutolinkHttp:vB,literalAutolinkWww:vB},exit:{literalAutolink:SB,literalAutolinkEmail:xB,literalAutolinkHttp:yB,literalAutolinkWww:bB}}}function gB(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:pB,notInConstruct:mB},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:pB,notInConstruct:mB},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:pB,notInConstruct:mB}]}}function _B(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function vB(e){this.config.enter.autolinkProtocol.call(this,e)}function yB(e){this.config.exit.autolinkProtocol.call(this,e)}function bB(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 xB(e){this.config.exit.autolinkEmail.call(this,e)}function SB(e){this.exit(e)}function CB(e){lB(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wB],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,TB]],{ignore:[`link`,`linkReference`]})}function wB(e,t,n,r,i){let a=``;if(!OB(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!EB(n)))return!1;let o=DB(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 TB(e,t,n,r){return!OB(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function EB(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 DB(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=Jz(e,`(`),a=Jz(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 OB(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||oB(n)||aB(n))&&(!t||n!==47)}function kB(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}zB.peek=RB;function AB(){this.buffer()}function jB(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function MB(){this.buffer()}function NB(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function PB(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=kB(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FB(e){this.exit(e)}function IB(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=kB(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LB(e){this.exit(e)}function RB(){return`[`}function zB(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 BB(){return{enter:{gfmFootnoteCallString:AB,gfmFootnoteCall:jB,gfmFootnoteDefinitionLabelString:MB,gfmFootnoteDefinition:NB},exit:{gfmFootnoteCallString:PB,gfmFootnoteCall:FB,gfmFootnoteDefinitionLabelString:IB,gfmFootnoteDefinition:LB}}}function VB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:zB},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?`
54
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?UB:HB))),s(),o}}function HB(e,t,n){return t===0?e:UB(e,t,n)}function UB(e,t,n){return(n?``:` `)+e}var WB=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];YB.peek=XB;function GB(){return{canContainEols:[`delete`],enter:{strikethrough:qB},exit:{strikethrough:JB}}}function KB(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:WB}],handlers:{delete:YB}}}function qB(e){this.enter({type:`delete`,children:[]},e)}function JB(e){this.exit(e)}function YB(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 XB(){return`~`}function ZB(e){return e.length}function QB(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ZB,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=$B(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]=eV(r[d]);else{let e=eV(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(`
55
+ `)}function $B(e){return e==null?``:String(e)}function eV(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 tV(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()),nV);return i(),o}function nV(e,t,n){return`>`+(n?``:` `)+e}function rV(e,t){return iV(e,t.inConstruct,!0)&&!iV(e,t.notInConstruct,!1)}function iV(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 aV(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
56
+ `&&rV(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
57
+ `}function oV(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 sV(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 cV(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function lV(e,t,n,r){let i=cV(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(sV(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,uV);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(oV(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:`
58
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
59
+ `),a&&(u+=s.move(a+`
60
+ `)),u+=s.move(c),l(),u}function uV(e,t,n){return(n?``:` `)+e}function dV(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fV(e,t,n,r){let i=dV(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?` `:`
61
+ `,...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 pV(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function mV(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function hV(e){if(e===null||rB(e)||oB(e))return 1;if(aB(e))return 2}function gV(e,t,n){let r=hV(e),i=hV(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}}_V.peek=vV;function _V(e,t,n,r){let i=pV(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=gV(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=mV(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=gV(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+mV(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function vV(e,t,n){return n.options.emphasis||`*`}var yV={};function bV(e,t){let n=t||yV;return xV(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function xV(e,t,n){if(CV(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 SV(e.children,t,n)}return Array.isArray(e)?SV(e,t,n):``}function SV(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=xV(e[i],t,n);return r.join(``)}function CV(e){return!!(e&&typeof e==`object`)}function wV(e,t){let n=!1;return iF(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)&&bV(e)&&(t.options.setext||n))}function TV(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(wV(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
62
+ `,after:`
63
+ `});return r(),t(),o+`
64
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
65
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
66
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=mV(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}EV.peek=DV;function EV(e){return e.value||``}function DV(){return`<`}OV.peek=kV;function OV(e,t,n,r){let i=dV(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 kV(){return`!`}AV.peek=jV;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 jV(){return`!`}MV.peek=NV;function MV(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 NV(){return"`"}function PV(e,t){let n=bV(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))}FV.peek=IV;function FV(e,t,n,r){let i=dV(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(PV(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 IV(e,t,n){return PV(e,n)?`<`:`[`}LV.peek=RV;function LV(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 RV(){return`[`}function zV(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 BV(e){let t=zV(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 VV(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function HV(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 UV(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?VV(n):zV(n),s=e.ordered?o===`.`?`)`:`.`:BV(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),HV(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 WV(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 GV(e,t,n,r){let i=WV(n),a=n.bulletCurrent||zV(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 KV(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var qV=KP([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function JV(e,t,n,r){return(e.children.some(function(e){return qV(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function YV(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}XV.peek=ZV;function XV(e,t,n,r){let i=YV(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=gV(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=mV(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=gV(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+mV(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ZV(e,t,n){return n.options.strong||`*`}function QV(e,t,n,r){return n.safe(e.value,r)}function $V(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 eH(e,t,n){let r=(HV(n)+(n.options.ruleSpaces?` `:``)).repeat($V(n));return n.options.ruleSpaces?r.slice(0,-1):r}var tH={blockquote:tV,break:aV,code:lV,definition:fV,emphasis:_V,hardBreak:aV,heading:TV,html:EV,image:OV,imageReference:AV,inlineCode:MV,link:FV,linkReference:LV,list:UV,listItem:GV,paragraph:KV,root:JV,strong:XV,text:QV,thematicBreak:eH},nH=document.createElement(`i`);function rH(e){let t=`&`+e+`;`;nH.innerHTML=t;let n=nH.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function iH(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 aH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function oH(e){return e.replace(aH,sH)}function sH(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return iH(n.slice(t?2:1),t?16:10)}return rH(n)||e}function cH(){return{enter:{table:lH,tableData:pH,tableHeader:pH,tableRow:dH},exit:{codeText:mH,table:uH,tableData:fH,tableHeader:fH,tableRow:fH}}}function lH(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 uH(e){this.exit(e),this.data.inTable=void 0}function dH(e){this.enter({type:`tableRow`,children:[]},e)}function fH(e){this.exit(e)}function pH(e){this.enter({type:`tableCell`,children:[]},e)}function mH(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,hH));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function hH(e,t){return t===`|`?t:e}function gH(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
67
+ `,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(`
68
+ `))}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 QB(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=tH.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function _H(){return{exit:{taskListCheckValueChecked:yH,taskListCheckValueUnchecked:yH,paragraph:bH}}}function vH(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:xH}}}function yH(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function bH(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 xH(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=tH.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 SH(){return[hB(),BB(),GB(),cH(),_H()]}function CH(e){return{extensions:[gB(),VB(e),KB(),gH(e),vH()]}}function wH(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 TH(e,t){return e.length>0?(wH(e,e.length,0,t),e):t}var EH={}.hasOwnProperty;function DH(e){let t={},n=-1;for(;++n<e.length;)OH(t,e[n]);return t}function OH(e,t){let n;for(n in t){let r=(EH.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){EH.call(r,a)||(r[a]=[]);let e=i[a];kH(r[a],Array.isArray(e)?e:e?[e]:[])}}}function kH(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);wH(e,0,0,r)}var AH={tokenize:WH,partial:!0},jH={tokenize:GH,partial:!0},MH={tokenize:KH,partial:!0},NH={tokenize:qH,partial:!0},PH={tokenize:JH,partial:!0},FH={name:`wwwAutolink`,tokenize:HH,previous:YH},IH={name:`protocolAutolink`,tokenize:UH,previous:XH},LH={name:`emailAutolink`,tokenize:VH,previous:ZH},RH={};function zH(){return{text:RH}}for(var BH=48;BH<123;)RH[BH]=LH,BH++,BH===58?BH=65:BH===91&&(BH=97);RH[43]=LH,RH[45]=LH,RH[46]=LH,RH[95]=LH,RH[72]=[LH,IH],RH[104]=[LH,IH],RH[87]=[LH,FH],RH[119]=[LH,FH];function VH(e,t,n){let r=this,i,a;return o;function o(t){return!QH(t)||!ZH.call(r,r.previous)||$H(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return QH(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(PH,u,l)(t):t===45||t===95||Xz(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&&Yz(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function HH(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!YH.call(r,r.previous)||$H(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(AH,e.attempt(jH,e.attempt(MH,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function UH(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&XH.call(r,r.previous)&&!$H(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Yz(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||Qz(t)||rB(t)||oB(t)||aB(t)?n(t):e.attempt(jH,e.attempt(MH,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function WH(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 GH(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(NH,c,s)(t):t===null||rB(t)||oB(t)||t!==45&&aB(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 KH(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(NH,t,a)(o):o===null||rB(o)||oB(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function qH(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||rB(o)||oB(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||rB(e)||oB(e)?t(e):r(e)}function a(e){return Yz(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Yz(t)?(e.consume(t),o):n(t)}}function JH(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Xz(e)?n(e):t(e)}}function YH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rB(e)}function XH(e){return!Yz(e)}function ZH(e){return!(e===47||QH(e))}function QH(e){return e===43||e===45||e===46||e===95||Xz(e)}function $H(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 eU(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Xz(e.charCodeAt(n+1))&&Xz(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 tU(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 nU={name:`attention`,resolveAll:rU,tokenize:iU};function rU(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};aU(d,-c),aU(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=TH(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=TH(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=TH(l,tU(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=TH(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=TH(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,wH(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 iU(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=hV(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=hV(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 aU(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var oU={name:`autolink`,tokenize:sU};function sU(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 Yz(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Xz(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||Xz(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||Qz(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Zz(t)?(e.consume(t),l):n(t)}function u(e){return Xz(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||Xz(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function cU(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return iB(r)?(e.enter(n),s(r)):t(r)}function s(r){return iB(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var lU={partial:!0,tokenize:uU};function uU(e,t,n){return r;function r(t){return iB(t)?cU(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||nB(e)?t(e):n(e)}}var dU={continuation:{tokenize:pU},exit:mU,name:`blockQuote`,tokenize:fU};function fU(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 iB(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function pU(e,t,n){let r=this;return i;function i(t){return iB(t)?cU(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(dU,t,n)(r)}}function mU(e){e.exit(`blockQuote`)}var hU={name:`characterEscape`,tokenize:gU};function gU(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 tB(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var _U={name:`characterReference`,tokenize:vU};function vU(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=Xz,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=eB,u):(e.enter(`characterReferenceValue`),a=7,o=$z,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Xz&&!rH(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 yU={partial:!0,tokenize:SU},bU={concrete:!0,name:`codeFenced`,tokenize:xU};function xU(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`),iB(t)?cU(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||nB(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(yU,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||nB(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):iB(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),cU(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||nB(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||nB(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&&iB(t)?cU(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||nB(t)?e.check(yU,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||nB(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`),iB(t)?cU(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`),iB(t)?cU(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||nB(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function SU(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 CU={name:`codeIndented`,tokenize:TU},wU={partial:!0,tokenize:EU};function TU(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),cU(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):nB(t)?e.attempt(wU,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||nB(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function EU(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):nB(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):cU(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):nB(e)?i(e):n(e)}}var DU={name:`codeText`,previous:kU,resolve:OU,tokenize:AU};function OU(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 kU(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)):nB(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||nB(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 jU=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&&MU(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),MU(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),MU(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);MU(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);MU(this.left,t.reverse())}}}};function MU(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 NU(e){let t={},n=-1,r,i,a,o,s,c,l,u=new jU(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,PU(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 wH(e,0,1/0,u.slice(0)),!l}function PU(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 FU={resolve:LU,tokenize:RU},IU={partial:!0,tokenize:zU};function LU(e){return NU(e),e}function RU(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):nB(t)?e.check(IU,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 zU(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),cU(e,a,`linePrefix`)}function a(i){if(i===null||nB(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 BU(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||Qz(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||nB(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||rB(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||Qz(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 VU(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):nB(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||nB(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!iB(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function HU(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):nB(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),cU(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||nB(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 UU(e,t){let n;return r;function r(i){return nB(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):iB(i)?cU(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var WU={name:`definition`,tokenize:KU},GU={partial:!0,tokenize:qU};function KU(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return VU.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=kB(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 rB(t)?UU(e,l)(t):l(t)}function l(t){return BU(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(GU,d,d)(t)}function d(t){return iB(t)?cU(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||nB(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function qU(e,t,n){return r;function r(t){return rB(t)?UU(e,i)(t):n(t)}function i(t){return HU(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return iB(t)?cU(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||nB(e)?t(e):n(e)}}var JU={name:`hardBreakEscape`,tokenize:YU};function YU(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return nB(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var XU={name:`headingAtx`,resolve:ZU,tokenize:QU};function ZU(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`},wH(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function QU(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||rB(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||nB(n)?(e.exit(`atxHeading`),t(n)):iB(n)?cU(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||rB(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var $U=`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(`.`),eW=[`pre`,`script`,`style`,`textarea`],tW={concrete:!0,name:`htmlFlow`,resolveTo:iW,tokenize:aW},nW={partial:!0,tokenize:sW},rW={partial:!0,tokenize:oW};function iW(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 aW(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):Yz(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):Yz(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 Yz(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||rB(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&eW.includes(l)?(i=1,r.interrupt?t(s):O(s)):$U.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||Xz(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 iB(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Yz(t)?(e.consume(t),b):iB(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Xz(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):iB(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):iB(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||nB(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||rB(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||iB(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||nB(t)?O(t):iB(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):nB(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(nW,R,k)(t)):t===null||nB(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(rW,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||nB(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 eW.includes(n)?(e.consume(t),L):O(t)}return Yz(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||nB(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function oW(e,t,n){let r=this;return i;function i(t){return nB(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 sW(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(lU,t,n)}}var cW={name:`htmlText`,tokenize:lW};function lW(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):Yz(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):Yz(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):nB(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):nB(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):nB(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):nB(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Yz(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Xz(t)?(e.consume(t),S):C(t)}function C(t){return nB(t)?(o=C,N(t)):iB(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Xz(t)?(e.consume(t),w):t===47||t===62||rB(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Yz(t)?(e.consume(t),E):nB(t)?(o=T,N(t)):iB(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Xz(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):nB(t)?(o=D,N(t)):iB(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):nB(t)?(o=O,N(t)):iB(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):nB(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||rB(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||rB(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 iB(t)?cU(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 uW={name:`labelEnd`,resolveAll:mW,resolveTo:hW,tokenize:gW},dW={tokenize:_W},fW={tokenize:vW},pW={tokenize:yW};function mW(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&&wH(e,0,e.length,n),e}function hW(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=TH(s,e.slice(a+1,a+r+3)),s=TH(s,[[`enter`,u,t]]),s=TH(s,tU(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=TH(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=TH(s,e.slice(o+1)),s=TH(s,[[`exit`,c,t]]),wH(e,a,e.length,s),e}function gW(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(kB(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(dW,u,o?u:d)(t):t===91?e.attempt(fW,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(pW,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function _W(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 rB(t)?UU(e,a)(t):a(t)}function a(t){return t===41?u(t):BU(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return rB(t)?UU(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?HU(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return rB(t)?UU(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 vW(e,t,n){let r=this;return i;function i(t){return VU.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(kB(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function yW(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 bW={name:`labelStartImage`,resolveAll:uW.resolveAll,tokenize:xW};function xW(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 SW={name:`labelStartLink`,resolveAll:uW.resolveAll,tokenize:CW};function CW(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 wW={name:`lineEnding`,tokenize:TW};function TW(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),cU(e,t,`linePrefix`)}}var EW={name:`thematicBreak`,tokenize:DW};function DW(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||nB(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),iB(t)?cU(e,s,`whitespace`)(t):s(t))}}var OW={continuation:{tokenize:MW},exit:PW,name:`list`,tokenize:jW},kW={partial:!0,tokenize:FW},AW={partial:!0,tokenize:NW};function jW(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:$z(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(EW,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 $z(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(lU,r.interrupt?n:u,e.attempt(kW,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return iB(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 MW(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(lU,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,cU(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!iB(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,cU(e,e.attempt(OW,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function NW(e,t,n){let r=this;return cU(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 PW(e){e.exit(this.containerState.type)}function FW(e,t,n){let r=this;return cU(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!iB(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var IW={name:`setextUnderline`,resolveTo:LW,tokenize:RW};function LW(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 RW(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`),iB(t)?cU(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||nB(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var zW={tokenize:qW,partial:!0};function BW(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:WW,continuation:{tokenize:GW},exit:KW}},text:{91:{name:`gfmFootnoteCall`,tokenize:UW},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:VW,resolveTo:HW}}}}function VW(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=kB(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 HW(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 UW(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||rB(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(kB(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return rB(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 WW(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||rB(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=kB(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return rB(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),cU(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function GW(e,t,n){return e.check(lU,t,e.attempt(zW,t,n))}function KW(e){e.exit(`gfmFootnoteDefinition`)}function qW(e,t,n){let r=this;return cU(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 JW(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&&wH(o,o.length,0,tU(s,e.slice(r+1,n),t)),wH(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),wH(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=hV(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=hV(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var YW=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){XW(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 XW(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 ZW(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 QW(){return{flow:{null:{name:`table`,tokenize:$W,resolveAll:eG}}}}function $W(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):nB(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):iB(t)?cU(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||rB(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,iB(t)?cU(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 iB(t)?cU(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||nB(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 iB(t)?cU(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||nB(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||nB(n)?(e.exit(`tableRow`),t(n)):iB(n)?cU(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||rB(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 eG(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 YW;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(nG(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=tG(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=tG(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=tG(f,t,o,i,n,d)):(o[0]=o[1],d=tG(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&nG(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=ZW(t.events,n))}return e}function tG(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},rG(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=rG(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=rG(t.events,n[2]),a=rG(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({},rG(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function nG(e,t,n,r,i){let a=[],o=rG(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 rG(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var iG={name:`tasklistCheck`,tokenize:oG};function aG(){return{text:{91:iG}}}function oG(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 rB(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 nB(r)?t(r):iB(r)?e.check({tokenize:sG},t,n)(r):n(r)}}function sG(e,t,n){return cU(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function cG(e){return DH([zH(),BW(),JW(e),QW(),aG()])}var lG={};function uG(e){let t=this,n=e||lG,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(cG(n)),a.push(SH()),o.push(CH(n))}var dG=Object.defineProperty,fG=Object.defineProperties,pG=Object.getOwnPropertyDescriptors,mG=Object.getOwnPropertySymbols,hG=Object.prototype.hasOwnProperty,gG=Object.prototype.propertyIsEnumerable,_G=(e,t,n)=>t in e?dG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vG=(e,t)=>{for(var n in t||={})hG.call(t,n)&&_G(e,n,t[n]);if(mG)for(var n of mG(t))gG.call(t,n)&&_G(e,n,t[n]);return e},yG=(e,t)=>fG(e,pG(t)),bG=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},xG=null,SG=(e,t)=>{let n=xG;return(n===null||n.text!==e)&&(n={text:e,lookup:bG(e)},xG=n),n.lookup[Math.min(t,e.length)]===1},CG=(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},wG=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]==="`"&&!CG(e,n)&&(t+=1)}return t},TG=(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},EG=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,DG=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(EG,(t,n,r,i)=>SG(e,i)?t:`${n}\\>${r}`),OG=/(\*\*)([^*]*\*?)$/,kG=/(__)([^_]*?)$/,AG=/(\*\*\*)([^*]*?)$/,jG=/(\*)([^*]*?)$/,MG=/(_)([^_]*?)$/,NG=/(`)([^`]*?)$/,PG=/(~~)([^~]*?)$/,FG=/^[\s_~*`]*$/,IG=/^[\s]*[-*+][\s]+$/,LG=/[\p{L}\p{N}_]/u,RG=/^```[^`\n]*```?$/,zG=/^\*{4,}$/,BG=/(__)([^_]+)_$/,VG=/(~~)([^~]+)~$/,HG=/~~/g,UG=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||LG.test(e)},WG=(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},GG=(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},KG=e=>e===`inlineLatex`||e===`blockLatex`,qG=(e,t)=>t===`[`&&e===`none`?`blockLatex`:t===`]`&&e===`blockLatex`?`none`:t===`(`&&e===`none`?`inlineLatex`:t===`)`&&e===`inlineLatex`?`none`:null,JG=(e,t)=>t?e===`blockDollar`?`none`:`blockDollar`:e===`blockDollar`?e:e===`inlineDollar`?`none`:`inlineDollar`,YG=(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=qG(n,e[r+1]);if(t!==null){n=t,r+=1;continue}}if(e[r]===`$`&&!KG(n)){let t=e[r+1]===`$`;n=JG(n,t),t&&(r+=1)}}return n!==`none`},XG=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===`)`)return!0;if(e[n]===`
69
+ `)return!1}return!1},ZG=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`)`)return!1;if(e[n]===`(`)return n>0&&e[n-1]===`]`&&XG(e,t);if(e[n]===`
70
+ `)return!1}return!1},QG=(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]===`
71
+ `)return!1}return!1},$G=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;--n)if(e[n]===`
72
+ `){r=n+1;break}let i=e.length;for(let n=t;n<e.length;n+=1)if(e[n]===`
73
+ `){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},eK=e=>e.includes(`$`)||e.includes(`\\(`)||e.includes(`\\[`),tK=(e,t,n,r)=>n===`\\`||eK(e)&&YG(e,t)?!0:n!==`*`&&r===`*`?(t<e.length-2?e[t+2]:``)!==`*`:n===`*`||(!n||n===` `||n===` `||n===`
74
+ `)&&(!r||r===` `||r===` `||r===`
75
+ `),nK=e=>e===` `||e===` `||e===`
76
+ `,rK=(e,t)=>!!(e&&t&&UG(e)&&UG(t)),iK=(e,t,n,r)=>{let i=rK(e,t),a=!!t&&!nK(t),o=!!e&&!nK(e);return i&&n%2==0&&!r?{count:!1}:o&&n%2==1||a?{count:!0,inWordAsteriskChain:i}:{count:!1}},aK=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]!==`*`){UG(e[a])||(r=!1);continue}let o=a>0?e[a-1]:``,s=a<i-1?e[a+1]:``;if(tK(e,a,o,s))continue;let c=iK(o,s,t,r);c.count&&(t+=1,r=c.inWordAsteriskChain)}return t},oK=(e,t,n,r)=>!!(n===`\\`||eK(e)&&YG(e,t)||ZG(e,t)||QG(e,t)||n===`_`||r===`_`||n&&r&&UG(n)&&UG(r)),sK=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]:``;oK(e,i,a,o)||(t+=1)}return t},cK=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},lK=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},uK=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},dK=(e,t,n)=>{if(!t||FG.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
77
+ `),i=r===-1?0:r+1,a=e.substring(i,n);return IG.test(a)&&t.includes(`
78
+ `)?!0:$G(e,n,`*`)},fK=e=>{let t=e.match(OG);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return SG(e,r)||TG(e,r)||dK(e,n,r)?e:lK(e)%2==1?n.endsWith(`*`)?`${e}*`:`${e}**`:e},pK=(e,t,n)=>{if(!t||FG.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
79
+ `),i=r===-1?0:r+1,a=e.substring(i,n);return IG.test(a)&&t.includes(`
80
+ `)?!0:$G(e,n,`_`)},mK=e=>{let t=e.match(kG);if(!t){let t=e.match(BG);if(t){let n=e.lastIndexOf(t[1]);if(!(SG(e,n)||TG(e,n))&&uK(e)%2==1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return SG(e,r)||TG(e,r)||pK(e,n,r)?e:uK(e)%2==1?`${e}__`:e},hK=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]!==`\\`&&!YG(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``,i=!t||nK(t),a=!r||nK(r);if(i&&a||t&&r&&UG(t)&&UG(r)||a)continue;return n}}return-1},gK=e=>{if(!e.match(jG))return e;let t=hK(e);if(t===-1||SG(e,t)||TG(e,t))return e;let n=e.substring(t+1);return!n||FG.test(n)?e:aK(e)%2==1?`${e}*`:e},_K=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]!==`\\`&&!YG(e,n)&&!ZG(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``;if(t&&r&&UG(t)&&UG(r))continue;return n}}return-1},vK=e=>{let t=e.length;for(;t>0&&e[t-1]===`
81
+ `;)--t;return t<e.length?`${e.slice(0,t)}_${e.slice(t)}`:`${e}_`},yK=e=>{if(!e.endsWith(`**`))return null;let t=e.slice(0,-2);if(lK(t)%2!=1)return null;let n=t.indexOf(`**`),r=_K(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},bK=e=>{if(!e.match(MG))return e;let t=_K(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||FG.test(n)||SG(e,t)||TG(e,t))return e;if(sK(e)%2==1){let t=yK(e);return t===null?vK(e):t}return e},xK=e=>{let t=lK(e),n=aK(e);return t%2==0&&n%2==0},SK=(e,t,n)=>!t||FG.test(t)||SG(e,n)||TG(e,n)?!0:$G(e,n,`*`),CK=e=>{if(zG.test(e))return e;let t=e.match(AG);if(!t)return e;let n=t[2];return SK(e,n,e.lastIndexOf(t[1]))?e:cK(e)%2==1?xK(e)?e:`${e}***`:e},wK=/<[a-zA-Z/][^>]*$/,TK=e=>{let t=e.match(wK);return!t||t.index===void 0||SG(e,t.index)?e:e.substring(0,t.index).trimEnd()},EK=e=>!e.match(RG)||e.includes(`
82
+ `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,DK=e=>(e.match(/```/g)||[]).length%2==1,OK=e=>{let t=EK(e);if(t!==null)return t;let n=e.match(NG);if(n&&!DK(e)){let t=n[2];if(!t||FG.test(t))return e;if(wG(e)%2==1)return`${e}\``}return e},kK=(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]==="`"&&!kK(e,r)&&(n=!n),!n&&e[r]===`$`&&e[r+1]===`$`&&(t+=1,r+=1);return t},jK=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]===`\\`){r+=1;continue}if(e[r]==="`"&&!kK(e,r)){n=!n;continue}!n&&e[r]===`$`&&(r+1<e.length&&e[r+1]===`$`?r+=1:t+=1)}return t},MK=e=>{if(e.endsWith(`$`)&&!e.endsWith(`$$`))return`${e}$`;let t=e.indexOf(`$$`);return t!==-1&&e.indexOf(`
83
+ `,t)!==-1&&!e.endsWith(`
84
+ `)?`${e}
85
+ $$`:`${e}$$`},NK=e=>AK(e)%2==0?e:MK(e),PK=e=>jK(e)%2==1?`${e}$`:e,FK=(e,t,n)=>{if(e.substring(t+2).includes(`)`))return null;let r=WG(e,t);if(r===-1||SG(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)`},IK=(e,t)=>{for(let n=0;n<t;n++)if(e[n]===`[`&&!SG(e,n)){if(n>0&&e[n-1]===`!`)continue;let t=GG(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},LK=(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=IK(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}if(GG(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=IK(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}return null},RK=(e,t=`protocol`)=>{let n=e.lastIndexOf(`](`);if(n!==-1&&!SG(e,n)){let r=FK(e,n,t);if(r!==null)return r}for(let n=e.length-1;n>=0;--n)if(e[n]===`[`&&!SG(e,n)){let r=LK(e,n,t);if(r!==null)return r}return e},zK=/^-{1,2}$/,BK=/^[\s]*-{1,2}[\s]+$/,VK=/^={1,2}$/,HK=/^[\s]*={1,2}[\s]+$/,UK=e=>{if(!e||typeof e!=`string`)return e;let t=e.lastIndexOf(`
86
+ `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(zK.test(i)&&!n.match(BK)){let t=r.split(`
87
+ `).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}if(VK.test(i)&&!n.match(HK)){let t=r.split(`
88
+ `).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}return e},WK=/([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu,GK=e=>!e||typeof e!=`string`||!e.includes(`~`)?e:e.replace(WK,(t,n,r)=>SG(e,r+n.length)?t:`${n}\\~`),KK=e=>{let t=e.match(PG);if(t){let n=t[2];if(!n||FG.test(n))return e;let r=e.lastIndexOf(t[1]);if(SG(e,r)||TG(e,r))return e;if(e.match(HG)?.length%2==1)return`${e}~~`}else{let t=e.match(VG);if(t){let n=e.lastIndexOf(t[0].slice(0,2));if(SG(e,n)||TG(e,n))return e;if(e.match(HG)?.length%2==1)return`${e}~`}}return e},qK=e=>e!==!1,JK=e=>e===!0,YK={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},XK=[{handler:{name:`singleTilde`,handle:GK,priority:YK.SINGLE_TILDE},optionKey:`singleTilde`},{handler:{name:`comparisonOperators`,handle:DG,priority:YK.COMPARISON_OPERATORS},optionKey:`comparisonOperators`},{handler:{name:`htmlTags`,handle:TK,priority:YK.HTML_TAGS},optionKey:`htmlTags`},{handler:{name:`setextHeadings`,handle:UK,priority:YK.SETEXT_HEADINGS},optionKey:`setextHeadings`},{handler:{name:`links`,handle:RK,priority:YK.LINKS},optionKey:`links`,earlyReturn:e=>e.endsWith(`](streamdown:incomplete-link)`)},{handler:{name:`boldItalic`,handle:CK,priority:YK.BOLD_ITALIC},optionKey:`boldItalic`},{handler:{name:`bold`,handle:fK,priority:YK.BOLD},optionKey:`bold`},{handler:{name:`italicDoubleUnderscore`,handle:mK,priority:YK.ITALIC_DOUBLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`italicSingleAsterisk`,handle:gK,priority:YK.ITALIC_SINGLE_ASTERISK},optionKey:`italic`},{handler:{name:`italicSingleUnderscore`,handle:bK,priority:YK.ITALIC_SINGLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`inlineCode`,handle:OK,priority:YK.INLINE_CODE},optionKey:`inlineCode`},{handler:{name:`strikethrough`,handle:KK,priority:YK.STRIKETHROUGH},optionKey:`strikethrough`},{handler:{name:`katex`,handle:NK,priority:YK.KATEX},optionKey:`katex`},{handler:{name:`inlineKatex`,handle:PK,priority:YK.INLINE_KATEX},optionKey:`inlineKatex`}],ZK=e=>{let t=e?.linkMode??`protocol`;return XK.filter(({handler:t,optionKey:n})=>t.name===`links`?qK(e?.links)||qK(e?.images):t.name===`inlineKatex`?JK(e?.inlineKatex):qK(e?.[n])).map(({handler:e,earlyReturn:n})=>e.name===`links`?{handler:yG(vG({},e),{handle:e=>RK(e,t)}),earlyReturn:t===`protocol`?n:void 0}:{handler:e,earlyReturn:n})},QK=(e,t)=>{if(!e||typeof e!=`string`)return e;let n=e.endsWith(` `)&&!e.endsWith(` `)?e.slice(0,-1):e,r=ZK(t),i=(t?.handlers??[]).map(e=>({handler:yG(vG({},e),{priority:e.priority??YK.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},$K=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tq={};function nq(e,t){return((t||tq).jsx?eq:$K).test(e)}var rq=/[ \t\n\f\r]/g;function iq(e){return typeof e==`object`?e.type===`text`&&aq(e.value):aq(e)}function aq(e){return e.replace(rq,``)===``}var oq=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(`
89
+ `);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})),sq=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(oq());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}})),cq=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))}})),lq=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(sq()),r=cq();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 uq(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?fq(e.position):`start`in e||`end`in e?fq(e):`line`in e||`column`in e?dq(e):``}function dq(e){return pq(e&&e.line)+`:`+pq(e&&e.column)}function fq(e){return dq(e&&e.start)+`-`+dq(e&&e.end)}function pq(e){return e&&typeof e==`number`?e:1}var mq=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=uq(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}};mq.prototype.file=``,mq.prototype.name=``,mq.prototype.reason=``,mq.prototype.message=``,mq.prototype.stack=``,mq.prototype.column=void 0,mq.prototype.line=void 0,mq.prototype.ancestors=void 0,mq.prototype.cause=void 0,mq.prototype.fatal=void 0,mq.prototype.place=void 0,mq.prototype.ruleId=void 0,mq.prototype.source=void 0;var hq=l(lq(),1),gq={}.hasOwnProperty,_q=new Map,vq=/[A-Z]/g,yq=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),bq=new Set([`td`,`th`]),xq=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Sq(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=Nq(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=Mq(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`?dI:uI,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Cq(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Cq(e,t,n){if(t.type===`element`)return wq(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Tq(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Dq(e,t,n);if(t.type===`mdxjsEsm`)return Eq(e,t);if(t.type===`root`)return Oq(e,t,n);if(t.type===`text`)return kq(e,t)}function wq(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=dI,e.schema=i),e.ancestors.push(t);let a=zq(e,t.tagName,!1),o=Pq(e,t),s=Iq(e,t);return yq.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!iq(e)})),Aq(e,o,a,t),jq(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Tq(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)}Bq(e,t.position)}function Eq(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bq(e,t.position)}function Dq(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=dI,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:zq(e,t.name,!0),o=Fq(e,t),s=Iq(e,t);return Aq(e,o,a,t),jq(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Oq(e,t,n){let r={};return jq(r,Iq(e,t)),e.create(t,e.Fragment,r,n)}function kq(e,t){return t.value}function Aq(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jq(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Mq(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 Nq(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=az(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 Pq(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&gq.call(t.properties,i)){let a=Lq(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&bq.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 Fq(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 Bq(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 Bq(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Iq(e,t){let n=[],r=-1,i=e.passKeys?new Map:_q;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=Cq(e,a,o);s!==void 0&&n.push(s)}return n}function Lq(e,t,n){let r=sI(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?pI(n):_I(n)),r.property===`style`){let t=typeof n==`object`?n:Rq(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Vq(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?rI[r.property]||r.property:r.attribute,n]}}function Rq(e,t){try{return(0,hq.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new mq("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=xq+`#cannot-parse-style-attribute`,r}}function zq(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=nq(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=nq(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return gq.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bq(e)}function Bq(e,t){let n=new mq("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=xq+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Vq(e){let t={},n;for(n in e)gq.call(e,n)&&(t[Hq(n)]=e[n]);return t}function Hq(e){let t=e.replace(vq,Uq);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Uq(e){return`-`+e.toLowerCase()}var Wq={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`]},Gq={tokenize:Kq};function Kq(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`),cU(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 nB(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var qq={tokenize:Yq},Jq={tokenize:Xq};function Yq(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 wH(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(Jq,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(Jq,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 nB(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++;wH(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 Xq(e,t,n){return cU(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var Zq={tokenize:Qq};function Qq(e){let t=this,n=e.attempt(lU,r,e.attempt(this.parser.constructs.flowInitial,i,cU(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FU,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 $q={resolveAll:rJ()},eJ=nJ(`string`),tJ=nJ(`text`);function nJ(e){return{resolveAll:rJ(e===`text`?iJ: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 rJ(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 iJ(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 aJ=s({attentionMarkers:()=>pJ,contentInitial:()=>sJ,disable:()=>mJ,document:()=>oJ,flow:()=>lJ,flowInitial:()=>cJ,insideSpan:()=>fJ,string:()=>uJ,text:()=>dJ}),oJ={42:OW,43:OW,45:OW,48:OW,49:OW,50:OW,51:OW,52:OW,53:OW,54:OW,55:OW,56:OW,57:OW,62:dU},sJ={91:WU},cJ={[-2]:CU,[-1]:CU,32:CU},lJ={35:XU,42:EW,45:[IW,EW],60:tW,61:IW,95:EW,96:bU,126:bU},uJ={38:_U,92:hU},dJ={[-5]:wW,[-4]:wW,[-3]:wW,33:bW,38:_U,42:nU,60:[oU,cW],91:SW,92:[JU,hU],93:uW,95:nU,96:DU},fJ={null:[nU,$q]},pJ={null:[42,95]},mJ={null:[]};function hJ(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=TH(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=tU(a,l.events,l),l.events):[]}function f(e,t){return _J(p(e),t)}function p(e){return gJ(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){nB(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&&wH(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 gJ(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 _J(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=`
90
+ `;break;case-3:o=`\r
91
+ `;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 vJ(e){let t={constructs:DH([aJ,...(e||{}).extensions||[]]),content:n(Gq),defined:[],document:n(qq),flow:n(Zq),lazy:{},string:n(eJ),text:n(tJ)};return t;function n(e){return n;function n(n){return hJ(t,e,n)}}}function yJ(e){for(;!NU(e););return e}var bJ=/[\0\t\n\r]/g;function xJ(){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(bJ.lastIndex=u,c=bJ.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 SJ={}.hasOwnProperty;function CJ(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),wJ(n)(yJ(vJ(n).document().write(xJ()(e,t,!0))))}function wJ(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(fe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ce),blockQuote:a(ie),characterEscape:T,characterReference:T,codeFenced:a(ae),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ae,o),codeText:a(H,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:V,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:B,characterReference:ne,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()}};EJ(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]];SJ.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]||OJ).call(a,void 0,e[0])}for(r.position={start:TJ(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:TJ(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:TJ(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]||OJ).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+uq({start:e.start,end:e.end})+`): it’s not open`);n.position.end=TJ(e.end)}function u(){return bV(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=kB(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:TJ(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=TJ(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=TJ(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=oH(t),n.identifier=kB(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=kB(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function te(e){this.data.characterReferenceType=e.type}function B(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=iH(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=rH(t);let i=this.stack[this.stack.length-1];i.value+=r}function ne(e){let t=this.stack.pop();t.position.end=TJ(e.end)}function re(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function V(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ie(){return{type:`blockquote`,children:[]}}function ae(){return{type:`code`,lang:null,meta:null,value:``}}function H(){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 TJ(e){return{line:e.line,column:e.column,offset:e.offset}}function EJ(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?EJ(e,r):DJ(e,r)}}function DJ(e,t){let n;for(n in t)if(SJ.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 OJ(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+uq({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+uq({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+uq({start:t.start,end:t.end})+`) is still open`)}function kJ(e){let t=this;t.parser=n;function n(n){return CJ(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 jJ(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
92
+ `}]}function MJ(e,t){let n=t.value?t.value+`
93
+ `:``,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 NJ(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PJ(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FJ(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=eU(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 IJ(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 LJ(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function RJ(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 zJ(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return RJ(e,t);let i={src:eU(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 BJ(e,t){let n={src:eU(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 VJ(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 HJ(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return RJ(e,t);let i={href:eU(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 UJ(e,t){let n={href:eU(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 WJ(e,t,n){let r=e.all(t),i=n?GJ(n):KJ(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:`
94
+ `}),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:`
95
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function GJ(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=KJ(n[r])}return t}function KJ(e){return e.spread??e.children.length>1}function qJ(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 JJ(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YJ(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function XJ(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZJ(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=az(t.children[1]),o=iz(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 QJ(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 $J(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var eY=9,tY=32;function nY(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(rY(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(rY(t.slice(i),i>0,!1)),a.join(``)}function rY(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===eY||t===tY;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===eY||t===tY;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function iY(e,t){let n={type:`text`,value:nY(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function aY(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var oY={blockquote:AJ,break:jJ,code:MJ,delete:NJ,emphasis:PJ,footnoteReference:FJ,heading:IJ,html:LJ,imageReference:zJ,image:BJ,inlineCode:VJ,linkReference:HJ,link:UJ,listItem:WJ,list:qJ,paragraph:JJ,root:YJ,strong:XJ,table:ZJ,tableCell:$J,tableRow:QJ,text:iY,thematicBreak:aY,toml:sY,yaml:sY,definition:sY,footnoteDefinition:sY};function sY(){}function cY(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 lY(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function uY(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||cY,r=e.options.footnoteBackLabel||lY,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=eU(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:{...AF(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
96
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
97
+ `}]}}var dY={}.hasOwnProperty,fY={};function pY(e,t){let n=t||fY,r=new Map,i=new Map,a={all:s,applyData:hY,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...oY,...n.handlers},one:o,options:n,patch:mY,wrap:_Y};return iF(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(dY.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=AF(n);return r.children=a.all(e),r}return AF(e)}return(a.options.unknownHandler||gY)(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=vY(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=vY(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function mY(e,t){e.position&&(t.position=sz(e))}function hY(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,AF(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function gY(e,t){let n=t.data||{},r=`value`in t&&!(dY.call(n,`hProperties`)||dY.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 _Y(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
98
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
99
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
100
+ `}),n}function vY(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function yY(e,t){let n=pY(e,t),r=n.one(e,void 0),i=uY(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
101
+ `},i)),a}function bY(e,t){return e&&`run`in e?async function(n,r){let i=yY(n,{file:r,...t});await e.run(i,r)}:function(n,r){return yY(n,{file:r,...e||t})}}function xY(e){if(e)throw e}var SY=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 CY(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 wY(){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?TY(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 TY(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 EY={basename:DY,dirname:OY,extname:kY,join:AY,sep:`/`};function DY(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);NY(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 OY(e){if(NY(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 kY(e){NY(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;)NY(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:jY(n)}function jY(e){NY(e);let t=e.codePointAt(0)===47,n=MY(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function MY(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 NY(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var PY={cwd:FY};function FY(){return`/`}function IY(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function LY(e){if(typeof e==`string`)e=new URL(e);else if(!IY(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 RY(e)}function RY(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 zY=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],BY=class{constructor(e){let t;t=e?IY(e)?{path:e}:typeof e==`string`||WY(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:PY.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<zY.length;){let e=zY[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)zY.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?EY.basename(this.path):void 0}set basename(e){HY(e,`basename`),VY(e,`basename`),this.path=EY.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?EY.dirname(this.path):void 0}set dirname(e){UY(this.basename,`dirname`),this.path=EY.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?EY.extname(this.path):void 0}set extname(e){if(VY(e,`extname`),UY(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=EY.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){IY(e)&&(e=LY(e)),HY(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?EY.basename(this.path,this.extname):void 0}set stem(e){HY(e,`stem`),VY(e,`stem`),this.path=EY.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 mq(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 VY(e,t){if(e&&e.includes(EY.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+EY.sep+"`")}function HY(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function UY(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function WY(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var GY=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),KY=l(SY(),1),qY={}.hasOwnProperty,JY=new class e extends GY{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=wY()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,KY.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(ZY(`data`,this.frozen),this.namespace[e]=t,this):qY.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ZY(`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=eX(e),n=this.parser||this.Parser;return YY(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),YY(`process`,this.parser||this.Parser),XY(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=eX(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);nX(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(),YY(`processSync`,this.parser||this.Parser),XY(`processSync`,this.compiler||this.Compiler),this.process(e,r),$Y(`processSync`,`process`,t),n;function r(e,r){t=!0,xY(e),n=r}}run(e,t,n){QY(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=eX(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),$Y(`runSync`,`run`,n),r;function i(e,t){xY(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=eX(t),r=this.compiler||this.Compiler;return XY(`stringify`,r),QY(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(ZY(`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,KY.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];CY(o)&&CY(r)&&(r=(0,KY.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function YY(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function XY(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function ZY(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 QY(e){if(!CY(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function $Y(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function eX(e){return tX(e)?e:new BY(e)}function tX(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function nX(e){return typeof e==`string`||rX(e)}function rX(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function iX(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var aX=iX();function oX(e){aX=e}var sX={exec:()=>null};function cX(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(uX.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var lX=(()=>{try{return!0}catch{return!1}})(),uX={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)}}>`)},dX=/^(?:[ \t]*(?:\n|$))+/,fX=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,pX=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mX=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,hX=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,gX=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,_X=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vX=cX(_X).replace(/bull/g,gX).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(),yX=cX(_X).replace(/bull/g,gX).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(),bX=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,xX=/^[^\n]+/,SX=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,CX=cX(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,SX).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),wX=cX(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,gX).getRegex(),TX=`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`,EX=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,DX=cX(`^ {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`,EX).replace(`tag`,TX).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),OX=cX(bX).replace(`hr`,mX).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`,TX).getRegex(),kX={blockquote:cX(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,OX).getRegex(),code:fX,def:CX,fences:pX,heading:hX,hr:mX,html:DX,lheading:vX,list:wX,newline:dX,paragraph:OX,table:sX,text:xX},AX=cX(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,mX).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`,TX).getRegex(),jX={...kX,lheading:yX,table:AX,paragraph:cX(bX).replace(`hr`,mX).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`,TX).getRegex()},MX={...kX,html:cX(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,EX).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:sX,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:cX(bX).replace(`hr`,mX).replace(`heading`,` *#{1,6} *[^
102
+ ]`).replace(`lheading`,vX).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},NX=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,PX=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,FX=/^( {2,}|\\)\n(?!\s*$)/,IX=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,LX=/[\p{P}\p{S}]/u,RX=/[\s\p{P}\p{S}]/u,zX=/[^\s\p{P}\p{S}]/u,BX=cX(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,RX).getRegex(),VX=/(?!~)[\p{P}\p{S}]/u,HX=/(?!~)[\s\p{P}\p{S}]/u,UX=/(?:[^\s\p{P}\p{S}]|~)/u,WX=cX(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,lX?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),GX=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,KX=cX(GX,`u`).replace(/punct/g,LX).getRegex(),qX=cX(GX,`u`).replace(/punct/g,VX).getRegex(),JX=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,YX=cX(JX,`gu`).replace(/notPunctSpace/g,zX).replace(/punctSpace/g,RX).replace(/punct/g,LX).getRegex(),XX=cX(JX,`gu`).replace(/notPunctSpace/g,UX).replace(/punctSpace/g,HX).replace(/punct/g,VX).getRegex(),ZX=cX(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,zX).replace(/punctSpace/g,RX).replace(/punct/g,LX).getRegex(),QX=cX(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,LX).getRegex(),$X=cX(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,zX).replace(/punctSpace/g,RX).replace(/punct/g,LX).getRegex(),eZ=cX(/\\(punct)/,`gu`).replace(/punct/g,LX).getRegex(),tZ=cX(/^<(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(),nZ=cX(EX).replace(`(?:-->|$)`,`-->`).getRegex(),rZ=cX(`^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`,nZ).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),iZ=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,aZ=cX(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,iZ).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),oZ=cX(/^!?\[(label)\]\[(ref)\]/).replace(`label`,iZ).replace(`ref`,SX).getRegex(),sZ=cX(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,SX).getRegex(),cZ=cX(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,oZ).replace(`nolink`,sZ).getRegex(),lZ=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,uZ={_backpedal:sX,anyPunctuation:eZ,autolink:tZ,blockSkip:WX,br:FX,code:PX,del:sX,delLDelim:sX,delRDelim:sX,emStrongLDelim:KX,emStrongRDelimAst:YX,emStrongRDelimUnd:ZX,escape:NX,link:aZ,nolink:sZ,punctuation:BX,reflink:oZ,reflinkSearch:cZ,tag:rZ,text:IX,url:sX},dZ={...uZ,link:cX(/^!?\[(label)\]\((.*?)\)/).replace(`label`,iZ).getRegex(),reflink:cX(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,iZ).getRegex()},fZ={...uZ,emStrongRDelimAst:XX,emStrongLDelim:qX,delLDelim:QX,delRDelim:$X,url:cX(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,lZ).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:cX(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,lZ).getRegex()},pZ={...fZ,br:cX(FX).replace(`{2,}`,`*`).getRegex(),text:cX(fZ.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},mZ={normal:kX,gfm:jX,pedantic:MX},hZ={normal:uZ,gfm:fZ,breaks:pZ,pedantic:dZ},gZ={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},_Z=e=>gZ[e];function vZ(e,t){if(t){if(uX.escapeTest.test(e))return e.replace(uX.escapeReplace,_Z)}else if(uX.escapeTestNoEncode.test(e))return e.replace(uX.escapeReplaceNoEncode,_Z);return e}function yZ(e){try{e=encodeURI(e).replace(uX.percentDecode,`%`)}catch{return null}return e}function bZ(e,t){let n=e.replace(uX.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(uX.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(uX.slashPipe,`|`);return n}function xZ(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 SZ(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 CZ(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 wZ(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 TZ(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
103
+ `).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(`
104
+ `)}var EZ=class{options;rules;lexer;constructor(e){this.options=e||aX}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:xZ(e,`
105
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=TZ(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=xZ(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:xZ(t[0],`
106
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=xZ(t[0],`
107
+ `).split(`
108
+ `),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(`
109
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
110
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
111
+ ${s}`:s,r=r?`${r}
112
+ ${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+`
113
+ `+e.join(`
114
+ `),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+`
115
+ `+e.join(`
116
+ `),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(`
117
+ `);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=CZ(t[2].split(`
118
+ `,1)[0],t[1].length),l=e.split(`
119
+ `,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+`
120
+ `,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(`
121
+ `,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+=`
122
+ `+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+=`
123
+ `+l}u=!l.trim(),r+=p+`
124
+ `,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=bZ(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
125
+ `):[],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(bZ(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)===`
126
+ `?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=xZ(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=SZ(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)),wZ(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 wZ(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}}}},DZ=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||aX,this.options.tokenizer=this.options.tokenizer||new EZ,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:uX,block:mZ.normal,inline:hZ.normal};this.options.pedantic?(t.block=mZ.pedantic,t.inline=hZ.pedantic):this.options.gfm&&(t.block=mZ.gfm,t.inline=this.options.breaks?hZ.breaks:hZ.gfm),this.tokenizer.rules=t}static get rules(){return{block:mZ,inline:hZ}}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(uX.carriageReturn,`
127
+ `),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(uX.tabCharGlobal,` `).replace(uX.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+=`
128
+ `: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(`
129
+ `)?``:`
130
+ `)+r.raw,n.text+=`
131
+ `+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(`
132
+ `)?``:`
133
+ `)+r.raw,n.text+=`
134
+ `+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(`
135
+ `)?``:`
136
+ `)+r.raw,a.text+=`
137
+ `+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(`
138
+ `)?``:`
139
+ `)+r.raw,n.text+=`
140
+ `+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}},OZ=class{options;parser;constructor(e){this.options=e||aX}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(uX.notSpaceStart)?.[0],i=e.replace(uX.endingNewline,``)+`
141
+ `;return r?`<pre><code class="language-`+vZ(r)+`">`+(n?i:vZ(i,!0))+`</code></pre>
142
+ `:`<pre><code>`+(n?i:vZ(i,!0))+`</code></pre>
143
+ `}blockquote({tokens:e}){return`<blockquote>
144
+ ${this.parser.parse(e)}</blockquote>
145
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
146
+ `}hr(e){return`<hr>
147
+ `}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+`>
148
+ `+r+`</`+i+`>
149
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
150
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
151
+ `}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>
152
+ <thead>
153
+ `+t+`</thead>
154
+ `+r+`</table>
155
+ `}tablerow({text:e}){return`<tr>
156
+ ${e}</tr>
157
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
158
+ `}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>${vZ(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=yZ(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+vZ(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=yZ(e);if(i===null)return vZ(n);e=i;let a=`<img src="${e}" alt="${vZ(n)}"`;return t&&(a+=` title="${vZ(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:vZ(e.text)}},kZ=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||aX,this.options.renderer=this.options.renderer||new OZ,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new kZ}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}},jZ=class{options;block;constructor(e){this.options=e||aX}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?DZ.lex:DZ.lexInline}provideParser(e=this.block){return e?AZ.parse:AZ.parseInline}},MZ=new class{defaults=iX();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=AZ;Renderer=OZ;TextRenderer=kZ;Lexer=DZ;Tokenizer=EZ;Hooks=jZ;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 OZ(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 EZ(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 jZ;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]=jZ.passThroughHooks.has(n)?e=>{if(this.defaults.async&&jZ.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 DZ.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?DZ.lex:DZ.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?DZ.lex:DZ.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+=`
159
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+vZ(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function NZ(e,t){return MZ.parse(e,t)}NZ.options=NZ.setOptions=function(e){return MZ.setOptions(e),NZ.defaults=MZ.defaults,oX(NZ.defaults),NZ},NZ.getDefaults=iX,NZ.defaults=aX,NZ.use=function(...e){return MZ.use(...e),NZ.defaults=MZ.defaults,oX(NZ.defaults),NZ},NZ.walkTokens=function(e,t){return MZ.walkTokens(e,t)},NZ.parseInline=MZ.parseInline,NZ.Parser=AZ,NZ.parser=AZ.parse,NZ.Renderer=OZ,NZ.TextRenderer=kZ,NZ.Lexer=DZ,NZ.lexer=DZ.lex,NZ.Tokenizer=EZ,NZ.Hooks=jZ,NZ.parse=NZ,NZ.options,NZ.setOptions,NZ.use,NZ.walkTokens,NZ.parseInline,AZ.parse,DZ.lex;var PZ=300,FZ=`300px`,IZ=500;function LZ(e={}){let{immediate:t=!1,debounceDelay:n=PZ,rootMargin:r=FZ,idleTimeout:i=IZ}=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 RZ=320,zZ=4,BZ=()=>typeof performance>`u`?Date.now():performance.now();function VZ(e){let t=e?.now??BZ,n=e?.maxBacklogMs??RZ,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,zZ),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 HZ=/\s/,UZ=/^\s+$/,WZ=new Set([`pre`,`svg`,`math`,`annotation`]),GZ=new Set([`img`,`hr`]),KZ=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,qZ=e=>e.some(e=>KZ(e)&&WZ.has(e.tagName)),JZ=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(KZ(n)&&n.tagName===`li`)return n}},YZ=(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}`},XZ=new Set([`ul`,`ol`,`li`]),ZZ=e=>{for(let t of e.children)if(KZ(t)){if(t.tagName===`input`)return t;if(XZ.has(t.tagName))continue;let e=ZZ(t);if(e)return e}},QZ=(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`},$Z=(e,t,n,r)=>{let i=ZZ(e);i&&QZ(i,t,n,r)},eQ=(e,t,n,r,i,a)=>{if(qZ(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;QZ(e,n,c?0:n.duration,l)},tQ=e=>{var t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(KZ(r)){if((t=r.properties)!=null&&t[`data-sd-animated`])break;r.properties={...r.properties,"data-sd-animated":!0}}}},nQ=e=>{let t=[],n=``,r=!1;for(let i of e){let e=HZ.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},rQ=e=>{let t=[],n=``;for(let r of e)HZ.test(r)?t.length>0&&!UZ.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},iQ=(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}]}},aQ=(e,t)=>!(e>0&&t<e),oQ=e=>KZ(e)&&GZ.has(e.tagName),sQ=(e,t,n)=>{let r=0,i=0;return nF(e,e=>e.type===`text`||oQ(e),(e,a)=>{if(qZ(a))return tF;if(oQ(e)){aQ(n,i)&&(r+=1),i+=1;return}let o=e.value;if(!o.trim()){i+=o.length;return}let s=t.sep===`char`?rQ(o):nQ(o);for(let e of s){let t=i;i+=e.length,!UZ.test(e)&&aQ(n,t)&&(r+=1)}}),r},cQ=(e,t,n,r,i,a)=>{var o;let s=t.at(-1);if(!(s&&`children`in s))return;if(qZ(t))return tF;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`?rQ(u):nQ(u),f=r.prevContentLength,p=!1,m=JZ(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,UZ.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;YZ(m,e,o,n.easing),$Z(m,n,e,o),g=!0}return iQ(e,n.animation,n.duration,n.easing,r,o)});return p&&tQ(t),c.children.splice(l,1,..._),l+_.length},lQ=0;function uQ(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=lQ++,i=()=>e=>{let r={count:0,newIndex:0};n.prevContentLength=n.committedCharCount;let i=t.timeline,a=i?.now()??BZ();i&&(n.pendingMark===null?n.pendingMark=i.mark():i.rewind(n.pendingMark));let o=i?i.take(sQ(e,t,n.prevContentLength),t.stagger,a):{baseDelay:0,step:t.stagger};nF(e,e=>e.type===`text`||oQ(e),(e,i)=>{if(e.type===`text`)return cQ(e,i,t,n,r,o);eQ(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}}}uQ();var dQ=(0,v.createContext)(!1),fQ=()=>(0,v.useContext)(dQ),pQ=(...e)=>oo(Si(e)),mQ=(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(` `)},hQ=e=>e?(...t)=>mQ(e,oo(Si(t))):pQ,gQ=(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)},_Q=(0,v.createContext)(pQ),vQ=()=>(0,v.useContext)(_Q),yQ=8,bQ=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}},xQ=(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<yQ;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},SQ=pQ(`block`),CQ=pQ(`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`),wQ=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},TQ=(0,v.memo)(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...s})=>{let c=vQ(),{isAnimating:l}=(0,v.useContext)(c0),u=bQ(i),d=xQ(l,!!u,t),f=(0,v.useMemo)(()=>c(CQ),[c]),p=(0,v.useMemo)(()=>c(SQ),[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,wQ(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===``?`
160
+ `: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))})})})}),EQ=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=vQ();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})},DQ=(0,v.createContext)({code:``}),OQ=()=>(0,v.useContext)(DQ),kQ=({language:e})=>{let t=vQ();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]===`
161
+ `;)t--;return e.slice(0,t)},jQ=(0,v.lazy)(()=>tN(()=>import(`./highlighted-body-KPVGNVTW-Dg6HJGi4.js`).then(e=>({default:e.HighlightedCodeBlockBody})),[])),MQ=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=vQ(),{codeBlockMaxHeight:l}=(0,v.useContext)(c0),u=(0,v.useMemo)(()=>AQ(e),[e]),d=(0,v.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
162
+ `).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[u]);return(0,U.jsx)(DQ.Provider,{value:{code:e},children:(0,U.jsxs)(EQ,{dir:`ltr`,isIncomplete:i,language:t,children:[(0,U.jsx)(kQ,{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)(TQ,{className:n,language:t,lineNumbers:o,maxHeight:l,result:d,startLine:a,...s}),children:(0,U.jsx)(jQ,{className:n,code:u,language:t,lineNumbers:o,maxHeight:l,raw:d,startLine:a,...s})})]})})},NQ={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`})})},PQ=(0,v.createContext)(NQ),FQ=(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])},IQ=({icons:e,children:t})=>{let n=(0,v.useRef)(e),r=(0,v.useRef)(e?{...NQ,...e}:NQ);FQ(n.current,e)||(n.current=e,r.current=e?{...NQ,...e}:NQ);let i=r.current;return(0,U.jsx)(PQ.Provider,{value:i,children:t})},LQ=()=>(0,v.useContext)(PQ),RQ={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`},zQ=(0,v.createContext)(RQ),BQ=()=>(0,v.useContext)(zQ),VQ=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=vQ(),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(0),{code:d}=OQ(),{isAnimating:f}=(0,v.useContext)(c0),p=BQ(),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=LQ(),_=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})]})},HQ=(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},UQ={"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`},WQ=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=vQ(),{code:c}=OQ(),{isAnimating:l,controls:u}=(0,v.useContext)(c0),d=BQ(),f=LQ(),p=a??c,m=n&&n in UQ?UQ[n]:`txt`,h=`${HQ(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{gQ(h,p,`text/plain`),e?.()}catch(e){t?.(e)}},title:d.downloadFile,type:`button`,...o,children:r??(0,U.jsx)(f.DownloadIcon,{size:14})})},GQ=()=>{let{Loader2Icon:e}=LQ(),t=vQ();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`)})})]})},KQ=/\.[^/.]+$/,qQ=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:s=!0,...c})=>{let{DownloadIcon:l}=LQ(),u=vQ(),d=(0,v.useRef)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),g=BQ(),_=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(KQ,``)}.${i}`}gQ(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},JQ=0,YQ=()=>{JQ+=1,JQ===1&&(document.body.style.overflow=`hidden`)},XQ=()=>{JQ=Math.max(0,JQ-1),JQ===0&&(document.body.style.overflow=``)},ZQ=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=LQ(),c=vQ(),[l,u]=(0,v.useState)(!1),d=BQ(),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){YQ();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),XQ()}}},[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,Td.createPortal)(m,document.body)},QQ=(0,v.createContext)(null),$Q=()=>(0,v.useContext)(QQ),e$=()=>$Q()?.code??null,t$=()=>$Q()?.mermaid??null,n$=e=>{var t;let n=$Q();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},r$=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},i$=(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}),a$=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=vQ(),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),{isAnimating:u,controls:d}=(0,v.useContext)(c0),f=LQ(),p=t$(),m=BQ(),h=HQ(d,`mermaid`,`diagram`),g=async t=>{try{if(t===`mmd`){gQ(`${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=r$(l);if(t===`svg`){gQ(`${h}.svg`,u,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){let e=await i$(u);gQ(`${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]})},o$=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=LQ(),c=vQ(),[l,u]=(0,v.useState)(!1),{isAnimating:d,controls:f}=(0,v.useContext)(c0),p=BQ(),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){YQ();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),XQ()}}},[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,Td.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)(a$,{chart:e,config:t}):null,g?(0,U.jsx)(VQ,{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)(f0,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})};function s$(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent??``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e;return t.tagName===`BR`?`
163
+ `:Array.from(t.childNodes).map(s$).join(``)}var c$=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(s$(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(s$(e).trim());n.push(t)}return{headers:t,rows:n}},l$=e=>{if(typeof e!=`object`)return`,`;let t=e.table;return typeof t==`object`?t.csvSeparator??`,`:`,`},u$=(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===`
164
+ `||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(`
165
+ `)},d$=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
166
+ `||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
167
+ `?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(`
168
+ `)},f$=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`||n===`
169
+ `){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):t===`
170
+ `?n.push(`<br>`):n.push(t);return n.join(``)},p$=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0,a=t.map(e=>f$(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?f$(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else{let t=e.map(e=>f$(e));r[i]=`| ${t.join(` | `)} |`,i+=1}return r.join(`
171
+ `)},m$=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=vQ(),[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)(c0),m=BQ(),h=l$(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=c$(t),o=``;o=e===`csv`?u$(a,h):e===`tsv`?d$(a):p$(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 _=LQ(),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]})},h$=({children:e,className:t,onDownload:n,onError:r})=>{let i=vQ(),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),{isAnimating:c,controls:l}=(0,v.useContext)(c0),u=BQ(),d=LQ(),f=l$(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=c$(t),a=e===`csv`?u$(i,f):p$(i),c=e===`csv`?`csv`:`md`;gQ(`${HQ(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]})},g$=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=LQ(),o=vQ(),[s,c]=(0,v.useState)(!1),{isAnimating:l}=(0,v.useContext)(c0),u=BQ(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,v.useEffect)(()=>{if(s){YQ();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),XQ()}}},[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,Td.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)(m$,{}):null,r?(0,U.jsx)(h$,{}):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]})},_$=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=vQ(),{isAnimating:l}=(0,v.useContext)(c0),u=bQ(n),d=xQ(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)(m$,{}):null,p?(0,U.jsx)(h$,{}):null,m?(0,U.jsx)(g$,{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})})]})},v$=/startLine=(\d+)/,y$=/\bnoLineNumbers\b/,b$=(0,v.lazy)(()=>tN(()=>import(`./mermaid-HWGCJPDP-CVg1TLJU.js`).then(e=>({default:e.Mermaid})),[])),x$=/language-([^\s]+)/,S$=`node`;function C$(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!==S$&&!Object.is(r[e],i[e]))return!1;return!0}function w$(e,t){return e?.properties?.metastring===t?.properties?.metastring}var T$=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,E$=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},D$=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},O$=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},k$=(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=vQ();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)=>C$(e,t));A$.displayName=`MarkdownOl`;var j$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();return(0,U.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>C$(e,t));j$.displayName=`MarkdownLi`;var M$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();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)=>C$(e,t));M$.displayName=`MarkdownUl`;var N$=(0,v.memo)(({className:e,node:t,...n})=>{let r=vQ();return(0,U.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>C$(e,t));N$.displayName=`MarkdownHr`;var P$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();return(0,U.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>C$(e,t));P$.displayName=`MarkdownStrong`;var F$=(0,v.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=vQ(),{linkSafety:o}=(0,v.useContext)(c0),[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)(ZQ,{...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)=>C$(e,t));F$.displayName=`MarkdownA`;var I$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();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)=>C$(e,t));I$.displayName=`MarkdownH1`;var L$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();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)=>C$(e,t));L$.displayName=`MarkdownH2`;var R$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();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)=>C$(e,t));R$.displayName=`MarkdownH3`;var z$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();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)=>C$(e,t));z$.displayName=`MarkdownH4`;var B$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();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)=>C$(e,t));B$.displayName=`MarkdownH5`;var V$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();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)=>C$(e,t));V$.displayName=`MarkdownH6`;var H$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,v.useContext)(c0),o=T$(i,`table`),s=E$(i,`copy`),c=E$(i,`download`),l=E$(i,`fullscreen`);return(0,U.jsx)(_$,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>C$(e,t));H$.displayName=`MarkdownTable`;var U$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();return(0,U.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>C$(e,t));U$.displayName=`MarkdownThead`;var W$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();return(0,U.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>C$(e,t));W$.displayName=`MarkdownTbody`;var G$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();return(0,U.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>C$(e,t));G$.displayName=`MarkdownTr`;var K$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();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)=>C$(e,t));K$.displayName=`MarkdownTh`;var q$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();return(0,U.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>C$(e,t));q$.displayName=`MarkdownTd`;var J$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();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)=>C$(e,t));J$.displayName=`MarkdownBlockquote`;var Y$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();return(0,U.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>C$(e,t));Y$.displayName=`MarkdownSup`;var X$=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=vQ();return(0,U.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>C$(e,t));X$.displayName=`MarkdownSub`;var Z$=(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)=>C$(e,t));Z$.displayName=`MarkdownSection`;var Q$=(0,v.memo)(({node:e,className:t,children:n,...r})=>{let i=vQ(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,v.useContext)(c0),l=t$(),u=fQ(),d=(t?.match(x$))?.at(1)??``,f=n$(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(v$),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&y$.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)(GQ,{}),children:(0,U.jsx)(e,{code:y,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=T$(s,`mermaid`),n=O$(s,`download`),r=O$(s,`copy`),a=O$(s,`fullscreen`),c=O$(s,`panZoom`),l=e&&(n||r||a);return(0,U.jsx)(v.Suspense,{fallback:(0,U.jsx)(GQ,{}),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)(a$,{chart:y,config:o?.config}):null,r?(0,U.jsx)(VQ,{code:y}):null,a?(0,U.jsx)(o$,{chart:y,config:o?.config}):null]})}):null,(0,U.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,U.jsx)(b$,{chart:y,config:o?.config,showControls:c})})]})})}let b=T$(s,`code`),x=D$(s,`download`),S=D$(s,`copy`),{"data-block":C,...w}=r;return(0,U.jsx)(MQ,{className:t,code:y,isIncomplete:u,language:d,lineNumbers:_,startLine:g,...w,children:b?(0,U.jsxs)(U.Fragment,{children:[x?(0,U.jsx)(WQ,{code:y,language:d}):null,S?(0,U.jsx)(VQ,{}):null]}):null})},(e,t)=>C$(e,t)&&w$(e.node,t.node));Q$.displayName=`MarkdownCode`;var $$=(0,v.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,v.useContext)(c0),i=T$(r,`image`),a=i&&k$(r,`download`);return(0,U.jsx)(qQ,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>C$(e,t));$$.displayName=`MarkdownImg`;var e1=(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)=>C$(e,t));e1.displayName=`MarkdownParagraph`;var t1={ol:A$,li:j$,ul:M$,hr:N$,strong:P$,a:F$,h1:I$,h2:L$,h3:R$,h4:z$,h5:B$,h6:V$,table:H$,thead:U$,tbody:W$,tr:G$,th:K$,td:q$,blockquote:J$,code:Q$,img:$$,pre:({children:e})=>(0,v.isValidElement)(e)?(0,v.cloneElement)(e,{"data-block":`true`}):e,sup:Y$,sub:X$,p:e1,section:Z$},n1=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,r1=/\p{L}/u;function i1(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(n1.test(e)){n??=`rtl`,i+=1;continue}r1.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var a1=/^[ \t]{0,3}(`{3,}|~{3,})/,o1=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,s1=e=>{let t=e.split(`
172
+ `),n=null,r=0;for(let e of t){let t=a1.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},c1=e=>{let t=e.split(`
173
+ `);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&o1.test(t))return!0}return!1},l1=()=>e=>{iF(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},u1=[],d1={allowDangerousHtml:!0},f1=new WeakMap,p1=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=f1.get(e);n||(n=e.name,f1.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=f1.get(r);e||(e=r.name,f1.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()}},m1=e=>{let t=h1(e),n=e.children||``;return S1(t.runSync(t.parse(n),n),e)},h1=e=>{let t=p1.get(e);if(t)return t;let n=_1(e);return p1.set(e,n),n},g1=e=>e.some(e=>Array.isArray(e)?e[0]===Oz:e===Oz),_1=e=>{let t=e.rehypePlugins||u1,n=e.remarkPlugins||u1,r=g1(t)?n:[...n,l1],i=e.remarkRehypeOptions?{...d1,...e.remarkRehypeOptions}:d1;return JY().use(kJ).use(r).use(bY,i).use(t)},v1=e=>e,y1=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},b1=(e,t)=>{for(let n in Wq)if(Object.hasOwn(Wq,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=Wq[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},x1=(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},S1=(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||v1;iF(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return y1(c,s,a,e.value),s;if(e.type===`element`&&(b1(e,t),x1(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 Sq(e,{Fragment:U.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.jsxs,passKeys:!0,passNode:!0})},C1=/\[\^[\w-]{1,200}\](?!:)/,w1=/\[\^[\w-]{1,200}\]:/,T1=/<([A-Za-z][\w:-]*)[\s>/]/,E1=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),D1=new Map,O1=new Map,k1=e=>{let t=e.toLowerCase(),n=D1.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return D1.set(t,r),r},A1=e=>{let t=e.toLowerCase(),n=O1.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return O1.set(t,r),r},j1=(e,t)=>{if(E1.has(t.toLowerCase()))return 0;let n=e.match(k1(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},M1=(e,t)=>{let n=e.match(A1(t));return n?n.length:0},N1=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},P1=e=>{let t=C1.test(e),n=w1.test(e);if(t||n)return[e];let r=DZ.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=j1(t,e),o=M1(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(T1);if(e){let n=e[1];j1(t,n)>M1(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(N1(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},F1=/^\n*/,I1=/\n*$/,L1=/\n\n/g,R1=(e,t,n)=>t.includes(`
174
+ `)?`${e}${t.replace(L1,`
175
+ <!---->
176
+ `).replace(F1,`
177
+
178
+ `).replace(I1,`
179
+
180
+ `)}${n}
181
+
182
+ `:e+t+n,z1=(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(`
183
+
184
+ `)){let n=c.slice(2).replace(L1,`
185
+ <!---->
186
+ `);r+=`${t}
187
+
188
+ ${n}`,i=e.length;break}if(!c.startsWith(`
189
+ `)){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(L1,`
190
+ <!---->
191
+ `);r+=`${t}
192
+
193
+ ${u}`,i=e.length;break}return i===0?e:r+e.slice(i)},B1=(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)=>R1(t,n,r)),n=z1(n,e)}return n},V1=/([\\`*_~[\]|])/g,H1=e=>e.replace(V1,`\\$1`),U1=(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+H1(n).replace(/\n\n/g,`&#10;&#10;`)+r)}return n},W1=new Set([`blockquote`,`dd`,`dt`,`figcaption`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`p`,`td`,`th`]),G1=new Set([`code`,`kbd`,`pre`,`samp`,`var`]);function K1(e){return e.children.map(e=>e.type===`text`?e.value:e.type===`element`&&!G1.has(e.tagName)?K1(e):``).join(``)}function q1(){return e=>{iF(e,`element`,e=>{if(G1.has(e.tagName)){e.properties??={},e.properties.dir=`ltr`;return}W1.has(e.tagName)&&(e.properties??={},typeof e.properties.dir!=`string`&&(e.properties.dir=i1(K1(e))))})}}var J1=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(J1).join(``):``,Y1=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));iF(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=J1(e);e.children=t?[{type:`text`,value:t}]:[]}})},X1=()=>e=>{iF(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},Z1=/^[ \t]*<[\w!/?-]/,Q1=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,$1=e=>typeof e!=`string`||e.length===0||!Z1.test(e)?e:e.replace(Q1,`$1`),e0={...Az,clobberPrefix:``,protocols:{...Az.protocols,href:[...Az.protocols?.href??[],`tel`,`streamdown`]},attributes:{...Az.attributes,code:[...Az.attributes?.code??[],`metastring`]}},t0={raw:Oz,sanitize:[qz,e0],harden:[oF,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},n0={gfm:[uG,{}],codeMeta:X1},r0=Object.values(t0),i0=Object.values(n0),a0={block:` ▋`,circle:` ●`},o0=[`github-light`,`github-dark`],s0={enabled:!0},c0=(0,v.createContext)({codeBlockMaxHeight:400,shikiTheme:o0,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:s0,tableMaxHeight:300}),l0=(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?$1(e):e,l=(0,U.jsx)(m1,{...s,children:c});return(0,U.jsx)(dQ.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});l0.displayName=`Block`;var u0=(0,v.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=r0,remarkPlugins:s=i0,className:c,shikiTheme:l,mermaid:u,codeBlockMaxHeight:d=400,controls:f=!0,isAnimating:p=!1,tableMaxHeight:m=300,animated:h,BlockComponent:g=l0,parseMarkdownIntoBlocksFn:_=P1,caret:y,plugins:b,remend:x,linkSafety:S=s0,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)(()=>hQ(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?QK(e,x):e;return T&&T.length>0&&(n=U1(n,T)),L.length>0&&(n=B1(n,L)),n},[e,t,r,x,L,T]),z=(0,v.useMemo)(()=>_(R),[R,_]),ee=(0,v.useMemo)(()=>n===`auto`?z.map(i1):void 0,[z,n]),te=(0,v.useMemo)(()=>z.map((e,t)=>`${M}-${t}`),[z.length,M]),B=(0,v.useMemo)(()=>h===!0?`true`:h?JSON.stringify(h):``,[h]),ne=(0,v.useRef)(null),re=(0,v.useRef)([]),V=(0,v.useRef)([]),ie=(0,v.useRef)(null),ae=(0,v.useRef)(``);B?(ae.current===B?ne.current||=VZ():(ae.current=B,ne.current=VZ({maxBacklogMs:B===`true`?void 0:h.maxBacklogMs}),re.current=[],V.current=[]),p&&ne.current&&ne.current.beginPass(ne.current.now())):(ne.current=null,re.current=[],V.current=[],ae.current=``),(0,v.useLayoutEffect)(()=>{var e;p&&((e=ne.current)==null||e.commitPass())});let H=(0,v.useMemo)(()=>({codeBlockMaxHeight:d,shikiTheme:l??(b?.code)?.getThemes()??o0,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)(()=>({...RQ,...E}),[oe]),ce=(0,v.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...t1,...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===r0){let t={...e0,tagNames:[...e0.tagNames??[],...Object.keys(w)],attributes:{...e0.attributes,...w}};e=[t0.raw,[qz,t],t0.harden]}return T&&T.length>0&&(e=[...e,[Y1,T]]),b!=null&&b.math&&(e=[...e,b.math.rehypePlugin]),n===`auto`&&t===`static`&&(e=[...e,q1]),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 s1(e)||c1(e)},[p,z]),fe=(0,v.useMemo)(()=>y&&p&&!de?{"--streamdown-caret":`"${a0[y]}"`}:void 0,[y,p,de]),pe=e=>{let t=null;if(ne.current&&p){if(!re.current[e]){let{maxBacklogMs:t,...n}=B&&B!==`true`?h:{};re.current[e]=uQ({...n,timeline:ne.current})}t=re.current[e]}ie.current!==ue&&(V.current=[],ie.current=ue),t&&!V.current[e]&&(V.current[e]=[...ue,t.rehypePlugin]);let n=t&&V.current[e]?V.current[e]:ue;return{blockAnimatePlugin:t,blockRehypePlugins:n}};return t===`static`?(0,U.jsx)(zQ.Provider,{value:se,children:(0,U.jsx)(QQ.Provider,{value:b??null,children:(0,U.jsx)(c0.Provider,{value:H,children:(0,U.jsx)(IQ,{icons:D,children:(0,U.jsx)(_Q.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)(m1,{components:ce,rehypePlugins:ue,remarkPlugins:le,...j,children:R})})})})})})}):(0,U.jsx)(zQ.Provider,{value:se,children:(0,U.jsx)(QQ.Provider,{value:b??null,children:(0,U.jsx)(c0.Provider,{value:H,children:(0,U.jsx)(IQ,{icons:D,children:(0,U.jsx)(_Q.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&&s1(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},te[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);u0.displayName=`Streamdown`;var d0=({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}=LQ(),d=vQ(),f=BQ(),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})]})},f0=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=vQ(),[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)(c0),_=t$(),y=g?.errorComponent,{shouldRender:b,containerRef:x}=LZ({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)(d0,{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`})})})},p0=/^[a-zA-Z][a-zA-Z0-9+.-]*:/,m0=/^(.*?):(\d+)(?::\d+)?$/,h0=/^L(\d+)/;function g0(e,t){let n=e?.trim();if(!n||n.startsWith(`#`)||n.startsWith(`//`))return;let r=n;if(p0.test(r)){if(!r.startsWith(`file:`))return;try{r=decodeURIComponent(new URL(r).pathname)}catch{return}}let i,a=r.indexOf(`#`);a!==-1&&(i=_0(h0.exec(r.slice(a+1))?.[1]),r=r.slice(0,a));let o=m0.exec(r);if(o&&(r=o[1],i??=_0(o[2])),!r)return;let s=zk(r,t);return s?{path:s,...i===void 0?{}:{line:i}}:void 0}function _0(e){let t=e===void 0?NaN:Number(e);return Number.isInteger(t)&&t>0?t:void 0}var v0=(0,v.createContext)(void 0);function y0({value:e,children:t}){return(0,U.jsx)(v0.Provider,{value:e,children:t})}function b0(){return(0,v.useContext)(v0)}var x0=new Set([`CodexImageGeneration`,`CodexImageView`]),S0={"image/png":`png`,"image/jpeg":`jpg`,"image/gif":`gif`,"image/webp":`webp`,"image/svg+xml":`svg`};function C0(e){return`image · ${jN(e.bytes)}`}var w0=`image unavailable`;function T0(e){if(!x0.has(e.name))return;let t=e.input,n=t?.savedPath??t?.path;return typeof n==`string`?n:void 0}function E0(e){return e.split(/[\\/]/).pop()||e}function D0(e,t){let n=S0[t.mediaType]??t.mediaType.split(`/`).pop()??`img`;return`${e.toLowerCase()}-${t.partIndex+1}.${n}`}var O0=[.1,.25,.33,.5,.67,.75,1,1.25,1.5,2,3,4,6,8],k0=16,A0=4,j0=.01,M0=25,N0=(0,v.createContext)(void 0);function P0(){return(0,v.useContext)(N0)}function F0({children:e}){let[t,n]=(0,v.useState)(),r=(0,v.useCallback)(()=>n(void 0),[]);return(0,U.jsxs)(N0.Provider,{value:n,children:[e,t?(0,U.jsx)(L0,{image:t,onClose:r},t.src):null]})}function I0({image:e,className:t,children:n}){let r=P0();return r?(0,U.jsx)(`button`,{type:`button`,"aria-label":`View ${e.name}`,title:e.name,"data-slot":`viewable-image`,className:W(`cursor-zoom-in`,t),onClick:t=>{t.stopPropagation(),r(e)},children:n}):(0,U.jsx)(U.Fragment,{children:n})}function L0({image:e,onClose:t,className:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(`fit`),[d,f]=(0,v.useState)(!1),p=(0,v.useRef)(void 0),m=(0,v.useRef)(void 0),h=(0,v.useRef)(void 0),g=(0,v.useRef)(!1),_=a&&s?Math.min(1,(s.width-32)/a.width,(s.height-32)/a.height):1,y=l===`fit`?Math.max(_,.01):l,b=a!==void 0&&s!==void 0&&(a.width*y>s.width||a.height*y>s.height);(0,v.useEffect)(()=>{let e=document.activeElement;return r.current?.focus(),()=>e?.focus?.()},[]),(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(()=>c({width:e.clientWidth,height:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[]),(0,v.useLayoutEffect)(()=>{let e=i.current,t=p.current;e&&t&&(p.current=void 0,m.current=void 0,e.scrollLeft=t.x*e.scrollWidth-t.viewX,e.scrollTop=t.y*e.scrollHeight-t.viewY)},[y]);let x=(0,v.useCallback)((e,t)=>{let n=i.current;if(n&&n.scrollWidth>0&&n.scrollHeight>0){let e=n.getBoundingClientRect(),r=t?t.clientX-e.left:n.clientWidth/2,i=t?t.clientY-e.top:n.clientHeight/2;p.current={x:(n.scrollLeft+r)/n.scrollWidth,y:(n.scrollTop+i)/n.scrollHeight,viewX:r,viewY:i}}u(e)},[]),S=e=>{let t=e>0?O0.find(e=>e>y+.001):O0.filter(e=>e<y-.001).at(-1);x(t??(e>0?O0[O0.length-1]:O0[0]))},C=e=>{e.stopPropagation(),e.key===`Escape`?(e.preventDefault(),t()):e.key===`+`||e.key===`=`?(e.preventDefault(),S(1)):e.key===`-`||e.key===`_`?(e.preventDefault(),S(-1)):e.key===`0`?(e.preventDefault(),x(`fit`)):e.key===`1`&&(e.preventDefault(),x(1))},w=(0,v.useRef)(y);w.current=y,(0,v.useEffect)(()=>{let e=i.current;if(!e)return;let t=e=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let t=Math.max(-25,Math.min(M0,e.deltaY)),n=m.current??w.current,r=Math.min(O0[O0.length-1],Math.max(O0[0],n*Math.exp(-t*j0)));m.current=r,x(r,e)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[x]);let T=e=>{let t=i.current;b&&t&&e.button===0&&(g.current=!1,h.current={x:e.clientX,y:e.clientY,left:t.scrollLeft,top:t.scrollTop},t.setPointerCapture(e.pointerId))},E=e=>{let t=i.current,n=h.current;t&&n&&(Math.abs(e.clientX-n.x)+Math.abs(e.clientY-n.y)>A0&&(g.current=!0),t.scrollLeft=n.left-(e.clientX-n.x),t.scrollTop=n.top-(e.clientY-n.y))},D=e=>{h.current=void 0,i.current?.releasePointerCapture?.(e.pointerId)};return(0,U.jsxs)(`div`,{ref:r,role:`dialog`,"aria-modal":`true`,"aria-label":e.name,tabIndex:-1,"data-slot":`image-viewer`,onKeyDown:C,onClick:e=>e.stopPropagation(),className:W(`absolute inset-0 z-50 flex flex-col bg-bg outline-none`,n),children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b border-border px-2 py-1.5`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1 px-1`,children:[(0,U.jsx)(`div`,{className:`truncate font-mono text-body-sm text-fg-1`,title:e.name,children:e.name}),a?(0,U.jsxs)(`div`,{className:`text-label text-fg-4`,children:[a.width,` × `,a.height]}):null]}),(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Zoom out`,title:`Zoom out (-)`,onClick:()=>S(-1),disabled:d,children:(0,U.jsx)(Fb,{})}),(0,U.jsxs)(`span`,{className:`w-12 text-center font-mono text-label text-fg-3 tabular-nums`,children:[Math.round(y*100),`%`]}),(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Zoom in`,title:`Zoom in (+)`,onClick:()=>S(1),disabled:d,children:(0,U.jsx)(Cx,{})}),(0,U.jsx)(G,{variant:l===`fit`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":`Fit to view`,"aria-pressed":l===`fit`,title:`Fit to view (0)`,onClick:()=>x(`fit`),disabled:d,children:(0,U.jsx)(Tb,{})}),(0,U.jsx)(G,{variant:l===1?`secondary`:`ghost`,size:`sm`,"aria-label":`Actual size`,"aria-pressed":l===1,title:`Actual size (1)`,onClick:()=>x(1),disabled:d,className:`font-mono`,children:`1:1`}),(0,U.jsx)(`a`,{href:e.src,download:e.name,"aria-label":`Download`,title:`Download`,className:`inline-flex size-7 items-center justify-center rounded-md text-fg-2 transition-colors hover:bg-surface-hover hover:text-foreground`,children:(0,U.jsx)(Gv,{className:`size-4`})}),(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,title:`Close (Esc)`,onClick:t,children:(0,U.jsx)(wC,{})})]}),(0,U.jsx)(`div`,{ref:i,"data-slot":`image-viewer-stage`,onPointerDown:T,onPointerMove:E,onPointerUp:D,onPointerCancel:D,onClick:e=>{if(g.current){g.current=!1;return}(e.target===e.currentTarget||e.target===e.currentTarget.firstElementChild)&&t()},className:W(`min-h-0 flex-1 overflow-auto bg-surface-hover/40`,b&&`cursor-grab active:cursor-grabbing`),children:(0,U.jsx)(`div`,{className:`flex min-h-full w-max min-w-full items-center justify-center`,style:{padding:k0},children:d?(0,U.jsx)(`span`,{className:`text-body-sm text-fg-4`,children:`Image could not be displayed`}):(0,U.jsx)(`img`,{src:e.src,alt:e.name,draggable:!1,onLoad:e=>o({width:e.currentTarget.naturalWidth,height:e.currentTarget.naturalHeight}),onError:()=>f(!0),onDoubleClick:()=>x(l===`fit`?1:`fit`),className:`block max-w-none select-none`,style:a?{width:a.width*y,height:a.height*y,imageRendering:y>2?`pixelated`:void 0}:{maxWidth:`100%`,maxHeight:`100%`,visibility:`hidden`}})})})]})}var R0=async()=>void 0,z0=(0,v.createContext)(R0);function B0({value:e,children:t}){return(0,U.jsx)(z0.Provider,{value:e??R0,children:t})}function V0(){return(0,v.useContext)(z0)}var H0=150;function U0(e){let t=V0(),[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})})},H0);return()=>{e=!1,clearTimeout(n)}},[t,i,a,o,s,c]),n}var W0=(0,v.createContext)(void 0);function G0({value:e,children:t}){return(0,U.jsx)(W0.Provider,{value:e,children:t})}function K0(e,t){let n=(0,v.useContext)(W0),r=t??n,[i,a]=(0,v.useState)({failed:!1});return(0,v.useEffect)(()=>{if(e===void 0)return;if(!r){a({failed:!0});return}let t=!0;return a({failed:!1}),r(e).then(e=>{t&&a({src:e,failed:e===void 0})}).catch(()=>{t&&a({failed:!0})}),()=>{t=!1}},[r,e]),i}var q0=67108864;function J0(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,Y0(n.current,i)):URL.revokeObjectURL(t),t}).catch(()=>void 0);return n.current.set(i,{pending:o,bytes:r.bytes}),o},[e,t])}function Y0(e,t){let n=0;for(let t of e.values())n+=t.bytes;for(let[r,i]of e){if(n<=q0)return;r!==t&&(i.url&&URL.revokeObjectURL(i.url),e.delete(r),n-=i.bytes)}}var X0=`https://local-image.invalid/`,Z0=/^(?:https?:|data:image\/|blob:)/i,Q0=/^https?:/i,$0=`remote image, not loaded`;function e2(){return e=>{t2(e)}}function t2(e){if(e.type===`element`&&e.tagName===`img`&&e.properties){let t=e.properties.src;typeof t==`string`&&t.trim()&&!Z0.test(t.trim())&&(e.properties.src=X0+encodeURIComponent(t.trim()))}for(let t of e.children??[])t2(t)}var n2=[e2,...Object.values(t0)];function r2(e){if(e?.startsWith(X0))try{return decodeURIComponent(e.slice(28))}catch{return}}function i2(e){if(e&&Q0.test(e.trim())&&r2(e)===void 0)try{return new URL(e.trim()).host}catch{return}}function a2({src:e,alt:t,terminal:n}){let r=typeof e==`string`?e:void 0,i=i2(r);return i===void 0?(0,U.jsx)(s2,{raw:r,alt:t,terminal:n}):(0,U.jsx)(o2,{href:r.trim(),host:i,alt:t,terminal:n})}function o2({href:e,host:t,alt:n,terminal:r}){let i=`${typeof n==`string`&&n?`${n} · `:``}${t} (${$0})`;return r?(0,U.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,"data-tone":`faint`,title:e,children:i}):(0,U.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,title:e,className:`my-1 inline-block rounded-md border border-border bg-surface-hover px-2 py-1 text-label text-fg-4`,children:i})}function s2({raw:e,alt:t,terminal:n}){let r=b0(),i=r2(e),a=i===void 0?void 0:g0(i,r?.cwd)?.path,o=K0(a),s=i===void 0?e:o.src,c=typeof t==`string`&&t?t:void 0,l=a?E0(a):c??`image`,u=i!==void 0&&(a===void 0||o.failed);return n?(0,U.jsx)(`span`,{className:`term-image`,"data-state":s?`loaded`:u?`failed`:`pending`,style:{height:`calc(var(--term-line) * 12)`},children:s?(0,U.jsx)(I0,{image:{src:s,name:l},children:(0,U.jsx)(`img`,{src:s,alt:c??l})}):(0,U.jsx)(`span`,{"data-tone":`faint`,children:u?`${w0} · ${i??l}`:l})}):s?(0,U.jsx)(I0,{image:{src:s,name:l},className:`my-1 block max-w-full`,children:(0,U.jsx)(`img`,{src:s,alt:c??l,className:`max-h-96 w-auto max-w-full rounded-md border border-border`})}):(0,U.jsx)(`span`,{className:`my-1 inline-block rounded-md border border-border bg-surface-hover px-2 py-1 text-label text-fg-4`,children:u?`${w0} · ${i??l}`:l})}function c2(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(c2).join(``);let t=e;return t.props?c2(t.props.children):``}function l2(e){let t=(Array.isArray(e)?e.find(Boolean):e)?.props?.className;return/language-([\w-]+)/.exec(t??``)?.[1]}function u2({code:e,language:t}){return(0,U.jsx)(mP,{className:`term-block`,placement:`inline`,actions:(0,U.jsx)(EP,{text:e,label:`Copy code`}),children:(0,U.jsx)(zP,{className:`term-code`,"data-language":t,children:(0,U.jsx)(`pre`,{className:`term-pre`,children:e})})})}function d2(e){return function({children:t}){return(0,U.jsx)(`div`,{className:`term-block`,"data-tone":e,"data-weight":`bold`,children:t})}}function f2({href:e,children:t}){let n=b0(),r=n?g0(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 p2={p:({children:e})=>(0,U.jsx)(`div`,{className:`term-block`,children:e}),h1:d2(`bright`),h2:d2(`bright`),h3:d2(`bright`),h4:d2(`fg`),h5:d2(`fg`),h6:d2(`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)(u2,{code:c2(e),language:l2(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)(f2,{href:t,children:e}),img:({src:e,alt:t})=>(0,U.jsx)(a2,{src:e,alt:t,terminal:!0}),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})},m2=(0,v.memo)(function({children:e,streaming:t,className:n}){return(0,U.jsx)(u0,{mode:t?`streaming`:`static`,parseIncompleteMarkdown:t,controls:!1,components:p2,rehypePlugins:n2,className:W(`term-md`,n),children:e})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className);function h2(e){return e.kind===`tool_call`&&vA(e.name)}function g2(e){return e.name?e.hostId?`${e.name}@${e.hostId}`:e.name:MA(e.sessionId)}function _2(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`&&vA(n.name)&&n.result&&!n.result.isError){let e=NA(n.result.text);e?.name&&t.set(e.sessionId,e.name)}}return t}function v2(e,t){let n=e.result&&!e.result.isError?NA(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)??MA(i)}function y2(e){let t=e.input?.text;return typeof t==`string`?t:``}function b2(e){return e.replace(/\s+/g,` `).trim()}function x2(e,t){return h2(e)||h2(t)?!1:e.parentToolUseId===t.parentToolUseId}function S2(e){if(VN(e))return`shell`;let t=/^mcp__([^_]+(?:_[^_]+)*?)__/.exec(e);return t?.[1]?t[1].replace(/_/g,`-`):e.toLowerCase()}function C2(e){return e.length===1?{kind:`call`,item:e[0]}:{kind:`summary`,items:e}}function w2(e,t){let n=t?`Running `:`Ran `,r=t?`…`:``,i=e.length,a=new Map;for(let t of e){let e=S2(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 T2(e,t=80){return e.length>t?e.slice(0,t-1)+`…`:e}function E2(e){return typeof e==`string`&&e.trim()!==``?e.trim():void 0}function D2(e){return`${e.name}(${O2(e)})`}function O2(e){let t=e.input,n=E2(t?.description),r=E2(t?.subagent_type);return r&&n?`${r} · ${T2(n)}`:r??(n?T2(n):LN(e.input))}function k2(e){let t=e.input;return E2(t?.prompt)}function A2(e){return e.status===`running`||e.status===`pending`}function j2(e){return e.status===`failed`||e.result?.isError===!0}function M2(e){let t=e[e.length-1];return t!==void 0&&j2(t)}function N2(e,t){return A2(e)||t.some(e=>e.kind===`tool_call`&&A2(e))}function P2(e){return j2(e)}function F2(e,t){let n=N2(e,t),r=t.reduce((e,t)=>e+ +(t.kind===`tool_call`),0),i=D2(e);return r===0?n?`${i} · working…`:`${i} · done`:`${i} · ${r} tool${r===1?``:`s`}${n?`…`:``}`}var I2=(0,v.createContext)(new Map);function L2({items:e,children:t}){let n=(0,v.useMemo)(()=>_2(e),[e]);return(0,U.jsx)(I2.Provider,{value:n,children:t})}function R2(){return(0,v.useContext)(I2)}var z2=4;function B2({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)>z2)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 V2(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=H2(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 H2(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}var U2=4,W2=400;function G2(e,t){let n=[],r=0,i=!1;for(let t of e.slice(0,U2)){if(n.length===0&&t.length>W2){n.push(`${t.slice(0,W2)}…`),r=W2,i=!0;break}if(n.length>0&&r+t.length>W2)break;n.push(t),r+=t.length+1}let a=e.join(`
194
+ `).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 K2=async()=>!1,q2=(0,v.createContext)(K2);function J2({value:e,children:t}){return(0,U.jsx)(q2.Provider,{value:e??K2,children:t})}function Y2(){return(0,v.useContext)(q2)}var X2=(0,v.createContext)(void 0);function Z2({value:e,children:t}){return(0,U.jsx)(X2.Provider,{value:e,children:t})}function Q2(e){return hA(e,(0,v.useContext)(X2))}var $2=8,e4={pending:`☐`,in_progress:`◐`,completed:`☒`};function t4(e,t){if(e!==`TodoWrite`)return;let n=Mk(t);if(n===void 0||n.length===0)return;let r=n.reduce((e,t)=>e+ +(t.status===`completed`),0),i=n.slice(0,$2),a=n.length-i.length;return{summary:`${r}/${n.length} done`,shown:i,more:a>0?`… +${a} more`:void 0}}function n4(e){return`${e4[e.status]} ${e.text}`}var r4=`output expired or not tracked by this gateway`,i4=`agent may type`;function a4(e){return e.status===`running`&&e.owner===`user`}function o4(e){return e.agentWrite===!0?`Revoke the agent’s access to this shell`:`Let the agent type into this shell`}function s4(e){return e.label||e.command.split(`
195
+ `)[0]||``}function c4(e){return`#${e.ordinal} ${s4(e)}`}function l4(e){return s4(e.shell)}function u4(e){return f4(e.shell)}function d4(e){return e.status===`exited`&&e.exitCode!==0}function f4(e){if(e.status===`running`)return e.agentWrite===!0?`running · ${i4}`:`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 p4(e){return d4(e.shell)}function m4(e){return`${l4(e)} · ${u4(e)}`}function h4(e,t){let n=t&&e.expanded!==void 0?e.expanded:e.text;if(n===``||e.shell.interactive)return[];let r=n.split(`
196
+ `);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 g4(e,t,n){if(e.shell.interactive)return AA;if(e.missing)return r4;if(!t)return e.truncated?`… more output - expand to fetch it`:void 0;let r=e.expanded===void 0?void 0:e.expanded.split(`
197
+ `).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 _4={loadOutput:async()=>!1,verify:async()=>!1,kill:async()=>!1},v4=(0,v.createContext)(_4);function y4({value:e,children:t}){return(0,U.jsx)(v4.Provider,{value:e??_4,children:t})}function b4(){return(0,v.useContext)(v4)}function x4(e){let t=b4().verify,n=e.shell.status===`running`,r=e.shell.id;(0,v.useEffect)(()=>{n&&t(r)},[n,r,t])}function S4({item:e}){let t=b4(),n=e.shell.id;return(0,U.jsxs)(U.Fragment,{children:[t.open?(0,U.jsx)(CP,{onOpen:()=>t.open?.(n)}):null,t.agentWrite&&a4(e.shell)?(0,U.jsx)(TP,{granted:e.shell.agentWrite===!0,label:o4(e.shell),onToggle:()=>void t.agentWrite?.(n,e.shell.agentWrite!==!0)}):null,e.shell.status===`running`?(0,U.jsx)(wP,{onKill:()=>void t.kill(n)}):null,(0,U.jsx)(vP,{id:e.id}),(0,U.jsx)(EP,{text:e.shell.command,label:`Copy command`})]})}var C4=2e3;function w4(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 T4(e){let t=e.name?`${e.name} (${MA(e.sessionId)})`:MA(e.sessionId);return`message from ${e.engine?`${e.engine} session `:`session `}${t}`}function E4({glyph:e,who:t,body:n,tone:r=`peer`,clip:i}){let a=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(BP,{tone:r,bold:!0,children:t}),`: `,n]});return(0,U.jsx)(LP,{glyph:e,glyphTone:r,tone:r,children:i?(0,U.jsx)(`span`,{className:`term-clip-1`,children:a}):a})}function D4({item:e}){let[t,n]=(0,v.useState)(!1),r=R2(),i=V2(t),a=y2(e).split(`
198
+ `),o=e.status===`failed`||e.result?.isError===!0?`red`:`peer`;return(0,U.jsx)(mP,{actions:(0,U.jsx)(vP,{id:e.id}),children:(0,U.jsxs)(`div`,{ref:i,className:t?`term-open`:void 0,children:[(0,U.jsx)(B2,{onPress:()=>n(e=>!e),expanded:t,children:(0,U.jsx)(E4,{glyph:`↤`,who:v2(e,r),tone:o,clip:!t,body:t?a[0]||`\xA0`:b2(a.join(` `))})}),t?(0,U.jsxs)(`div`,{children:[a.slice(1).map((e,t)=>(0,U.jsx)(LP,{tone:o,children:e||`\xA0`},t)),e.result?(0,U.jsx)(LP,{tone:`faint`,children:b2(e.result.text)}):null]}):null]})})}function O4({item:e,attachmentUrl:t}){return(0,U.jsx)(mP,{actions:(0,U.jsx)(vP,{id:e.id}),children:(0,U.jsxs)(`div`,{className:`term-user`,"data-peer":e.origin?``:void 0,children:[e.attachments?.length?(0,U.jsx)(LP,{glyph:`❯`,glyphTone:`dim`,tone:`dim`,children:e.attachments.map((e,n)=>(0,U.jsxs)(v.Fragment,{children:[n>0?`, `:null,(0,U.jsx)(F4,{attachment:e,href:t?.(e.id)})]},e.id))}):null,e.text?e.text.split(`
199
+ `).map((t,n)=>e.origin&&n===0?(0,U.jsx)(E4,{glyph:`↦`,who:g2(e.origin),body:t?(0,U.jsx)(oP,{text:t}):`\xA0`},n):(0,U.jsx)(LP,{glyph:!e.origin&&n===0?`❯`:void 0,glyphTone:`dim`,tone:e.origin?`peer`:`fg`,children:t?(0,U.jsx)(oP,{text:t}):`\xA0`},n)):null]})})}function k4({item:e}){return(0,U.jsx)(mP,{actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(vP,{id:e.id}),e.streaming?null:(0,U.jsx)(EP,{text:e.text,label:`Copy message`})]}),children:(0,U.jsx)(LP,{glyph:`●`,glyphTone:`fg`,tone:`fg`,children:(0,U.jsx)(m2,{streaming:e.streaming,children:e.text})})})}function A4({item:e}){return(0,U.jsx)(LP,{glyph:`✻`,glyphTone:`dim`,tone:`dim`,children:(0,U.jsx)(`span`,{className:`term-em`,children:e.text})})}var j4={running:`blue`,pending:`blue`,deferred:`yellow`,settled:`dim`,failed:`red`};function M4({item:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),s=Y2(),c=V2(t),l=e.status??(e.result===void 0?`running`:`settled`),u=l===`running`||l===`pending`,d=l===`failed`||e.result?.isError===!0,f=tP(u),p=q4(u&&e.ts!==void 0),m=u?MP(e.ts,p):void 0,h=jP(e),g=e.result?.text??``,_=g.trimEnd().split(`
200
+ `),y=G2(_,e.result?.totalChars),b=t?r?_:w4(_,C4):y.shown,x=_.length-b.length,S=t&&!r&&x>0,C=e.result?.truncated===!0,w=C?(e.result?.totalChars??0)-g.length:0,T=d?`red`:l===`settled`&&HN(e.name)?`green`:j4[l]??`dim`,E=e.input?.command,D=typeof E==`string`?E:g,O=t4(e.name,e.input),k=Q2(e.name),A=T0(e);return(0,U.jsx)(`div`,{ref:c,className:t?`term-open`:void 0,children:(0,U.jsxs)(mP,{actions:(0,U.jsxs)(U.Fragment,{children:[PP(e)?(0,U.jsx)(xP,{toolUseId:e.id}):null,(0,U.jsx)(vP,{id:e.id}),D?(0,U.jsx)(EP,{text:D,label:`Copy`}):null]}),children:[(0,U.jsx)(B2,{onPress:()=>n(e=>!e),expanded:t,children:(0,U.jsxs)(LP,{glyph:u?f:`●`,glyphTone:T,tone:`fg`,title:k?e.name:void 0,children:[(0,U.jsx)(BP,{bold:!0,tone:`bright`,className:u?`term-shimmer`:void 0,children:k??e.name}),(0,U.jsxs)(BP,{tone:`dim`,children:[`(`,O?O.summary:LN(e.input),`)`]}),m?(0,U.jsxs)(BP,{tone:`faint`,children:[` `,`·`,`\xA0`,m]}):null,k&&t?(0,U.jsxs)(BP,{tone:`faint`,children:[` · `,e.name]}):null,e.backend&&e.backend!==`server`?(0,U.jsxs)(BP,{tone:`faint`,children:[` · `,e.backend]}):null]})}),(0,U.jsx)(K4,{lines:h}),A===void 0?null:(0,U.jsx)(L4,{path:A}),e.result?.images?.map(t=>(0,U.jsx)(I4,{toolUseId:e.id,name:D0(e.name,t),image:t},t.partIndex)),e.patch&&!t?(0,U.jsx)(GP,{patch:e.patch}):O&&!t?(0,U.jsx)(P4,{preview:O}):g?(0,U.jsxs)(U.Fragment,{children:[b.map((e,t)=>(0,U.jsx)(LP,{indent:1,columns:3,glyph:t===0?`⎿`:void 0,tone:d?`red`:`dim`,children:e||`\xA0`},t)),t?S||C?(0,U.jsx)(LP,{indent:1,columns:3,tone:`faint`,children:a?(0,U.jsxs)(U.Fragment,{children:[`… fetching `,(e.result?.totalChars??0).toLocaleString(),` chars`]}):S||C?(0,U.jsx)(`button`,{type:`button`,className:`term-press term-link`,onClick:()=>{i(!0),C&&(o(!0),s(e.id).finally(()=>o(!1)))},children:C?`… +${w.toLocaleString()} chars - fetch the rest`:`… +${x} line${x===1?``:`s`} - show all ${g.length.toLocaleString()} chars`}):(0,U.jsxs)(U.Fragment,{children:[`… +`,x,` line`,x===1?``:`s`]})}):x>0?(0,U.jsxs)(LP,{indent:1,columns:3,tone:`faint`,children:[`… +`,x,` line`,x===1?``:`s`]}):null:y.more?(0,U.jsx)(LP,{indent:1,columns:3,tone:`faint`,children:y.more}):null]}):null]})})}var N4={pending:`dim`,in_progress:`blue`,completed:`faint`};function P4({preview:e}){return(0,U.jsxs)(U.Fragment,{children:[e.shown.map((e,t)=>(0,U.jsx)(LP,{indent:1,columns:3,glyph:t===0?`⎿`:void 0,tone:N4[e.status],children:n4(e)},t)),e.more?(0,U.jsx)(LP,{indent:1,columns:3,tone:`faint`,children:e.more}):null]})}function F4({attachment:e,href:t}){let n=P0();return!n||!t||!e.mediaType.startsWith(`image/`)?(0,U.jsx)(U.Fragment,{children:e.name}):(0,U.jsx)(`button`,{type:`button`,className:`term-press term-link`,onClick:r=>{r.stopPropagation(),n({src:t,name:e.name})},children:e.name})}function I4({toolUseId:e,name:t,image:n}){let r=U0({toolUseId:e,...n});return(0,U.jsx)(R4,{state:r,name:t,placeholder:C0(n)})}function L4({path:e}){let t=K0(e);return(0,U.jsx)(R4,{state:t,name:E0(e),placeholder:E0(e)})}function R4({state:e,name:t,placeholder:n}){let{src:r,failed:i}=e;return(0,U.jsx)(LP,{indent:1,columns:3,children:(0,U.jsx)(`div`,{className:`term-image`,"data-state":r?`loaded`:i?`failed`:`pending`,style:{height:`calc(var(--term-line) * 12)`},children:r?(0,U.jsx)(I0,{image:{src:r,name:t},children:(0,U.jsx)(`img`,{src:r,alt:t})}):(0,U.jsx)(BP,{tone:`faint`,children:i?w0:n})})})}function z4({items:e}){let[t,n]=(0,v.useState)(!1),r=V2(t),i=e.some(e=>{let t=e.status??(e.result===void 0?`running`:`settled`);return t===`running`||t===`pending`}),a=M2(e),o=tP(i),s=NP(e),c=MP(s,q4(s!==void 0));return(0,U.jsxs)(`div`,{ref:r,className:t?`term-open`:void 0,children:[(0,U.jsx)(B2,{onPress:()=>n(e=>!e),expanded:t,children:(0,U.jsxs)(LP,{glyph:i?o:void 0,glyphTone:i?`mark`:void 0,tone:a?`red`:`dim`,children:[i?(0,U.jsx)(`span`,{className:`term-shimmer`,children:w2(e,i)}):w2(e,i),c?(0,U.jsxs)(BP,{tone:`faint`,children:[` `,`·`,`\xA0`,c]}):null]})}),t?null:(0,U.jsx)(K4,{lines:FP(e)}),t?(0,U.jsx)(`div`,{children:e.map((t,n)=>(0,U.jsxs)(v.Fragment,{children:[n>0?(0,U.jsx)(RP,{}):null,n<e.length-1?(0,U.jsx)(pP,{value:`below`,children:(0,U.jsx)(M4,{item:t})}):(0,U.jsx)(M4,{item:t})]},t.id))}):null]})}function B4({items:e}){let t=C2(e);return t.kind===`summary`?(0,U.jsx)(z4,{items:t.items}):h2(t.item)?(0,U.jsx)(D4,{item:t.item}):(0,U.jsx)(M4,{item:t.item})}function V4({item:e}){return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(LP,{tone:e.isError?`red`:`faint`,children:[e.isError?e.subtype:`done`,` · `,kN(e.durationMs),` · `,ON(e.costUsd??e.totalCostUsd)]}),e.errors?.map((e,t)=>(0,U.jsx)(LP,{tone:`red`,children:e},t))]})}function H4({item:e}){let t=e.error!==void 0;return(0,U.jsx)(LP,{glyph:e.pending?`⋯`:`≡`,glyphTone:t?`red`:`yellow`,tone:t?`red`:`faint`,children:DN(e)})}function U4({item:e}){let t=e.level===`error`;return(0,U.jsx)(LP,{glyph:`!`,glyphTone:t?`red`:`yellow`,tone:t?`red`:`dim`,children:e.text})}function W4({item:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),a=b4(),o=V2(t),s=e.shell.status===`running`,c=p4(e),l=c?`red`:s?`magenta`:`dim`,u=h4(e,t),d=g4(e,t,u.length),f=e.shell.id;return x4(e),(0,U.jsx)(`div`,{ref:o,className:t?`term-open`:void 0,children:(0,U.jsxs)(mP,{actions:(0,U.jsx)(S4,{item:e}),children:[(0,U.jsx)(B2,{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)(LP,{glyph:`$`,glyphTone:l,tone:`fg`,children:[(0,U.jsx)(BP,{bold:!0,tone:`bright`,children:l4(e)}),(0,U.jsxs)(BP,{tone:c?`red`:`faint`,children:[` · `,u4(e)]})]})}),u.map((e,t)=>(0,U.jsx)(LP,{tone:c?`red`:`dim`,children:e||` `},t)),d||r?(0,U.jsx)(LP,{tone:`faint`,children:r?`… fetching the full output`:d}):null]})})}function G4({item:e,href:t}){return(0,U.jsxs)(LP,{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)(BP,{tone:`blue`,children:e.path}),(0,U.jsxs)(BP,{tone:`faint`,children:[` · `,jN(e.bytes)]}),e.description?(0,U.jsxs)(BP,{tone:`faint`,children:[` · `,e.description]}):null]})}function K4({lines:e}){return e.map((e,t)=>(0,U.jsx)(LP,{indent:1,columns:3,glyph:t===0?`⎿`:void 0,tone:`faint`,children:e||` `},t))}function q4(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 J4({label:e,startedAt:t,tokens:n}){let r=tP(!0),i=q4(t!==void 0),a=[t===void 0?void 0:kN(i-t),n?`↓ ${(n/1e3).toFixed(1)}k tokens`:void 0].filter(Boolean);return(0,U.jsxs)(LP,{glyph:r,glyphTone:`mark`,tone:`mark`,children:[(0,U.jsx)(`span`,{className:`term-shimmer`,children:e}),a.length?(0,U.jsxs)(BP,{tone:`faint`,children:[` (`,a.join(` · `),`)`]}):null]})}function Y4({fontSize:e,lineHeight:t,bleed:n,affordances:r,className:i,style:a,children:o,...s}){let c=uP(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)(dP,{value:c,children:o})})}var X4=`Run a command on the host…`,Z4=`$ shell mode · esc to exit`;function Q4({onSend:e,onSendNow:t,onInterrupt:n,busy:r,disabled:i,placeholder:a=`Message the agent…`,commands:o,skills:s,clientCommands:c,onSearchFiles:l,peers:u,onShellCommand:d,attachments:f,toolbar:p,layout:m=`stacked`,fontSize:h,lineHeight:g,affordances:_,draft:y,className:b,ref:x}){let S=m===`inline`,C=wN()===`terminal`,[w]=(0,v.useState)(()=>y?.initialText??``),{bind:T,plainText:E,isEmpty:D,clear:O,focus:k}=yO(w===``?void 0:{initialValue:FE(w)}),A=(0,v.useRef)(null),[j,M]=(0,v.useState)(!1),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!1);(0,v.useImperativeHandle)(x,()=>({insertText:e=>{let t=E.length>0&&!/\s$/.test(E)?` `:``;T.ref.current?.appendText(t+e),k()},focus:k}),[T.ref,E,k]);let L=(0,v.useMemo)(()=>{let e=[],t=mN({commands:o,clientCommands:c,skills:s});if(t.length>0){let n=new Map(t.map(e=>[`${e.kind}:${e.name}`,e]));e.push(xO({onSearch:e=>_N(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)(bS,{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)(jee,{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:fN(t.skill)}:void 0},onSelect:e=>e.value,chipClassName:`font-mono`}))}return l&&e.push(bO({searchDebounceMs:150,onSearch:async(e,t)=>(await l(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`})),u?.length&&e.push(SO({accessibilityLabel:`session`,onSearch:e=>vN(e,u).map(e=>({value:e.slug,label:e.label,description:[e.gateway,e.engine,e.project,e.status].filter(Boolean).join(` · `),icon:(0,U.jsx)(cC,{className:`size-3.5 text-fg-3`})})),onSelect:e=>e.value,chipStyle:`inline`,chipClassName:`font-mono`,emptyMessage:`No matching sessions`})),d&&e.push(CO({char:`$`,accessibilityLabel:`shell mode`,onActivate:()=>P(!0)})),e.length>0?e:void 0},[o,s,c,l,u,d]),R=y?.save;(0,v.useEffect)(()=>{R?.(E)},[E,R]);let z=f?.items??[],ee=!i&&(!D||z.length>0)&&!f?.uploading&&!f?.hasFailure,te=(n=!1)=>{if(ee){if(N){let e=E.trim();if(e===``)return;d?.(e),P(!1),y?.clear(),O(),k();return}(n&&t?t:e)(E.trim(),f?.readyIds??[]),f?.clear(),y?.clear(),O(),k()}},B=e=>{P(!1),e&&T.ref.current?.setText(`$${E}`),k()},ne=[L?.some(e=>e.char===`/`)?{key:`/`,what:`commands and skills`}:void 0,l?{key:`@`,what:`mention a file`}:void 0,u?.length?{key:`#`,what:`refer to another session`}:void 0,d?{key:`$`,what:`run a shell command`}:void 0,{key:`?`,what:`this list, on an empty composer`}].filter(e=>e!==void 0),re=N?{onEscape:()=>B(!0),onKeyDown:e=>{e.key===`Backspace`&&D&&(e.preventDefault(),B(!1))}}:{onEscape:F?()=>I(!1):void 0,onKeyDown:e=>{if(e.key===`?`&&D&&!e.metaKey&&!e.ctrlKey){e.preventDefault(),I(!0);return}if(e.key===`Enter`&&e.altKey&&t&&ee){e.preventDefault(),te(!0);return}F&&I(!1)}},V=F?(0,U.jsx)(U.Fragment,{children:ne.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,ie=F?(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:V}):null,ae=e=>{e&&e.length>0&&f?.add(e)},H=f&&!f.disabled?(0,U.jsx)(`input`,{ref:A,type:`file`,multiple:!0,accept:f.accept||void 0,className:`hidden`,onChange:e=>{ae(e.target.files),e.target.value=``}}):null,oe=!!f&&!f.disabled,se=oe?(0,U.jsxs)(U.Fragment,{children:[H,(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,disabled:i,onClick:()=>A.current?.click(),children:(0,U.jsx)(sx,{className:`size-4`})})]}):null,ce=N?(0,U.jsx)($4,{gutter:!0,label:`Leave shell mode`,tone:`magenta`,onClick:()=>B(!1),children:`$`}):r?(0,U.jsx)($4,{gutter:!0,label:`Interrupt`,tone:`yellow`,onClick:n,children:`✕`}):oe?(0,U.jsx)($4,{gutter:!0,label:`Attach files`,disabled:i,onClick:()=>A.current?.click(),children:`+`}):(0,U.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`,"data-tone":`blue`,children:`❯`}),le=t&&ee&&!N?(0,U.jsx)(`button`,{type:`button`,className:`term-press term-link text-label`,onClick:()=>te(!0),children:`⌥↵ send now - moves the running command to the background`}):null,ue=C?(0,U.jsx)($4,{label:`Send`,disabled:!ee,onClick:()=>te(),tone:ee?`blue`:void 0,children:`↵`}):r&&!ee?(0,U.jsx)(G,{variant:`outline`,size:`icon-sm`,"aria-label":`Interrupt`,className:`rounded-full`,onClick:n,children:(0,U.jsx)(OS,{className:`size-3`})}):(0,U.jsx)(G,{size:`icon-sm`,"aria-label":`Send`,className:`rounded-full`,disabled:!ee,onClick:()=>te(),children:(0,U.jsx)(m_,{className:`size-4`})}),de={onDragOver:e=>{f&&!f.disabled&&(e.preventDefault(),M(!0))},onDragLeave:()=>M(!1),onDrop:e=>{f&&!f.disabled&&(e.preventDefault(),M(!1),ae(e.dataTransfer.files))}},fe=f?.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)(KS,{className:`size-3 shrink-0`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1`,children:f.error}),(0,U.jsx)(`button`,{type:`button`,onClick:f.dismissError,"aria-label":`Dismiss`,className:`shrink-0 opacity-70 hover:opacity-100`,children:(0,U.jsx)(wC,{className:`size-3`})})]}):null,pe=z.length>0&&f?(0,U.jsx)(e3,{attachments:f}):null,me=(e,t,n)=>(0,U.jsx)(vO,{...T,triggers:L,markdown:!1,normalizeBullets:!1,onSubmit:()=>te(),disabled:i,placeholder:i?`Session ended`:N?X4:a,minHeight:e,maxHeight:t,"aria-label":N?`Run a shell command`:`Message the agent`,className:n,onImagePaste:e=>f?.add([e]),...re});if(C){let e=g??18;return(0,U.jsxs)(`div`,{"data-slot":`composer`,className:W(`shrink-0`,b),children:[(0,U.jsx)(Y4,{...de,fontSize:h,lineHeight:g,affordances:_,bleed:`1ch`,"data-dragging":j||void 0,className:W(`term-composer`,N&&`term-composer-shell`,i&&`opacity-60`),children:(0,U.jsxs)(`div`,{className:`term-composer-body`,children:[le?(0,U.jsxs)(`div`,{className:`term-row`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`}),le]}):null,pe,(0,U.jsxs)(`div`,{className:`term-row`,children:[oe&&!N?H:null,ce,(0,U.jsxs)(`div`,{className:`flex min-w-0 items-start`,children:[me(e,e*10,`term-composer-field min-w-0 flex-1`),ue]})]}),F?(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:V})]}):null,N?(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:Z4})]}):p?(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:p})]}):null]})}),fe]})}return(0,U.jsxs)(`div`,{"data-slot":`composer`,className:W(`px-[var(--wd-composer-padding)] pb-[var(--wd-composer-padding)]`,b),children:[ie,le?(0,U.jsx)(`div`,{className:`mx-auto mb-1 w-full max-w-[var(--wd-transcript-max-width)] text-text-muted`,children:le}):null,(0,U.jsxs)(`div`,{...de,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`,j&&`border-ring ring-2 ring-ring/30`,N&&`border-[var(--wd-shell-accent)] focus-within:border-[var(--wd-shell-accent)] focus-within:ring-[var(--wd-shell-accent)]/30`,i&&`opacity-60`),children:[pe,S?(0,U.jsxs)(`div`,{className:`flex items-end gap-1 p-1`,children:[N?(0,U.jsx)(r3,{onLeave:()=>B(!1)}):se,me(20,192,`min-w-0 flex-1 py-1 text-body-sm text-text`),ue]}):(0,U.jsxs)(U.Fragment,{children:[me(28,192,`px-3 pt-2.5 pb-0 text-body-sm text-text`),(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:[N?(0,U.jsx)(r3,{onLeave:()=>B(!1)}):se,N?(0,U.jsx)(`span`,{className:`text-label text-text-muted`,children:Z4}):p]}),ue]})]})]}),fe]})}function $4({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 e3({attachments:e}){let t=wN()===`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)(t3,{item:t,onRetry:()=>e.retry(t.key),onRemove:()=>e.remove(t.key)},t.key))})}function t3({item:e,onRetry:t,onRemove:n}){let r=e.status===`failed`,i=wN()===`terminal`,a=i?``:`rounded-md`;return(0,U.jsxs)(`div`,{className:`group relative shrink-0`,title:r?`${e.name} - ${e.error}`:`${e.name} · ${jN(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)(ay,{className:`size-4`}),(0,U.jsx)(`span`,{className:`max-w-12 truncate text-[9px] font-semibold uppercase`,children:n3(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)(DE,{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)(Gx,{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)(wC,{className:`size-2.5`})})]})}function n3(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t+1).toUpperCase():`FILE`}function r3({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 i3(e){return typeof CSS<`u`&&CSS.supports(`color`,e)?e:void 0}var a3={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 o3(e){return(e??`claude`)===`codex`?a3:void 0}function s3(e){return e===void 0?`none`:e>=95?`error`:e>=80?`warning`:`none`}function c3(e){let t=s3(e);return t===`error`?`text-danger`:t===`warning`?`text-warning`:`text-fg-3`}function l3(e){return e>=90?`bg-danger`:e>=70?`bg-warning`:`bg-accent`}function u3({usage:e,engine:t,open:n,onOpenChange:r,className:i}){return(0,U.jsx)(gT,{open:n,onOpenChange:r,children:(0,U.jsxs)(_T,{className:i,children:[(0,U.jsx)(vT,{title:`Context`,description:e?.model}),(0,U.jsx)(yT,{children:(0,U.jsx)(d3,{usage:e,engine:t})})]})})}function d3({usage:e,engine:t}){let n=o3(t);return(0,U.jsxs)(U.Fragment,{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:[AN(e.totalTokens),` / `,AN(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`,l3(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=i3(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:AN(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.`}),n?(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:n.summary}),n.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:n.caveat})]}):null]})}function f3({type:e}){return e===`dir`?(0,U.jsx)(xy,{className:`size-3.5 shrink-0 text-accent`}):e===`symlink`?(0,U.jsx)(sb,{className:`size-3.5 shrink-0 text-fg-4`}):(0,U.jsx)(sy,{className:`size-3.5 shrink-0 text-fg-4`})}function p3({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(Rk(e,`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(Rk(e,`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)(gT,{open:n,onOpenChange:r,children:(0,U.jsxs)(_T,{size:`lg`,children:[(0,U.jsx)(vT,{title:m?m.path.split(`/`).pop():`Files`,description:m?m.path:i,actions:m?(0,U.jsxs)(G,{variant:`ghost`,size:`xs`,onClick:()=>h(void 0),children:[(0,U.jsx)(sv,{className:`size-3.5`}),`Back`]}):C?(0,U.jsxs)(G,{variant:`ghost`,size:`xs`,onClick:()=>void x(C),children:[(0,U.jsx)(sv,{className:`size-3.5`}),`Up`]}):null}),(0,U.jsxs)(yT,{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:jN(m.bytes)}),(0,U.jsx)(OE,{code:m.content,label:m.path.split(`/`).pop()})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(aS,{className:`absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4`}),(0,U.jsx)(go,{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)(DE,{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)(sy,{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)(f3,{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:jN(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 m3={connected:`success`,failed:`danger`,"needs-auth":`warning`,pending:`info`,disabled:`neutral`};function h3({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:i=!0,className:a}){let o=g3(e,t,n);return(0,U.jsx)(gT,{open:n,onOpenChange:r,children:(0,U.jsxs)(_T,{className:a,children:[(0,U.jsx)(vT,{title:o.title,description:o.description,actions:(0,U.jsx)(_3,{model:o})}),(0,U.jsx)(yT,{children:(0,U.jsx)(v3,{model:o,canManageServers:i})})]})})}function g3(e,t,n=!0){let r=uM(()=>e.listMcpServers(t),[e,t],{enabled:n&&!!e&&!!t}),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)();(0,v.useEffect)(()=>{n&&(l(void 0),d(void 0),a(void 0))},[n,e,t]);let f=r.data,p=f?.find(e=>e.name===c),m=p?.tools?.find(e=>e.name===u);return{servers:f,server:p,tool:m,loading:r.loading,busyServer:o,error:i??(r.error===void 0?void 0:Rk(r.error,`Could not read MCP status`)),title:m?.name??p?.name??`MCP servers`,description:m?`${p?.name} tool`:p?p.serverInfo?.name:void 0,selectServer:l,selectTool:d,back:c?()=>u?d(void 0):l(void 0):void 0,reload:()=>{a(void 0),r.reload()},act:async(n,i)=>{if(e&&t){s(n),a(void 0);try{r.setData(await e.mcpServerAction(t,n,i))}catch(e){a(Rk(e,`Could not ${i} ${n}`))}finally{s(void 0)}}}}}function _3({model:e}){return e.back?(0,U.jsxs)(G,{variant:`ghost`,size:`xs`,onClick:e.back,children:[(0,U.jsx)(sv,{className:`size-3.5`}),`Back`]}):(0,U.jsxs)(G,{variant:`ghost`,size:`xs`,onClick:e.reload,disabled:e.loading,children:[e.loading?(0,U.jsx)(DE,{className:`size-3 text-current`}):(0,U.jsx)(Gx,{className:`size-3`}),`Refresh`]})}function v3({model:e,canManageServers:t=!0}){let{error:n,servers:r,server:i,tool:a}=e;return(0,U.jsxs)(U.Fragment,{children:[n?(0,U.jsx)(`div`,{className:`mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:n}):null,a?(0,U.jsx)(x3,{tool:a}):i?(0,U.jsx)(b3,{server:i,busy:e.busyServer===i.name,canManage:t,onAct:t=>void e.act(i.name,t),onSelectTool:e.selectTool}):n&&!r?null:(0,U.jsx)(y3,{servers:r,loading:e.loading,onSelect:e.selectServer})]})}function y3({servers:e,loading:t,onSelect:n}){if(t&&!e)return(0,U.jsx)(`div`,{className:`py-6 text-center`,children:(0,U.jsx)(DE,{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)(uo,{variant:m3[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 b3({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)(bT,{label:`Status`,children:(0,U.jsx)(uo,{variant:m3[e.status]??`neutral`,dot:!0,children:e.status})}),e.transport?(0,U.jsx)(bT,{label:`Transport`,children:e.transport}):null,e.scope?(0,U.jsx)(bT,{label:`Scope`,children:e.scope}):null,e.serverInfo?(0,U.jsxs)(bT,{label:`Server`,children:[e.serverInfo.name,` `,e.serverInfo.version]}):null,e.command?(0,U.jsx)(bT,{label:`Command`,mono:!0,children:[e.command,...e.args??[]].join(` `)}):null,e.url?(0,U.jsx)(bT,{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)(G,{variant:`outline`,size:`sm`,disabled:t,onClick:()=>r(`reconnect`),children:[t?(0,U.jsx)(DE,{className:`size-3 text-current`}):(0,U.jsx)(Gx,{className:`size-3`}),`Reconnect`]}),(0,U.jsxs)(G,{variant:`outline`,size:`sm`,disabled:t,onClick:()=>r(a?`enable`:`disable`),children:[a?(0,U.jsx)(Dx,{className:`size-3`}):(0,U.jsx)(Tx,{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 x3({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)(uo,{variant:`success`,children:`read-only`}):null,t.destructive?(0,U.jsx)(uo,{variant:`danger`,children:`destructive`}):null,t.openWorld?(0,U.jsx)(uo,{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:S3(e.inputSchema)})]})]})}function S3(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}var C3={user:`Personal`,repo:`This project`,system:`System`,admin:`Managed`};function w3({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)(gT,{open:t,onOpenChange:e=>{e||o(void 0),n(e)},children:(0,U.jsxs)(_T,{className:i,children:[(0,U.jsx)(vT,{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)(G,{variant:`ghost`,size:`xs`,onClick:()=>o(void 0),children:[(0,U.jsx)(sv,{className:`size-3.5`}),`Back`]}):void 0}),(0,U.jsx)(yT,{children:s?(0,U.jsx)(E3,{skill:s,onUse:r,onUsed:()=>n(!1)}):(0,U.jsx)(T3,{skills:e,onSelect:o})})]})})}function T3({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:C3[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)(uo,{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 E3({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)(bT,{label:`Scope`,children:C3[e.scope]??e.scope}):null,(0,U.jsx)(bT,{label:`Status`,children:(0,U.jsx)(uo,{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)(G,{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 D3(e){return e==="default"}function O3(e){return e.replace(/\[.*\]$/,``)}function k3(e){let t=e.toLowerCase().split(`-`);return t[0]===`claude`&&t.shift(),t[0]??``}function A3(e,t){if(t===e.value||t===e.resolvedModel)return!0;let n=O3(t);if(e.resolvedModel)return n===O3(e.resolvedModel);let r=k3(n);return r!==``&&r===k3(O3(e.value))}function j3(e,t){if(t)return e.filter(e=>!D3(e.value)).find(e=>A3(e,t))}function M3({models:e,model:t,onModelChange:n,variant:r=`toolbar`,disabled:i,className:a}){let o=j3(e,t)??(t?void 0:e.find(e=>D3(e.value)));return(0,U.jsxs)(OC,{items:e.map(e=>({value:e.value,label:e.displayName})),value:o?.value??null,onValueChange:e=>{typeof e==`string`&&e!==o?.value&&n(D3(e)?void 0:e)},disabled:i,children:[(0,U.jsx)(jC,{"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)(kC,{placeholder:t??`model`})})}),(0,U.jsx)(MC,{className:`min-w-72`,children:e.map(e=>(0,U.jsxs)(NC,{value:e.value,children:[(0,U.jsx)(AC,{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 N3=`default`;function P3(e,t,n){return j3(e,t)?.reasoningEfforts??n.reasoningEfforts??[]}function F3({efforts:e,effort:t,onEffortChange:n,variant:r=`toolbar`,disabled:i,className:a}){let o=[{value:N3,label:`Default`},...e.map(e=>({value:e,label:e}))];return(0,U.jsxs)(OC,{items:o,value:t??null,onValueChange:e=>{typeof e==`string`&&e!==t&&n(e===N3?void 0:e)},disabled:i,children:[(0,U.jsx)(jC,{"aria-label":`Reasoning effort`,className:W(r===`toolbar`&&`h-6 max-w-32 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover`,a),children:(0,U.jsxs)(`span`,{className:W(`flex items-center gap-1 truncate`,r===`toolbar`&&`font-mono text-label`),children:[(0,U.jsx)(F_,{className:`size-3 shrink-0`}),(0,U.jsx)(kC,{placeholder:`effort`})]})}),(0,U.jsx)(MC,{className:`min-w-40`,children:o.map(e=>(0,U.jsxs)(NC,{value:e.value,children:[(0,U.jsx)(AC,{children:(0,U.jsx)(`span`,{className:`font-medium`,children:e.label})}),e.value===N3?(0,U.jsx)(`span`,{className:`text-label text-fg-4`,children:`The model's configured default`}):null]},e.value))})]})}var I3=[{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:Cv},{value:`plan`,label:`Plan`,shortLabel:`Plan`,description:`Create a plan before making changes`,icon:pee},{value:`auto`,label:`Auto`,shortLabel:`Auto`,description:`The agent handles permission decisions`,icon:EC},{value:`dontAsk`,label:`Don't ask`,shortLabel:`Don't ask`,description:`Never ask - deny anything not pre-approved`,icon:dS},{value:`bypassPermissions`,label:`Bypass permissions`,shortLabel:`Bypass`,description:`Skip every approval - the agent is unsupervised`,icon:KS,dangerous:!0}];function L3(e){return I3.find(t=>t.value===e)}function R3(e,t){return(e?I3.filter(t=>e.includes(t.value)):I3).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 z3({mode:e,onModeChange:t,modes:n,canBypass:r,variant:i=`toolbar`,disabled:a,className:o}){let s=e===`bypassPermissions`,c=n?I3.filter(e=>n.includes(e.value)):I3,l=e=>e.value===`bypassPermissions`&&r===!1;return(0,U.jsxs)(OC,{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)(jC,{"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)(kC,{placeholder:`permissions`})})}),(0,U.jsx)(MC,{className:`min-w-64`,children:c.map(e=>{let t=l(e);return(0,U.jsxs)(NC,{value:e.value,disabled:t,children:[(0,U.jsx)(AC,{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)})})]})}var B3={shell:{name:`magenta`,live:`magenta`},subagent:{name:`green`,live:`mark`}},V3={shell:`text-[var(--wd-shell-accent)]`,subagent:`text-accent`};function H3({kind:e,name:t,status:n,detail:r,failed:i,live:a,onBack:o,actions:s,terminal:c,fontSize:l,lineHeight:u}){if(c){let c=B3[e],d=e=>(0,U.jsxs)(LP,{glyph:`←`,glyphTone:`dim`,indent:1,tone:i?`red`:c.name,children:[e,n?(0,U.jsxs)(BP,{tone:i?`red`:a?c.live:`dim`,children:[` · `,n]}):null,r?(0,U.jsxs)(BP,{tone:`faint`,children:[` · `,r]}):null]});return(0,U.jsx)(Y4,{fontSize:l,lineHeight:u,className:`shrink-0`,children:s===void 0?(0,U.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back to the session`,className:`block w-full cursor-pointer text-left`,children:d(t)}):(0,U.jsx)(mP,{placement:`inline`,actions:s,children:d((0,U.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back to the session`,className:`cursor-pointer text-left`,children:t}))})})}return(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)(G,{variant:`ghost`,size:`sm`,onClick:o,className:`h-6 gap-1 px-1.5`,children:[(0,U.jsx)(u_,{className:`size-3.5`}),`Back`]}),(0,U.jsx)(`span`,{className:W(`min-w-0 flex-1 truncate text-body-sm`,e===`shell`&&`font-mono`,i?`text-danger`:`text-fg-2`),children:t}),n?(0,U.jsx)(`span`,{className:W(`shrink-0 text-label`,i?`text-danger`:a?V3[e]:`text-fg-3`),children:n}):null,r?(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:r}):null,s]})}function U3({task:e,items:t,label:n,onBack:r,terminal:i,fontSize:a,lineHeight:o}){let s=e?N2(e,t):!1,c=e?P2(e):!1,l=tP(s),u=t.reduce((e,t)=>e+ +(t.kind===`tool_call`),0),d=s?e?.ts:void 0,f=q4(d!==void 0),p=d===void 0?void 0:kN(f-d),m=e?O2(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(0,U.jsx)(H3,{kind:`subagent`,name:m,status:h,detail:g,failed:c,live:s,onBack:r,terminal:i,fontSize:a,lineHeight:o})}function W3(e){return(`parentToolUseId`in e?e.parentToolUseId:void 0)??void 0}function G3(e,t){return e.filter(e=>W3(e)===t)}function K3(e){return e.kind===`tool_call`}function q3(e){return e.children.flatMap(e=>`run`in e?e.run:[e.item])}function J3(e,t,n){let r=e.at(-1);if(K3(t)&&!h2(t)){r&&`run`in r&&x2(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 Y3(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`&&W3(t)===void 0&&r.add(t.id);let i=new Map;e.forEach((e,n)=>{let a=W3(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=W3(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)J3(n,e.item,e.index);a.push({key:`task:${r.id}`,task:r,children:n,childIndices:t.map(e=>e.index),index:e});continue}}J3(a,r,e)}}return a}function X3(e,t){return h2(e)||h2(t)?!0:e.kind!==`tool_call`||t.kind!==`tool_call`}function Z3(e){return`item`in e?h2(e.item)?`peer_send`:e.item.kind:`tool_call`}function Q3(e,t){return Z3(e)!==`tool_call`||Z3(t)!==`tool_call`}function $3({sessionId:e,request:t,reveal:n,onChange:r,returnTo:i}){let[a,o]=(0,v.useState)(void 0),[s,c]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{o(void 0),c(void 0)},[e]);let l=(0,v.useRef)(i);l.current=i;let u=(0,v.useCallback)(()=>{o(e=>{let t=e===void 0?void 0:l.current(e);t!==void 0&&c({toolUseId:t,nonce:Date.now()})})},[]),d=t?.nonce,f=t?.id;(0,v.useEffect)(()=>{f===void 0?u():o(f)},[d]);let p=n?.nonce;(0,v.useEffect)(()=>{p!==void 0&&o(void 0)},[p]),(0,v.useEffect)(()=>{if(a===void 0)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&u()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a,u]);let m=(0,v.useRef)(r);m.current=r;let h=(0,v.useRef)(void 0);return(0,v.useEffect)(()=>{h.current!==a&&(h.current=a,m.current?.(a))},[a]),{id:a,enter:o,leave:u,returnReveal:s}}function e6(e){let{sessionId:t,items:n,session:r,reveal:i,openSubagent:a,onSubagentChange:o}=e,s=$3({sessionId:t,request:a&&{id:a.toolUseId,nonce:a.nonce},reveal:i,onChange:o,returnTo:e=>e}),c=s.id,l=(0,v.useMemo)(()=>c===void 0?[]:G3(n,c),[n,c]),u=(0,v.useMemo)(()=>c===void 0?void 0:n.find(e=>e.kind===`tool_call`&&e.id===c),[n,c]),d=(0,v.useMemo)(()=>{let e=r?.subagents?.find(e=>e.toolUseId===c);return e?NO(e):`Sub-agent`},[r,c]);return{subagentId:c,enterSubagent:s.enter,leaveSubagent:s.leave,returnReveal:s.returnReveal,frameItems:l,task:u,fallbackLabel:d}}function t6({shell:e,label:t,cols:n,onBack:r,onKill:i,onAgentWrite:a,terminal:o,fontSize:s,lineHeight:c}){let l=e?.status===`running`,u=e?d4(e):!1,d=e?c4(e):t,f=e?f4(e):void 0,p=n??e?.cols,m=p===void 0?void 0:`${p} cols`,h=e?.agentWrite===!0,g=e&&a&&a4(e)?()=>a(!h):void 0,_=o?(0,U.jsxs)(U.Fragment,{children:[g&&e?(0,U.jsx)(TP,{granted:h,label:o4(e),onToggle:g}):null,l&&i?(0,U.jsx)(wP,{onKill:i}):null]}):(0,U.jsxs)(U.Fragment,{children:[g&&e?(0,U.jsx)(`button`,{type:`button`,"aria-label":o4(e),"aria-pressed":h,title:o4(e),className:W(`shrink-0 text-label`,h?`text-warning`:`text-fg-3 hover:text-fg-1`),onClick:g,children:(0,U.jsx)(DP,{granted:h,className:`size-3.5`})}):null,l&&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)(wC,{className:`size-3.5`})}):null]});return(0,U.jsx)(H3,{kind:`shell`,name:d,status:f,detail:m,failed:u,live:l,onBack:r,actions:_,terminal:o,fontSize:s,lineHeight:c})}function n6({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=r6(),p=(0,v.useRef)(r);p.current=r;let m=cN(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 o6().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:i6(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=i6(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(`wd-shell-term 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)(DE,{})})]})}function r6(){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 i6(e){return e===`light`?{background:`#00000000`,foreground:`#1f2328`,cursor:`#1f2328`,selectionBackground:`#b9c7d980`}:{background:`#00000000`,foreground:`#d4d4d4`,cursor:`#d4d4d4`,selectionBackground:`#3a4a5f80`}}var a6;function o6(){return a6??=(async()=>{let[e,t]=await Promise.all([tN(()=>import(`./xterm-ScmBfeDI.js`),[]),tN(()=>import(`./addon-fit-DIOBYJe3.js`),[])]);return{Terminal:e.Terminal,FitAddon:t.FitAddon}})(),a6}function s6(e){let{sessionId:t,items:n,session:r,shells:i,reveal:a,openShell:o,onShellChange:s}=e,c=(0,v.useRef)(void 0),l=$3({sessionId:t,request:o&&{id:o.shellId,nonce:o.nonce},reveal:a,onChange:s,returnTo:()=>c.current}),u=l.id,d=(0,v.useMemo)(()=>u===void 0?void 0:n.find(e=>e.kind===`shell`&&e.shell.id===u),[n,u]);c.current=d?.id;let f=(0,v.useMemo)(()=>{if(u!==void 0)return d?.shell??i?.find(e=>e.id===u)??r?.shells?.find(e=>e.id===u)},[d,i,r,u]),p=f&&(f.label||f.command.split(`
201
+ `)[0])||`shell`;return{shellId:u,enterShell:l.enter,leaveShell:l.leave,returnReveal:l.returnReveal,shell:f,label:p}}function c6(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 l6={"\r":`enter`,"\n":`newline`," ":`tab`,"\x1B":`escape`,"":`backspace`},u6=[`shell_run`,`shell_write`,`shell_kill`,`shell_request_write`];function d6(e){if(typeof e!=`string`)return;let t=e.startsWith(`mcp__`)?e.slice(e.indexOf(`__`,5)+2):e;return u6.includes(t)?t:void 0}function f6(e){let t=d6(e?.toolName);if(!t)return;let n=e?.input!==null&&typeof e?.input==`object`?e.input:{},r=typeof n.shellId==`string`?n.shellId:``;switch(t){case`shell_run`:return{kind:`run`,command:typeof n.command==`string`?n.command:``};case`shell_write`:{let e=Array.isArray(n.keys)?n.keys.filter(e=>typeof e==`string`):void 0;return{kind:`write`,shellId:r,...typeof n.data==`string`?{data:n.data}:{},...e&&e.length>0?{keys:e}:{}}}case`shell_kill`:return{kind:`kill`,shellId:r};case`shell_request_write`:return{kind:`grant`,shellId:r,reason:typeof n.reason==`string`?n.reason:``}}}function p6(e){switch(e.kind){case`run`:return`Agent wants to start a shell`;case`write`:return`Agent wants to type into shell ${e.shellId}`;case`kill`:return`Agent wants to kill shell ${e.shellId}`;case`grant`:return`Agent asks to type into your shell ${e.shellId}`}}function m6(e){switch(e.kind){case`run`:return e.command.split(`
202
+ `).map((e,t)=>t===0?`$ ${e}`:` ${e}`);case`write`:{let t=[];return e.data!==void 0&&t.push(`types: ${h6(e.data)}`),e.keys&&t.push(`presses: ${e.keys.map(e=>`[${e}]`).join(` `)}`),t}case`kill`:return[`kill ${e.shellId}`];case`grant`:return[`why: ${h6(e.reason)}`,`until the shell ends or you revoke it`]}}function h6(e){let t=``;for(let n of e){let e=n.codePointAt(0);if(e>=32&&e!==127){t+=n;continue}let r=l6[n];t+=r?`[${r}]`:`[ctrl-${String.fromCharCode(e+64).toLowerCase()}]`}return t}function g6(e){let t=c6(e),n=t?void 0:f6(e),r={description:e.description,decisionReason:e.decisionReason};return t?{plan:t,heading:`Plan ready for review`,question:`Ready to implement this plan?`,...r,choices:[{key:`allow`,button:`Approve plan`,option:`Approve plan`},{key:`deny`,button:`Keep planning`,option:`Keep planning - tell it what to change`},{key:`stop`,button:`Stop the turn`,option:`No, and stop the turn`,danger:!0}],denyPlaceholder:`What should change? (optional) - the agent keeps planning and reads this`}:{shell:n,heading:n?p6(n):e.title??e.displayName??`Permission needed`,question:n?`Do you want to let it?`:`Do you want to proceed?`,...r,choices:[{key:`allow`,button:`Allow`,option:`Yes`},{key:`deny`,button:`Deny`,option:`No, and tell the agent what to do differently`},{key:`stop`,button:`Deny & stop`,option:`No, and stop the turn`,danger:!0}],denyPlaceholder:`Reason (optional) - the agent reads this and can try something else`}}var _6={img:({src:e,alt:t})=>(0,U.jsx)(a2,{src:e,alt:t})},v6=(0,v.memo)(function({children:e,streaming:t,className:n}){return(0,U.jsx)(u0,{mode:t?`streaming`:`static`,parseIncompleteMarkdown:t,shikiTheme:[`github-light`,`github-dark`],linkSafety:{enabled:!1},components:_6,rehypePlugins:n2,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 y6({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=g6(e),{plan:f,shell:p}=d,[m,h,g]=d.choices,_=LN(e.input),y=BN(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.heading}),d.description?(0,U.jsx)(`div`,{className:`mt-0.5 text-label text-fg-3`,children:d.description}):null,d.decisionReason?(0,U.jsx)(`div`,{className:`mt-0.5 text-label text-fg-4`,children:d.decisionReason}):null,f?(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)(v6,{children:f})}):(0,U.jsxs)(U.Fragment,{children:[p?(0,U.jsx)(`pre`,{"data-slot":`shell-request`,className:`mt-1.5 max-h-48 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-body-sm whitespace-pre-wrap text-fg-1`,children:m6(p).join(`
203
+ `)}):null,(0,U.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(y,{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}),_&&!p?(0,U.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,children:_}):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)(G,{size:`sm`,onClick:()=>t(e.id),children:m.button}),(0,U.jsx)(G,{size:`sm`,variant:`outline`,onClick:()=>s(e=>!e),children:h.button}),(0,U.jsx)(G,{size:`sm`,variant:`outline`,onClick:()=>u(!0),children:g.button})]})]}),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)(go,{autoFocus:!0,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u(!1),e.key===`Escape`&&s(!1)},placeholder:d.denyPlaceholder,className:`h-7 flex-1`}),(0,U.jsx)(G,{size:`sm`,variant:`outline`,onClick:()=>s(!1),children:`Cancel`}),(0,U.jsx)(G,{size:`sm`,variant:`destructive`,onClick:()=>u(!1),children:h.button})]}):null]})}var b6={labels:[],other:``,otherActive:!1};function x6(e){let t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(`, `)}function S6(e,t,n){if(!n)return{...e,labels:[t],otherActive:!1};let r=e.labels.includes(t)?e.labels.filter(e=>e!==t):[...e.labels,t];return{...e,labels:r}}function C6(e,t){let n=!e.otherActive;return{...e,otherActive:n,labels:n&&!t?[]:e.labels}}function w6(e,t){let n={};return e.forEach((e,r)=>{n[e.question]=x6(t[r]??b6)}),n}function T6(e){let[t,n]=(0,v.useState)(()=>e.map(()=>b6)),r=e=>t[e]??b6,i=e=>x6(r(e))!==``,a=(t,r)=>n(n=>e.map((e,i)=>i===t?r(n[i]??b6):n[i]??b6)),o=t=>e[t]?.multiSelect===!0;return{selections:t,selectionFor:r,answered:i,complete:e.every((e,t)=>i(t)),update:(e,t)=>a(e,e=>({...e,...t})),toggle:(e,t)=>a(e,n=>S6(n,t,o(e))),toggleOther:e=>a(e,t=>C6(t,o(e))),answers:()=>w6(e,t)}}var E6=[{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`}];function D6({request:e,onAnswer:t,onDismiss:n,className:r}){let i=kA(e.input),{selectionFor:a,update:o,toggle:s,toggleOther:c,complete:l,answers:u}=T6(i);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)(Db,{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);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)(uo,{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(e=>{let r=n.labels.includes(e.label);return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>s(t,e.label),className:W(`rounded-md border px-2.5 py-1.5 text-left transition-colors`,r?`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:e.label}),e.description?(0,U.jsx)(`span`,{className:`block text-label text-fg-4`,children:e.description}):null,r&&e.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:e.preview}):null]},e.label)}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>c(t),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)(_o,{autoFocus:!0,rows:1,value:n.other,onChange:e=>o(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)(G,{size:`sm`,onClick:()=>t(e.id,{...e.input,answers:u()}),disabled:!l,children:`Answer`})})]}),(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Dismiss question`,className:`shrink-0`,onClick:()=>n(e.id,`Question dismissed by user`),children:(0,U.jsx)(wC,{className:`size-3.5`})})]})})}function O6({dashed:e}){return(0,U.jsx)(`div`,{className:W(`term-rule-row`,e&&`term-rule-dashed`),"aria-hidden":!0})}function k6({children:e}){return(0,U.jsx)(LP,{tone:`faint`,children:e})}function A6({children:e,className:t}){return(0,U.jsx)(`div`,{className:W(`term-box`,t),children:e})}function j6({title:e,subject:t}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(LP,{tone:`blue`,bold:!0,children:e}),t?(0,U.jsx)(LP,{tone:`dim`,children:t}):null]})}var M6={check:[`[ ]`,`[✓]`],radio:[`( )`,`(•)`]};function N6(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 P6({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&&!N6(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)(LP,{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)(BP,{tone:e.checked?`green`:`faint`,children:[M6[e.marker??`check`][+!!e.checked],` `]}),(0,U.jsx)(BP,{bold:a||e.selected,children:e.label})]})}),e.description?(0,U.jsx)(LP,{columns:5,tone:`dim`,children:e.description}):null,e.detail?(0,U.jsx)(`div`,{className:`term-detail`,children:e.detail}):null]},e.key)})})}function F6({value:e,onChange:t,onSubmit:n,onCancel:r,placeholder:i}){return(0,U.jsx)(LP,{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 I6({tabs:e,active:t,onSelect:n}){return(0,U.jsxs)(LP,{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)(BP,{tone:`faint`,children:` →`})]})}var L6={maxHeight:`min(24rem, 50vh)`,overflowY:`auto`};function R6({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=g6(e),{plan:f,shell:p,heading:m}=d,h=f||p?void 0:WP(e.input),g=f||p?``:LN(e.input),_=h?.path??(g||void 0),y=o?(0,U.jsx)(F6,{value:c,onChange:l,onSubmit:()=>u(!1),onCancel:()=>s(!1),placeholder:d.denyPlaceholder}):void 0,b=d.choices.map(e=>({key:e.key,label:e.option,danger:e.danger,detail:e.key===`deny`?y:void 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)(O6,{}),(0,U.jsx)(j6,{title:m,subject:_}),(0,U.jsx)(RP,{}),f?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{style:L6,children:(0,U.jsx)(m2,{children:f})}),(0,U.jsx)(RP,{}),(0,U.jsx)(O6,{dashed:!0})]}):p?(0,U.jsxs)(U.Fragment,{children:[m6(p).map((e,t)=>(0,U.jsx)(LP,{bold:!0,children:e},t)),(0,U.jsx)(RP,{}),(0,U.jsx)(O6,{dashed:!0})]}):h?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(GP,{patch:h}),(0,U.jsx)(RP,{}),(0,U.jsx)(O6,{dashed:!0})]}):d.description?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(LP,{tone:`dim`,children:d.description}),(0,U.jsx)(RP,{})]}):null,d.decisionReason?(0,U.jsx)(LP,{tone:`faint`,children:d.decisionReason}):null,(0,U.jsx)(LP,{children:d.question}),(0,U.jsx)(P6,{label:m,options:b,focused:i,onFocus:a,active:!o,onChoose:n=>{let r=d.choices[n]?.key;r===`allow`?t(e.id):r===`deny`?s(!0):r===`stop`&&u(!0)}}),(0,U.jsx)(RP,{}),(0,U.jsx)(k6,{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`})]})}function z6({request:e,onAnswer:t,onDismiss:n,className:r}){let i=kA(e.input),{selectionFor:a,answered:o,complete:s,update:c,toggle:l,toggleOther:u,answers:d}=T6(i),[f,p]=(0,v.useState)(()=>i.map(()=>0)),[m,h]=(0,v.useState)(0),[g,_]=(0,v.useState)(0),y=m>=i.length,b=a(m),x=()=>t(e.id,{...e.input,answers:d()}),S=()=>n(e.id,`Question dismissed by user`),C=e=>h(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(),S();return}e.key===`Tab`&&(e.preventDefault(),C(e.shiftKey?-1:1))},children:[(0,U.jsx)(O6,{}),(0,U.jsx)(I6,{tabs:[...i.map((e,t)=>({key:`q${t}`,label:e.header||`Question ${t+1}`,glyph:o(t)?`▣`:`▢`})),{key:`submit`,label:`Submit`,glyph:`✓`}],active:m,onSelect:h}),(0,U.jsx)(RP,{}),y?(0,U.jsx)(V6,{questions:i,answers:i.map((e,t)=>x6(a(t))),complete:s,cursor:g,onCursor:_,onSubmit:x,onCancel:S}):(0,U.jsx)(B6,{question:i[m],selection:b,cursor:f[m]??0,onCursor:e=>p(t=>t.map((t,n)=>n===m?e:t)),onToggle:e=>l(m,e),onOther:e=>c(m,e),onToggleOther:()=>u(m),onAdvance:()=>C(1),onDismiss:S},m),(0,U.jsx)(RP,{}),(0,U.jsx)(k6,{children:!y&&b.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 B6({question:e,selection:t,cursor:n,onCursor:r,onToggle:i,onOther:a,onToggleOther:o,onAdvance:s,onDismiss:c}){let l=e.multiSelect===!0,u=[...e.options.map((e,r)=>{let i=t.labels.includes(e.label);return{key:e.label,label:e.label,description:e.description,checked:l?i:void 0,marker:`check`,selected:!l&&i,detail:e.preview&&n===r?(0,U.jsx)(A6,{children:e.preview.split(`
204
+ `).map((e,t)=>(0,U.jsx)(LP,{columns:0,tone:`dim`,children:e||` `},t))}):void 0}}),{key:`__other`,label:`Other…`,checked:t.otherActive,marker:`check`,detail:t.otherActive?(0,U.jsx)(F6,{value:t.other,onChange:e=>a({other:e}),onSubmit:s,onCancel:()=>a({otherActive:!1,other:``}),placeholder:`Type your own answer`}):void 0},...l?[{key:`__next`,label:`Submit`}]:[],{key:`__chat`,label:`Chat about this`}];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(LP,{bold:!0,tone:`bright`,children:e.question}),(0,U.jsx)(RP,{}),(0,U.jsx)(P6,{label:e.question,options:u,focused:n,active:!t.otherActive,onFocus:r,onChoose:t=>{if(t<e.options.length){i(e.options[t].label),l||s();return}if(t===e.options.length){o();return}if(l&&t===e.options.length+1){s();return}c()}})]})}function V6({questions:e,answers:t,complete:n,cursor:r,onCursor:i,onSubmit:a,onCancel:o}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(LP,{bold:!0,tone:`bright`,children:`Review your answers`}),(0,U.jsx)(RP,{}),e.map((e,n)=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(LP,{glyph:`●`,glyphTone:`dim`,children:e.question}),(0,U.jsx)(LP,{indent:1,glyph:`→`,glyphTone:`green`,children:(0,U.jsx)(BP,{tone:t[n]?`green`:`faint`,children:t[n]||`not answered`})})]},n)),(0,U.jsx)(RP,{}),(0,U.jsx)(LP,{children:n?`Ready to submit your answers?`:`Some questions are unanswered.`}),(0,U.jsx)(P6,{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 H6({requests:e,terminal:t,fontSize:n,lineHeight:r,affordances:i,hostPrompts:a,onApprove:o,onDeny:s}){let c=e=>s(e,`Question dismissed by user`);return(0,U.jsx)(`div`,{className:W(t?`pb-2`:`px-3 pb-2`),children:(0,U.jsx)(U6,{terminal:t,fontSize:n,lineHeight:r,affordances:i,children:e.map(e=>{let n=a?.[e.toolName];if(n)return(0,U.jsx)(n,{request:e,onApprove:o,onDeny:s},e.id);let r=e.toolName===`AskUserQuestion`&&kA(e.input).length>0;return t?r?(0,U.jsx)(z6,{request:e,onAnswer:o,onDismiss:c},e.id):(0,U.jsx)(R6,{request:e,onApprove:o,onDeny:s},e.id):r?(0,U.jsx)(D6,{request:e,onAnswer:o,onDismiss:c},e.id):(0,U.jsx)(y6,{request:e,onApprove:o,onDeny:s},e.id)})})})}function U6({terminal:e,fontSize:t,lineHeight:n,affordances:r,children:i}){return e?(0,U.jsx)(Y4,{fontSize:t,lineHeight:n,affordances:r,bleed:`1ch`,className:`term-transcript`,children:i}):(0,U.jsx)(`div`,{className:`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] flex-col gap-2`,children:i})}function W6({variant:e,fileLinks:t,loadFullResult:n,shellActions:r,toolTitles:i,resultImages:a,children:o}){return(0,U.jsx)(CN,{value:e,children:(0,U.jsx)(y0,{value:t,children:(0,U.jsx)(J2,{value:n,children:(0,U.jsx)(y4,{value:r,children:(0,U.jsx)(Z2,{value:i,children:(0,U.jsx)(B0,{value:a,children:o})})})})})})}function G6(e,t){let[n,r]=(0,v.useState)({sessionId:e,mark:t,caughtUp:!1}),i=n;n.sessionId!==e&&(i={sessionId:e,mark:t,caughtUp:!1},r(i));let a=(0,v.useCallback)(()=>r(e=>e.caughtUp?e:{...e,caughtUp:!0}),[]);return{mark:i.caughtUp?void 0:i.mark,dismiss:a}}var K6={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`};function q6(e,t,n){let r=(0,v.useMemo)(()=>({cache:new Map,urls:new Set,live:!0}),[e,t]);return(0,v.useEffect)(()=>(r.live=!0,()=>{r.live=!1;for(let e of r.urls)URL.revokeObjectURL(e);r.urls.clear(),r.cache.clear()}),[r]),(0,v.useCallback)(i=>{let a=n?.[i],o=a?`produced:${a.fileId}`:`fs:${i}`,s=r.cache.get(o);if(s)return s;let c=(a&&t?J6(e,t,a.fileId,r):Y6(e,i)).catch(()=>{r.cache.get(o)===c&&r.cache.delete(o)});return r.cache.set(o,c),c},[e,t,n,r])}async function J6(e,t,n,r){let i=await e.readProducedFile(t,n);if(i.size===0)return;let a=URL.createObjectURL(i);if(!r.live)throw URL.revokeObjectURL(a),Error(`host image store disposed`);return r.urls.add(a),a}async function Y6(e,t){let n=await e.readHostFile(t);if(n.encoding!==`base64`)return;let r=K6[t.slice(t.lastIndexOf(`.`)+1).toLowerCase()];return r?`data:${r};base64,${n.content}`:void 0}function X6({state:e,client:t,sessionId:n,open:r,onOpenChange:i}){return(0,U.jsx)(gT,{open:r,onOpenChange:i,children:(0,U.jsxs)(_T,{children:[(0,U.jsx)(vT,{title:`Session info`,description:e.session?.title}),(0,U.jsx)(yT,{children:(0,U.jsx)(Z6,{state:e,client:t,sessionId:n,active:r})})]})})}function Z6({state:e,client:t,sessionId:n,active:r=!0}){let i=e.session,a=e.permissionMode?L3(e.permissionMode):void 0;return(0,U.jsxs)(`div`,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsxs)(`div`,{className:`pb-2`,children:[(0,U.jsx)(bT,{label:`Engine`,children:e.engine??`claude`}),i?.profile?(0,U.jsx)(bT,{label:`Profile`,children:i.profile}):null,e.model?(0,U.jsx)(bT,{label:`Model`,mono:!0,children:e.model}):null,a?(0,U.jsx)(bT,{label:`Permission mode`,children:a.label}):null,i?.apiKeySource?(0,U.jsx)(bT,{label:`Credentials`,children:i.apiKeySource}):null]}),(0,U.jsxs)(`div`,{className:`py-2`,children:[e.cwd?(0,U.jsx)(Q6,{label:`Working directory`,value:e.cwd}):null,e.sdkSessionId?(0,U.jsx)(Q6,{label:`Engine session id`,value:e.sdkSessionId}):null,i?(0,U.jsx)(Q6,{label:`Gateway session id`,value:i.id}):null]}),(0,U.jsxs)(`div`,{className:`py-2`,children:[i?.createdAt?(0,U.jsx)(bT,{label:`Started`,children:NN(i.createdAt)}):null,i?.numTurns===void 0?null:(0,U.jsx)(bT,{label:`Turns`,children:i.numTurns}),(0,U.jsx)(bT,{label:`Cost`,mono:!0,children:ON(e.costUsd??(e.totalCostUsd||void 0))})]}),e.capabilities.vfs?(0,U.jsx)($6,{client:t,sessionId:n,active:r}):null]})}function Q6({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)(EE,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function $6({client:e,sessionId:t,active:n}){let{data:r,loading:i}=uM(()=>e.listSessionFiles(t),[e,t],{enabled:n&&!!t});return(0,U.jsxs)(`div`,{className:`pt-3`,children:[(0,U.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Files`}),i?(0,U.jsx)(`div`,{className:`py-3 text-center`,children:(0,U.jsx)(DE,{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)(Gv,{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:jN(n.bytes)})]})},n.path))}):(0,U.jsx)(`p`,{className:`py-2 text-body-sm text-fg-4`,children:`Nothing delivered yet.`})]})}var e8={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 t8(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 n8({usage:e,engine:t}){let n=o3(t);return(0,U.jsx)(WT,{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:i3(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:AN(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:[AN(e.totalTokens),` / `,AN(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`,c3(e.percentage)),children:[`Ctx `,AN(e.totalTokens)]})})}function r8({label:e,info:t,now:n}){let r=t.utilization,i=t.resetsAt===void 0?void 0:t.resetsAt*1e3;return(0,U.jsx)(WT,{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:MN(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`:c3(r??0)),children:[(0,U.jsx)(ME,{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:[` · `,MN(i,n)]})]})})}function i8({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 a8({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=e8[e.status],m=t8(),h=t??e.rateLimits,g=h?.five_hour,_=h?.seven_day,v=r??(n===!1?`reconnecting`:`live`),y=wN()===`terminal`,b=s&&s.length>0?Fk(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)(i8,{onClick:i,hint:`Session info`,children:v===`live`?(0,U.jsxs)(uo,{variant:p.variant,dot:!p.busy,className:`items-baseline`,children:[p.busy?(0,U.jsx)(DE,{className:`size-3 self-center text-current`}):null,p.label]}):(0,U.jsxs)(uo,{variant:v===`offline`?`danger`:`warning`,dot:!1,className:`items-baseline`,children:[v===`offline`?(0,U.jsx)(vC,{className:`size-3 self-center text-current`}):(0,U.jsx)(Lx,{className:`size-3 animate-spin self-center text-current`}),v===`offline`?`Offline`:`Reconnecting…`]})}),e.capabilities.contextUsage&&e.contextUsage?(0,U.jsx)(i8,{onClick:a,hint:`Context breakdown`,children:(0,U.jsx)(n8,{usage:e.contextUsage,engine:e.engine})}):null,g||_?(0,U.jsx)(i8,{onClick:o,hint:`Plan usage`,children:(0,U.jsxs)(`span`,{className:`inline-flex items-baseline gap-2`,children:[g?(0,U.jsx)(r8,{label:`Session`,info:g,now:m}):null,_?(0,U.jsx)(r8,{label:`Weekly`,info:_,now:m}):null]})}):null,b?(0,U.jsx)(i8,{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:Ik(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:ON(e.costUsd??(e.totalCostUsd||void 0))}),u?(0,U.jsx)(`span`,{className:`self-center`,children:u}):null]})}var o8={damping:.7,stiffness:.05,mass:1.25},s8=70,c8=1e3/60,l8=350,u8=!1;globalThis.document?.addEventListener(`mousedown`,()=>{u8=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{u8=!1}),globalThis.document?.addEventListener(`click`,()=>{u8=!1});var d8=(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(!u8)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<=s8}}},[]),f=(0,v.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=m8(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))/c8;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:m8(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=f8(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=f8(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=m8(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:l8})}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 f8(e,t){let n=(0,v.useCallback)(t=>(n.current=t,e(t)),t);return n}var p8=new Map;function m8(...e){let t={...o8},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 p8.has(r)||p8.set(r,Object.freeze(t)),n?`instant`:p8.get(r)}var h8=(0,v.createContext)(null),g8=typeof window<`u`?v.useLayoutEffect:v.useEffect;function _8({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=d8({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]),g8(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),v.createElement(h8.Provider,{value:b},v.createElement(`div`,{...l},typeof t==`function`?t(b):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=v8();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})(_8||={});function v8(){let e=(0,v.useContext)(h8);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}function y8({className:e,children:t,...n}){return(0,U.jsx)(_8,{"data-slot":`conversation`,className:W(`relative flex-1 overflow-y-auto`,e),initial:`instant`,resize:`instant`,role:`log`,...n,children:t})}function b8({className:e,children:t,...n}){return(0,U.jsx)(_8.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 x8({className:e}){let{isAtBottom:t,scrollToBottom:n}=v8();return t?null:(0,U.jsx)(G,{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)(c_,{className:`size-4`})})}function S8({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 C8({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:i}){let a=[{icon:jb,text:`Tell the agent what to do.`},...t?[{icon:Iee,text:`Type / for the CLI’s slash commands.`}]:[],...n?[{icon:bS,text:`Type $ to draft a message for one of the agent’s skills.`}]:[],...r?[{icon:oee,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)(RS,{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 w8(e){return typeof e==`object`?e.key:e}function T8(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 E8(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 D8(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var O8=(e,t)=>Math.abs(e-t)<1.01,Dre=(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)}})},k8,A8=()=>{if(k8!==void 0)return k8;if(typeof navigator>`u`)return k8=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return k8=!0;let e=navigator.maxTouchPoints;return k8=navigator.platform===`MacIntel`&&e!==void 0&&e>0},j8=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ore=e=>e,M8=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},kre=(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(j8(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(j8(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},N8={passive:!0},Are=typeof window>`u`||`onscrollend`in window,jre=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Are,o=0,s=a?null:Dre(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,N8),a&&r.addEventListener(`scrollend`,u,N8),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Mre=(e,t)=>jre(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Nre=(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`]},Pre=(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 Fre(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 Ire=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:Ore,rangeExtractor:M8,onChange:()=>{},measureElement:Nre,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=>w8(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||Fre(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=E8(()=>(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,A8()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,N8),e.addEventListener(`touchend`,n,N8),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&&(A8()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!O8(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=E8(()=>[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=E8(()=>[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=T8(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=E8(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=Rre(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=E8(()=>{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=E8(()=>[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 D8(t[P8(0,t.length-1,r?e=>n[e*2]:e=>D8(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(A8()&&(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&&O8(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()}},P8=(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 Lre(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 Rre(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=Lre(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=P8(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 F8=typeof document<`u`?v.useLayoutEffect:v.useEffect;function zre({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,Td.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[u]=v.useState(()=>{let e=new Ire(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),F8(()=>u._didMount(),[]),F8(()=>(s(u),u._willUpdate())),F8(()=>{c(u)}),u}function Bre(e){return zre({observeElementRect:kre,observeElementOffset:Mre,scrollToFn:Pre,...e})}function Vre(e,t,n){return{width:e,ch:t,line:n,cache:new WeakMap}}function Hre(e,t){if(!(`item`in e))return sie(e,t).px;let n=t.cache.get(e.item);if(n)return n.px;let r=q8(e.item,t);return t.cache.set(e.item,r),r.px}function Ure(e,t){let n=Math.max(1,Math.floor(t.width/t.ch+V8));return(Math.min(B8(e,n).lines,4)+1)*t.line}function Wre(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 Gre=/!\[[^\]]*\]\([^)]*\)/,Kre=/^\s*!\[[^\]]*\]\([^)\s]+\)\s*$/,qre=new Intl.Segmenter(`en`,{granularity:`grapheme`}),Jre=[[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 I8(e){return Jre.some(([t,n])=>e>=t&&e<=n)}var L8=/\p{Extended_Pictographic}/u;function Yre(e){if(L8.test(e)||e.includes(`‍`)||e.includes(`️`))return{w:2,exact:!1};let t=e.codePointAt(0)??0;return I8(t)?{w:2,exact:!1}:t<32?{w:0,exact:!0}:{w:1,exact:!0}}var R8=2,Xre=new Set([`-`,`-`,`-`,`?`]),Zre=/^[\x20-\x7e]*$/;function Qre(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 $re(e){if(Zre.test(e))return Qre(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=[...qre.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=R8-r%R8||R8,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}=Yre(o);if(I8(o.codePointAt(0)??0)||L8.test(o)){i(),t.push({kind:`word`,w:s,exact:c}),r+=s;continue}n.w+=s,n.exact=n.exact&&c,r+=s,Xre.has(o)&&!/^\d/.test(a[e+1]??``)&&i()}return i(),t}function z8(e,t){if(t<=0)return{lines:1,exact:!1};let n=$re(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 B8(e,t){let n=0,r=!0;for(let i of e.split(`
205
+ `)){let e=z8(i,t);n+=Math.max(1,e.lines),r&&=e.exact}return{lines:Math.max(1,n),exact:r}}var V8=1e-4;function H8(e,t){return{px:e.px+t.px,exact:e.exact&&t.exact}}function U8(e,t,{indentCells:n=0,gutterCells:r=2,extraPx:i=0}={}){let a=t.width-i-(n+r)*t.ch,{lines:o,exact:s}=B8(e,Math.floor(a/t.ch+V8));return{px:o*t.line,exact:s}}function W8(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 G8(e){let t=[],n=[];for(let r of e){let e=/(?:\s{2}|\\)$/.test(r);n.push(W8(r.replace(/(?:\s+|\\)$/,``))),e&&(t.push(n.join(` `)),n=[])}return n.length&&t.push(n.join(` `)),t}function eie(e){return e!==void 0&&e.trim()===``}function K8(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]}}function tie(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}})}function nie(e){let t=e.split(`
206
+ `),n=[],r=0;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(`
207
+ `)});continue}let i=/^(#{1,6})\s+(.*)$/.exec(e);if(i){n.push({t:`h`,text:W8(i[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(G8(a)),a=[]):a.push(t);a.length&&i.push(G8(a)),n.push({t:`quote`,paras:i});continue}if(K8(e)){let e=[],i=[],a;for(;r<t.length;){let n=K8(t[r]);if(!n){if(eie(t[r])&&K8(t[r+1]??``)){r+=1;continue}break}if(n.depth===0){if(a!==void 0&&n.ordered!==a)break;a=n.ordered}i[n.depth]=n.ordered?3:2;let o=i.slice(0,n.depth).reduce((e,t)=>e+(t??2),0),s=[n.text];for(r+=1;r<t.length&&t[r].trim()!==``&&!K8(t[r]);)s.push(t[r].trimStart()),r+=1;e.push({lines:G8(s),gutter:i[n.depth],indent:o})}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 a=[e];for(r+=1;r<t.length&&t[r].trim()!==``&&!t[r].startsWith("```")&&!/^(#{1,6})\s+/.test(t[r])&&!/^>\s?/.test(t[r])&&!K8(t[r])&&!t[r].trimStart().startsWith(`|`)&&!/^(-{3,}|\*{3,}|_{3,})\s*$/.test(t[r]);)a.push(t[r]),r+=1;a.length===1&&Kre.test(a[0])?n.push({t:`image`}):n.push({t:`p`,lines:G8(a),images:a.some(e=>Gre.test(e))})}return n}function rie(e,t,n=0){let r=t.width-n-2*t.ch,i=Math.floor(r/t.ch+V8),a=nie(e),o={px:0,exact:!0};for(let[e,n]of a.entries())switch(e>0&&(o=H8(o,{px:t.line,exact:!0})),n.t){case`p`:for(let e of n.lines){let r=B8(e,i);o=H8(o,{px:r.lines*t.line,exact:r.exact&&!n.images})}break;case`image`:o=H8(o,{px:12*t.line,exact:!0});break;case`h`:{let e=B8(n.text,i);o=H8(o,{px:e.lines*t.line,exact:e.exact});break}case`fence`:{let e=0,r=!0;for(let a of n.code.split(`
208
+ `)){let n=z8(a,i);e+=Math.max(1,n.lines)*t.line,r&&=n.exact}o=H8(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=B8(n,i-a.indent-a.gutter);e+=o.lines*t.line,r&&=o.exact}o=H8(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=B8(n,i-2);e+=a.lines*t.line,r&&=a.exact}}o=H8(o,{px:e,exact:r});break}case`table`:o=H8(o,{px:n.rows*t.line,exact:!0});break;case`hr`:o=H8(o,{px:t.line,exact:!0})}return{px:Math.max(o.px,t.line),exact:o.exact}}function iie(e,t,n=0){let r=e.hunks.map(tie),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=H8(s,{px:t.line,exact:!0}));for(let e of i)s=H8(s,U8(e.text||` `,t,{indentCells:2,gutterCells:o,extraPx:n}))}return e.truncated&&(s=H8(s,{px:t.line,exact:!0})),s}function aie(e,t,n){let r=t4(e.name,e.input),i=r?r.summary:LN(e.input),a=e.backend&&e.backend!==`server`?` · ${e.backend}`:``,o=AP(e)&&e.ts!==void 0?OP:``,s=U8(`${e.name}(${i})${a}${o}`,t,{gutterCells:2,extraPx:n});for(let r of jP(e))s=H8(s,U8(r||` `,t,{indentCells:3,gutterCells:3,extraPx:n}));let c=(e.result?.images?.length??0)+(T0(e)===void 0?0:1);if(c>0&&(s=H8(s,{px:c*12*t.line,exact:!0})),e.patch)return H8(s,iie(e.patch,t,n));if(r){for(let e of r.shown)s=H8(s,U8(n4(e),t,{indentCells:3,gutterCells:3,extraPx:n}));return r.more&&(s=H8(s,U8(r.more,t,{indentCells:3,gutterCells:3,extraPx:n}))),s}let l=e.result?.text??``;if(!l)return s;let{shown:u,more:d}=G2(l.trimEnd().split(`
209
+ `),e.result?.totalChars);for(let e of u)s=H8(s,U8(e||` `,t,{indentCells:3,gutterCells:3,extraPx:n}));return d&&(s=H8(s,U8(d,t,{indentCells:3,gutterCells:3,extraPx:n}))),s}function oie(e){return`parentToolUseId`in e&&e.parentToolUseId!=null?14:0}function q8(e,t){let n=oie(e);switch(e.kind){case`user`:{let r={px:0,exact:!0};if(e.attachments?.length&&(r=H8(r,U8(e.attachments.map(e=>e.name).join(`, `),t,{extraPx:n}))),e.text){let i=e.origin?`${g2(e.origin)}: `:``;for(let[a,o]of e.text.split(`
210
+ `).entries())r=H8(r,U8((a===0?i:``)+(o||` `),t,{extraPx:n}))}return r}case`assistant_text`:return rie(e.text,t,n);case`thinking`:return U8(e.text,t,{extraPx:n});case`tool_call`:return h2(e)?{px:t.line+n,exact:!0}:aie(e,t,n);case`turn_result`:{let r=U8(`${e.isError?e.subtype:`done`} · ${kN(e.durationMs)} · ${ON(e.totalCostUsd)}`,t,{extraPx:n});for(let i of e.errors??[])r=H8(r,U8(i,t,{extraPx:n}));return r}case`notice`:return U8(e.text,t,{extraPx:n});case`compaction`:return U8(DN(e),t,{extraPx:n});case`file_delivered`:return U8(`${e.path} · ${jN(e.bytes)}`+(e.description?` · ${e.description}`:``),t,{extraPx:n});case`shell`:{let r=h4(e,!1),i=U8(m4(e),t,{extraPx:n});for(let e of r)i=H8(i,U8(e||` `,t,{extraPx:n}));let a=g4(e,!1,r.length);return a&&(i=H8(i,U8(a,t,{extraPx:n}))),i}default:return{px:0,exact:!1}}}function sie(e,t){if(`task`in e)return U8(F2(e.task,q3(e)),t);if(`run`in e){let n=C2(e.run);if(n.kind===`call`)return q8(n.item,t);let r=n.items.some(e=>e.status===`running`||e.status===`pending`),i=NP(n.items)===void 0?``:OP,a=U8(w2(n.items,r)+i,t);for(let e of FP(n.items))a=H8(a,U8(e||` `,t,{indentCells:3,gutterCells:3}));return a}return q8(e.item,t)}function J8(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 Y8={user:`l`,subagent:`l`,shell:`l`,turn:`r`,turnFailed:`r`,toolFailed:`r`,error:`r`,approval:`f`,recap:`f`,bookmark:`f`},X8={approval:7,error:6,turnFailed:5,toolFailed:4,user:3,turn:2,bookmark:1,subagent:1,shell:1,recap:0},cie={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 Z8(e){return`${e.isError?e.subtype:`done`} · ${kN(e.durationMs)} · ${ON(e.totalCostUsd)}`}function lie(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}(${LN(e.input)})`;case`turn_result`:return Z8(e);case`file_delivered`:return e.path;default:return``}}function uie(e){return e.kind===`tool_call`&&(e.status===`failed`||e.result?.isError===!0)}function die(e,t,n){let r=new Map;return e.forEach((e,i)=>{e.kind===`tool_call`&&W3(e)===t&&r.set(n(i),i)}),new Set(r.values())}function Q8(e,{frameParentId:t,bookmarks:n=[],recapItemIndex:r,rowIndexFor:i=e=>e}={}){let a=[],o=new Set;for(let t of e){let e=W3(t);e!==void 0&&o.add(e)}let s=die(e,t,i),c={},l=()=>{let e=c.response??c.turn;e!==void 0&&a.push({kind:c.failed?`turnFailed`:`turn`,itemIndex:e,turnIndex:c.turn}),c={}};e.forEach((e,n)=>{if(e.kind===`tool_call`&&o.has(e.id)&&a.push({kind:`subagent`,itemIndex:n}),e.kind===`user`&&W3(e)===t)l(),a.push({kind:`user`,itemIndex:n});else if(e.kind===`turn_result`)c.turn=n,c.failed=e.isError,l();else if(e.kind===`notice`&&e.level===`error`)a.push({kind:`error`,itemIndex:n});else if(e.kind===`shell`)a.push({kind:`shell`,itemIndex:n});else if(uie(e)&&s.has(n))a.push({kind:`toolFailed`,itemIndex:n});else if(e.kind===`assistant_text`&&W3(e)===t){if(t!==void 0){a.push({kind:`turn`,itemIndex:n});return}c.response=n}}),l();for(let t of n)t>=0&&t<e.length&&a.push({kind:`bookmark`,itemIndex:t});return r!==void 0&&a.push({kind:`recap`,itemIndex:r}),a}function fie(e,t){let n=Math.max(1,t),r=Math.max(2,Math.round(e/n));return t=>({y:Math.min(Math.max(0,e-r),Math.round(t.itemIndex/n*e)),h:r})}function $8(e,t){let n=new Map;for(let r of e){let e=Y8[r.kind],i=n.get(e)??[];i.push({mark:r,...t(r)}),n.set(e,i)}let r=[];for(let[e,t]of n){t.sort((e,t)=>e.y-t.y);let n=null;for(let{mark:i,y:a,h:o}of t)n&&a<=n.y+n.h+1?(n.h=Math.max(n.h,a+o-n.y),X8[i.kind]>X8[n.kind]&&(n.kind=i.kind),n.marks.push({mark:i,y:a})):(n={lane:e,kind:i.kind,y:a,h:o,marks:[{mark:i,y:a}]},r.push(n))}return r}function e5(e){return{lane:Y8.approval,kind:`approval`,y:Math.max(0,e-2),h:2,marks:[]}}var pie={excerptClass:`wd-scrub-ex`,muted:`muted`,danger:`danger`,glyph:`muted`,detail:`muted`},mie={excerptClass:`term-scrub-ex`,muted:`faint`,danger:`red`,glyph:`dim`,text:`fg`,strong:`bright`,detail:`fg`,answerGlyph:`● `};function t5({cluster:e,first:t,items:n,pendingApprovals:r,recapLabel:i},a){let o=e.marks.length>1?` · ${e.marks.length} marks`:``,s=t?.kind??e.kind;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{"data-tone":a.muted,children:[cie[s],o]}),e.kind===`approval`?hie(r[0],a):s===`recap`?gie(i,a):_ie(t,n,a)]})}function hie(e,t){return e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{"data-tone":t.strong,children:g6(e).heading}),(0,U.jsx)(`div`,{className:t.excerptClass,"data-tone":t.detail,children:`${e.displayName??e.toolName}(${LN(e.input)})`})]}):null}function gie(e,t){return e===void 0?null:(0,U.jsxs)(`div`,{"data-tone":t.muted,children:[`※ `,e]})}function _ie(e,t,n){if(!e)return null;let r=t[e.itemIndex];if(e.kind===`turn`||e.kind===`turnFailed`){let i=e.turnIndex===void 0?void 0:t[e.turnIndex];return(0,U.jsxs)(U.Fragment,{children:[r?.kind===`assistant_text`?(0,U.jsxs)(`div`,{className:n.excerptClass,"data-tone":n.text,children:[n.answerGlyph?(0,U.jsx)(`span`,{"data-tone":n.glyph,children:n.answerGlyph}):null,r.text]}):null,i?.kind===`turn_result`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{"data-tone":i.isError?n.danger:n.muted,children:Z8(i)}),i.errors?.map((e,t)=>(0,U.jsx)(`div`,{"data-tone":n.danger,children:e},t))]}):null]})}if(!r)return null;let i=e.kind===`toolFailed`&&r.kind===`tool_call`?r.result?.text.split(`
211
+ `).find(e=>e.trim()!==``):void 0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:n.excerptClass,"data-tone":e.kind===`error`||e.kind===`toolFailed`?n.danger:n.text,children:[e.kind===`user`?(0,U.jsx)(`span`,{"data-tone":n.glyph,children:`❯ `}):null,lie(r)]}),i?(0,U.jsx)(`div`,{className:n.excerptClass,"data-tone":n.danger,children:i}):null]})}function n5(e,t,n){return t>0?e/Math.max(t,n):0}function vie(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=Q8(n,{frameParentId:i,bookmarks:r,rowIndexFor:s}).map(e=>({...e,rowIndex:s(e.itemIndex)}));a&&p.push({kind:`recap`,itemIndex:-1,rowIndex:a.rowIndex});let m=n5(t,d,f),h=$8(p,e=>{let n=e.rowIndex??s(e.itemIndex),r=e.itemIndex>=0?u?.(e.itemIndex):void 0,i=l(n),a=r?2:Math.max(2,Math.round(i*m)),o=c(n)+(r?r.ordinal/r.count*i:0);return{y:Math.min(Math.max(0,t-a),Math.round(o*m)),h:a}});return o.length>0&&h.push(e5(t)),h}function yie(e){let{scrollOffset:t,viewportH:n,totalSize:r,onJumpToRow:i,interactive:a,fontSize:o,lineHeight:s}=e,c=v8(),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?vie(e,d):[],[e.items,e.bookmarks,e.recapRow,e.pendingApprovals,r,d,n]),b=n5(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=(t,n)=>{if(t.kind===`approval`&&t.marks.length===0){c.scrollToBottom();return}let r=J8(t,w(n));r&&i(r.rowIndex??e.rowIndexFor(r.itemIndex))},E=(e,t)=>{let n=w(t),r=J8(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)(Y4,{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:t5({cluster:p.cluster,first:p.mark,items:e.items,pendingApprovals:e.pendingApprovals,recapLabel:e.recapRow?.label},mie)}):null]})})}function bie({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=$8(Q8(e,{frameParentId:i,bookmarks:r,recapItemIndex:n}),fie(u,e.length));return t.length>0&&a.push(e5(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=J8(t,h(n));r&&o?.(r.itemIndex)},_=(e,t)=>{let n=h(t),r=J8(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:t5({cluster:f.cluster,first:f.mark,items:e,pendingApprovals:t},pie)}):null]})}var r5=new WeakMap,i5=new WeakMap;function a5(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 o5(e,t){let n=a5(e[t-1]),r=a5(e[t]);return!n||!r||X3(n,r)}function xie(e){let t=r5.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)}),r5.set(e,n),n}function s5(e,t){let n=xie(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 Sie(e){let t=i5.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 i5.set(e,n),n}function Cie(e,t){return Sie(e).get(t)}function wie(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=Wre(e);t&&n&&r&&o(e=>e&&e.width===n&&e.ch===r&&e.line===t?e:Vre(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 c5=4,l5=50;function Tie(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 Eie(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 Die(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&&o5(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>=c5)&&(f.current=setTimeout(()=>{Math.abs(o.scrollTop-u())>1&&d(e+1)},l5))};d(0);return}let d=t=>{let n=o.querySelector(`[data-index="${e}"]`);if(n){n.scrollIntoView({behavior:`instant`,block:u});return}t>=c5||(c.scrollToIndex(e,{align:u,behavior:`auto`}),f.current=setTimeout(()=>d(t+1),l5))};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),Tie(l)},()=>{d.current=null}}),p}function u5({item:e,fileUrl:t,attachmentUrl:n}){switch(e.kind){case`user`:return(0,U.jsx)(O4,{item:e,attachmentUrl:n});case`assistant_text`:return(0,U.jsx)(k4,{item:e});case`thinking`:return(0,U.jsx)(A4,{item:e});case`tool_call`:return h2(e)?(0,U.jsx)(D4,{item:e}):(0,U.jsx)(M4,{item:e});case`turn_result`:return(0,U.jsx)(V4,{item:e});case`notice`:return(0,U.jsx)(U4,{item:e});case`compaction`:return(0,U.jsx)(H4,{item:e});case`file_delivered`:return(0,U.jsx)(G4,{item:e,href:t?.(e.path)});case`shell`:return(0,U.jsx)(W4,{item:e});default:return null}}function d5({text:e,terminal:t}){let[n,r]=(0,v.useState)(!1);return t?(0,U.jsx)(`div`,{"data-slot":`brief`,children:(0,U.jsx)(B2,{onPress:()=>r(e=>!e),expanded:n,children:(0,U.jsx)(LP,{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 Oie({block:e,fileUrl:t,onOpenSubagent:n}){let[r,i]=(0,v.useState)(!1),a=V2(r),o=(0,v.useMemo)(()=>q3(e),[e]),s=o.some(e=>e.kind===`user`)?void 0:k2(e.task),c=N2(e.task,o),l=P2(e.task),u=tP(c),d=(0,U.jsxs)(`div`,{ref:a,className:r?`term-open`:void 0,children:[(0,U.jsx)(B2,{onPress:()=>i(e=>!e),expanded:r,children:(0,U.jsx)(LP,{glyph:c?u:`●`,glyphTone:l?`red`:c?`mark`:`dim`,tone:l?`red`:`green`,children:c?(0,U.jsx)(`span`,{className:`term-shimmer`,children:F2(e.task,o)}):F2(e.task,o)})}),r?(0,U.jsxs)(`div`,{className:`term-nested`,children:[s?(0,U.jsx)(d5,{text:s,terminal:!0}):null,e.children.map((n,r)=>{let i=e.children[r+1],a=`run`in n?(0,U.jsx)(B4,{items:n.run}):(0,U.jsx)(u5,{item:n.item,fileUrl:t});return(0,U.jsxs)(v.Fragment,{children:[r>0&&Q3(e.children[r-1],n)?(0,U.jsx)(RP,{}):null,i&&!Q3(n,i)?(0,U.jsx)(pP,{value:`inline`,children:a}):a]},n.key)})]}):null]});return n===void 0?d:(0,U.jsx)(mP,{actions:(0,U.jsx)(SP,{onOpen:()=>n(e.task.id)}),children:d})}function kie({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)(ay,{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:[jN(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)(Gv,{className:`size-3.5`}),`Download`]}):null]})}function f5({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 p5({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 Aie({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)(v6,{streaming:t,children:e})}):null]})}var m5=2e3,jie={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}},Mie={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 Nie(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`?Mie[n.slice(n.lastIndexOf(`.`)+1).toLowerCase()]:void 0}function Pie({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=Y2(),u=T0(e),d=e.status??(e.result===void 0?`running`:`settled`),f=jie[d],p=d===`failed`||e.result?.isError===!0,m=BN(e.name),h=Q2(e.name),g=e.result?.text??``,_=!a&&g.length>m5,y=_?g.slice(0,m5):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)(h5,{code:JSON.stringify(e.input,null,2),language:`json`,label:`Parameters`}),e.logs?.length?(0,U.jsx)(h5,{code:e.logs.join(`
212
+ `),label:`Logs`}):null,e.result===void 0?null:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(h5,{code:y||`(empty result)`,language:Nie(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?(0,U.jsx)(Iie,{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)(Fie,{toolUseId:e.id,name:D0(e.name,t),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)(uo,{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:LN(e.input)}),(0,U.jsxs)(uo,{variant:f.variant,dot:!f.busy,className:`shrink-0 gap-1`,children:[f.busy?(0,U.jsx)(DE,{className:`size-3 text-current`}):null,d===`deferred`?(0,U.jsx)(mee,{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 h5({code:e,label:t,className:n}){return(0,U.jsx)(OE,{code:e,label:t,variant:`panel`,className:n})}function Fie({toolUseId:e,name:t,image:n}){let{src:r,failed:i}=U0({toolUseId:e,...n});return(0,U.jsx)(`div`,{className:`flex h-60 items-start overflow-hidden rounded-md border border-border bg-surface-hover`,children:r?(0,U.jsx)(I0,{image:{src:r,name:t},className:`h-full max-w-full`,children:(0,U.jsx)(`img`,{src:r,alt:t,className:`h-full max-w-full object-contain`})}):(0,U.jsx)(`span`,{className:`p-2 text-label text-fg-4`,children:i?w0:C0(n)})})}function Iie({path:e,load:t}){let{src:n}=K0(e,t);if(!n)return null;let r=E0(e);return(0,U.jsx)(`div`,{className:`border-t border-border p-2.5`,children:(0,U.jsx)(I0,{image:{src:n,name:r},className:`block max-w-full`,children:(0,U.jsx)(`img`,{src:n,alt:r,className:`max-h-96 w-auto max-w-full rounded-md border border-border`})})})}function Lie({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`,` · `,kN(e.durationMs),` · `,ON(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 Rie({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 zie({item:e,fileUrl:t,attachmentUrl:n,hostImage:r,terminal:i}){if(i)return(0,U.jsx)(u5,{item:e,fileUrl:t,attachmentUrl:n});switch(e.kind){case`user`:return(0,U.jsx)(mP,{actions:(0,U.jsx)(vP,{id:e.id}),children:(0,U.jsxs)(f5,{from:`user`,children:[e.origin?(0,U.jsx)(`div`,{className:`wd-peer-origin text-xs text-muted-foreground`,children:T4(e.origin)}):null,e.attachments?.length?(0,U.jsx)(Gie,{attachments:e.attachments,attachmentUrl:n}):null,e.text?(0,U.jsx)(p5,{children:(0,U.jsx)(oP,{text:e.text})}):null]})});case`assistant_text`:return(0,U.jsx)(mP,{actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(vP,{id:e.id}),e.streaming?null:(0,U.jsx)(EP,{text:e.text,label:`Copy message`})]}),children:(0,U.jsx)(f5,{from:`assistant`,children:(0,U.jsx)(p5,{children:(0,U.jsx)(v6,{streaming:e.streaming,children:e.text})})})});case`thinking`:return(0,U.jsx)(Aie,{isStreaming:e.id===`streaming-thinking`,children:e.text});case`tool_call`:return(0,U.jsx)(Bie,{item:e,hostImage:r});case`turn_result`:return(0,U.jsx)(Lie,{item:e});case`notice`:return(0,U.jsx)(Rie,{item:e});case`compaction`:return(0,U.jsx)(Uie,{item:e});case`file_delivered`:return(0,U.jsx)(kie,{item:e,href:t?.(e.path)});case`shell`:return(0,U.jsx)(Hie,{item:e});default:return null}}function Bie({item:e,hostImage:t}){let n=e.input?.command,r=typeof n==`string`?n:e.result?.text??``;return(0,U.jsxs)(mP,{actions:(0,U.jsxs)(U.Fragment,{children:[PP(e)?(0,U.jsx)(xP,{toolUseId:e.id}):null,(0,U.jsx)(vP,{id:e.id}),r?(0,U.jsx)(EP,{text:r,label:`Copy`}):null]}),children:[(0,U.jsx)(Pie,{item:e,hostImage:t}),AP(e)?(0,U.jsx)(Vie,{item:e}):null]})}function Vie({item:e}){let t=q4(e.ts!==void 0),n=MP(e.ts,t),r=jP(e);return!n&&r.length===0?null:(0,U.jsxs)(`div`,{"data-slot":`tool-live`,className:`mt-1 text-label text-fg-4`,children:[n?(0,U.jsxs)(`div`,{children:[`running `,n]}):null,r.length>0?(0,U.jsx)(`pre`,{className:`overflow-x-auto font-mono whitespace-pre-wrap text-fg-3`,children:r.join(`
213
+ `)}):null]})}function Hie({item:e}){let[t,n]=(0,v.useState)(!1),r=b4(),i=p4(e),a=h4(e,t),o=g4(e,t,a.length),s=e.shell.id;return x4(e),(0,U.jsx)(mP,{actions:(0,U.jsx)(S4,{item:e}),children:(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(s)},children:l4(e)}),(0,U.jsx)(`span`,{className:W(`shrink-0 text-label`,i?`text-danger`:`text-fg-4`),children:u4(e)})]}),a.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:a.join(`
214
+ `)}):null,o?(0,U.jsx)(`div`,{className:`px-3 pb-2 text-label text-fg-4`,children:o}):null]})})}function Uie({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?`⋯`:`≡`,` `,DN(e)]}),(0,U.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})}function Wie({line:e,since:t,terminal:n}){let r=t===void 0?void 0:NN(t),i=r?`${e} · last here ${r}`:e;return n?(0,U.jsx)(`div`,{"data-slot":`recap`,children:(0,U.jsxs)(LP,{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 Gie({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)(I0,{image:{src:n,name:e.name},className:`rounded-md`,children:(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 g5(e,t){return e!==void 0&&t<e}function Kie(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 qie(e){return e.text||(e.attachments??[]).map(e=>e.name).join(`, `)}function Jie({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 Yie({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=v8(),[w,T]=(0,v.useState)(null),E=(0,v.useMemo)(()=>e.flatMap((e,t)=>`item`in e&&e.item.kind===`user`&&W3(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&&Eie(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=wie({terminal:r,fontSize:l,lineHeight:u,rowsRef:k}),j=Bre({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&&o5(e,t)?A.line:0;return n&&`text`in n&&n.key===`brief`?Ure(n.text,A)+r:n&&!(`line`in n)?Hre(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(M8(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=Die({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(s5(e,t),`start`)},[N]);let F=uP(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)(L2,{items:d,children:j.getVirtualItems().map(i=>{let l=e[i.index],u=i.index>0&&(!r||o5(e,i.index))?c.className:void 0,d=r&&i.index<e.length-1&&!o5(e,i.index+1),f=`run`in l?(0,U.jsx)(`div`,{className:W(g5(t,l.index)&&`opacity-45`),children:(0,U.jsx)(B4,{items:l.run})}):`item`in l?(0,U.jsx)(`div`,{className:W(g5(t,l.index)&&`opacity-45`,Kie(l.item,o)),children:(0,U.jsx)(zie,{item:l.item,fileUrl:g,attachmentUrl:_,hostImage:y,terminal:r})}):`text`in l&&l.key===`brief`?(0,U.jsx)(d5,{text:l.text,terminal:r}):`line`in l?(0,U.jsx)(Wie,{line:l.line,since:n,terminal:r}):(0,U.jsx)(`div`,{className:W(g5(t,l.index)&&`opacity-45`),children:(0,U.jsx)(Oie,{block:l,fileUrl:g,onOpenSubagent:s})}),p=(0,U.jsx)(pP,{value:d?`inline`:`below`,children:f});if(a&&`item`in l&&l.item.kind===`user`&&W3(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)(Jie,{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?p:qie(l.item),content:p},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:p},l.key)})}),p&&w?.parentElement?(0,Td.createPortal)(r?(0,U.jsx)(yie,{items:d,pendingApprovals:f,recapRow:R,bookmarks:I,frameParentId:o,rowIndexFor:t=>s5(e,t),positionInRow:t=>Cie(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)(bie,{items:d,pendingApprovals:f,recapItemIndex:L>=0?t:void 0,bookmarks:I,frameParentId:o,interactive:F,onJumpToItem:t=>M(s5(e,t),`start`)}),w.parentElement):null]})}function Xie(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 Zie(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 Qie({active:e,fontSize:t,lineHeight:n,affordances:r,children:i}){return e?(0,U.jsx)(Y4,{fontSize:t,lineHeight:n,affordances:r,bleed:`1ch`,className:`term-transcript`,children:i}):(0,U.jsx)(`div`,{"data-cards":``,className:`contents`,children:(0,U.jsx)(dP,{value:uP(r),children:i})})}function $ie({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:i,variant:a=`cards`,fontSize:o,lineHeight:s,affordances:c,stickyPrompt:l=!1,scrubber:u,bookmarks:d,sessionNames:f,replaying:p=!1,catchUp:m,jumpToRecapRef:h,repinRef:g,reveal:_,frame:y,onOpenSubagent:b,emptyState:x,className:S}){let C=a===`terminal`,w=(0,v.useMemo)(()=>y?G3(e.items,y.parentToolUseId):e.items,[e.items,y]),T=(0,v.useMemo)(()=>y?e.items.find(e=>e.kind===`tool_call`&&e.id===y.parentToolUseId):void 0,[e.items,y]),E=TN[a],D=Xie(e.status),O=!y&&m&&m.from>0&&m.from<e.items.length?m.from:void 0,k=(0,v.useMemo)(()=>O===void 0?void 0:oN(aN(e,O)),[e,O]),A=(0,v.useMemo)(()=>y&&T&&!w.some(e=>e.kind===`user`)?k2(T):void 0,[y,T,w]),j=(0,v.useMemo)(()=>{let e=(e,t)=>Y3(w.slice(e,t),e,C);return O===void 0||!k?[...A?[{key:`brief`,text:A}]:[],...e(0,w.length)]:[...e(0,O),{key:`recap`,line:k},...e(O,w.length)]},[w,O,k,C,A]),M=(0,v.useMemo)(()=>e.skills?.map(e=>e.name),[e.skills]);return(0,U.jsx)(CN,{value:a,children:(0,U.jsx)(G0,{value:i,children:(0,U.jsx)(iP,{names:M,children:(0,U.jsx)(aP,{names:f,children:(0,U.jsxs)(y8,{className:W(p&&`invisible`,S),children:[(0,U.jsx)(b8,{className:W(C&&`gap-0 p-0`),children:(0,U.jsxs)(Qie,{active:C,fontSize:o,lineHeight:s,affordances:c,children:[y?T===void 0&&!p?(0,U.jsx)(`div`,{className:W(C?`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:w.length===0&&e.status!==`starting`?x===void 0?(0,U.jsx)(C8,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(e=>e.enabled),canBrowseFiles:r}):x:null,y&&T===void 0&&!p?null:(0,U.jsx)(Yie,{rows:j,boundary:O,since:m?.since,terminal:C,replaying:p,stickyPrompt:!y&&l,gap:E,fontSize:o,lineHeight:s,items:w,pendingApprovals:e.pendingApprovals,scrubber:u,bookmarks:y?void 0:d,affordances:c,fileUrl:t,attachmentUrl:n,hostImage:i,jumpToRecapRef:h,repinRef:g,reveal:y?void 0:_,frameParentId:y?.parentToolUseId,onOpenSubagent:y?void 0:b}),(y?T!==void 0&&N2(T,w):Zie(e))?C?(0,U.jsxs)(U.Fragment,{children:[e.items.length>0?(0,U.jsx)(`div`,{className:`term-blank`,"aria-hidden":!0}):null,(0,U.jsx)(J4,{label:e.status===`starting`?`Starting…`:`Working…`,startedAt:D,tokens:e.contextUsage?.totalTokens})]}):(0,U.jsx)(S8,{label:e.status===`starting`?`Starting session…`:void 0}):null]})}),(0,U.jsx)(x8,{}),p?(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)]`,!C&&`px-4 py-4`),children:C?(0,U.jsx)(Y4,{fontSize:o,lineHeight:s,affordances:!1,bleed:`1ch`,className:`term-transcript`,children:(0,U.jsx)(J4,{label:`Loading…`})}):(0,U.jsx)(S8,{label:`Loading session…`})})}):null]})})})})})}var eae=.02;function tae(e){let t=e.usageByModel??{},n=e.pricing,r=cA(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:nA(e),usage:t,tokens:iA(t),costUsd:rA(e,n)?sA(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,eae*Math.max(i??0,a??0));return{displayUsd:i??a,computedUsd:i,reportedUsd:a,breakdown:r,rows:o,unpricedShare:r.unpricedShare,showUnpricedWarning:r.unpricedShare>Uk,unknownBasisModels:aA(t),gapUsd:c?s:void 0}}function _5(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 v5({windows:e,now:t,className:n}){let r=_5(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)(nae,{window:e,now:i},e.key))})}function nae({window:e,now:t}){let{key:n,info:r,updatedAt:i,inferredReset:a}=e,o=r.utilization??0,s=xA(e,t),c=r.resetsAt===void 0?void 0:r.resetsAt*1e3,l=FN(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:PN(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`,l3(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)(Ux,{className:`size-3`}),` Resets in `,MN(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 `:``,IN(i,t)]}):null]})]})}function y5(e){return e===`claude`?`Claude Code`:e}function b5({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 rae({cost:e,engine:t}){let{breakdown:n,rows:r}=e;return r.length===0?(0,U.jsx)(b5,{label:`This session has cost`,value:ON(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:ON(e.displayUsd)})]}),(0,U.jsxs)(`div`,{className:`space-y-1 border-t border-border pt-2`,children:[(0,U.jsx)(b5,{label:`input`,value:ON(n.input),tone:`muted`}),(0,U.jsx)(b5,{label:`output`,value:ON(n.output),tone:`muted`}),(0,U.jsx)(b5,{label:`cache write`,value:ON(n.cacheWrite),tone:`muted`}),(0,U.jsx)(b5,{label:`cache read`,value:ON(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:[AN(e.tokens),` · `,e.costUsd===void 0?`no rate`:ON(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:[y5(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:[y5(t),` reports `,ON(e.reportedUsd),` for the same tokens.`]})]})}function iae({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)(b5,{label:`This profile, last 7 days`,value:ON(e.weekUsd)}),(0,U.jsx)(b5,{label:`Last 30 days`,value:ON(e.monthUsd),tone:`muted`}),t?(0,U.jsxs)(`p`,{className:`pt-1 text-label text-fg-4`,children:[aae(t.ratio),` the `,ON(t.weeklyShareUsd),` weekly share of your`,` `,ON(t.monthlyUsd),` a month. A subscription is a flat fee, so this is leverage, not a bill.`]}):null]})}function aae(e){return e>=10?`${Math.round(e)}x`:`${e.toFixed(1)}x`}function oae({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=_5(l),p=tae({costUsd:i,totalCostUsd:r,usageByModel:a,pricing:o}),m=tA(f);return(0,U.jsx)(gT,{open:l,onOpenChange:u,children:(0,U.jsxs)(_T,{className:d,children:[(0,U.jsx)(vT,{title:`Usage`,description:y5(n),actions:t?(0,U.jsx)(uo,{variant:`accent`,className:`mt-0.5 shrink-0 capitalize`,children:t}):null}),(0,U.jsxs)(yT,{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)(v5,{windows:e,now:f}),(0,U.jsx)(`div`,{className:`mt-5 border-t border-border pt-3`,children:(0,U.jsx)(rae,{cost:p,engine:n})}),s?(0,U.jsx)(iae,{spend:s}):null,(0,U.jsx)(`p`,{className:`mt-3 text-label text-fg-4`,children:m?`${Hk} ${m}`:Hk}),c?(0,U.jsxs)(`p`,{className:`mt-2 text-label text-fg-4`,children:[`Updated `,IN(c,f)]}):null]})]})})}var sae=[`button`,`a`,`input`,`textarea`,`select`,`summary`,`img`,`[contenteditable="true"]`,`[role="button"]`,`[role="menuitem"]`,`[role="checkbox"]`,`[role="radio"]`,`[role="tab"]`].join(`,`),cae=[{panel:`context`,label:`Context`,Icon:tv},{panel:`usage`,label:`Usage`,Icon:Dy},{panel:`info`,label:`Session info`,Icon:bee},{panel:`mcp`,label:`MCP servers`,Icon:xx},{panel:`skills`,label:`Skills`,Icon:bS},{panel:`files`,label:`Project files`,Icon:yy}];function lae({client:e,sessionId:t,header:n,panelSurface:r=`internal`,statusSurface:i=`internal`,statusPlacement:a=`top`,onOpenPanel:o,onVitals:s,transcriptVariant:c=`cards`,transcriptFont:l=`sans`,affordances:u,terminalMetrics:d,scrubber:f=!1,bookmarks:p,peerMentions:m=!0,onToggleBookmark:h,reveal:g,subagents:_,shells:y,openSubagent:b,onSubagentChange:x,openShell:S,onShellChange:C,stickyPrompt:w=!1,controlsSurface:T=`internal`,onControls:E,focusComposerOnClick:D=!1,unseen:O,readOnly:k=!1,approvalPrompts:A,toolHost:j,clientTools:M,cacheTranscript:N,emptyState:P,onLinkClick:F,onOpenFile:I,fontSize:L,className:R}){let z={fontSize:d?.fontSize??L,lineHeight:d?.lineHeight??(L===void 0?void 0:Math.round(18/13*L))},ee=r===`external`,te=i===`external`,B=T===`status`&&!te,ne=T===`external`||B,[re,V]=(0,v.useState)(void 0),[ie,ae]=(0,v.useState)(),{state:H,connection:oe,replaying:se,protocolMismatch:ce,shell:le,pricing:ue,models:de,effectiveModel:fe,handle:pe,send:me,runShell:he,approve:ge,deny:_e,interrupt:ve,backgroundTask:ye,clearContext:be,setModel:xe,setEffort:Se,setPermissionMode:Ce,reconnectNow:we,loadFullResult:Te,loadShellOutput:Ee,verifyShell:De,killShell:Oe,setShellAgentWrite:ke}=Ij(e,t,{onProtocolError:V,cacheTranscript:N}),{shellId:Ae,enterShell:je,leaveShell:Me,returnReveal:Ne,shell:Pe,label:Fe}=s6({sessionId:t,items:H.items,session:H.session,shells:y,reveal:g,openShell:S,onShellChange:C}),Ie=H.session?.shellAgentWrite===void 0?void 0:ke,Le=(0,v.useMemo)(()=>({loadOutput:Ee,verify:De,kill:Oe,open:je,agentWrite:Ie}),[Ee,De,Oe,je,Ie]);(0,v.useEffect)(()=>V(void 0),[t]);let{subagentId:Re,enterSubagent:ze,leaveSubagent:Be,returnReveal:Ve,frameItems:He,task:Ue,fallbackLabel:We}=e6({sessionId:t,items:H.items,session:H.session,reveal:g,openSubagent:b,onSubagentChange:x}),Ge=(0,v.useMemo)(()=>Ve&&Ne?Ve.nonce>=Ne.nonce?Ve:Ne:Ve??Ne,[Ve,Ne]),{mark:Ke,dismiss:qe}=G6(t,O),Je=Ke?Math.max(0,H.items.length-Ke.itemCount):0,Ye=(0,v.useCallback)(e=>{ee?o?.(e):ae(e)},[ee,o]);(0,v.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&we()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[we]),iN(pe,j===!1?{enabled:!1}:M?{...j,clientTools:{...j?.clientTools,...M}}:j);let Xe=c===`terminal`,Ze=H.capabilities,{usage:Qe,spend:$e}=UM(e,H.session?.profile,{enabled:Ze.rateLimits}),et=(0,v.useMemo)(()=>yA({rateLimits:H.rateLimits,updatedAt:H.rateLimitsUpdatedAt},Qe),[H.rateLimits,H.rateLimitsUpdatedAt,Qe]),tt=(0,v.useMemo)(()=>Object.keys(et).length>0?CA(et):void 0,[et]),nt=(0,v.useMemo)(()=>{let e=Object.values(et).map(e=>e.updatedAt);return e.length>0?Math.max(...e):void 0},[et]),rt=(0,v.useMemo)(()=>Pk({checklist:H.checklist,subagents:_??H.session?.subagents}),[H.checklist,_,H.session?.subagents]),it=de.length>0,at=(0,v.useMemo)(()=>P3(de,fe??H.model,Ze),[de,fe,H.model,Ze]),ot=(0,v.useMemo)(()=>xN({capabilities:Ze,hasModels:it,efforts:at,setModel:xe,setEffort:Se,setPermissionMode:Ce,clearContext:be,openPanel:Ye}),[Ze,it,at,Ye,be,xe,Se,Ce]),st=(0,v.useMemo)(()=>bN(mN({commands:Ze.slashCommands?H.commands:void 0,clientCommands:ot,skills:Ze.skillsList?H.skills:void 0})),[Ze.slashCommands,Ze.skillsList,H.commands,H.skills,ot]),ct=(0,v.useRef)(s);ct.current=s;let lt=fe??H.model,ut=(0,v.useMemo)(()=>R3(Ze.permissionModes,H.session?.canBypassPermissions),[Ze.permissionModes,H.session?.canBypassPermissions]),dt={status:H.status,connection:oe,engine:H.engine,capabilities:H.capabilities,model:lt,models:de,effort:H.effort,efforts:at,permissionMode:H.permissionMode,permissionModes:ut,skills:H.skills,composerCommands:st,cwd:H.cwd,contextUsage:H.contextUsage,tasks:rt,rateLimits:tt,rateLimitsUpdatedAt:nt,itemCount:H.items.length,totalCostUsd:H.totalCostUsd},ft=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{ft.current&&dae(ft.current,dt)||(ft.current=dt,ct.current?.(dt))});let pt=(0,v.useRef)(E);pt.current=E;let mt=(0,v.useRef)({setModel:xe,setEffort:Se,setPermissionMode:Ce,interrupt:ve});mt.current={setModel:xe,setEffort:Se,setPermissionMode:Ce,interrupt:ve};let ht=(0,v.useRef)({setModel:e=>mt.current.setModel(e),setEffort:e=>mt.current.setEffort(e),setPermissionMode:e=>mt.current.setPermissionMode(e),interrupt:()=>mt.current.interrupt(),focusComposer:()=>At.current?.focus(),insertComposerText:e=>At.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(p??[]),[p]),_t=(0,v.useMemo)(()=>h?{has:e=>gt.has(e),toggle:h}:void 0,[gt,h]),vt=!k&&Ze.backgroundTasks===!0,yt=(0,v.useMemo)(()=>vt?{background:ye}:void 0,[vt,ye]),bt=H.status===`running`||H.status===`awaiting_approval`,xt=H.status===`failed`||H.status===`closed`,St=tM(e,t,{capabilities:Ze,engine:H.engine}),Ct=pM(e,H.cwd),wt=yM(e,t,m),Tt=HM(e,t),Et=(0,v.useCallback)((e,t)=>Ct.search(e,{...t,limit:8}),[Ct.search]),Dt=(0,v.useMemo)(()=>SA(et),[et]),Ot=q6(e,t,H.producedFiles),kt=J0(e,t),At=(0,v.useRef)(null),jt=(0,v.useRef)(null),Mt=(0,v.useRef)(null),Nt=(e,t)=>{if(t.length===0){let t=yN(e,ot);if(t&&t.command.run(t.args))return}qe(),Mt.current?.(),me(e,t)},Pt=vt?IP(H.items):void 0,Ft=q4(Pt!==void 0),It=Pt!==void 0&&Ft-Pt>=5e3,Lt=(e,t)=>{Nt(e,t),ye()},Rt={context:Ze.contextUsage,usage:Ze.rateLimits,info:!0,mcp:Ze.mcpStatus,skills:Ze.skillsList,files:Ct.available},zt=(0,U.jsxs)(Hw,{children:[(0,U.jsx)(Uw,{render:(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Session actions`,children:(0,U.jsx)(qv,{className:`size-4`})})}),(0,U.jsx)(Ww,{children:cae.filter(e=>Rt[e.panel]).map(({panel:e,label:t,Icon:n})=>(0,U.jsxs)(Gw,{onClick:()=>Ye(e),children:[(0,U.jsx)(n,{className:`size-3.5 text-fg-3`}),` `,t]},e))})]}),Bt=ee?null:zt,Vt=e=>({open:ie===e,onOpenChange:t=>ae(t?e:void 0)}),Ht=typeof n==`function`,Ut=(0,U.jsxs)(U.Fragment,{children:[de.length?(0,U.jsx)(M3,{models:de,model:fe,onModelChange:xe,disabled:xt,className:B?`h-5`:void 0}):null,at.length&&H.effort!==null?(0,U.jsx)(F3,{efforts:at,effort:H.effort,onEffortChange:Se,disabled:xt,className:B?`h-5`:void 0}):null,H.permissionMode?(0,U.jsx)(z3,{mode:H.permissionMode,onModeChange:Ce,modes:Ze.permissionModes,canBypass:H.session?.canBypassPermissions,disabled:xt,className:B?`h-5`:void 0}):null]}),Wt=te?null:(0,U.jsx)(a8,{state:H,rateLimits:tt,connection:oe,placement:a,controls:B&&!k?Ut:void 0,onOpenStatus:ee&&!o?void 0:()=>Ye(`info`),onOpenContext:ee&&!o?void 0:()=>Ye(`context`),onOpenUsage:ee&&!o?void 0:()=>Ye(`usage`),actions:Ht?void 0:Bt}),Gt=(0,v.useMemo)(()=>I?{cwd:H.cwd,open:I}:void 0,[I,H.cwd]),Kt=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!F)return;let e=Kt.current;if(!e)return;let t=e=>{let t=e.target?.closest?.(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&F(n)&&(e.preventDefault(),e.stopPropagation())};return e.addEventListener(`click`,t,!0),()=>e.removeEventListener(`click`,t,!0)},[F]),(0,U.jsx)(W6,{variant:c,fileLinks:Gt,loadFullResult:Te,shellActions:Le,toolTitles:H.toolTitles,resultImages:kt,children:(0,U.jsx)(`div`,{ref:Kt,"data-slot":`session-panel`,"data-agent-font":l,onClick:e=>{D&&!k&&(e.target?.closest(sae)||window.getSelection()?.isCollapsed!==!1&&At.current?.focus())},className:W(`relative flex h-full min-h-0 flex-col overflow-hidden bg-bg`,R),style:L===void 0?void 0:{"--wd-font-size":`${Math.round(L)}px`},children:(0,U.jsxs)(F0,{children:[Ht?n({actions:Bt}):n,a===`top`?Wt:null,ce===void 0?null:(0,U.jsxs)(x5,{level:`warning`,children:[`Server speaks protocol v`,ce,`, this build renders v`,1,`. Some events may not render.`]}),re?(0,U.jsx)(x5,{level:`error`,onDismiss:()=>V(void 0),children:re}):null,Ae===void 0?null:(0,U.jsx)(t6,{shell:Pe,label:Fe,onBack:Me,onKill:()=>void Oe(Ae),onAgentWrite:Ie?e=>void Ie(Ae,e):void 0,terminal:Xe,...z}),Ae===void 0&&Re!==void 0?(0,U.jsx)(U3,{task:Ue,items:He,label:We,onBack:Be,terminal:Xe,...z}):null,Ae===void 0?(0,U.jsx)(_P,{value:_t,children:(0,U.jsx)(bP,{value:yt,children:(0,U.jsx)($ie,{state:H,fileUrl:t?n=>e.sessionFileUrl(t,n):void 0,attachmentUrl:t?n=>e.attachmentUrl(t,n):void 0,canBrowseFiles:Ct.available,sessionNames:wt.names,hostImage:Ot,variant:c,...z,affordances:u,stickyPrompt:w,scrubber:f,bookmarks:p,replaying:se,catchUp:Ke&&Je>0?{from:Ke.itemCount,since:Ke.since}:void 0,reveal:Ge??g,frame:Re===void 0?void 0:{parentToolUseId:Re},onOpenSubagent:ze,emptyState:P,jumpToRecapRef:jt,repinRef:Mt},Re??`session`)})}):(0,U.jsx)(n6,{handle:pe,shellId:Ae,fontSize:z.fontSize},Ae),Ke&&Je>0&&!se&&Re===void 0&&Ae===void 0?(0,U.jsx)(uae,{count:Je,since:Ke.since,terminal:Xe,onJump:()=>jt.current?.(),onDismiss:qe}):null,!k&&Ze.interactiveApprovals&&H.pendingApprovals.length>0?(0,U.jsx)(H6,{requests:H.pendingApprovals,terminal:Xe,...z,affordances:u,hostPrompts:A,onApprove:ge,onDeny:_e}):null,k||Re!==void 0||Ae!==void 0?null:(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(Q4,{ref:At,onSend:Nt,onSendNow:It?Lt:void 0,onInterrupt:ve,busy:bt,disabled:xt||!t,commands:Ze.slashCommands?H.commands:void 0,skills:Ze.skillsList?H.skills:void 0,clientCommands:ot,attachments:St,draft:Tt,onSearchFiles:Ct.available?Et:void 0,peers:wt.peers,onShellCommand:le?he:void 0,layout:ne?`inline`:`stacked`,toolbar:ne?void 0:Ut,...z,affordances:u})}),a===`bottom`?Wt:null,ee?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(X6,{state:H,client:e,sessionId:t,...Vt(`info`)}),(0,U.jsx)(u3,{usage:H.contextUsage,engine:H.engine??`claude`,...Vt(`context`)}),(0,U.jsx)(oae,{rateLimits:Dt,subscriptionType:H.subscriptionType,engine:H.engine??`claude`,totalCostUsd:H.totalCostUsd,costUsd:H.costUsd,usageByModel:H.usageByModel,pricing:ue,spend:$e,updatedAt:nt,...Vt(`usage`)}),(0,U.jsx)(h3,{client:e,sessionId:t,canManageServers:Ze.mcpServerActions,...Vt(`mcp`)}),(0,U.jsx)(w3,{skills:H.skills,...Vt(`skills`),onUse:e=>At.current?.insertText(pN(e))}),(0,U.jsx)(p3,{client:e,cwd:H.cwd,...Vt(`files`)})]})]})})})}function uae({count:e,since:t,terminal:n,onJump:r,onDismiss:i}){return(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`,n?`text-fg-3`:`text-accent`),children:`※`}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e,` new `,e===1?`row`:`rows`,t===void 0?``:` since you were last here`]}),(0,U.jsx)(`button`,{type:`button`,onClick:r,className:`shrink-0 underline-offset-2 hover:text-fg-1 hover:underline`,children:`jump`}),(0,U.jsx)(`button`,{type:`button`,onClick:i,className:`shrink-0 underline-offset-2 hover:text-fg-1 hover:underline`,children:`dismiss`})]})})}function dae(e,t){return Object.keys(t).every(n=>Object.is(e[n],t[n]))}function x5({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)(KS,{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)(wC,{className:`size-3.5`})}):null]})})}var S5=`[^\\s:'"\`()\\[\\]{}<>|]+`,fae=RegExp(`(?:^|[\\s'"\`([{<@,])((?:\\.\\.?)?(?:/${S5})+|[^\\s:'"\`()\\[\\]{}<>|@,]+(?:/${S5})+)(?::(\\d+))?`),pae=/^([\w.@-]+\.[A-Za-z0-9]{1,10})(?::(\d+))?$/,mae=/[.,;:!?)\]}'"`]+$/,hae=/\.[A-Za-z0-9]{1,10}$/;function gae(e,t=!1){let n=e??``,r=fae.exec(n);if(!r)return t?_ae(n):void 0;let i=r[1].replace(mae,``);if(i.includes(`/`)&&!i.endsWith(`/`)&&(i.startsWith(`/`)||i.startsWith(`./`)||i.startsWith(`../`)||hae.test(i)))return{path:i,line:r[2]?Number(r[2]):void 0,length:i.length+(r[2]?r[2].length+1:0)}}function _ae(e){let t=pae.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 C5=`wd-path-link`,vae=.6;function w5(e){if(!e)return;let t=e.closest(`code`)!==null,n=e.textContent?.trim()??``,r=gae(n,t);if(r&&!(!t&&r.length<n.length*vae))return{path:r.path,line:r.line}}function yae({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(C5),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=w5(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)&&w5(t)&&(o=t,t.classList.add(C5)))},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 bae(e,t){return g0(e,t)?.path??e}var xae={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 Sae={claude:`text-vendor-claude`,codex:`text-vendor-openai`},Cae={claude:`text-vendor-claude`};function E5(e,t){return Sae[T5(e,t)??``]??`text-fg-3`}function D5(e,t){return Cae[T5(e,t)??``]??`text-fg-3`}function O5({engine:e,model:t,className:n}){let r=xae[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 k5({row:e,className:t}){let{info:n}=e,r=W(`size-4 shrink-0`,t);if(e.state===`attention`)return(0,U.jsx)(x_,{className:W(r,`animate-pulse text-warning`)});if(e.state===`working`)return(0,U.jsx)(DE,{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)(uee,{className:W(r,`text-fg-4`)});case`parked`:return(0,U.jsx)(lee,{className:W(r,`text-fg-3`)});default:return(0,U.jsx)(zb,{className:W(r,`text-fg-4`)})}}function A5(e,t){return t?.avatar===void 0?void 0:e?.[t.avatar]}function j5({row:e,image:t,size:n=32,state:r,badge:i=!0,className:a}){let{info:o}=e,s=r??e.state,c=s===`working`&&t?.busy&&t.busy.durations.length>1?t.busy:void 0,l=o.engineAsleep===!0,u=o.engine??`claude`,d=n>=28?14:11;return(0,U.jsxs)(`span`,{"data-slot":`agent-avatar`,className:W(`relative inline-flex shrink-0`,a),style:{width:n,height:n},title:o.agent?.name,children:[c?(0,U.jsx)(`span`,{"aria-hidden":!0,className:`wd-avatar-strip size-full rounded-[4px]`,style:{backgroundImage:`url(${c.src})`,backgroundSize:`${c.durations.length*n}px ${n}px`,"--wd-strip-end":`-${c.durations.length*n}px`,"--wd-strip-steps":c.durations.length,animationDuration:`${c.durations.reduce((e,t)=>e+t,0)}ms`}}):t?(0,U.jsx)(`img`,{src:t.still,alt:``,draggable:!1,className:W(`size-full rounded-[4px] [image-rendering:pixelated]`,l&&`opacity-60 grayscale`)}):(0,U.jsx)(`span`,{className:`flex size-full items-center justify-center rounded-[4px] border border-dashed border-border`,children:(0,U.jsx)(O5,{engine:u,model:o.model,className:W(`size-1/2`,E5(u,o.model))})}),i&&(s!==`idle`||l)?(0,U.jsx)(`span`,{className:`absolute -right-1 -bottom-1 flex items-center justify-center rounded-full bg-bg`,style:{width:d,height:d},children:(0,U.jsx)(k5,{row:{...e,state:s},className:`size-full p-px`})}):null]})}function M5({className:e}){return(0,U.jsx)(`span`,{className:W(`shrink-0 rounded-[3px] border border-accent/50 px-1 text-[0.625rem] leading-3.5 font-medium tracking-wide text-accent`,e),children:`LEAD`})}function wae({row:e,image:t,conversation:n,className:r}){let i=e.info.agent;if(!i)return null;let a=n??i.conversation??1,o=[i.lead!==void 0&&i.team?`${i.team} team`:void 0,`conversation ${a}`].filter(Boolean).join(` · `);return(0,U.jsxs)(`span`,{"data-slot":`agent-heading`,className:W(`flex min-w-0 items-center gap-2`,r),children:[(0,U.jsx)(j5,{row:e,image:t,size:24}),(0,U.jsx)(`span`,{className:`truncate text-body-sm font-medium text-fg-1`,children:i.name}),i.leads?(0,U.jsx)(M5,{}):null,o?(0,U.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:o}):null]})}var Tae={anchor:i_,atom:aee,beaker:see,bike:C_,binary:T_,blocks:D_,bot:j_,box:N_,brain:F_,briefcase:L_,brush:z_,bug:V_,"building-2":U_,cable:G_,camera:Y_,car:Z_,cat:$_,"circuit-board":fee,cloud:hee,code:Cv,coffee:Tv,cog:Dv,compass:kv,container:jv,cpu:Fv,"credit-card":Lv,database:zv,diamond:Vv,dog:Uv,feather:$v,film:ly,flame:dy,"flask-conical":py,folder:xy,"gamepad-2":Ty,gauge:Dy,gem:ky,ghost:jy,gift:Ny,"git-branch":Fy,globe:Ly,"graduation-cap":zy,hammer:gee,hexagon:_ee,house:vee,image:Yy,key:xee,landmark:See,laptop:Cee,layers:tb,leaf:wee,library:Tee,lightbulb:ab,lock:hb,mail:yb,map:xb,"message-circle":kb,mic:Nb,monitor:Lb,moon:zb,mountain:Vb,music:Ub,network:Gb,newspaper:qb,notebook:Yb,orbit:Zb,package:$b,palette:tx,"pen-tool":lx,phone:hx,"piggy-bank":_x,plane:yx,plug:xx,puzzle:kx,radar:jx,radio:Nx,receipt:Fx,rocket:zx,ruler:qx,satellite:Yx,scale:$x,scissors:tS,server:sS,shield:Eee,ship:Dee,"shopping-cart":Oee,signal:Aee,smartphone:Mee,sparkles:bS,sprout:Nee,square:OS,star:AS,sun:MS,table:Lee,tag:Ree,target:Bee,telescope:zee,terminal:RS,"test-tube":BS,"tree-pine":WS,trophy:JS,truck:XS,umbrella:QS,users:cC,wallet:uC,wand:fC,waves:mC,webhook:gC,wifi:bC,wrench:SC,zap:EC};function N5({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=Tae[e.name]??xy;return(0,U.jsx)(i,{className:W(`inline-block size-3 shrink-0`,r)})}var Eae=[{value:`all`,label:`All`},{value:`active`,label:`Active`},{value:`none`,label:`Hide`}];function P5({config:e,onConfigChange:t,rows:n,scope:r,gateways:i,className:a}){let o=(0,v.useMemo)(()=>zO(n),[n]),s=(0,v.useMemo)(()=>BO(n),[n]),c=(0,v.useMemo)(()=>{if(i)return i;let e=new Map;for(let t of n)e.set(t.hostId,t.hostName);return[...e].map(([e,t])=>({id:e,name:t}))},[n,i]),l=n=>t({...e,...n});return(0,U.jsxs)(`div`,{"data-slot":`session-filters`,className:W(`flex flex-col gap-3`,a),children:[(0,U.jsxs)(I5,{title:`Filter`,children:[r?(0,U.jsx)(L5,{label:`Scope`,children:(0,U.jsx)(PC,{className:`w-full min-w-0`,label:`Scope`,value:e.scoped?`scoped`:`all`,options:[{value:`scoped`,label:r.label},{value:`all`,label:`All folders`}],onChange:e=>l({scoped:e===`scoped`})})}):null,(0,U.jsx)(L5,{label:`State`,children:(0,U.jsx)(R5,{label:`State`,value:e.states,options:DO.map(e=>({value:e,label:OO[e]})),onChange:e=>l({states:e})})}),o.length>1?(0,U.jsx)(L5,{label:`Engine`,children:(0,U.jsx)(R5,{label:`Engine`,value:e.adapters,options:o.map(e=>({value:e,label:e})),onChange:e=>l({adapters:e})})}):null,c.length>1?(0,U.jsx)(L5,{label:`Gateway`,children:(0,U.jsx)(R5,{label:`Gateway`,value:e.gateways,options:c.map(e=>({value:e.id,label:e.name})),onChange:e=>l({gateways:e})})}):null,s.length>1?(0,U.jsx)(L5,{label:`Project`,children:(0,U.jsx)(R5,{label:`Project`,value:e.projects??[],options:s.map(e=>({value:e.key,label:e.label})),onChange:e=>l({projects:e})})}):null]}),(0,U.jsxs)(I5,{title:`Layout`,children:[(0,U.jsx)(L5,{label:`Group`,children:(0,U.jsx)(PC,{className:`w-full min-w-0`,label:`Group`,value:e.groupBy,options:[{value:`none`,label:`No grouping`},{value:`state`,label:`By state`},{value:`adapter`,label:`By engine`},{value:`project`,label:c.length>1?`By gateway & project`:`By project`},{value:`custom`,label:`Custom`}],onChange:e=>l({groupBy:e})})}),(0,U.jsx)(L5,{label:`Sort`,children:(0,U.jsx)(PC,{className:`w-full min-w-0`,label:`Sort`,value:e.sortBy,options:[{value:`recent`,label:`Recent`},{value:`name`,label:`Name`},{value:`state`,label:`State`},...s.length>1?[{value:`project`,label:`Project`}]:[],...c.length>1?[{value:`gateway`,label:`Gateway`}]:[]],onChange:e=>l({sortBy:e})})})]}),(0,U.jsxs)(I5,{title:`Show under each session`,children:[(0,U.jsx)(L5,{label:`Agents`,children:(0,U.jsx)(F5,{label:`Agents`,value:e.subagents,onChange:e=>l({subagents:e})})}),(0,U.jsx)(L5,{label:`Shells`,children:(0,U.jsx)(F5,{label:`Shells`,value:e.shells??`active`,onChange:e=>l({shells:e})})}),(0,U.jsx)(L5,{label:`Tasks`,children:(0,U.jsx)(F5,{label:`Tasks`,value:e.tasks??`active`,onChange:e=>l({tasks:e})})})]})]})}function Dae({open:e,onOpenChange:t,className:n,...r}){let i=Ok(r.config),a=i>0||kk(r.config);return(0,U.jsxs)(pT,{open:e,onOpenChange:t,children:[(0,U.jsx)(mT,{render:(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":i>0?`Filters (${i} active)`:`Filters`,title:i>0?`${i} filter${i===1?``:`s`} active`:`Filters`,className:n,children:(0,U.jsx)(Cy,{className:W(`size-3.5`,a&&`fill-current text-fg-1`)})})}),(0,U.jsx)(hT,{className:`w-80`,children:(0,U.jsx)(P5,{...r})})]})}function F5({label:e,value:t,onChange:n}){return(0,U.jsx)(`div`,{role:`radiogroup`,"aria-label":e,className:`flex w-full rounded-md border border-border p-px`,children:Eae.map(e=>(0,U.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e.value===t,onClick:()=>n(e.value),className:W(`min-w-0 flex-1 truncate rounded-[4px] px-1.5 py-0.5 text-label outline-none transition-colors`,`focus-visible:ring-2 focus-visible:ring-ring`,e.value===t?`bg-row-selected text-fg-1`:`text-fg-3 hover:bg-row-hover hover:text-fg-1`),children:e.label},e.value))})}function I5({title:e,children:t}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`div`,{className:`text-label font-medium uppercase tracking-wide text-fg-4`,children:e}),t]})}function L5({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-16 shrink-0 truncate text-label text-fg-3`,children:e}),(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:t})]})}function R5({label:e,value:t,options:n,onChange:r}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsxs)(OC,{multiple:!0,value:t,onValueChange:e=>r(e),children:[(0,U.jsx)(jC,{"aria-label":e,className:`min-w-0 flex-1`,children:(0,U.jsx)(kC,{children:t.length===0?`All`:t.length===1?n.find(e=>e.value===t[0])?.label??`All`:`${t.length} selected`})}),(0,U.jsx)(MC,{children:n.map(e=>(0,U.jsx)(NC,{value:e.value,children:(0,U.jsx)(AC,{children:e.label})},e.value))})]}),t.length>0?(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Clear ${e}`,onClick:()=>r([]),children:(0,U.jsx)(wC,{className:`size-3 text-fg-4`})}):null]})}function z5({usage:e,engine:t,size:n=11,className:r}){if(e===void 0)return null;let i=o3(t),a=`Context ${e.percentage.toFixed(0)}% · ${AN(e.totalTokens)} / ${AN(e.maxTokens)}`,o=W(`shrink-0 leading-none`,c3(e.percentage),r),s=(0,U.jsx)(ME,{value:e.percentage,size:n,strokeWidth:2});return i?(0,U.jsx)(WT,{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})}function Oae(e,t,n=`all`,r,i){let a=jO(e,n).filter(MO).map(e=>({key:e.toolUseId,kind:`agent`,label:NO(e),noun:`agent`,state:jae(e.status),detail:e.toolCount>0?String(e.toolCount):void 0,title:`${NO(e)} · ${e.toolCount} tool${e.toolCount===1?``:`s`}`,onSelect:()=>t(e.toolUseId)})),o=i===void 0?[]:Lk(e,i.show).map(e=>kae(e,i));if(r===void 0)return[...a,...o];let s=e.shellAgentWrite!==void 0,c=qO(e,r.show??`active`,r.now).map(e=>Aae(e,r,s));return[...a,...o,...c]}function kae(e,t){let n=e.source===`checklist`&&e.state===`running`&&!t.live,r=e.toolUseId;return{key:e.key,kind:`task`,label:e.label,noun:`task`,state:n?`pending`:e.state,detail:e.detail,title:n?`${e.label} · left in progress`:e.label,onSelect:()=>t.onSelect(e),onKill:e.stoppable&&r!==void 0&&t.onStop?()=>t.onStop?.(r):void 0,killLabel:`Stop this task`}}function Aae(e,t,n){let r=f4(e),i=e.status===`running`;return{key:e.id,kind:`shell`,label:s4(e),noun:`shell`,state:d4(e)?`failed`:i?`running`:`done`,detail:i?e.agentWrite===!0?i4:void 0:r,title:`${c4(e)} · ${r}`,onSelect:()=>t.onSelect(e.id),onKill:i&&t.onKill?()=>t.onKill?.(e.id):void 0,killLabel:`Kill this shell`,agentWrite:n&&t.onAgentWrite&&a4(e)?{granted:e.agentWrite===!0,label:o4(e),toggle:()=>t.onAgentWrite?.(e.id,e.agentWrite!==!0)}:void 0}}function jae(e){switch(e){case`running`:return`running`;case`failed`:return`failed`;default:return`done`}}function Mae({step:e,active:t=!1,onSelect:n}){let r=e.state===`failed`?`text-danger`:e.kind===`shell`?`text-[var(--wd-shell-accent)]`:e.kind===`task`?e.state===`pending`?`text-fg-4`:`text-fg-2`:`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)(Nae,{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,e.kind===`agent`?(0,U.jsx)(f_,{className:`size-3.5 shrink-0 text-fg-4`}):null]}),e.agentWrite?(0,U.jsx)(`button`,{type:`button`,"aria-label":e.agentWrite.label,"aria-pressed":e.agentWrite.granted,title:e.agentWrite.label,onClick:t=>{t.stopPropagation(),e.agentWrite?.toggle()},className:W(`shrink-0 px-1 text-micro leading-none outline-none`,e.agentWrite.granted?`text-warning`:`text-fg-4 hover:text-fg-1`),children:(0,U.jsx)(DP,{granted:e.agentWrite.granted,className:`size-3.5`})}):null,e.onKill?(0,U.jsx)(`button`,{type:`button`,"aria-label":`${e.kind===`task`?`Stop`:`Kill`} ${e.label}`,title:e.killLabel,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 Nae({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)(DE,{className:`size-[11px] shrink-0`});case`failed`:return(0,U.jsx)(pv,{className:`size-[11px] shrink-0`});case`pending`:return(0,U.jsx)(dee,{className:`size-[11px] shrink-0`});default:return(0,U.jsx)(rv,{className:`size-[11px] shrink-0`})}}var B5={meta:!1,ctrl:!1,alt:!1};function Pae({row:e,active:t=!1,activeStepKey:n,showGateway:r,showProject:i=!0,projectIcons:a,subagents:o=`active`,shells:s=`active`,tasks:c=`active`,onSelect:l,onSelectSubagent:u,onSelectTask:d,onStopTask:f,onSelectShell:p,onKillShell:m,onShellAgentWrite:h,now:g,onRename:_,renameOn:y=`doubleClick`,editing:b,onEditingChange:x,actions:S,avatars:C,variant:w=`card`,badgeState:T,teamUnseen:E=0,teamTray:D,tile:O=!1,className:k}){let{info:A}=e,[j,M]=(0,v.useState)(!1),N=b??j,P=e=>{M(e),x?.(e)},F=A.engine??`claude`,I=i?UO(e):GO(e),L=i?WO(e):void 0,R=i?A.project?.icon:void 0,z=R?.type===`image`?a?.[R.hash]:void 0,ee=ON(A.costUsd??A.totalCostUsd),te=[r?e.hostName:void 0,A.profile?`@${A.profile}`:void 0,ee===`-`?void 0:ee].filter(e=>!!e),B=zN(A.model),ne=Iae(A.statusLabel),re=e.state===`attention`||e.teamState===`attention`||T===`attention`,V=[];B&&V.push((0,U.jsx)(`span`,{className:D5(F,A.model),children:B},`model`)),ne&&V.push((0,U.jsx)(`span`,{title:ne,className:`text-fg-3`,children:ne},`status`)),I!==void 0&&V.push((0,U.jsxs)(`span`,{title:L,children:[(0,U.jsx)(N5,{icon:R,src:z,name:L,className:`mr-1.5 size-4 align-[-0.3em]`}),I]},`project`));for(let e of te)V.push((0,U.jsx)(`span`,{children:e},e));let ie=Oae(A,e=>u?u(e):l?.(B5),o,{now:g??Date.now(),show:s,onSelect:e=>p?p(e):l?.(B5),onKill:m,onAgentWrite:h},{show:c,live:A.status===`running`||A.status===`starting`||A.status===`awaiting_approval`,onSelect:e=>d?d(e):l?.(B5),onStop:f}),ae=ie.some(e=>e.key===n),H=A.agent,oe=H?H.name:VO(A),se=H?H.name:A.title??``,ce=NN(A.lastActivityAt??A.createdAt),le=N&&_?(0,U.jsx)(Fae,{initial:se,placeholder:H?`Agent name`:`Session name`,onCommit:e=>{P(!1),e!==se&&(e||!H)&&_(e)},onCancel:()=>P(!1)}):(0,U.jsx)(`span`,{onDoubleClick:_&&y===`doubleClick`?e=>{e.stopPropagation(),P(!0)}:void 0,className:`min-w-0 shrink truncate text-body-sm font-medium tracking-[-0.005em] text-fg-1`,children:oe}),ue=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;return(0,U.jsxs)(`div`,{"data-slot":`session-item`,"data-active":t||void 0,"data-asleep":A.engineAsleep||void 0,title:A.engineAsleep?`Asleep, wakes on your next message`:void 0,role:`button`,tabIndex:0,onClick:e=>{e.detail>1||N||l?.({meta:e.metaKey,ctrl:e.ctrlKey,alt:e.altKey})},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l?.({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`,re?W(`bg-row-attention`,t&&`ring-1 ring-accent ring-inset`):ae?`bg-row-selected-weak`:t?`bg-row-selected`:`hover:bg-row-hover`,k),children:[H&&w===`member`?(0,U.jsxs)(`div`,{className:W(`flex h-6 items-center gap-1.5 overflow-hidden py-0.5 pr-0.5 pl-1.5`,A.engineAsleep&&`opacity-60`),children:[(0,U.jsx)(j5,{row:e,image:A5(C,H),size:22}),le,ne?(0,U.jsx)(`span`,{title:ne,className:`min-w-0 flex-1 truncate text-body-sm text-fg-3`,children:ne}):(0,U.jsx)(`span`,{className:`flex-1`}),ue,(0,U.jsx)(`span`,{className:`shrink-0 text-body-sm text-fg-4`,children:ce}),S]}):H||O?(0,U.jsxs)(`div`,{className:W(`flex items-center gap-2 py-0.5 pr-0.5 pl-1.5`,A.engineAsleep&&`opacity-60`),children:[(0,U.jsx)(j5,{row:e,image:A5(C,H),state:T}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsxs)(`div`,{className:`flex h-5 items-center gap-1.5 overflow-hidden`,children:[le,H?.leads?(0,U.jsx)(M5,{}):null,H?(0,U.jsx)(`span`,{className:`w-max max-w-max min-w-0 grow basis-0 truncate text-label text-fg-4/70`,children:ce}):null,(0,U.jsx)(`span`,{className:`flex-1`}),ue,E>0?(0,U.jsxs)(`span`,{title:`${E} new message${E===1?``:`s`} in the team`,className:`flex h-4 shrink-0 items-center gap-0.5 rounded-full bg-accent px-1.5 text-[0.75rem] leading-none text-accent-fg tabular-nums`,children:[(0,U.jsx)(cC,{className:`size-3`}),E]}):null,D,(0,U.jsx)(z5,{usage:A.contextUsage,engine:F,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:[H?(0,U.jsxs)(U.Fragment,{children:[B?(0,U.jsx)(`span`,{className:W(`shrink-0`,D5(F,A.model)),children:B}):null,ne?(0,U.jsxs)(`span`,{title:ne,className:`min-w-0 truncate text-fg-3`,children:[B?`· `:``,ne]}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`min-w-0 truncate text-fg-4`,children:V.map((e,t)=>(0,U.jsxs)(v.Fragment,{children:[t>0?` · `:``,e]},t))}),(0,U.jsxs)(`span`,{className:`shrink-0 text-fg-4`,children:[V.length>0?`· `:``,ce]})]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1`}),S]})]})]}):(0,U.jsxs)(`div`,{className:W(`flex flex-col gap-1 py-0.5 pr-0.5 pl-1.5`,A.engineAsleep&&`opacity-60`),children:[(0,U.jsxs)(`div`,{className:`flex h-5 items-center gap-1.5 overflow-hidden`,children:[(0,U.jsx)(V5,{children:(0,U.jsx)(k5,{row:e})}),le,(0,U.jsx)(`span`,{className:`flex-1`}),ue,(0,U.jsx)(z5,{usage:A.contextUsage,engine:F,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)(V5,{children:(0,U.jsx)(O5,{engine:F,model:A.model,className:W(`size-4`,E5(F,A.model))})}),(0,U.jsx)(`span`,{className:`min-w-0 truncate text-fg-4`,children:V.map((e,t)=>(0,U.jsxs)(v.Fragment,{children:[t>0?` · `:``,e]},t))}),(0,U.jsxs)(`span`,{className:`shrink-0 text-fg-4`,children:[V.length>0?`· `:``,ce]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1`}),S]})]}),ie.length>0?(0,U.jsx)(`div`,{className:`flex flex-col`,children:ie.map(e=>(0,U.jsx)(Mae,{step:e,active:e.key===n,onSelect:e.onSelect},e.key))}):null]})}function V5({children:e}){return(0,U.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:e})}function Fae({initial:e,placeholder:t,onCommit:n,onCancel:r}){let[i,a]=(0,v.useState)(e),o=(0,v.useRef)(null);return(0,v.useEffect)(()=>{o.current?.focus(),o.current?.select()},[]),(0,v.useEffect)(()=>{let e=()=>{o.current?.focus(),o.current?.select()};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[]),(0,U.jsx)(`input`,{ref:o,value:i,spellCheck:!1,placeholder:t,"aria-label":t,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),onChange:e=>a(e.target.value),onBlur:()=>{document.hasFocus()&&n(i.trim())},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?n(i.trim()):e.key===`Escape`&&r()},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 Iae(e){return e?e.emoji?`${e.emoji} ${e.text}`:e.text:void 0}function Lae(e,t){if(t<=0)return`join`;let n=e/t;return n<.25?`before`:n>.75?`after`:`join`}function H5(e,t){let n=e.info.agent,r=t.info.agent;if(e.hostId!==t.hostId)return`a team stays on one gateway`;if(!r)return`only an agent can lead a team`;if(n?.id===r.id||e.info.id===t.info.id)return`an agent cannot lead its own team`;if(r.lead!==void 0)return`${r.name} is a member of a team; teams are one level deep`;if(n?.leads)return`${n.name} leads a team; teams are one level deep`}function Rae(e,t,n,r){let i=H5(e,t);if(i)return i;let a=(t.members??[]).filter(t=>t.info.id!==e.info.id||t.hostId!==e.hostId),o=a.findIndex(e=>e.info.id===n.info.id&&e.hostId===n.hostId);return U5(e,t,a,o<0?a.length:r===`before`?o:o+1)}function zae(e,t){let n=H5(e,t);if(n)return n;let r=(t.members??[]).filter(t=>t.info.id!==e.info.id||t.hostId!==e.hostId);return U5(e,t,r,r.length)}function U5(e,t,n,r){let i=n.map((e,t)=>({row:e,order:t<r?t:t+1})).filter(({row:e,order:t})=>e.info.agent?.order!==t);return{row:e,lead:t,order:r,...i.length?{siblings:i}:{}}}var Bae=5e3;function Vae(e,t,n){let{custom:r,team:i}=n,[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(),d=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(d.current),[]);let f=()=>{o(void 0),c(void 0)},p=(e,t)=>{e.stopPropagation(),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.kind===`session`?t.key:t.id),o(t)},m=(e,t)=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=t.refusal?`none`:`move`,(s?.spot!==t.spot||s.refusal!==t.refusal)&&c(t)},h=(e,t)=>{clearTimeout(d.current),u({key:e,message:t instanceof Error?t.message:String(t)}),d.current=setTimeout(()=>u(void 0),Bae)},g=(e,t)=>()=>{u(void 0),Promise.resolve().then(()=>i.onMove(t)).catch(t=>h(e,t))};function _(n,o,s,c){if(a?.kind!==`session`||a.key===o)return;let l=r?{spot:`row:${o}`,run:()=>t(wk(e,a.key,s.custom,s.custom?o:void 0))}:void 0,u=i?.rowOf(a.key);if(!i||!u||!c)return l;let d=n.currentTarget.getBoundingClientRect(),f=Lae(n.clientY-d.top,d.height);if(c.lead){let e=Rae(u,c.lead,c.row,f);return typeof e==`string`?{spot:`refused:${o}`,refusal:e}:{spot:`${f===`before`?`before`:`after`}:${o}`,run:g(o,e)}}if(f===`join`){let e=zae(u,c.row);return typeof e==`string`?l??{spot:`refused:${o}`,refusal:e}:{spot:`join:${o}`,run:g(o,e)}}if(u.info.agent?.lead!==void 0){let e=g(o,{row:u,lead:null});return{spot:`${f}:${o}`,run:()=>{e(),l?.run()}}}return l?{...l,spot:`${f}:${o}`}:void 0}function y(e,t,n){return{draggable:!0,onDragStart:t=>p(t,{kind:`session`,key:e}),onDragEnd:f,onDragOver:r=>{let i=_(r,e,t,n);i&&m(r,i)},onDrop:r=>{let i=_(r,e,t,n);i&&(r.preventDefault(),r.stopPropagation(),i.run?.(),f())}}}function b(n){let o=()=>{let e=a?.kind===`session`?i?.rowOf(a.key):void 0;return e?.info.agent?.lead===void 0?void 0:e};return{onDragOver:e=>{a&&(r||o())&&m(e,{spot:`group:${n.key}`})},onDrop:i=>{i.preventDefault();let s=o();s&&g(LO(s),{row:s,lead:null})(),r&&a?.kind===`session`?t(wk(e,a.key,n.custom)):r&&a?.kind===`group`&&t(Tk(e,a.id,n.custom)),f()}}}function x(e){let t=e.custom;return t===void 0?{}:{draggable:!0,onDragStart:e=>p(e,{kind:`group`,id:t}),onDragEnd:f}}function S(e){if(l?.key===e)return{zone:`refused`,message:l.message};let t=s?.spot;if(!t||t.slice(t.indexOf(`:`)+1)!==e)return{};let n=t.slice(0,t.indexOf(`:`));return n===`refused`?{zone:`refused`,message:s?.refusal}:n===`row`||n===`before`?{zone:`before`}:n===`after`?{zone:`after`}:n===`join`?{zone:`join`}:{}}return{dragging:a!==void 0,isOver:e=>s?.spot===e,cue:S,session:y,container:b,header:x,create:(n=`New group`)=>{let r=vk();return t(yk(e,n,r)),r},rename:(n,r)=>t(bk(e,n,r)),style:(n,r)=>t(Sk(e,n,r)),remove:n=>t(Ck(e,n))}}function Hae({group:e,look:t,editing:n,onEditingChange:r,onRename:i,onRemove:a,onStyle:o,dragProps:s}){if(n)return(0,U.jsx)(Uae,{initial:e.label??``,onRename:i,onDone:()=>r(!1)});let c=e.custom!==void 0;return(0,U.jsx)(W5,{...s,label:e.label??``,count:e.rows.length,caps:!c,className:W(`group/heading`,c&&`cursor-grab`),onDoubleClick:c?()=>r(!0):void 0,leading:c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Vy,{className:`-mr-1.5 -ml-1.5 size-3 opacity-0 group-hover/heading:opacity-60`}),t?(0,U.jsx)(Gae,{group:t,onStyle:o}):null]}):void 0,actions:c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(G5,{label:`Rename group`,onClick:()=>r(!0),children:(0,U.jsx)(px,{className:`size-3`})}),(0,U.jsx)(G5,{label:`Delete group`,title:`Delete the group - its sessions move to Ungrouped`,onClick:a,children:(0,U.jsx)(HS,{className:`size-3`})})]}):void 0})}function Uae({initial:e,onRename:t,onDone:n}){let[r,i]=(0,v.useState)(e),a=()=>{let i=r.trim();i&&i!==e&&t(i),n()};return(0,U.jsx)(`div`,{className:`px-2`,children:(0,U.jsx)(go,{autoFocus:!0,"aria-label":`Group name`,value:r,onFocus:e=>e.currentTarget.select(),onChange:e=>i(e.target.value),onBlur:a,onKeyDown:e=>{e.key===`Enter`?a():e.key===`Escape`&&(e.stopPropagation(),n())},className:`h-6 text-label`})})}function W5({label:e,count:t,leading:n,actions:r,caps:i=!0,className:a,...o}){return(0,U.jsxs)(`div`,{...o,className:W(`group/heading flex min-h-5 items-center gap-2 px-2 text-label font-medium text-fg-4`,a),children:[n,(0,U.jsx)(`span`,{className:W(`min-w-0 truncate`,i?`uppercase tracking-wide`:`text-fg-3`),children:e}),(0,U.jsx)(`span`,{className:`text-fg-4/70`,children:t}),r?(0,U.jsx)(`span`,{className:`ml-auto flex items-center gap-0.5 opacity-0 transition-opacity group-hover/heading:opacity-100 focus-within:opacity-100`,children:r}):null]})}function G5({label:e,title:t,onClick:n,children:r}){return(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":e,title:t??e,className:`size-5 text-fg-3`,onClick:e=>{e.stopPropagation(),n()},children:r})}function Wae({onClick:e}){return(0,U.jsxs)(G,{variant:`ghost`,size:`xs`,className:`mx-1 self-start text-fg-3`,onClick:e,children:[(0,U.jsx)(Cx,{}),`New group`]})}var K5=64;function Gae({group:e,onStyle:t}){let[n,r]=(0,v.useState)(),i=(0,v.useRef)(null),a=e.icon?(0,U.jsx)(`img`,{src:e.icon,alt:``,className:`size-3.5 rounded-[3px] object-cover`,draggable:!1}):(0,U.jsx)(`span`,{className:`size-2 rounded-[2px]`,style:{background:xk(e)}});return t?(0,U.jsxs)(pT,{children:[(0,U.jsx)(mT,{render:(0,U.jsx)(`button`,{type:`button`,"aria-label":`Colour or image for ${e.name}`,title:`Colour or image`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),className:`flex size-3.5 shrink-0 items-center justify-center rounded-[3px] hover:ring-1 hover:ring-border`,children:a})}),(0,U.jsxs)(hT,{align:`start`,className:`flex w-44 flex-col gap-2`,children:[(0,U.jsx)(`div`,{className:`grid grid-cols-4 gap-1.5`,children:TO.map(n=>(0,U.jsx)(`button`,{type:`button`,"aria-label":`Colour ${n}`,onClick:()=>t({color:n,icon:null}),className:W(`h-6 rounded-[4px] ring-offset-1 ring-offset-surface`,!e.icon&&xk(e)===n&&`ring-2 ring-fg-3`),style:{background:n}},n))}),(0,U.jsx)(`input`,{ref:i,type:`file`,accept:`image/*`,className:`hidden`,onChange:e=>{let n=e.target.files?.[0];e.target.value=``,n&&(r(void 0),Kae(n).then(e=>t({icon:e})).catch(()=>r(`That image could not be read`)))}}),(0,U.jsxs)(G,{variant:`outline`,size:`xs`,onClick:()=>i.current?.click(),children:[(0,U.jsx)(Yy,{}),`Choose image…`]}),e.icon?(0,U.jsx)(G,{variant:`ghost`,size:`xs`,onClick:()=>t({icon:null}),children:`Remove image`}):null,n?(0,U.jsx)(`span`,{className:`text-label text-danger`,children:n}):null]})]}):(0,U.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center`,children:a})}async function Kae(e){let t=await createImageBitmap(e),n=document.createElement(`canvas`);n.width=K5,n.height=K5;let r=n.getContext(`2d`);if(!r)throw Error(`no canvas`);let i=Math.max(K5/t.width,K5/t.height),a=t.width*i,o=t.height*i;return r.drawImage(t,(K5-a)/2,(K5-o)/2,a,o),t.close(),n.toDataURL(`image/png`)}function qae(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 Jae({rows:e,config:t,onConfigChange:n,scope:r,activeId:i,activeSubagentId:a,activeShellId:o,now:s,isActive:c=e=>e.info.id===i,rowActions:l,gatewayCount:u,showSubset:d=!0,onSelect:f,onDelete:p,onRename:m,onRenameAgent:h,onClearContext:g,onSleep:_,onSelectSubagent:y,onSelectTask:b,onStopTask:x,onSelectShell:S,onKillShell:C,onShellAgentWrite:w,avatars:T,onTeamMove:E,onCreateInGroup:D,emptyState:O,showControls:k=!0,showSearch:A=k,autoFocusSearch:j,projectIcons:M,className:N}){let P=(0,v.useMemo)(()=>new Set(e.map(e=>e.hostId)).size,[e]),F=u??P,I=(0,v.useMemo)(()=>$O(e,t,r),[e,t,r]),L=(0,v.useMemo)(()=>ok(I,t,{gatewayCount:F,all:e}),[I,t,F,e]),R=Ek(t,r,I.length,e.length),z=(0,v.useMemo)(()=>e.some(e=>e.info.agent!==void 0),[e]),ee=t.groupBy===`custom`,[te,B]=(0,v.useState)(),ne=e=>n({...t,...e}),re=(0,v.useMemo)(()=>new Map(e.map(e=>[LO(e),e])),[e]),V=Vae(t.customGroups??[],e=>ne({customGroups:e}),{custom:ee,team:E?{rowOf:e=>re.get(e),onMove:E}:void 0}),ie=ee||E!==void 0,ae=e=>{if(ee)return(0,U.jsx)(Hae,{group:e,look:t.customGroups?.find(t=>t.id===e.custom),onStyle:t=>e.custom&&V.style(e.custom,t),editing:e.custom!==void 0&&te===e.custom,onEditingChange:t=>B(t?e.custom:void 0),onRename:t=>e.custom&&V.rename(e.custom,t),onRemove:()=>e.custom&&V.remove(e.custom),dragProps:V.header(e)});if(e.earlier)return(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":t.earlierOpen===!0,onClick:()=>ne({earlierOpen:!t.earlierOpen}),className:`flex items-center gap-1 px-2 text-left text-label text-fg-4 hover:text-fg-2`,children:[t.earlierOpen?(0,U.jsx)(av,{className:`size-3.5`}):(0,U.jsx)(lv,{className:`size-3.5`}),`Earlier · `,e.rows.length,` one-off session`,e.rows.length===1?``:`s`]});if(t.groupBy===`none`||!e.label)return null;let n=t.groupBy===`project`,r=n&&e.hostId?{hostId:e.hostId,cwd:e.cwd}:void 0;return(0,U.jsx)(W5,{label:e.gateway&&e.project?(0,U.jsxs)(U.Fragment,{children:[e.gateway,(0,U.jsx)(`span`,{"aria-hidden":!0,children:` · `}),(0,U.jsx)(`span`,{className:`text-fg-1`,children:e.project})]}):e.label,count:e.rows.length,title:n&&e.cwd?e.cwd:void 0,leading:n?(0,U.jsx)(N5,{icon:e.rows[0]?.info.project?.icon,src:Yae(e.rows[0],M),name:e.label}):void 0,actions:r&&D?(0,U.jsx)(G5,{label:`New session in ${e.label}`,onClick:()=>D(r),children:(0,U.jsx)(Cx,{className:`size-3`})}):void 0})};return(0,U.jsxs)(`div`,{"data-slot":`session-browser`,className:W(`flex flex-col gap-3`,N),children:[A?(0,U.jsx)(Qae,{value:t.search,onChange:e=>ne({search:e}),autoFocus:j,className:`px-2`}):null,k?(0,U.jsx)(P5,{config:t,onConfigChange:n,rows:e,scope:r,className:`px-2`}):null,R&&d?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 text-label text-fg-4`,children:[(0,U.jsxs)(`span`,{children:[R.shown,` of `,R.total,R.causes.length?` · ${R.causes.join(` · `)}`:null]}),(0,U.jsx)(`button`,{type:`button`,className:`text-fg-3 underline underline-offset-2 hover:text-fg-1`,onClick:()=>n(Ak(t)),children:`Show all`})]}):null,e.length===0?O??(0,U.jsx)(AE,{icon:(0,U.jsx)(tb,{}),title:`No sessions yet`}):I.length===0?Dk(t)?(0,U.jsx)(AE,{icon:(0,U.jsx)(rS,{}),title:`No matches`,description:`No session matches the current search and filters.`,action:`Clear filters`,onAction:()=>n(Ak(t))}):r&&QO(t,r)?(0,U.jsx)(AE,{icon:(0,U.jsx)(hy,{}),title:`Nothing in this folder`,description:`No session is running in ${r.label}.`,action:`Show all folders`,onAction:()=>ne({scoped:!1})}):(0,U.jsx)(AE,{icon:(0,U.jsx)(tb,{}),title:`Nothing here`,description:`No session to show.`}):(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[L.map(e=>(0,U.jsxs)(`div`,{...ie?V.container(e):{},className:W(`flex flex-col gap-1 rounded-md`,ie&&V.isOver(`group:${e.key}`)&&`bg-row-hover/50`),children:[ae(e),ee&&e.custom!==void 0&&e.rows.length===0?(0,U.jsx)(`div`,{className:`mx-1 rounded-md border border-dashed border-border px-2 py-2 text-center text-label text-fg-4`,children:`Drag sessions here`}):null,e.earlier&&!t.earlierOpen?null:e.rows.map(r=>{let i=(n,i,u={})=>(0,U.jsx)(Xae,{dragProps:E||ee&&i===`card`?V.session(LO(n),e,i===`member`?{row:n,lead:r}:{row:r}):void 0,dropCue:ie?V.cue(LO(n)):void 0,row:n,variant:i,active:c(n),activeSubagentId:a,activeShellId:o,actions:l?.(n),now:s,showGateway:F>1&&t.groupBy!==`project`,showProject:t.groupBy!==`project`,subagents:t.subagents,shells:t.shells,tasks:t.tasks,projectIcons:M,avatars:T,tile:z,onSelect:f,onDelete:p,onRename:n.info.agent?h:m,onClearContext:g,onSleep:_,onSelectSubagent:y,onSelectTask:b,onStopTask:x,onSelectShell:S,onKillShell:C,onShellAgentWrite:w,...u},LO(n));if(!r.members?.length)return i(r,`card`,{className:r.context?`opacity-50`:void 0});let u=pk(t,r);return(0,U.jsx)(Zae,{lead:r,collapsed:u,avatars:T,onToggle:()=>n(mk(t,r)),renderLead:(e,t)=>i(r,`card`,{className:r.context?`opacity-50`:void 0,badgeState:u?r.teamState:void 0,teamUnseen:u?e.unseen:0,teamTray:t}),renderMember:e=>i(e,`member`)},LO(r))})]},e.key)),ee?(0,U.jsx)(Wae,{onClick:()=>B(V.create())}):null]})]})}function Yae(e,t){let n=e?.info.project?.icon;return n?.type===`image`?t?.[n.hash]:void 0}function Xae({row:e,variant:t,avatars:n,badgeState:r,teamUnseen:i,teamTray:a,tile:o,className:s,dragProps:c,dropCue:l,active:u,actions:d,activeSubagentId:f,activeShellId:p,now:m,showGateway:h,showProject:g=!0,subagents:_,shells:y,tasks:b,projectIcons:x,onSelect:S,onDelete:C,onRename:w,onClearContext:T,onSleep:E,onSelectSubagent:D,onSelectTask:O,onStopTask:k,onSelectShell:A,onKillShell:j,onShellAgentWrite:M}){let{info:N}=e,[P,F]=(0,v.useState)(!1),I=(0,U.jsx)(Pae,{row:e,variant:t,avatars:n,badgeState:r,teamUnseen:i,teamTray:a,tile:o,className:s,active:u===!0,activeStepKey:u?p??f:void 0,now:m,showGateway:h,showProject:g,subagents:_,shells:y,tasks:b,projectIcons:x,onSelect:t=>S?.(e,t),onSelectSubagent:D?t=>D(e,t):void 0,onSelectTask:O?t=>O(e,t):void 0,onStopTask:k?t=>k(e,t):void 0,onSelectShell:A?t=>A(e,t):void 0,onKillShell:j?t=>j(e,t):void 0,onShellAgentWrite:M?(t,n)=>M(e,t,n):void 0,onRename:w?t=>w(e,t):void 0,renameOn:d===void 0?`external`:`doubleClick`,editing:d===void 0?P:void 0,onEditingChange:d===void 0?F:void 0,actions:d??(0,U.jsxs)(U.Fragment,{children:[w&&!P?(0,U.jsx)(J5,{label:N.agent?`Rename agent`:`Rename session`,onClick:()=>F(!0),children:(0,U.jsx)(px,{className:`size-3 text-fg-3`})}):null,T&&N.capabilities?.clearContext?(0,U.jsx)(J5,{label:`Clear context`,title:`Clear the conversation - the session keeps running and the old conversation stays resumable`,onClick:()=>T(e),children:(0,U.jsx)(Yv,{className:`size-3 text-fg-3`})}):null,E&&N.capabilities?.engineSleep&&N.status===`idle`&&!N.engineAsleep?(0,U.jsx)(J5,{label:`Sleep session`,title:`Stop the engine process to free its memory - the session stays here and wakes on your next message`,onClick:()=>E(e),children:(0,U.jsx)(y_,{className:`size-3 text-fg-3`})}):null,C?(0,U.jsx)(J5,{label:`Close session`,onClick:()=>C(e),children:(0,U.jsx)(HS,{className:`size-3 text-fg-3`})}):null]})});if(!c)return I;let L=l?.zone;return(0,U.jsxs)(`div`,{...c,title:L===`refused`?l?.message:void 0,className:W(`rounded-md`,L===`before`&&`shadow-[inset_0_2px_0_0_var(--color-accent)]`,L===`after`&&`shadow-[inset_0_-2px_0_0_var(--color-accent)]`,L===`join`&&`bg-accent/10 ring-1 ring-accent`,L===`refused`&&`ring-1 ring-danger/60`),children:[I,L===`refused`&&l?.message?(0,U.jsx)(`div`,{role:`status`,className:`px-3 pb-1 text-label text-danger`,children:l.message}):null]})}var q5=4;function Zae({lead:e,collapsed:t,avatars:n,onToggle:r,renderLead:i,renderMember:a}){let o=e.members??[],s=hk(e);if(t){let t=o.filter(e=>e.state===`attention`),c=[`${s.members} member${s.members===1?``:`s`}`,s.working?`${s.working} working`:void 0,s.attention?`${s.attention} need${s.attention===1?`s`:``} you`:void 0].filter(Boolean),l=o.length-q5,u=(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":!1,"aria-label":`Expand ${e.info.agent?.name??`team`}: ${c.join(`, `)}`,title:c.join(` · `),onClick:e=>{e.stopPropagation(),r()},className:`flex shrink-0 items-center gap-1 rounded-[4px] px-0.5 hover:bg-row-hover`,children:[o.slice(0,l>0?3:q5).map(e=>(0,U.jsx)(j5,{row:e,image:A5(n,e.info.agent),size:16,className:`rounded-[3px]`},LO(e))),l>0?(0,U.jsxs)(`span`,{className:`text-label text-fg-4 tabular-nums`,children:[`+`,l+1]}):null]});return(0,U.jsxs)(`div`,{"data-slot":`team`,"data-collapsed":!0,className:`flex flex-col`,children:[i(s,u),t.length?(0,U.jsx)(`div`,{className:`ml-3 flex flex-col`,children:t.map(a)}):null]})}return(0,U.jsxs)(`div`,{"data-slot":`team`,className:`flex flex-col`,children:[i(s),(0,U.jsxs)(`div`,{className:`relative ml-3.5 flex flex-col pl-1`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-0 bottom-3 left-0 w-px bg-border`}),(0,U.jsx)(`button`,{type:`button`,"aria-expanded":!0,"aria-label":`Collapse ${e.info.agent?.name??`team`}`,onClick:r,className:`absolute -top-1 -left-[7px] flex size-3.5 items-center justify-center rounded-full border border-border bg-bg text-fg-4 hover:text-fg-1`,children:(0,U.jsx)(av,{className:`size-2.5`})}),o.map(a)]})]})}function J5({label:e,title:t,onClick:n,children:r}){return(0,U.jsx)(G,{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 Qae({value:e,onChange:t,autoFocus:n,className:r,inputClassName:i}){return(0,U.jsxs)(`div`,{className:W(`relative`,r),children:[(0,U.jsx)(aS,{className:`pointer-events-none absolute top-1/2 left-4.5 size-3.5 -translate-y-1/2 text-fg-4`}),(0,U.jsx)(go,{value:e,onChange:e=>t(e.target.value),onKeyDown:n=>{n.key===`Escape`&&e&&(n.stopPropagation(),t(``))},placeholder:`Search sessions`,"aria-label":`Search sessions`,autoFocus:n,className:W(`pr-7 pl-8`,i)}),e?(0,U.jsx)(`button`,{type:`button`,"aria-label":`Clear search`,onClick:()=>t(``),className:`absolute top-1/2 right-3.5 -translate-y-1/2 rounded p-0.5 text-fg-4 hover:text-fg-1`,children:(0,U.jsx)(wC,{className:`size-3`})}):null]})}function Y5(){let[e,t]=(0,v.useState)(T());return(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Toggle theme`,onClick:()=>t(O()),children:e===`dark`?(0,U.jsx)(MS,{className:`size-4`}):(0,U.jsx)(zb,{className:`size-4`})})}var X5=[{value:`default`,displayName:`Default (recommended)`,description:`The CLI's configured default model`},{value:`fable`,displayName:`Fable`,description:`Fable 5.1 · For your toughest challenges`},{value:`opus`,displayName:`Opus`,description:`Opus 5.5 · For complex work and everyday tasks`},{value:`sonnet`,displayName:`Sonnet`,description:`Sonnet 5.5 · Most efficient for simpler tasks`},{value:`haiku`,displayName:`Haiku`,description:`Haiku 4.5 · Fastest for quick answers`}],Z5=`workerdeck.transcript-variant`;function Q5(){return b(Z5)===`terminal`?`terminal`:`cards`}function $ae(e){x(Z5,e)}var $5=`workerdeck.transcript-font`;function e7(){return b($5)===`mono`?`mono`:`sans`}function eoe(e){x($5,e)}var t7=`workerdeck.font-size`;function n7(){let e=b(t7);if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>=8&&t<=24?Math.round(t):void 0}function toe(e){x(t7,e===void 0?void 0:String(Math.round(e)))}var r7=`workerdeck.catch-up`;function i7(){return b(r7)===`off`?`off`:`on`}function noe(e){x(r7,e)}var a7=`workerdeck.action-style`;function o7(){return b(a7)===`labeled`?`labeled`:`icons`}function roe(e){x(a7,e)}function s7({label:e,options:t,read:n,write:r,onChange:i}){let[a,o]=(0,v.useState)(n);return(0,U.jsx)(PC,{label:e,value:a,options:t,onChange:e=>{o(e),r(e),i?.(e)},className:`min-w-40`})}function c7({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 ioe({open:e,onOpenChange:t}){let[n,r]=(0,v.useState)(Q5);return(0,U.jsx)(gT,{open:e,onOpenChange:t,children:(0,U.jsxs)(_T,{size:`md`,className:`w-[min(30rem,calc(100vw-2rem))]`,children:[(0,U.jsx)(vT,{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)(yT,{children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,U.jsxs)(c7,{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)(Y5,{})]}),(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)(s7,{label:`Agent view style`,options:[{value:`cards`,label:`Cards`},{value:`terminal`,label:`Terminal`}],read:Q5,write:$ae,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)(s7,{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(n7()??``),write:e=>toe(e?Number(e):void 0)})]}),n===`cards`?(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)(s7,{label:`Agent view font`,options:[{value:`sans`,label:`Regular`},{value:`mono`,label:`Monospace`}],read:e7,write:eoe})]}):null,(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Row actions`}),(0,U.jsx)(s7,{label:`Row actions`,options:[{value:`icons`,label:`Icons`},{value:`labeled`,label:`Icons and labels`}],read:o7,write:roe})]})]}),(0,U.jsx)(c7,{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)(s7,{label:`Catch-up mode`,options:[{value:`on`,label:`On`},{value:`off`,label:`Off`}],read:i7,write:noe})]})})]})})]})})}function l7({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 u7(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)}}function d7(e,{load:t,intervalMs:n,onIdle:r}){let i=u7(e),a,o=0,s,c=()=>(a??=t(i).finally(()=>{a=void 0}),a),l=e=>{let t=i.subscribe(e);return++o===1&&(c(),n&&(s=setInterval(()=>void c(),n))),()=>{t(),--o===0&&(clearInterval(s),s=void 0,r?.())}};return{...i,subscribe:l,refresh:c,watched:()=>o>0,use:()=>(0,v.useSyncExternalStore)(l,i.get,i.get)}}var f7=`workerdeck.hosts.v1`;function p7(e){return`workerdeck.host.${e}.key`}var aoe=`gateway`,m7=u7({hosts:[],ready:!1});function h7(e){b7.clear(),m7.set(e)}function g7(){let e=S(f7,[]);return Array.isArray(e)?e.map(({implicit:e,...t})=>t):[]}function _7(e){C(f7,e.filter(e=>!e.implicit))}function ooe(){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 v7(e){return b(p7(e))??``}function y7(e,t){x(p7(e),t===``?void 0:t)}var b7=new Map;function x7(e){let t=b7.get(e);if(t)return t;let n=m7.get().hosts.find(t=>t.id===e);if(!n)return;let r=zA(n);if(r===void 0)return;let i=new UA({baseUrl:r,...n.implicit?{}:VA({baseUrl:r,key:v7(n.id)})});return b7.set(e,i),i}function soe(e){return m7.get().hosts.find(t=>t.id===e)}function S7(){return m7.get().hosts.find(e=>e.implicit)??m7.get().hosts[0]}function coe(){let e=S7();return e?x7(e.id):void 0}function C7(e){return BA(e)}function loe(e,t){let n=g7(),r=n.some(t=>t.id===e.id)?n.map(t=>t.id===e.id?e:t):[...n,e];_7(r),y7(e.id,t),h7({...m7.get(),hosts:[...m7.get().hosts.filter(e=>e.implicit),...r]})}function uoe(e){let t=g7().filter(t=>t.id!==e);_7(t),y7(e,``),h7({...m7.get(),hosts:[...m7.get().hosts.filter(e=>e.implicit),...t]})}async function doe(){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 w7=!1;function T7(){if(w7)return;w7=!0;let e=g7();h7({hosts:e,ready:!1}),doe().then(t=>{h7({hosts:t?[{id:aoe,name:`This gateway`,baseUrl:location.origin,implicit:!0},...e]:e,ready:!0})})}function E7(e){return T7(),m7.subscribe(e)}function D7(){return(0,v.useSyncExternalStore)(E7,m7.get,m7.get)}function foe(){return T7(),m7.get().hosts}function O7(e){return E7(e)}function k7({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)(()=>v7(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)(go,{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)(go,{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)(go,{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)(G,{onClick:()=>{if(zA({baseUrl:o})===void 0){sE.error(`That address is not a URL`);return}if(!i.trim()){sE.error(`Give the gateway a name`);return}let t={id:e.id,name:i.trim(),baseUrl:o.trim()};loe(t,c),n(t)},children:t})]})]})}function poe({open:e,onOpenChange:t,onCreated:n}){let[r,i]=(0,v.useState)(()=>A7());return(0,U.jsx)(gT,{open:e,onOpenChange:e=>{e&&i(A7()),t(e)},children:(0,U.jsxs)(_T,{children:[(0,U.jsx)(vT,{title:`Add gateway`,description:`A workerdeck gateway you run - typically over Tailscale.`}),(0,U.jsx)(yT,{children:(0,U.jsx)(k7,{host:r,submitLabel:`Add gateway`,onSaved:n,actions:(0,U.jsx)(G,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`})})})]})})}function A7(){return{id:ooe(),name:``,baseUrl:``}}function j7({host:e,onClose:t,onRemoved:n}){return(0,U.jsx)(gT,{open:!0,onOpenChange:e=>!e&&t(),children:(0,U.jsxs)(_T,{children:[(0,U.jsx)(vT,{title:`Remove ${e.name}?`,description:`Its auth key is deleted from this browser. The gateway itself keeps running.`}),(0,U.jsx)(yT,{children:(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{variant:`outline`,onClick:t,children:`Cancel`}),(0,U.jsx)(G,{variant:`destructive`,onClick:()=>{uoe(e.id),n()},children:`Remove`})]})})]})})}function M7(e){return e===`sessions`?`workerdeck.sessions-sidebar-width`:`workerdeck.${e}-sidebar-width`}function N7(e){return e===`sessions`?`workerdeck.sessions-sidebar-collapsed`:`workerdeck.${e}-sidebar-collapsed`}function moe(e){let t=Number(b(M7(e)));return t?Math.min(520,Math.max(240,t)):300}function hoe(e,t){x(M7(e),String(t))}function goe(e){return b(N7(e))===`1`}function _oe(e,t){x(N7(e),t?`1`:`0`)}var P7=`workerdeck.sessions-search-shown`;function voe(){return b(P7)===`1`}function yoe(e){x(P7,e?`1`:`0`)}function F7({section:e,title:t,badge:n,actions:r,children:i,rail:a,railActions:o}){let[s,c]=(0,v.useState)(()=>moe(e)),[l,u]=(0,v.useState)(()=>goe(e)),d=t=>{u(t),_oe(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)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Expand ${t.toLowerCase()}`,onClick:()=>d(!1),children:(0,U.jsx)(ax,{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)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Collapse ${t.toLowerCase()}`,onClick:()=>d(!0),children:(0,U.jsx)(rx,{className:`size-3.5`})}),r]}),i]}),(0,U.jsx)(kE,{orientation:`vertical`,value:s,onValueChange:t=>{c(t),hoe(e,t)},min:240,max:520,defaultValue:300,"aria-label":`Resize ${t.toLowerCase()} sidebar`})]})}function I7({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 L7({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`,qae(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 R7({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 z7=`workerdeck.watermarks.v1`,B7=u7(0),V7=new DA({read:()=>S(z7,void 0),write:e=>{C(z7,e),B7.set(B7.get()+1)}});function H7(){return B7.use(),{unseenFor:(0,v.useCallback)((e,t)=>OA(V7.get(e,t.id),t),[]),watermarks:V7}}function boe(e,t){let n=V7.get(e,t);return n?{itemCount:n.itemCount,since:n.seenAt}:void 0}function xoe(e,t){let n=(0,v.useRef)({});return(0,v.useCallback)(r=>{t&&!document.hidden&&(n.current={...n.current,...r},V7.mark(e,t,n.current))},[e,t])}function Soe(e){let{unseenFor:t}=H7();return(0,v.useMemo)(()=>e.reduce((e,n)=>e+t(n.hostId,n.info),0),[e,t])}var Coe=5e3,woe=1200,Toe=700,U7=d7({snapshots:[],loaded:!1},{load:Eoe}),W7=0,G7;function K7(){return U7.refresh()}async function Eoe(){W7=Date.now();let e=foe(),t=new Map(U7.get().snapshots.map(e=>[e.host.id,e])),n=await Promise.all(e.map(async e=>{let n=x7(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:Rk(n)}}}));U7.set({snapshots:n,loaded:!0})}function Doe(){if(G7!==void 0)return;let e=Math.max(0,Toe-(Date.now()-W7));G7=setTimeout(()=>{G7=void 0,K7()},e)}var q7,J7;function Ooe(e){let t=e?woe:Coe;(q7===void 0||J7!==t)&&(q7!==void 0&&clearInterval(q7),J7=t,q7=setInterval(()=>void K7(),t))}function Y7(){let e=U7.use();(0,v.useEffect)(()=>O7(()=>void K7()),[]);let t=e.snapshots.some(e=>e.sessions.some(e=>{let t=kO(e);return t===`working`||t===`attention`}));return(0,v.useEffect)(()=>Ooe(t),[t]),{...e,refresh:K7}}function X7(e){let{unseenFor:t}=H7();return(0,v.useMemo)(()=>e.flatMap(({host:e,sessions:n})=>n.filter(e=>!KO(e)).map(n=>({hostId:e.id,hostName:e.name,local:C7(e),adapter:n.engine??`claude`,state:kO(n),info:n,unseen:t(e.id,n)}))),[e,t])}function koe(){let e=jr(),t=bi({select:e=>e.location.pathname.match(/^\/gateways\/(.+)$/)?.[1]}),{hosts:n,ready:r}=D7(),{snapshots:i}=Y7(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=i.filter(e=>e.error===void 0).length,u=(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Add gateway`,onClick:()=>o(!0),children:(0,U.jsx)(Cx,{className:`size-4`})});return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(F7,{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)(I7,{children:[r&&n.length===0?(0,U.jsx)(AE,{icon:(0,U.jsx)(sS,{}),title:`No gateways yet`,description:(0,U.jsxs)(U.Fragment,{children:[`Add one with `,(0,U.jsx)(jE,{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)(L7,{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)(R7,{label:`Remove ${n.name}`,onClick:()=>c(n),children:(0,U.jsx)(HS,{className:`size-3`})})},n.id)})]})}),s?(0,U.jsx)(j7,{host:s,onClose:()=>c(void 0),onRemoved:()=>{let n=s.id===t;c(void 0),n&&e({to:`/gateways`})}}):null,(0,U.jsx)(poe,{open:a,onOpenChange:o,onCreated:t=>{o(!1),e({to:`/gateways/$hostId`,params:{hostId:t.id}})}})]})}function Z7({value:e,onChange:t,models:n=X5,className:r}){return(0,U.jsx)(M3,{variant:`form`,models:n,model:e||void 0,onModelChange:e=>t(e??``),className:r})}function Q7({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)(OC,{items:e.map(e=>({value:e.name,label:e.name})),value:t,onValueChange:e=>n(e),children:[(0,U.jsx)(jC,{className:r,children:(0,U.jsx)(kC,{})}),(0,U.jsx)(MC,{children:e.map(e=>(0,U.jsx)(NC,{value:e.name,children:(0,U.jsx)(AC,{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 $7(){return coe()}function e9(e,t,n){let r=e?.capabilities??jA[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=X5.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 t9={profiles:[]},n9=d7(t9,{load:Aoe});async function Aoe(){let e=await $7()?.listProfiles().catch(()=>t9);n9.set(e??t9)}function r9(){return(0,v.useEffect)(()=>O7(()=>void n9.refresh()),[]),{...n9.use(),refresh:n9.refresh}}function joe(){return r9().profiles}var i9=`workerdeck.last-profile`;function Moe(e){let t=e!==void 0&&e!==S7()?.id?e:void 0,[n,r]=(0,v.useState)();return(0,v.useEffect)(()=>{if(t===void 0)return;let e=!0;return x7(t)?.listProfiles().then(t=>e&&r(t.profiles)).catch(()=>e&&r([])),()=>{e=!1}},[t]),t===void 0?void 0:n??[]}function Noe(e){let t=joe(),n=Moe(e)??t,[r,i]=(0,v.useState)(()=>b(i9)??``),a=n.some(e=>e.name===r)?r:n[0]?.name??``;return{profiles:n,profile:a,selected:n.find(e=>e.name===a),select:e=>{i(e),x(i9,e)}}}var a9=`workerdeck.last-cwd`;function Poe(e,t){let[n,r]=(0,v.useState)([]);return(0,v.useEffect)(()=>{(t===void 0?$7():x7(t))?.listHostRoots().then(e=>r(e.roots.map(e=>e.path))).catch(()=>r([]))},[t]),(0,v.useMemo)(()=>{let t=b(a9),r=[...t?[t]:[],...[...e].sort((e,t)=>(t.lastActivityAt??t.createdAt)-(e.lastActivityAt??e.createdAt)).map(e=>e.cwd),...n];return[...new Set(r)].slice(0,12)},[e,n])}var Foe={session:`default`,job:`acceptEdits`},Ioe={session:`ask`,job:`auto`};function o9(e,t={}){let[n,r]=(0,v.useState)(()=>t.cwd??b(a9)??``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(void 0),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(Ioe[e]),{profiles:m,profile:h,selected:g,select:_}=Noe(t.hostId),y=e9(g,c??g?.defaults?.permissionMode??Foe[e],o);return{hostId:t.hostId,cwd:n,setCwd:r,prompt:i,setPrompt:a,mode:y.mode,setMode:l,model:o,setModel:s,effort:u,setEffort:d,questions:f,setQuestions:p,profiles:m,profile:h,selectProfile:_,engine:y,sessionFields:e=>({cwd:y.capabilities.hostCwd===!1?void 0:n.trim(),profile:h||void 0,prompt:e.prompt,permissionMode:y.mode,model:y.model.trim()||void 0,resume:e.resume,reasoningEffort:u&&y.reasoningEfforts.includes(u)?u:void 0,questionBehavior:y.capabilities.interactiveApprovals?f:void 0,...y.capabilities.settingSources?{settingSources:[`user`,`project`],allowDangerouslySkipPermissions:e.allowBypass||void 0}:{}}),rememberCwd:e=>x(a9,n.trim()||e)}}function s9({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)(OC,{items:E6.map(e=>({value:e.value,label:e.label})),value:e.questions,onValueChange:t=>e.setQuestions(t),children:[(0,U.jsx)(jC,{className:`min-w-36`,children:(0,U.jsx)(kC,{})}),(0,U.jsx)(MC,{children:E6.map(e=>(0,U.jsx)(NC,{value:e.value,children:(0,U.jsx)(AC,{children:`${e.label} - ${e.description}`})},e.value))})]})]}):null}function c9({form:e,sessions:t,promptLabel:n,promptPlaceholder:r=`e.g. /verify-content 42, or a task description`,extras:i,actions:a,onProfileChange:o}){let{engine:s}=e;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(l9,{form:e,sessions:t}),(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)(_o,{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)(Q7,{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)(z3,{variant:`form`,mode:s.mode,onModeChange:e.setMode,modes:s.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)(Z7,{value:s.model,onChange:e.setModel,models:s.models,className:`min-w-40`})]}),(0,U.jsx)(u9,{form:e}),a]})]})}function l9({form:e,sessions:t,label:n=`Working directory`}){let r=Poe(t,e.hostId),i=(0,v.useId)();return e.engine.capabilities.hostCwd===!1?null:(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)(go,{value:e.cwd,list:i,onChange:t=>e.setCwd(t.target.value),placeholder:`/path/to/project`,spellCheck:!1,className:`font-mono`}),(0,U.jsx)(`datalist`,{id:i,children:r.map(e=>(0,U.jsx)(`option`,{value:e},e))})]})}function u9({form:e}){let{engine:t}=e;return t.reasoningEfforts.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:`Effort`}),(0,U.jsxs)(OC,{items:[{value:`default`,label:`Default`},...t.reasoningEfforts.map(e=>({value:e,label:e}))],value:e.effort||`default`,onValueChange:t=>e.setEffort(t==="default"?``:String(t)),children:[(0,U.jsx)(jC,{className:`min-w-28`,children:(0,U.jsx)(kC,{})}),(0,U.jsx)(MC,{children:[`default`,...t.reasoningEfforts].map(e=>(0,U.jsx)(NC,{value:e,children:(0,U.jsx)(AC,{children:e})},e))})]})]})}var d9=d7({jobs:[],stats:void 0,enabled:!0,live:!1,error:void 0},{load:Loe,intervalMs:15e3,onIdle:Roe}),f9=d9.patch,p9;function m9(){return d9.refresh()}async function Loe(){try{let e=$7();if(!e)return;let[t,n]=await Promise.all([e.listJobs(),e.queueStats()]);f9({jobs:t,stats:n,enabled:!0,error:void 0})}catch(e){let t=Rk(e);/not configured/i.test(t)?f9({enabled:!1,error:void 0}):f9({error:t})}}function Roe(){p9?.(),p9=void 0,f9({live:!1})}function zoe(){if(p9||!d9.get().enabled||d9.get().stats===void 0||!d9.watched())return;let e=$7();if(!e)return;let t=e.attachQueue(),n=[t.on(`attached`,()=>void m9()),t.on(`stats`,e=>f9({stats:e})),t.on(`connectionChange`,e=>f9({live:e})),t.on(`event`,e=>{f9({jobs:d9.get().jobs.some(t=>t.id===e.job.id)?d9.get().jobs.map(t=>t.id===e.job.id?e.job:t):[...d9.get().jobs,e.job]})})];p9=()=>{for(let e of n)e();t.detach()}}function h9(){let e=d9.use();return(0,v.useEffect)(zoe,[e.enabled,e.stats]),{...e,refresh:m9}}function Boe({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)(ME,{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:[AN(e.dailyTokensUsed),e.dailyTokenLimit===void 0?``:` / ${AN(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:AN(e.sessionTokenLimit)})]}),e.paused?(0,U.jsx)(uo,{variant:`warning`,dot:!0,children:`Paused - daily budget exhausted`}):null]})}function Voe({onScheduled:e}){let{snapshots:t}=Y7(),n=t.find(e=>e.host.id===S7()?.id)?.sessions??[],r=o9(`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()){sE.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)){sE.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)){sE.error(`Attempts must be a whole number of at least 1`);return}p(!0);try{r.rememberCwd(r.cwd.trim()),await $7().createJob({session:{...r.sessionFields({allowBypass:i}),prompt:r.prompt.trim()},maxTokens:t,attempts:n,webhook:u.trim()?{url:u.trim()}:void 0}),r.setPrompt(``),sE.success(`Job scheduled`),e()}catch(e){sE.error(Rk(e,`Failed to schedule job`))}finally{p(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(c9,{form:r,sessions:n,promptLabel:`Prompt (the task - runs unattended)`,extras:(0,U.jsx)(s9,{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)(go,{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)(go,{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)(go,{value:u,onChange:e=>d(e.target.value),placeholder:`https://…/hook`,spellCheck:!1,className:`min-w-44 font-mono`})]}),(0,U.jsxs)(G,{className:`ml-auto`,onClick:()=>void h(),disabled:f,children:[f?(0,U.jsx)(DE,{className:`size-3.5 text-current`}):(0,U.jsx)(Cx,{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 Hoe({open:e,onOpenChange:t,onScheduled:n}){return(0,U.jsx)(gT,{open:e,onOpenChange:t,children:(0,U.jsxs)(_T,{size:`lg`,children:[(0,U.jsx)(vT,{title:`Schedule a job`,description:`A one-shot run the queue executes unattended.`}),(0,U.jsx)(yT,{children:e?(0,U.jsx)(Voe,{onScheduled:n}):null})]})})}function Uoe(){let{stats:e,enabled:t,error:n}=h9();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)(AE,{icon:(0,U.jsx)(lb,{}),title:`No job selected`,description:(0,U.jsxs)(U.Fragment,{children:[`Pick one on the left, or schedule one with `,(0,U.jsx)(jE,{children:`+`}),` above.`]})}),e?(0,U.jsx)(`div`,{className:`mt-2 w-full max-w-xl`,children:(0,U.jsx)(Boe,{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 g9={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`}},Woe=[`queued`,`running`,`parked`];function Goe(){let e=jr(),t=bi({select:e=>e.location.pathname.match(/^\/jobs\/(.+)$/)?.[1]}),{jobs:n,enabled:r,live:i,refresh:a}=h9(),[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||Woe.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)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Schedule a job`,onClick:()=>s(!0),children:(0,U.jsx)(Cx,{className:`size-4`})}):void 0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(F7,{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)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh`,onClick:()=>void a(),children:(0,U.jsx)(Lx,{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)(go,{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)(G,{variant:u?`default`:`outline`,size:`xs`,"aria-pressed":u,onClick:()=>d(!u),children:`Active`})]}):null,(0,U.jsxs)(I7,{children:[n.length===0?(0,U.jsx)(AE,{icon:(0,U.jsx)(db,{}),title:`No jobs yet`,description:(0,U.jsxs)(U.Fragment,{children:[`Schedule one with `,(0,U.jsx)(jE,{children:`+`}),` above.`]})}):p.length===0?(0,U.jsx)(AE,{icon:(0,U.jsx)(rS,{}),title:`No matches`,description:`No job matches the active filter.`,action:`Show all`,onAction:()=>d(!1)}):null,p.map(n=>(0,U.jsx)(Koe,{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)(AE,{icon:(0,U.jsx)(db,{}),title:`No job queue`,description:`This gateway runs without one, so there is nothing to schedule against.`})}),(0,U.jsx)(Hoe,{open:o,onOpenChange:s,onScheduled:()=>{s(!1),a()}})]})}function Koe({job:e,active:t,onOpen:n,onChanged:r}){let i=g9[e.status],a=e.status===`queued`||e.status===`running`||e.status===`parked`,o=[NN(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(ON(s)),(0,U.jsx)(L7,{active:t,onSelect:n,title:e.prompt,status:(0,U.jsxs)(uo,{variant:i.variant,dot:!i.busy,className:`shrink-0`,children:[i.busy?(0,U.jsx)(DE,{className:`size-3 text-current`}):null,i.label]}),description:o.join(` · `),actions:a?(0,U.jsx)(R7,{label:`Cancel job`,onClick:()=>{$7()?.cancelJob(e.id).then(r).catch(e=>sE.error(Rk(e,`Cancel failed`)))},children:(0,U.jsx)(wC,{className:`size-3`})}):null})}var _9=[`web_search`,`download`,`web_fetch`,`deliver_file`];function v9(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function y9({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 qoe({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()){sE.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:v9(d).length>0?v9(d):void 0,apiKeyEnv:p.trim()||void 0};let e={};b.length>0&&(e.capabilities=b),v9(S).length>0&&(e.mcpServers=v9(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 $7().createProfile(n),sE.success(`Profile '${n.name}' created`),e(n.name)}catch(e){sE.error(Rk(e,`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)(y9,{label:`Engine`,children:(0,U.jsxs)(OC,{items:[{value:`provider`,label:`provider`},{value:`claude`,label:`claude`},{value:`codex`,label:`codex`}],value:t,onValueChange:e=>n(e),children:[(0,U.jsx)(jC,{className:`min-w-32`,children:(0,U.jsx)(kC,{})}),(0,U.jsxs)(MC,{children:[(0,U.jsx)(NC,{value:`provider`,children:(0,U.jsx)(AC,{children:`provider - model-agnostic engine`})}),(0,U.jsx)(NC,{value:`claude`,children:(0,U.jsx)(AC,{children:`claude - Agent SDK + config dir`})}),(0,U.jsx)(NC,{value:`codex`,children:(0,U.jsx)(AC,{children:`codex - app-server + CODEX_HOME`})})]})]})}),(0,U.jsx)(y9,{label:`Name`,children:(0,U.jsx)(go,{value:r,onChange:e=>i(e.target.value),placeholder:`kimi`})}),(0,U.jsx)(y9,{label:`Description (optional)`,children:(0,U.jsx)(go,{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)(y9,{label:`Provider id`,children:(0,U.jsx)(go,{value:s,onChange:e=>c(e.target.value),placeholder:`anthropic / openai / moonshotai`,className:`font-mono`})}),(0,U.jsx)(y9,{label:`Default model`,children:(0,U.jsx)(go,{value:l,onChange:e=>u(e.target.value),placeholder:`kimi-k3`,className:`font-mono`})}),(0,U.jsx)(y9,{label:`Models offered (comma-separated)`,children:(0,U.jsx)(go,{value:d,onChange:e=>f(e.target.value),placeholder:`kimi-k3, kimi-k2`,className:`font-mono`})}),(0,U.jsx)(y9,{label:`API key variable`,children:(0,U.jsx)(go,{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)(y9,{label:`Capabilities granted`,children:(0,U.jsx)(`div`,{className:`flex flex-wrap gap-3 py-1.5`,children:_9.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)(y9,{label:`MCP servers (names, comma-separated)`,children:(0,U.jsx)(go,{value:S,onChange:e=>C(e.target.value),placeholder:`deepwiki`,className:`font-mono`})})]}),(0,U.jsx)(y9,{label:`Instructions (optional)`,children:(0,U.jsx)(go,{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)(y9,{label:`Home directory (optional)`,children:(0,U.jsx)(go,{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)(y9,{label:`Config directory`,children:(0,U.jsx)(go,{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)(G,{onClick:()=>void A(),disabled:E,children:[E?(0,U.jsx)(DE,{className:`size-3.5 text-current`}):(0,U.jsx)(Cx,{className:`size-4`}),`Create profile`]})})]})}function Joe({open:e,onOpenChange:t,onCreated:n}){return(0,U.jsx)(gT,{open:e,onOpenChange:t,children:(0,U.jsxs)(_T,{size:`lg`,children:[(0,U.jsx)(vT,{title:`New profile`,description:`What a session runs as - a Claude config directory, or a model provider.`}),(0,U.jsx)(yT,{children:e?(0,U.jsx)(qoe,{onCreated:n}):null})]})})}function Yoe(){let e=jr(),t=bi({select:e=>e.location.pathname.match(/^\/profiles\/(.+)$/)?.[1]}),{profiles:n,canManage:r,refresh:i}=r9(),[a,o]=(0,v.useState)(!1),s=r?(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`New profile`,onClick:()=>o(!0),children:(0,U.jsx)(Cx,{className:`size-4`})}):void 0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(F7,{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)(I7,{children:[n.length===0?(0,U.jsx)(AE,{icon:(0,U.jsx)(yee,{}),title:r?`No profiles yet`:`No profiles`,description:r?(0,U.jsxs)(U.Fragment,{children:[`Add one with `,(0,U.jsx)(jE,{children:`+`}),` above.`]}):`This gateway declares none, and this login may not add them.`}):null,n.map(n=>(0,U.jsx)(L7,{active:n.name===t,onSelect:()=>void e({to:`/profiles/$profileName`,params:{profileName:n.name}}),title:n.name,status:n.managed?null:(0,U.jsx)(uo,{variant:`neutral`,className:`shrink-0`,children:`declared`}),description:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(O5,{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)(Joe,{open:a,onOpenChange:o,onCreated:t=>{o(!1),i(),e({to:`/profiles/$profileName`,params:{profileName:t}})}})]})}var Xoe=8;function b9(){return Array.from({length:Xoe},()=>({seed:crypto.randomUUID()}))}function Zoe({row:e,onClose:t,onChanged:n}){return(0,U.jsx)(gT,{open:e!==void 0,onOpenChange:e=>!e&&t(),children:(0,U.jsxs)(_T,{size:`sm`,children:[(0,U.jsx)(vT,{title:`Avatar for ${e?.info.agent?.name??`agent`}`}),(0,U.jsx)(yT,{children:e?(0,U.jsx)(Qoe,{row:e,onClose:t,onChanged:n},e.info.id):null})]})})}function Qoe({row:e,onClose:t,onChanged:n}){let r=e.info.agent,[i,a]=(0,v.useState)(b9),[o,s]=(0,v.useState)();(0,v.useEffect)(()=>{let t=x7(e.hostId);if(!t)return;let n=!0,o=[];for(let e of i)e.src||t.agentAvatarPreview(r.id,e.seed).then(t=>{let r=URL.createObjectURL(t);o.push(r),n&&a(t=>t.map(t=>t.seed===e.seed?{...t,src:r}:t))}).catch(()=>{});return()=>{n=!1;for(let e of o)URL.revokeObjectURL(e)}},[i.map(e=>e.seed).join(`,`),r.id,e.hostId]);let c=i=>{let a=x7(e.hostId);a&&(s(i),a.changeAgentAvatar(r.id,i).then(()=>{n(),t()}).catch(e=>{s(void 0),sE.error(Rk(e,`Could not change the avatar`))}))};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(`div`,{className:`grid grid-cols-4 gap-2`,children:i.map(e=>(0,U.jsx)(`button`,{type:`button`,disabled:o!==void 0,"aria-label":`Use this avatar`,onClick:()=>c(e.seed),className:W(`flex aspect-square items-center justify-center rounded-md border border-border bg-surface hover:border-accent`,o===e.seed&&`border-accent`),children:e.src?(0,U.jsx)(`img`,{src:e.src,alt:``,className:`size-14 [image-rendering:pixelated]`,draggable:!1}):(0,U.jsx)(DE,{className:`size-4 text-fg-4`})},e.seed))}),(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`Pick one. The agent can also change its own with change_avatar.`}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsxs)(G,{variant:`outline`,disabled:o!==void 0,onClick:()=>a(b9()),children:[(0,U.jsx)(kee,{}),`More`]}),(0,U.jsx)(G,{variant:`outline`,onClick:t,children:`Cancel`})]})]})}function $oe({sessions:e,target:t,onCreated:n}){let r=o9(`session`,t),i=()=>t.hostId===void 0?$7():x7(t.hostId),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(!1),{engine:d}=r,f=async e=>{let t=e?.cwd??r.cwd.trim();if(!t){sE.error(`Working directory is required`);return}o(!0);try{r.rememberCwd(t),n((await i().createSession({...r.sessionFields({prompt:e?void 0:r.prompt.trim()||void 0,resume:e?.sessionId,allowBypass:!0}),cwd:t})).id)}catch(e){sE.error(Rk(e,`Failed to create session`))}finally{o(!1)}},p=async()=>{if(!r.cwd.trim()){sE.error(`Set a working directory first - resumable sessions are listed per project`);return}u(!0);try{c(await i().listSdkSessions({dir:r.cwd.trim(),limit:20,profile:r.profile||void 0}))}catch(e){sE.error(Rk(e,`Failed to list resumable sessions`))}finally{u(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(c9,{form:r,sessions:e,promptLabel:`Initial prompt (optional)`,onProfileChange:()=>c(void 0),extras:(0,U.jsx)(s9,{form:r}),actions:(0,U.jsxs)(G,{className:`ml-auto`,onClick:()=>void f(),disabled:a,children:[a?(0,U.jsx)(DE,{className:`size-3.5 text-current`}):(0,U.jsx)(Cx,{className:`size-4`}),`Create`]})}),d.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)(G,{variant:`ghost`,size:`xs`,onClick:()=>void p(),disabled:l,children:[l?(0,U.jsx)(DE,{className:`size-3 text-current`}):(0,U.jsx)(Vx,{className:`size-3`}),s?`Reload`:`Browse`]})]}),s===void 0?null:s.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:s.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:NN(e.lastModified)})]})]}),(0,U.jsx)(G,{variant:`outline`,size:`xs`,onClick:()=>void f(e),disabled:a,children:`Resume`})]},e.sessionId))})]}):null]})}function ese({open:e,onOpenChange:t,sessions:n,target:r={},gatewayName:i,onCreated:a}){return(0,U.jsx)(gT,{open:e,onOpenChange:t,children:(0,U.jsxs)(_T,{size:`lg`,children:[(0,U.jsx)(vT,{title:i?`New session on ${i}`:`New session`,description:`Pick a directory and an engine.`}),(0,U.jsx)(yT,{children:(0,U.jsx)($oe,{sessions:n,target:r,onCreated:a},`${r.hostId??``}:${r.cwd??``}`)})]})})}function tse(){return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsx)(AE,{icon:(0,U.jsx)(l7,{}),title:`No session open`,description:`Pick one on the left, or start a new agent or session from the buttons above it.`})})}var x9=`none`,nse=wO/6e4;function rse({open:e,onOpenChange:t,sessions:n,leads:r,target:i={},gatewayName:a,onCreated:o,onOneOff:s}){return(0,U.jsx)(gT,{open:e,onOpenChange:t,children:(0,U.jsxs)(_T,{size:`lg`,children:[(0,U.jsx)(vT,{title:a?`New agent on ${a}`:`New agent`,description:`A named, long-lived session with an avatar and a standing brief that survives every new conversation.`}),(0,U.jsx)(yT,{children:(0,U.jsx)(ise,{sessions:n,leads:r,target:i,onCreated:o,onCancel:()=>t(!1),onOneOff:s},`${i.hostId??``}:${i.cwd??``}`)})]})})}function ise({sessions:e,leads:t,target:n,onCreated:r,onCancel:i,onOneOff:a}){let o=o9(`session`,n),{engine:s}=o,[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!0),[m,h]=(0,v.useState)(!0),[g,_]=(0,v.useState)(x9),[y,b]=(0,v.useState)(!1),x=c.trim(),S=async()=>{let e=o.sessionFields({prompt:o.prompt.trim()||void 0});if(s.capabilities.hostCwd!==!1&&!e.cwd){sE.error(`Project directory is required`);return}let t=n.hostId===void 0?$7():x7(n.hostId);if(t){b(!0);try{e.cwd&&o.rememberCwd(e.cwd);let n=await t.createAgent({name:x||void 0,config:{cwd:e.cwd,profile:e.profile,model:e.model,reasoningEffort:e.reasoningEffort,permissionMode:e.permissionMode,brief:u.trim()||void 0,agentContextReset:f?void 0:!1,sleepAfterMs:m?void 0:0},prompt:e.prompt,lead:g===x9?void 0:g});if(!n.session)throw Error(`The gateway created the agent without a session`);r(n.session.id)}catch(e){sE.error(Rk(e,`Failed to create the agent`))}finally{b(!1)}}};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 font-medium text-fg-3`,children:`Name`}),(0,U.jsx)(go,{value:c,onChange:e=>l(e.target.value),placeholder:`Leave empty for a suggested name`,spellCheck:!1})]}),(0,U.jsx)(l9,{form:o,sessions:e,label:`Project`}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(Q7,{profiles:o.profiles,value:o.profile,onChange:o.selectProfile,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)(z3,{variant:`form`,mode:s.mode,onModeChange:o.setMode,modes:s.modes,className:`min-w-44`})]}),(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)(Z7,{value:s.model,onChange:o.setModel,models:s.models,className:`min-w-40`})]}),(0,U.jsx)(u9,{form:o})]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Standing brief (optional, survives every new conversation)`}),(0,U.jsx)(_o,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:`e.g. You own the iOS client. Keep it in parity with protocol.`})]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`First prompt (optional)`}),(0,U.jsx)(_o,{value:o.prompt,onChange:e=>o.setPrompt(e.target.value),rows:2,placeholder:`Leave empty to start idle`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(S9,{checked:f,onChange:p,children:[`Manages its own context `,(0,U.jsx)(`span`,{className:`text-fg-4`,children:`(context_reset)`})]}),(0,U.jsxs)(S9,{checked:m,onChange:h,children:[`Sleeps when idle after `,nse,` min`]}),t.length?(0,U.jsxs)(`label`,{className:`flex items-center gap-2 text-body-sm text-fg-2`,children:[(0,U.jsx)(`span`,{children:`Join a team`}),(0,U.jsxs)(OC,{items:[{value:x9,label:`None`},...t.map(e=>({value:e.info.agent.id,label:e.info.agent.name}))],value:g,onValueChange:e=>_(String(e)),children:[(0,U.jsx)(jC,{className:`min-w-36`,children:(0,U.jsx)(kC,{})}),(0,U.jsxs)(MC,{children:[(0,U.jsx)(NC,{value:x9,children:(0,U.jsx)(AC,{children:`None`})}),t.map(e=>(0,U.jsx)(NC,{value:e.info.agent.id,children:(0,U.jsx)(AC,{children:e.info.agent.leads?`${e.info.agent.name} (team)`:e.info.agent.name})},e.info.agent.id))]})]})]}):null]}),(0,U.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 border-t border-border pt-3`,children:[(0,U.jsx)(G,{variant:`link`,size:`sm`,className:`px-0 text-fg-3`,onClick:()=>a({hostId:n.hostId,cwd:o.cwd.trim()||n.cwd}),children:`One-off session instead`}),(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(G,{variant:`outline`,onClick:i,children:`Cancel`}),(0,U.jsxs)(G,{onClick:()=>void S(),disabled:y,children:[y?(0,U.jsx)(DE,{className:`size-3.5 text-current`}):(0,U.jsx)(iC,{className:`size-4`}),x?`Create ${x}`:`Create agent`]})]})]})}function S9({checked:e,onChange:t,children:n}){return(0,U.jsxs)(`label`,{className:`flex w-fit cursor-pointer items-center gap-2 text-body-sm text-fg-2`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked),className:`size-3.5 accent-(--color-fg-1)`}),n]})}function C9(e,t,n){let r=n?.info.agent?.id,i=e.filter(e=>e.hostId===t&&e.info.id!==n?.info.id&&e.info.agent!==void 0&&e.info.agent.lead===void 0&&e.info.agent.id!==r);return[...i.filter(e=>e.info.agent?.leads),...i.filter(e=>!e.info.agent?.leads)]}function ase(e,t){let n=e.info.agent?.id;return n===void 0?[]:t.filter(t=>t.hostId===e.hostId&&t.info.agent?.lead===n)}function ose({row:e,rows:t,onAction:n}){let{info:r}=e,i=r.agent,a=i?.lead===void 0&&!i?.leads?C9(t,e.hostId,e):[],o=r.capabilities?.engineSleep&&r.status===`idle`&&!r.engineAsleep;return(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center`,onClick:w9,onDoubleClick:w9,children:[r.capabilities?.clearContext?(0,U.jsx)(E9,{label:`Clear context`,title:`Clear the conversation - the session keeps running and the old conversation stays resumable`,onClick:()=>n({kind:`clear`}),children:(0,U.jsx)(Yv,{className:`size-3 text-fg-3`})}):null,o?(0,U.jsx)(E9,{label:`Sleep session`,title:`Stop the engine process to free its memory - the session stays here and wakes on your next message`,onClick:()=>n({kind:`sleep`}),children:(0,U.jsx)(y_,{className:`size-3 text-fg-3`})}):null,(0,U.jsx)(E9,{label:`Close session`,title:i?`End this session; the agent stays and can start a new conversation`:`Close session`,onClick:()=>n({kind:`close`}),children:(0,U.jsx)(HS,{className:`size-3 text-fg-3`})}),(0,U.jsxs)(Hw,{children:[(0,U.jsx)(Uw,{render:(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":i?`Agent actions`:`Session actions`,title:i?`Agent actions`:`Session actions`,className:`size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100 data-popup-open:opacity-100`,children:(0,U.jsx)(qv,{className:`size-3.5 text-fg-3`})})}),(0,U.jsxs)(Ww,{children:[(0,U.jsx)(T9,{icon:(0,U.jsx)(px,{}),onClick:()=>n({kind:`rename`}),children:i?`Rename agent`:`Rename session`}),(0,U.jsx)(T9,{icon:(0,U.jsx)(jb,{}),onClick:()=>n({kind:`status`}),children:e.info.statusLabel?`Change status`:`Set status`}),i?.avatar?(0,U.jsx)(T9,{icon:(0,U.jsx)(Zv,{}),onClick:()=>n({kind:`avatar`}),children:`Change avatar`}):null,(0,U.jsx)(Kw,{}),i?null:(0,U.jsx)(T9,{icon:(0,U.jsx)(iC,{}),onClick:()=>n({kind:`adopt`}),children:`Make agent`}),a.length?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`px-2 pt-1.5 pb-1 text-label text-fg-4`,children:`Add to team`}),a.map(e=>(0,U.jsx)(T9,{icon:(0,U.jsx)(cC,{}),onClick:()=>n({kind:`join`,lead:e}),children:(0,U.jsxs)(`span`,{className:`truncate`,children:[`Join `,e.info.agent?.name]})},e.info.id))]}):null,i?.lead===void 0?null:(0,U.jsxs)(T9,{icon:(0,U.jsx)(_b,{}),onClick:()=>n({kind:`leave`}),children:[`Leave `,i.team??`team`]}),i?.leads?(0,U.jsx)(T9,{icon:(0,U.jsx)(eC,{}),onClick:()=>n({kind:`dissolve`}),children:`Dissolve team`}):null,i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T9,{icon:(0,U.jsx)(Ux,{}),onClick:()=>n({kind:`restart`}),children:`New conversation`}),(0,U.jsx)(Kw,{}),(0,U.jsx)(T9,{icon:(0,U.jsx)(nC,{}),destructive:!0,onClick:()=>n({kind:`retire`}),children:`Retire agent…`})]}):null]})]})]})}function w9(e){e.stopPropagation()}function T9({icon:e,destructive:t,onClick:n,children:r}){return(0,U.jsxs)(Gw,{destructive:t,onClick:n,className:`[&_svg]:size-3.5 [&_svg]:shrink-0`,children:[(0,U.jsx)(`span`,{className:W(`flex`,t?`text-danger`:`text-fg-3`),children:e}),r]})}function E9({label:e,title:t,onClick:n,children:r}){return(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":e,title:t,className:`size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,onClick:()=>n(),children:r})}var sse=6e4,D9={},O9=new Set,k9=new Map,A9=new Set;function cse(e){return A9.add(e),()=>A9.delete(e)}function lse(){return D9}function j9(e){return(0,v.useEffect)(()=>{for(let t of e){let e=t.info.agent;e?.avatar!==void 0&&use(t.hostId,e.id,e.avatar)}},[e]),(0,v.useSyncExternalStore)(cse,lse)}function use(e,t,n){if(D9[n]||O9.has(n)||Date.now()-(k9.get(n)??-1/0)<sse)return;let r=x7(e);r&&(O9.add(n),(async()=>{try{let e=await r.agentAvatar(t),i=await r.agentAvatar(t,!0).catch(()=>void 0),a={still:URL.createObjectURL(e.blob)};i?.durations&&(a.busy={src:URL.createObjectURL(i.blob),durations:i.durations}),k9.delete(n),D9={...D9,[n]:a};for(let e of A9)e()}catch{k9.set(n,Date.now())}finally{O9.delete(n)}})())}var M9=`workerdeck.view-config`;function dse(){let[e,t]=(0,v.useState)(()=>({...RO(S(M9,{})),search:``,scoped:!1}));return[e,(0,v.useCallback)(e=>{t(e),C(M9,e)},[])]}function fse(){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}=Y7(),o=X7(i),s=CM(o,x7),c=j9(o),l=i.filter(e=>e.error!==void 0),u=S7(),[d,f]=dse(),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(),[b,x]=(0,v.useState)(),[S,C]=(0,v.useState)(),[w,T]=(0,v.useState)(),[E,D]=(0,v.useState)({}),O=e=>{D(e),g(!1),m(!0)},k=e=>{D(e),m(!1),g(!0)},A=E.hostId??u?.id,j=i.find(e=>e.host.id===A)?.sessions??[],M=E.hostId&&i.length>1?soe(E.hostId)?.name:void 0,N=t=>{A&&e({to:`/sessions/$hostId/$sessionId`,params:{hostId:A,sessionId:t},search:{}})},[P,F]=(0,v.useState)(voe),I=(0,v.useMemo)(()=>$O(o,d),[o,d]),L=t=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{}}),R=(0,v.useRef)(0),z=(t,n)=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{subagent:n,sn:++R.current}}),ee=(0,v.useRef)(0),te=(t,n)=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{shell:n,shn:++ee.current}}),B=(e,t)=>{x7(e.hostId)?.killShell(e.info.id,t).then(()=>a()).catch(e=>sE.error(Rk(e,`Kill failed`)))},ne=(e,t,n)=>{x7(e.hostId)?.setShellAgentWrite(e.info.id,t,n).then(()=>a()).catch(e=>sE.error(Rk(e,n?`Grant failed`:`Revoke failed`)))},re=(e,t)=>{x7(e.hostId)?.updateSession(e.info.id,{title:t||null}).then(()=>a()).catch(e=>sE.error(Rk(e,`Rename failed`)))},V=(e,t)=>{let n=e.info.agent;n&&t&&ae(e,`Rename failed`,e=>e.updateAgent(n.id,{name:t}))},ie=async e=>{let t=x7(e.row.hostId);if(!t)return;let n=e.lead?.info.agent?.id??null,r=e.row.info.agent?.id;try{if(r)await t.updateAgent(r,n?{lead:n,...e.order===void 0?{}:{order:e.order}}:{lead:null});else if(n){let r=await t.createAgent({adopt:e.row.info.id,lead:n});e.order!==void 0&&await t.updateAgent(r.agent.id,{order:e.order})}for(let n of e.siblings??[]){let e=n.row.info.agent?.id;e&&await t.updateAgent(e,{order:n.order})}}catch(e){throw Error(Rk(e,n?`Could not join the team`:`Could not leave the team`),{cause:e})}finally{a()}},ae=(e,t,n)=>{let r=x7(e.hostId);r&&n(r).then(()=>a()).catch(e=>sE.error(Rk(e,t)))},H=e=>{let t=x7(e.hostId);if(!t)return;let n=t.attach(e.info.id,{reconnect:!1}),r=setTimeout(()=>{n.detach(),sE.error(`Clear failed - the gateway did not answer`)},5e3);n.on(`attached`,()=>{n.clearContext(),setTimeout(()=>{clearTimeout(r),n.detach(),sE.success(`Context cleared - the previous conversation stays resumable`),a()},150)})},oe=(e,n)=>{let r=e.info.agent;switch(n.kind){case`rename`:y(e);break;case`status`:x(e);break;case`avatar`:C(e);break;case`clear`:H(e);break;case`sleep`:ae(e,`Sleep failed`,t=>t.sleepSession(e.info.id));break;case`close`:ae(e,`Delete failed`,t=>t.deleteSession(e.info.id));break;case`adopt`:ae(e,`Could not make an agent`,t=>t.createAgent({adopt:e.info.id}));break;case`join`:{let t=n.lead.info.agent?.id;ae(e,`Could not join the team`,n=>r?n.updateAgent(r.id,{lead:t}):n.createAgent({adopt:e.info.id,lead:t}));break}case`leave`:r&&ae(e,`Could not leave the team`,e=>e.updateAgent(r.id,{lead:null}));break;case`dissolve`:{let t=ase(e,o);ae(e,`Could not dissolve the team`,async e=>{for(let n of t)await e.updateAgent(n.info.agent.id,{lead:null})});break}case`restart`:r&&ae(e,`Could not restart the agent`,async n=>{let i=await n.restartAgent(r.id);i.session&&e.info.id===t&&L({...e,info:i.session})});break;case`retire`:T(e)}},se=()=>{let e=!P;F(e),yoe(e),!e&&d.search&&f({...d,search:``})},ce=(e,t)=>{x7(e.hostId)?.stopTask(e.info.id,t).then(()=>a()).catch(e=>sE.error(Rk(e,`Stop failed`)))},le=(0,v.useRef)(0),ue=(t,n)=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:n.toolUseId?{reveal:n.toolUseId,rn:++le.current}:{}}),de=(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`New agent`,title:`New agent`,onClick:()=>k({}),children:(0,U.jsx)(iC,{className:`size-4`})}),fe=(0,U.jsxs)(`span`,{className:`flex items-center`,children:[de,(0,U.jsxs)(Hw,{children:[(0,U.jsx)(Uw,{render:(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`More ways to start`,title:`New session or agent`,className:`w-4`,children:(0,U.jsx)(av,{className:`size-3`})})}),(0,U.jsxs)(Ww,{children:[(0,U.jsxs)(Gw,{onClick:()=>k({}),children:[(0,U.jsx)(iC,{className:`size-3.5 text-fg-3`}),` New agent`]}),(0,U.jsxs)(Gw,{onClick:()=>O({}),children:[(0,U.jsx)(Cx,{className:`size-3.5 text-fg-3`}),` New one-off session`]})]})]})]});return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(F7,{section:`sessions`,title:`Sessions`,railActions:de,actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":P?`Hide search`:`Search sessions`,"aria-pressed":P,onClick:se,children:(0,U.jsx)(aS,{className:W(`size-3.5`,P&&`text-fg-1`)})}),(0,U.jsx)(Dae,{config:d,onConfigChange:f,rows:o}),(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh`,onClick:()=>void a(),children:(0,U.jsx)(Lx,{className:`size-3.5`})}),fe]}),rail:I.map(e=>(0,U.jsxs)(`button`,{type:`button`,title:`${VO(e.info)} - ${e.state}`,"aria-label":VO(e.info),onClick:()=>L(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)(O5,{engine:e.adapter,model:e.info.model,className:`size-4`}),(0,U.jsx)(k5,{row:e})]},e.info.id)),children:[l.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)(I7,{children:(0,U.jsx)(Jae,{rows:o,config:d,onConfigChange:f,showControls:!1,showSearch:P,autoFocusSearch:!0,projectIcons:s,activeId:t,activeSubagentId:n,activeShellId:r,onSelect:L,onSelectSubagent:z,onSelectTask:ue,onStopTask:ce,onSelectShell:te,onKillShell:B,onShellAgentWrite:ne,onCreateInGroup:O,onRename:re,onRenameAgent:V,onTeamMove:ie,avatars:c,rowActions:e=>(0,U.jsx)(ose,{row:e,rows:o,onAction:t=>oe(e,t)}),emptyState:(0,U.jsx)(AE,{icon:(0,U.jsx)(tb,{}),title:`No sessions yet`,description:(0,U.jsx)(U.Fragment,{children:`Start an agent or a session from the buttons above.`})})})})]}),(0,U.jsx)(ese,{open:p,onOpenChange:m,sessions:j,target:E,gatewayName:M,onCreated:e=>{m(!1),N(e),a()}}),(0,U.jsx)(rse,{open:h,onOpenChange:g,sessions:j,leads:C9(o,A),target:E,gatewayName:M,onCreated:e=>{g(!1),N(e),a()},onOneOff:e=>O({hostId:e.hostId,cwd:e.cwd})}),(0,U.jsx)(Zoe,{row:S,onClose:()=>C(void 0),onChanged:()=>void a()}),(0,U.jsx)(hse,{row:b,onClose:()=>x(void 0),onSave:(e,t)=>ae(e,`Could not set the status`,n=>n.updateSession(e.info.id,{statusLabel:t}))}),(0,U.jsx)(pse,{row:_,onClose:()=>y(void 0),onRename:(e,t)=>e.info.agent?V(e,t):re(e,t)}),(0,U.jsx)(nw,{open:w!==void 0,onOpenChange:e=>!e&&T(void 0),children:(0,U.jsxs)(aw,{children:[(0,U.jsxs)(ow,{children:[`Retire `,w?.info.agent?.name??`this agent`,`?`]}),(0,U.jsxs)(sw,{children:[`The agent and its session end. `,w?.info.agent?.leads?`Its members are released and stay as agents. `:``,`Past conversations stay resumable from the engine's store.`]}),(0,U.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,U.jsx)(iw,{render:(0,U.jsx)(G,{variant:`outline`,children:`Cancel`})}),(0,U.jsx)(G,{variant:`destructive`,onClick:()=>{let e=w,t=e?.info.agent;T(void 0),e&&t&&ae(e,`Could not retire the agent`,e=>e.retireAgent(t.id))},children:`Retire`})]})]})})]})}function pse({row:e,onClose:t,onRename:n}){return(0,U.jsx)(gT,{open:e!==void 0,onOpenChange:e=>!e&&t(),children:(0,U.jsxs)(_T,{size:`sm`,children:[(0,U.jsx)(vT,{title:e?.info.agent?`Rename agent`:`Rename session`}),(0,U.jsx)(yT,{children:e?(0,U.jsx)(mse,{row:e,onClose:t,onRename:n},e.info.id):null})]})})}function mse({row:e,onClose:t,onRename:n}){let r=e.info.agent,[i,a]=(0,v.useState)(r?r.name:e.info.title??``),o=i.trim(),s=()=>{(!r||o)&&(n(e,o),t())};return(0,U.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),s()},children:[(0,U.jsx)(go,{autoFocus:!0,value:i,onChange:e=>a(e.target.value),placeholder:r?`Agent name`:`Session name`,spellCheck:!1}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{variant:`outline`,onClick:t,children:`Cancel`}),(0,U.jsx)(G,{type:`submit`,disabled:r!==void 0&&!o,children:`Rename`})]})]})}function hse({row:e,onClose:t,onSave:n}){return(0,U.jsx)(gT,{open:e!==void 0,onOpenChange:e=>!e&&t(),children:(0,U.jsxs)(_T,{size:`sm`,children:[(0,U.jsx)(vT,{title:`Status`}),(0,U.jsx)(yT,{children:e?(0,U.jsx)(gse,{row:e,onClose:t,onSave:n},e.info.id):null})]})})}function gse({row:e,onClose:t,onSave:n}){let[r,i]=(0,v.useState)(e.info.statusLabel?.emoji??``),[a,o]=(0,v.useState)(e.info.statusLabel?.text??``),s=r=>{n(e,r),t()};return(0,U.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),s(a.trim()?{text:a.trim(),...r.trim()?{emoji:r.trim()}:{}}:null)},children:[(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(go,{value:r,onChange:e=>i(e.target.value),placeholder:`🙂`,"aria-label":`Emoji`,maxLength:16,className:`w-12 text-center`}),(0,U.jsx)(go,{autoFocus:!0,value:a,onChange:e=>o(e.target.value),placeholder:`What is this session doing?`,"aria-label":`Status`,maxLength:80,spellCheck:!1})]}),(0,U.jsx)(`p`,{className:`text-label text-fg-4`,children:`Shown under the name in the session list. The agent can change it with set_status.`}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[e.info.statusLabel?(0,U.jsx)(G,{variant:`outline`,onClick:()=>s(null),children:`Clear`}):null,(0,U.jsx)(G,{variant:`outline`,onClick:t,children:`Cancel`}),(0,U.jsx)(G,{type:`submit`,children:`Save`})]})]})}function _se(){let{snapshots:e}=Y7(),t=Soe(X7(e));(0,v.useEffect)(()=>{document.title=t>0?`(${t}) workerdeck`:`workerdeck`},[t])}var N9=[{id:`sessions`,label:`Sessions`,icon:ES,path:`/sessions`,sidebar:fse},{id:`gateways`,label:`Gateways`,icon:xx,path:`/gateways`,sidebar:koe},{id:`jobs`,label:`Jobs`,icon:lb,path:`/jobs`,sidebar:Goe},{id:`profiles`,label:`Profiles`,icon:oC,path:`/profiles`,sidebar:Yoe}],P9=`workerdeck.sidebar-collapsed`;function vse({children:e}){_se();let t=bi({select:e=>e.location.pathname}),n=[...N9].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(P9)===`1`),c=()=>{s(e=>(x(P9,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)(l7,{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:N9.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)(lS,{className:`size-4`})}),(0,U.jsx)(Y5,{}),(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)(ax,{className:`size-4`}):(0,U.jsx)(rx,{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)(ioe,{open:i,onOpenChange:a})]})}function F9({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 I9({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 L9({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 yse(){let{hostId:e}=kr({from:`/gateways/$hostId`}),t=jr(),{hosts:n,ready:r}=D7(),{snapshots:i}=Y7(),[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)(F9,{crumbs:[{label:`Gateways`,to:`/gateways`},{label:s.name}],actions:s.implicit?null:(0,U.jsxs)(G,{variant:`outline`,size:`xs`,onClick:()=>o(!0),children:[(0,U.jsx)(HS,{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)(I9,{children:[(0,U.jsxs)(fo,{children:[(0,U.jsx)(po,{children:(0,U.jsx)(mo,{children:`Connection`})}),(0,U.jsxs)(ho,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsx)(L9,{label:`Status`,children:l===`ok`?(0,U.jsx)(uo,{variant:`success`,dot:!0,children:`Connected`}):l===`error`?(0,U.jsx)(uo,{variant:`danger`,dot:!0,children:`Unreachable`}):(0,U.jsx)(uo,{variant:`neutral`,dot:!0,children:`Connecting…`})}),c?.error?(0,U.jsx)(L9,{label:`Last error`,children:(0,U.jsx)(`span`,{className:`text-danger`,children:c.error})}):null,(0,U.jsx)(L9,{label:`Live sessions`,children:c?c.sessions.length:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`-`})}),(0,U.jsx)(L9,{label:`Reachability`,children:C7(s)?`This machine (loopback)`:`Remote`}),(0,U.jsx)(L9,{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)(fo,{children:[(0,U.jsx)(po,{children:(0,U.jsx)(mo,{children:`Settings`})}),(0,U.jsx)(ho,{children:(0,U.jsx)(k7,{host:s,onSaved:e=>sE.success(`Saved ${e.name}`)},s.id)})]}),a?(0,U.jsx)(j7,{host:s,onClose:()=>o(!1),onRemoved:()=>{o(!1),t({to:`/gateways`})}}):null]})]})}function bse(){return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsx)(AE,{icon:(0,U.jsx)(xx,{}),title:`No gateway selected`,description:(0,U.jsxs)(U.Fragment,{children:[`Pick one on the left, or add one with `,(0,U.jsx)(jE,{children:`+`}),` above.`]})})})}function xse({files:e,activePath:t,onActivate:n,onClose:r,className:i}){return(0,U.jsx)(HT,{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)(Sse,{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 Sse({file:e,active:t,onActivate:n,onClose:r,onArrow:i}){let a=GM(e),o=(0,v.useRef)(null);return(0,v.useEffect)(()=>{t&&o.current?.scrollIntoView({block:`nearest`,inline:`nearest`})},[t]),(0,U.jsxs)(WT,{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:jN(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)(wC,{className:`size-3`})}),a?(0,U.jsx)(`span`,{className:`hidden group-hover:block`,children:(0,U.jsx)(wC,{className:`size-3`})}):null]})]})}var R9=12;function Cse({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)(aS,{className:`absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4`}),(0,U.jsx)(go,{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)(wC,{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)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh the file tree`,onClick:()=>e.refresh(),children:(0,U.jsx)(Lx,{className:`size-3.5 text-fg-3`})}),i?(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Hide project files`,onClick:i,children:(0,U.jsx)(rx,{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)(DE,{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)(z9,{label:wse(e.relative),detail:Tse(e.relative),title:e.relative,icon:(0,U.jsx)(sy,{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)(DE,{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)(z9,{label:t.entry.name,indent:t.depth,active:t.entry.path===n,icon:t.entry.type===`dir`?t.loading?(0,U.jsx)(DE,{className:`size-3.5 shrink-0 text-fg-4`}):t.expanded?(0,U.jsx)(hy,{className:`size-3.5 shrink-0 text-accent`}):(0,U.jsx)(xy,{className:`size-3.5 shrink-0 text-accent`}):(0,U.jsx)(f3,{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)*R9+22},children:`More entries than the server will return - use search.`}):null]},t.entry.path))})})]})}function z9({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*R9+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 wse(e){return e.slice(e.lastIndexOf(`/`)+1)}function Tse(e){let t=e.lastIndexOf(`/`);return t===-1?void 0:e.slice(0,t)}function Ese({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=Dse(),f=(0,v.useRef)({onChange:n,onSave:r});return f.current={onChange:n,onSave:r},(0,v.useEffect)(()=>{let n=!1;return Ose().then(r=>{if(n||!o.current)return;c.current=r;let a=r.editor.create(o.current,{value:t,language:H9(e),readOnly:i,automaticLayout:!0,theme:B9(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,H9(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(B9(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)(DE,{className:`size-4 text-fg-4`})})]})}function Dse(){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 B9(e){return e===`light`?`wd-light`:`wd-dark`}var V9;function Ose(){return V9??=(async()=>{let e=await tN(()=>import(`./vs--sdmWUZx.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})(),V9}function H9(e){let t=e.slice(e.lastIndexOf(`/`)+1);return kse[t.toLowerCase()]||(Ase[t.slice(t.lastIndexOf(`.`)+1).toLowerCase()]??`plaintext`)}var kse={dockerfile:`dockerfile`,makefile:`plaintext`,".gitignore":`plaintext`,".env":`shell`},Ase={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 jse({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)(KS,{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)(G,{variant:`outline`,size:`xs`,onClick:()=>a?.(e.path),children:`Use the version on disk`}),(0,U.jsx)(G,{variant:`outline`,size:`xs`,onClick:()=>o?.(e.path),children:`Keep mine`}),(0,U.jsx)(G,{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)(KS,{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)(G,{variant:`ghost`,size:`xs`,onClick:()=>s?.(e.path),children:`Dismiss`})]}):null,e.status===`loading`?(0,U.jsx)(U9,{children:(0,U.jsx)(DE,{className:`size-4 text-fg-4`})}):e.status===`error`?(0,U.jsxs)(U9,{children:[(0,U.jsx)(KS,{className:`size-4 text-danger`}),(0,U.jsx)(`p`,{className:`text-body-sm text-danger`,children:e.error})]}):e.status===`binary`?(0,U.jsxs)(U9,{children:[(0,U.jsx)(ry,{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)(Ese,{path:e.path,value:KM(e),readOnly:!t,onChange:n?t=>n(e.path,t):void 0,onSave:r?()=>r(e.path):void 0}),e.status===`ready`&&(e.saving||GM(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)(DE,{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)(G,{variant:`ghost`,size:`xs`,onClick:()=>i?.(e.path),children:`Revert`}),(0,U.jsxs)(G,{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 U9({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 Mse=180,Nse=520,Pse=220,W9=120;function G9({client:e,sessionId:t,header:n,transcriptVariant:r,transcriptFont:i,affordances: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}=WM(e,t),j=A?.cwd,M=hM(e,j),N=pM(e,j),P=ZM(e),{canWrite:F}=mM(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=Ise(),[L,R]=(0,v.useState)(D??!1),[z,ee]=(0,v.useState)(E),te=(0,v.useRef)(O);te.current=O,(0,v.useEffect)(()=>{te.current?.({width:z,collapsed:L})},[z,L]);let[B,ne]=(0,v.useState)(360),re=P.files.length>0,V=!I,ie=M.available&&!L;(0,v.useEffect)(()=>{V&&R(!0)},[V]);let ae=(0,v.useCallback)(e=>{let t=P.files.find(t=>t.path===e);if(t&&GM(t)){let e=t.name;if(!window.confirm(`${e} has unsaved changes. Close it and lose them?`))return}P.close(e)},[P]),H=(0,v.useRef)(null),oe=Fse(H);yae({container:H,onOpen:(0,v.useCallback)(({path:e})=>P.open(bae(e,j)),[P.open,j]),enabled:M.available,ignore:`.monaco-editor, .xterm`});let se=Math.max(W9,oe-Pse),[ce,le]=(0,v.useState)(null),ue=n===void 0||ce===null?void 0:typeof n==`function`?e=>(0,Td.createPortal)(n(e),ce):(0,Td.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:[ie?(0,U.jsx)(Cse,{tree:M,search:N,activePath:P.activePath,onOpenFile:P.open,onCollapse:()=>R(!0),style:{width:V?Math.min(z,320):z},className:W(`shrink-0 border-r border-border`,V&&`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)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Show project files`,onClick:()=>R(!1),children:(0,U.jsx)(ax,{className:`size-4 text-fg-3`})})}):null,ie&&!V?(0,U.jsx)(kE,{orientation:`vertical`,value:z,onValueChange:ee,min:Mse,max:Nse,defaultValue:E,"aria-label":`Resize the file tree`}):null,(0,U.jsxs)(`div`,{ref:H,className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[re?(0,U.jsxs)(`div`,{className:`flex min-h-0 shrink-0 flex-col overflow-hidden`,style:{height:Math.min(B,se||B)},children:[(0,U.jsx)(xse,{files:P.files,activePath:P.activePath,onActivate:P.activate,onClose:ae}),(0,U.jsx)(jse,{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,re?(0,U.jsx)(kE,{orientation:`horizontal`,value:Math.min(B,se||B),onValueChange:ne,min:W9,max:se,"aria-label":`Resize the open file`}):null,(0,U.jsx)(lae,{client:e,sessionId:t,header:ue,transcriptVariant:r,transcriptFont:i,affordances: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`})]}),V&&ie?(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 Fse(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 Ise(){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 K9=`workerdeck.rail`,Lse={width:260,collapsed:!1};function q9(){let e=S(K9,{});return{width:Math.min(520,Math.max(180,Number(e.width)||Lse.width)),collapsed:e.collapsed===!0}}function J9(e){C(K9,e)}function Rse(){let{jobId:e}=kr({from:`/jobs/$jobId`}),t=jr(),{jobs:n,refresh:r}=h9(),{snapshots:i}=Y7(),a=n.find(t=>t.id===e),o=$7(),s=S7()?.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&&(sE.error(`That job is no longer in the queue`),t({to:`/jobs`}))},[l,a,t]);let[d]=(0,v.useState)(Q5),[f]=(0,v.useState)(e7),[p]=(0,v.useState)(o7),[m]=(0,v.useState)(n7),[h]=(0,v.useState)(q9);if(!a)return null;let g=(0,U.jsx)(Y9,{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)(G9,{client:o,sessionId:a.sessionId,readOnly:!0,transcriptVariant:d,transcriptFont:f,affordances:{labels:p===`labeled`},fontSize:m,scrubber:!0,stickyPrompt:!0,statusPlacement:`bottom`,defaultRailWidth:h.width,defaultRailCollapsed:h.collapsed,onRailChange:J9,header:({actions:e})=>(0,U.jsx)(Y9,{job:a,onChanged:()=>void r(),actions:e})},a.sessionId)}function Y9({job:e,onChanged:t,actions:n}){let r=g9[e.status],i=e.status===`queued`||e.status===`running`||e.status===`parked`,a=async()=>{try{await $7().cancelJob(e.id),t()}catch(e){sE.error(Rk(e,`Cancel failed`))}};return(0,U.jsxs)(F9,{crumbs:[{label:`Jobs`,to:`/jobs`},{label:e.prompt}],actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(uo,{variant:`neutral`,className:`shrink-0`,children:`read-only`}),(0,U.jsx)(EE,{value:e.id,"aria-label":`Copy job id`}),i?(0,U.jsxs)(G,{variant:`outline`,size:`xs`,onClick:()=>void a(),children:[(0,U.jsx)(wC,{className:`size-3`}),`Cancel`]}):null,n]}),children:[(0,U.jsxs)(uo,{variant:r.variant,dot:!r.busy,className:`shrink-0`,children:[r.busy?(0,U.jsx)(DE,{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:NN(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:[AN(e.usage.tokens),` tok`]}):null,(e.usage.costUsd??e.usage.totalCostUsd)>0?(0,U.jsx)(`span`,{className:`shrink-0`,children:ON(e.usage.costUsd??e.usage.totalCostUsd)}):null,e.error?(0,U.jsx)(`span`,{className:`truncate text-danger`,children:e.error}):null]})]})}function X9({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=e9(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:v9(d).length>0?v9(d):void 0},i.session={capabilities:p,mcpServers:v9(h).length>0?v9(h):void 0,instructions:_.trim()||void 0}),x(!0);try{t(await $7().updateProfile(e.name,i)),sE.success(`Profile saved`)}catch(e){sE.error(Rk(e,`Failed to save profile`))}finally{x(!1)}};return(0,U.jsxs)(fo,{children:[(0,U.jsx)(po,{children:(0,U.jsx)(mo,{children:`Edit profile`})}),(0,U.jsxs)(ho,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(y9,{label:`Description`,children:(0,U.jsx)(go,{value:r,onChange:e=>i(e.target.value)})}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,U.jsx)(y9,{label:`Default model`,children:C.length>1?(0,U.jsx)(Z7,{value:a,onChange:o,models:C}):(0,U.jsx)(go,{value:a,onChange:e=>o(e.target.value),placeholder:`unset - request / engine default`,className:`font-mono`})}),(0,U.jsx)(y9,{label:`Default permission mode`,children:(0,U.jsx)(z3,{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)(y9,{label:`Default model id`,children:(0,U.jsx)(go,{value:l,onChange:e=>u(e.target.value),className:`font-mono`})}),(0,U.jsx)(y9,{label:`Models offered (comma-separated)`,children:(0,U.jsx)(go,{value:d,onChange:e=>f(e.target.value),className:`font-mono`})})]}),(0,U.jsx)(y9,{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`]}),_9.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)(y9,{label:`MCP servers (names, comma-separated)`,children:(0,U.jsx)(go,{value:h,onChange:e=>g(e.target.value),className:`font-mono`})}),(0,U.jsx)(y9,{label:`Instructions`,children:(0,U.jsx)(go,{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)(G,{onClick:()=>void w(),disabled:b,children:[b?(0,U.jsx)(DE,{className:`size-3.5 text-current`}):(0,U.jsx)(Zx,{className:`size-4`}),`Save`]})]})]})]})}function zse(e){window.location.href=`vscode://file${e}`}function Bse(){return(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,U.jsx)(AE,{icon:(0,U.jsx)(oC,{}),title:`No profile selected`,description:`A profile is what a session runs as - its config directory and credentials, or a model provider.`})})}function Z9({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)(uo,{variant:`neutral`,children:e},e))})}function Vse(){let{profileName:e}=kr({from:`/profiles/$profileName`}),t=jr(),{refresh:n}=r9(),{ready:r}=D7(),i=uM(async()=>$7()?.getProfile(e),[e,r],{enabled:r,pollMs:6e4}),a=i.data,o=i.error===void 0?void 0:Rk(i.error,`Failed to load profile`),s=a?.profile,c=a?.config,l=(0,v.useMemo)(()=>SA(s?.usage),[s?.usage]),u=async()=>{try{await $7().deleteProfile(e),await n(),sE.success(`Profile '${e}' deleted`),t({to:`/profiles`})}catch(e){sE.error(Rk(e,`Delete failed`))}};return(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsx)(F9,{crumbs:[{label:`Profiles`,to:`/profiles`},{label:e}],actions:(0,U.jsxs)(U.Fragment,{children:[s?.configDir?(0,U.jsxs)(G,{variant:`outline`,size:`xs`,onClick:()=>zse(s.configDir),children:[(0,U.jsx)(Cv,{className:`size-3`}),`Open in VSCode`]}):null,s?.managed?(0,U.jsxs)(G,{variant:`outline`,size:`xs`,onClick:()=>void u(),children:[(0,U.jsx)(HS,{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)(I9,{children:[o?(0,U.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:o}):null,!a&&!o?(0,U.jsx)(DE,{className:`mx-auto size-5 text-fg-4`}):null,s&&c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(fo,{children:[(0,U.jsx)(po,{children:(0,U.jsx)(mo,{children:`Worker defaults`})}),(0,U.jsxs)(ho,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsx)(L9,{label:`Engine`,children:(0,U.jsx)(uo,{variant:`neutral`,children:s.engine??`claude`})}),s.engine===`provider`?(0,U.jsx)(L9,{label:`Provider`,children:(0,U.jsx)(`span`,{className:`font-mono text-label`,children:s.provider?.id})}):(0,U.jsx)(L9,{label:`Config directory`,children:(0,U.jsx)(`span`,{className:`font-mono text-label`,children:s.configDir})}),(0,U.jsx)(L9,{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)(L9,{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)(L9,{label:`Models offered`,children:(0,U.jsx)(Z9,{items:s.provider?.models??[],empty:`the default model only`})}),(0,U.jsx)(L9,{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)(fo,{children:[(0,U.jsx)(po,{children:(0,U.jsx)(mo,{children:`Plan usage`})}),(0,U.jsx)(ho,{children:(0,U.jsx)(v5,{windows:l})})]}):null,s.engine===`provider`?(0,U.jsxs)(fo,{children:[(0,U.jsx)(po,{children:(0,U.jsx)(mo,{children:`Session grants`})}),(0,U.jsxs)(ho,{className:`flex flex-col divide-y divide-border`,children:[(0,U.jsx)(L9,{label:`Capabilities`,children:(0,U.jsx)(Z9,{items:s.session?.capabilities??[],empty:`not declared - whatever the server wired`})}),(0,U.jsx)(L9,{label:`MCP servers`,children:(0,U.jsx)(Z9,{items:s.session?.mcpServers??[],empty:`not declared - every connected server`})}),(0,U.jsx)(L9,{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)(fo,{children:[(0,U.jsx)(po,{children:(0,U.jsx)(mo,{children:`Claude Code configuration`})}),(0,U.jsxs)(ho,{className:`flex flex-col divide-y divide-border`,children:[c.settings?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(L9,{label:`Model (settings.json)`,children:c.settings.model??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`not set`})}),(0,U.jsx)(L9,{label:`Default permission mode`,children:c.settings.defaultPermissionMode??(0,U.jsx)(`span`,{className:`text-fg-4`,children:`not set`})}),(0,U.jsx)(L9,{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)(L9,{label:`Env vars (names only)`,children:(0,U.jsx)(Z9,{items:c.settings.envKeys??[],empty:`none`})}),(0,U.jsx)(L9,{label:`Hooks`,children:(0,U.jsx)(Z9,{items:c.settings.hooks??[],empty:`none`})})]}):(0,U.jsx)(L9,{label:`settings.json`,children:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`not found`})}),(0,U.jsx)(L9,{label:`User memory (CLAUDE.md / AGENTS.md)`,children:c.hasUserMemory?`present`:(0,U.jsx)(`span`,{className:`text-fg-4`,children:`none`})}),(0,U.jsx)(L9,{label:`Skills`,children:(0,U.jsx)(Z9,{items:c.skills,empty:`none`})}),(0,U.jsx)(L9,{label:`Agents`,children:(0,U.jsx)(Z9,{items:c.agents,empty:`none`})}),(0,U.jsx)(L9,{label:`Commands`,children:(0,U.jsx)(Z9,{items:c.commands,empty:`none`})})]})]}),s.managed?(0,U.jsx)(X9,{profile:s,onSaved:e=>i.setData({...a,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]})]})}function Hse(){let{hostId:e,sessionId:t}=kr({from:`/sessions/$hostId/$sessionId`}),{ready:n}=D7(),r=jr(),i=x7(e);return(0,v.useEffect)(()=>{n&&!i&&(sE.error(`That gateway is not configured here`),r({to:`/sessions`}))},[n,i,r]),i?(0,U.jsx)(Use,{hostId:e,sessionId:t,client:i},`${e}:${t}`):null}function Use({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}=WM(n,t),f=xoe(e,t),{bookmarks:p,toggle:m}=VM(`${e}:${t}`),[h]=(0,v.useState)(()=>i7()===`on`?boe(e,t):void 0),[g]=(0,v.useState)(Q5),[_]=(0,v.useState)(e7),[y]=(0,v.useState)(o7),[b]=(0,v.useState)(n7),[x]=(0,v.useState)(q9);(0,v.useEffect)(()=>{d&&(sE.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}=Y7(),T=X7(w),E=T.find(n=>n.hostId===e&&n.info.id===t&&n.info.agent),D=j9(T),O=(0,v.useMemo)(()=>w.find(t=>t.host.id===e)?.sessions.find(e=>e.id===t),[w,e,t]);(0,v.useEffect)(()=>{O&&S&&f({activity:O.activityCount,prose:O.proseCount,turns:O.numTurns})},[O?.activityCount,O?.proseCount,O?.numTurns,S,f]);let k=async()=>{try{await n.deleteSession(t)}catch{}r({to:`/sessions`})},A=u?.cwd?.split(`/`).filter(Boolean).pop();return(0,U.jsx)(G9,{client:n,sessionId:t,transcriptVariant:g,transcriptFont:_,affordances:{labels:y===`labeled`},fontSize:b,openSubagent:i?{toolUseId:i,nonce:a??0}:void 0,reveal:o?{toolUseId:o,nonce:s??0}:void 0,subagents:O?.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:O?.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:J9,unseen:h,onVitals:e=>{f({itemCount:e.itemCount}),Doe()},header:({actions:e})=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border bg-surface px-3 py-2`,children:[E?(0,U.jsx)(wae,{row:E,image:A5(D,E.info.agent),className:`shrink-0`}):(0,U.jsx)(`span`,{className:`truncate text-body-sm font-medium text-fg-1`,children:u?.title??A??t.slice(0,8)}),u?.engine&&u.engine!==`claude`?(0,U.jsx)(uo,{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)(EE,{value:t,"aria-label":`Copy session id`}),(0,U.jsxs)(nw,{children:[(0,U.jsx)(rw,{render:(0,U.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close session`,children:(0,U.jsx)(HS,{className:`size-4 text-fg-3`})})}),(0,U.jsxs)(aw,{children:[(0,U.jsx)(ow,{children:`Close this session?`}),(0,U.jsx)(sw,{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)(iw,{render:(0,U.jsx)(G,{variant:`outline`,children:`Cancel`})}),(0,U.jsx)(G,{variant:`destructive`,onClick:()=>void k(),children:`Close session`})]})]})]}),e]})},t)}var Q9=$r({component:vse}),Wse=Zr({getParentRoute:()=>Q9,path:`/`,beforeLoad:()=>{throw Ve({to:`/sessions`})}}),Gse=Zr({getParentRoute:()=>Q9,path:`/sessions`,component:tse}),Kse=Zr({getParentRoute:()=>Q9,path:`/sessions/$hostId/$sessionId`,component:Hse,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})}),qse=Zr({getParentRoute:()=>Q9,path:`/gateways`,component:bse}),Jse=Zr({getParentRoute:()=>Q9,path:`/gateways/$hostId`,component:yse}),Yse=Zr({getParentRoute:()=>Q9,path:`/jobs`,component:Uoe}),Xse=Zr({getParentRoute:()=>Q9,path:`/jobs/$jobId`,component:Rse}),Zse=Zr({getParentRoute:()=>Q9,path:`/profiles`,component:Bse}),Qse=Zr({getParentRoute:()=>Q9,path:`/profiles/$profileName`,component:Vse}),$se=gi({routeTree:Q9.addChildren([Wse,Gse,Kse,qse,Jse,Yse,Xse,Zse,Qse]),history:wt()});function ece(){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(yi,{router:$se}),(0,U.jsx)(CE,{})]})}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)(ece,{})}));export{tN as a,s as c,TQ as i,l,c0 as n,Hn as o,f0 as r,d as s,e$ as t};