@pablopunk/tau 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/{main-D-Tg9b5Y.js → main-R5EDx89w.js} +2 -2
- package/dist/serve-CuMzEud7.js +1 -0
- package/dist/{serve-Cmy0rUWr.js → serve-Uc4Nin5f.js} +2 -2
- package/dist/web/dist/assets/index-vDvuOoR3.js +110 -0
- package/dist/web/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/serve-Dmzn5V0l.js +0 -1
- package/dist/web/dist/assets/index-BktLKZHR.js +0 -108
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/xterm-BrP-ENHg.css","assets/wght-DMLdVLkb.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,t.exports),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 ee(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function M(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),te(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+ee(a,u),c+=te(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+ee(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(M(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 ne(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(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 re=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 ie(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,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(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 ie(ae.bind(null,e))}var oe={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(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=oe,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=ae,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:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,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.1`})),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.1`})),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`),ee=Symbol.for(`react.strict_mode`),M=Symbol.for(`react.profiler`),te=Symbol.for(`react.consumer`),ne=Symbol.for(`react.context`),N=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function he(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case M:return`Profiler`;case ee:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case ne:return e.displayName||`Context`;case te:return(e._context.displayName||`Context`)+`.Consumer`;case N:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?he(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ge=Array.isArray,_e=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},be=[],xe=-1;function Se(e){return{current:e}}function Ce(e){0>xe||(e.current=be[xe],be[xe]=null,xe--)}function we(e,t){xe++,be[xe]=e.current,e.current=t}var Te=Se(null),Ee=Se(null),De=Se(null),Oe=Se(null);function ke(e,t){switch(we(De,t),we(Ee,e),we(Te,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}}Ce(Te),we(Te,e)}function Ae(){Ce(Te),Ce(Ee),Ce(De)}function je(e){var t=e.memoizedState;t!==null&&(hh._currentValue=t.memoizedState,we(Oe,e)),t=Te.current;var n=yp(t,e.type);t!==n&&(we(Ee,e),we(Te,n))}function Me(e){Ee.current===e&&(Ce(Te),Ce(Ee)),Oe.current===e&&(Ce(Oe),hh._currentValue=ye)}var Ne,Pe;function Fe(e){if(Ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||``,Pe=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+Ne+e+Pe}var Ie=!1;function Le(e,t){if(!e||Ie)return``;Ie=!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{Ie=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Fe(n):``}function Re(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe(`Lazy`);case 13:return e.child!==t&&t!==null?Fe(`Suspense Fallback`):Fe(`Suspense`);case 19:return Fe(`SuspenseList`);case 0:case 15:return Le(e.type,!1);case 11:return Le(e.type.render,!1);case 1:return Le(e.type,!0);case 31:return Fe(`Activity`);case 30:return Fe(`ViewTransition`);default:return``}}function ze(e){try{var t=``,n=null;do t+=Re(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var Be=Object.prototype.hasOwnProperty,Ve=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ue=t.unstable_shouldYield,We=t.unstable_requestPaint,Ge=t.unstable_now,Ke=t.unstable_getCurrentPriorityLevel,qe=t.unstable_ImmediatePriority,Je=t.unstable_UserBlockingPriority,Ye=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,Qe=t.log,$e=t.unstable_setDisableYieldValue,et=null,tt=null;function nt(e){if(typeof Qe==`function`&&$e(e),tt&&typeof tt.setStrictMode==`function`)try{tt.setStrictMode(et,e)}catch{}}var rt=Math.clz32?Math.clz32:ot,it=Math.log,at=Math.LN2;function ot(e){return e>>>=0,e===0?32:31-(it(e)/at|0)|0}var st=256,ct=262144,lt=4194304;function ut(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 dt(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=ut(n))):i=ut(o):i=ut(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ut(n))):i=ut(o)):i=ut(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 ft(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function pt(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-rt(n),i=1<<r;t|=e[r],n&=~i}return t}function mt(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 ht(){var e=lt;return lt<<=1,!(lt&62914560)&&(lt=4194304),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function _t(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vt(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-rt(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&&yt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function yt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-rt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function xt(e,t){var n=t&-t;return n=n&42?1:St(n),(n&(e.suspendedLanes|t))===0?n:0}function St(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 Ct(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function wt(){var e=ve.p;return e===0?(e=window.event,e===void 0?32:jh(e.type)):e}function Tt(e,t){var n=ve.p;try{return ve.p=e,t()}finally{ve.p=n}}var Et=Math.random().toString(36).slice(2),Dt=`__reactFiber$`+Et,Ot=`__reactProps$`+Et,kt=`__reactContainer$`+Et,At=`__reactEvents$`+Et,jt=`__reactListeners$`+Et,Mt=`__reactHandles$`+Et,Nt=`__reactResources$`+Et,Pt=`__reactMarker$`+Et,Ft=`__reactLoad$`+Et;function It(e){delete e[Dt],delete e[Ot],delete e[jt],delete e[Mt]}function Lt(e){var t;if(t=e[Dt])return t;for(var n=e.parentNode;n;){if(t=n[kt]||n[Dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bm(e);e!==null;){if(n=e[Dt])return n;e=bm(e)}return t}e=n,n=e.parentNode}return null}function Rt(e){if(e=e[Dt]||e[kt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function zt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Bt(e){var t=e[Nt];return t||=e[Nt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Vt(e){e[Pt]=!0}function Ht(e){e[Ft]=void 0}var Ut=new Set,Wt={};function Gt(e,t){Kt(e,t),Kt(e+`Capture`,t)}function Kt(e,t){for(Wt[e]=t,e=0;e<t.length;e++)Ut.add(t[e])}var qt=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]*$`),Jt={},Yt={};function Xt(e){return Be.call(Yt,e)?!0:Be.call(Jt,e)?!1:qt.test(e)?Yt[e]=!0:(Jt[e]=!0,!1)}var Zt=!1;function Qt(){var e=Zt;return Zt=!1,e}function $t(e,t,n){if(Xt(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 en(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 tn(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 nn(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function rn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function an(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 on(e){if(!e._valueTracker){var t=rn(e)?`checked`:`value`;e._valueTracker=an(e,t,``+e[t])}}function sn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=rn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var cn=/[\n"\\]/g;function ln(e){return e.replace(cn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function un(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=``+nn(t)):e.value!==``+nn(t)&&(e.value=``+nn(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):fn(e,nn(n)):o===`number`&&e.value==t?fn(e,nn(e.value)):fn(e,nn(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=``+nn(s):e.removeAttribute(`name`)}function dn(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)){on(e);return}n=n==null?``:``+nn(n),t=t==null?n:``+nn(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),on(e)}function fn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function pn(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=``+nn(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 mn(e,t,n){t!=null&&(t=``+nn(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+nn(n)}function hn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=nn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),on(e)}function gn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _n=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 vn(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||_n.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function yn(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]=``,Zt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(vn(e,a,r),Zt=!0)}else for(var o in t)t.hasOwnProperty(o)&&vn(e,o,t[o])}function bn(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 xn=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`]]),Sn=/^[\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 Cn(e){return Sn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function wn(){}var Tn=null;function En(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dn=null,On=null;function kn(e){var t=Rt(e);if(t&&(e=t.stateNode)){var n=e[Ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(un(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="`+ln(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Ot]||null;if(!a)throw Error(i(90));un(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&&sn(r)}break a;case`textarea`:mn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&pn(e,!!n.multiple,t,!1)}}}var An=!1;function jn(e,t,n){if(An)return e(t,n);An=!0;try{return e(t)}finally{if(An=!1,(Dn!==null||On!==null)&&(Wd(),Dn&&(t=Dn,e=On,On=Dn=null,kn(t),e)))for(t=0;t<e.length;t++)kn(e[t])}}function Mn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ot]||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 Nn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Pn=!1;if(Nn)try{var Fn={};Object.defineProperty(Fn,"passive",{get:function(){Pn=!0}}),window.addEventListener(`test`,Fn,Fn),window.removeEventListener(`test`,Fn,Fn)}catch{Pn=!1}var In=null,Ln=null,Rn=null;function zn(){if(Rn)return Rn;var e,t=Ln,n=t.length,r,i=`value`in In?In.value:In.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 Rn=i.slice(e,1<r?1-r:void 0)}function Bn(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 Vn(){return!0}function Hn(){return!1}function Un(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)?Vn:Hn,this.isPropagationStopped=Hn,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=Vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Vn)},persist:function(){},isPersistent:Vn}),t}var Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gn=Un(Wn),Kn=D({},Wn,{view:0,detail:0}),qn=Un(Kn),Jn,Yn,Xn,Zn=D({},Kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cr,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!==Xn&&(Xn&&e.type===`mousemove`?(Jn=e.screenX-Xn.screenX,Yn=e.screenY-Xn.screenY):Yn=Jn=0,Xn=e),Jn)},movementY:function(e){return`movementY`in e?e.movementY:Yn}}),Qn=Un(Zn),$n=Un(D({},Zn,{dataTransfer:0})),er=Un(D({},Kn,{relatedTarget:0})),tr=Un(D({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0})),nr=Un(D({},Wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),rr=Un(D({},Wn,{data:0})),ir={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},ar={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`},or={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function sr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=or[e])?!!t[e]:!1}function cr(){return sr}var lr=Un(D({},Kn,{key:function(e){if(e.key){var t=ir[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?ar[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cr,charCode:function(e){return e.type===`keypress`?Bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ur=Un(D({},Zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),dr=Un(D({},Wn,{submitter:0})),fr=Un(D({},Kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cr})),pr=Un(D({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),mr=Un(D({},Zn,{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})),hr=Un(D({},Wn,{newState:0,oldState:0,source:0})),gr=[9,13,27,32],_r=Nn&&`CompositionEvent`in window,vr=null;Nn&&`documentMode`in document&&(vr=document.documentMode);var yr=Nn&&`TextEvent`in window&&!vr,br=Nn&&(!_r||vr&&8<vr&&11>=vr),xr=` `,Sr=!1;function Cr(e,t){switch(e){case`keyup`:return gr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function wr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Tr=!1;function Er(e,t){switch(e){case`compositionend`:return wr(t);case`keypress`:return t.which===32?(Sr=!0,xr):null;case`textInput`:return e=t.data,e===xr&&Sr?null:e;default:return null}}function Dr(e,t){if(Tr)return e===`compositionend`||!_r&&Cr(e,t)?(e=zn(),Rn=Ln=In=null,Tr=!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 br&&t.locale!==`ko`?null:t.data;default:return null}}var Or={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 kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Or[e.type]:t===`textarea`}function Ar(e,t,n,r){Dn?On?On.push(r):On=[r]:Dn=r,t=tp(t,`onChange`),0<t.length&&(n=new Gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var jr=null,Mr=null;function Nr(e){qf(e,0)}function Pr(e){if(sn(zt(e)))return e}function Fr(e,t){if(e===`change`)return t}var Ir=!1;if(Nn){var Lr;if(Nn){var Rr=`oninput`in document;if(!Rr){var zr=document.createElement(`div`);zr.setAttribute(`oninput`,`return;`),Rr=typeof zr.oninput==`function`}Lr=Rr}else Lr=!1;Ir=Lr&&(!document.documentMode||9<document.documentMode)}function Br(){jr&&(jr.detachEvent(`onpropertychange`,Vr),Mr=jr=null)}function Vr(e){if(e.propertyName===`value`&&Pr(Mr)){var t=[];Ar(t,Mr,e,En(e)),jn(Nr,t)}}function Hr(e,t,n){e===`focusin`?(Br(),jr=t,Mr=n,jr.attachEvent(`onpropertychange`,Vr)):e===`focusout`&&Br()}function Ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Pr(Mr)}function Wr(e,t){if(e===`click`)return Pr(t)}function Gr(e,t){if(e===`input`||e===`change`)return Pr(t)}function Kr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var qr=typeof Object.is==`function`?Object.is:Kr;function Jr(e,t){if(qr(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(!Be.call(t,i)||!qr(e[i],t[i]))return!1}return!0}function Yr(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 P(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xr(e,t){var n=P(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=P(n)}}function Zr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Yr(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=Yr(e.document)}return t}function $r(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 ei=Nn&&`documentMode`in document&&11>=document.documentMode,ti=null,ni=null,F=null,ri=!1;function ii(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ri||ti==null||ti!==Yr(r)||(r=ti,`selectionStart`in r&&$r(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}),F&&Jr(F,r)||(F=r,r=tp(ni,`onSelect`),0<r.length&&(t=new Gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ti)))}function ai(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var oi={animationend:ai(`Animation`,`AnimationEnd`),animationiteration:ai(`Animation`,`AnimationIteration`),animationstart:ai(`Animation`,`AnimationStart`),transitionrun:ai(`Transition`,`TransitionRun`),transitionstart:ai(`Transition`,`TransitionStart`),transitioncancel:ai(`Transition`,`TransitionCancel`),transitionend:ai(`Transition`,`TransitionEnd`)},si={},ci={};Nn&&(ci=document.createElement(`div`).style,`AnimationEvent`in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),`TransitionEvent`in window||delete oi.transitionend.transition);function li(e){if(si[e])return si[e];if(!oi[e])return e;var t=oi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ci)return si[e]=t[n];return e}var ui=li(`animationend`),di=li(`animationiteration`),fi=li(`animationstart`),pi=li(`transitionrun`),mi=li(`transitionstart`),hi=li(`transitioncancel`),gi=li(`transitionend`),_i=new Map,vi=`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(` `);vi.push(`scrollEnd`);function yi(e,t){_i.set(e,t),Gt(t,[e])}var bi=0;function I(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Td.identifierPrefix;var n=bi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function xi(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 L(e,t){return e=xi(e),t=xi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Si=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)},Ci=[],wi=0,Ti=0;function Ei(){for(var e=wi,t=Ti=wi=0;t<e;){var n=Ci[t];Ci[t++]=null;var r=Ci[t];Ci[t++]=null;var i=Ci[t];Ci[t++]=null;var a=Ci[t];if(Ci[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&&Ai(n,i,a)}}function Di(e,t,n,r){Ci[wi++]=e,Ci[wi++]=t,Ci[wi++]=n,Ci[wi++]=r,Ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Oi(e,t,n,r){return Di(e,t,n,r),ji(e)}function ki(e,t){return Di(e,null,null,t),ji(e)}function Ai(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-rt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ji(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 Mi={};function Ni(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 Pi(e,t,n,r){return new Ni(e,t,n,r)}function Fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var n=e.alternate;return n===null?(n=Pi(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 Li(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 Ri(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Fi(r)&&(s=1);else if(typeof r==`string`)s=th(e,n,Te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Pi(31,n,t,a),e.elementType=se,e.lanes=o,e;case j:return zi(n.children,a,o,t);case ee:s=8,a|=24;break;case M:return e=Pi(12,n,t,a|2),e.elementType=M,e.lanes=o,e;case re:return e=Pi(13,n,t,a),e.elementType=re,e.lanes=o,e;case ie:return e=Pi(19,n,t,a),e.elementType=ie,e.lanes=o,e;case ce:case ue:return e=a|32,e=Pi(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ne:s=10;break a;case te:s=9;break a;case N:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Pi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function zi(e,t,n,r){return e=Pi(7,e,r,t),e.lanes=n,e}function Bi(e,t,n){return e=Pi(6,e,null,t),e.lanes=n,e}function Vi(e){var t=Pi(18,null,null,0);return t.stateNode=e,t}function Hi(e,t,n){return t=Pi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ui=new WeakMap;function Wi(e,t){if(typeof e==`object`&&e){var n=Ui.get(e);return n===void 0?(t={value:e,source:t,stack:ze(t)},Ui.set(e,t),t):n}return{value:e,source:t,stack:ze(t)}}var Gi=[],Ki=0,qi=null,Ji=0,Yi=[],Xi=0,R=null,Zi=1,Qi=``;function $i(e,t){Gi[Ki++]=Ji,Gi[Ki++]=qi,qi=e,Ji=t}function ea(e,t,n){Yi[Xi++]=Zi,Yi[Xi++]=Qi,Yi[Xi++]=R,R=e;var r=Zi;e=Qi;var i=32-rt(r)-1;r&=~(1<<i),n+=1;var a=32-rt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-rt(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null;for(;e===R;)R=Yi[--Xi],Yi[Xi]=null,Qi=Yi[--Xi],Yi[Xi]=null,Zi=Yi[--Xi],Yi[Xi]=null}function ra(e,t){Yi[Xi++]=Zi,Yi[Xi++]=Qi,Yi[Xi++]=R,Zi=t.id,Qi=t.overflow,R=e}var ia=null,aa=null,oa=!1,sa=null,ca=!1,la=Error(i(519));function ua(e){throw ha(Wi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),la}function da(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Dt]=e,t[Ot]=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),dn(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),hn(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=wn),t=!0):t=!1,t||ua(e,!0)}function z(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:ia=ia.return}}function fa(e){if(e!==ia)return!1;if(!oa)return z(e),oa=!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&&aa&&ua(e),z(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=ym(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=ym(e)}else t===27?(t=aa,Ap(e.type)?(e=vm,vm=null,aa=e):aa=t):aa=ia?_m(e.stateNode.nextSibling):null;return!0}function pa(){aa=ia=null,oa=!1}function ma(){var e=sa;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,e),sa=null),e}function ha(e){sa===null?sa=[e]:sa.push(e)}var ga=Se(null),_a=null,va=null;function ya(e,t,n){we(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,Ce(ga)}function xa(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 Sa(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),xa(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),xa(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),xa(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 Ca(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;qr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Oe.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&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!qr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(i(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=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()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,Ma={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new ka,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Fa(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 Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,Va=null;function Ha(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Bf(),Va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ua,Ua),t}function Ua(){if(--za===0&&(Ia=null,Ra!==null)){Va!==null&&(Va.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,Va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(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 Ga=_e.S;_e.S=function(e,t){if(bd=Ge(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),Ia!==null)for(var n=Ef;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=Ef;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=Se(null);function qa(){var e=Ka.current;return e===null?td.pooledCache:e}function Ja(e,t){t===null?we(Ka,Ka.current):we(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:Ma._currentValue,pool:e}}var Xa=Error(i(460)),Za=Error(i(474)),Qa=Error(i(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(wn,wn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(wn,wn);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,ao(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function io(){if(ro===null)throw Error(i(459));var e=ro;return ro=null,e}function ao(e){if(e===Xa||e===Qa)throw Error(i(483))}var oo=null,so=0;function co(e){var t=so;return so+=1,oo===null&&(oo=[]),to(oo,e,t)}function lo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function uo(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 fo(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=Ii(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=Bi(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),lo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&no(i)===t.type)?(t=a(t,n.props),lo(t,n),t.return=e,t):(t=Ri(n.type,n.key,n.props,null,e.mode,r),lo(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=Hi(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=zi(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=Bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ri(t.type,t.key,t.props,null,e.mode,n),lo(n,t),n.return=e,n;case A:return t=Hi(t,e.mode,n),t.return=e,t;case oe:return t=no(t),f(e,t,n)}if(ge(t)||pe(t))return t=zi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,co(t),n);if(t.$$typeof===ne)return f(e,Da(e,t),n);uo(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 oe:return n=no(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,co(n),r);if(n.$$typeof===ne)return p(e,t,Da(e,n),r);uo(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 oe:return r=no(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,co(r),i);if(r.$$typeof===ne)return m(e,t,n,Da(t,r),i);uo(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),oa&&$i(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 oa&&$i(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)}),oa&&$i(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),oa&&$i(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 oa&&$i(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)}),oa&&$i(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),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=zi(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Ri(o.type,o.key,o.props,null,e.mode,c),lo(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=Hi(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=no(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(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,co(o),c);if(o.$$typeof===ne)return _(e,r,Da(e,o),c);uo(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=Bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(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 vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(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=ji(e),Ai(e,null,n),t}return Di(e,r,t,n),ji(e)}function bo(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,bt(e,n)}}function xo(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var So=!1;function Co(){if(So){var e=Va;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!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===Ba&&(So=!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:ho=!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 To(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)To(n[e],t)}var Do=Se(null),Oo=Se(0);function B(e,t){e=ld,we(Oo,e),we(Do,t),ld=e|t.baseLanes}function ko(){we(Oo,ld),we(Do,Do.current)}function Ao(){ld=Oo.current,Ce(Do),Ce(Oo)}var jo=Se(null),Mo=null;function No(e){var t=e.alternate;we(Ro,Ro.current&1),we(jo,e),Mo===null&&(t===null||Do.current!==null||t.memoizedState!==null)&&(Mo=e)}function Po(e){we(Ro,Ro.current),we(jo,e),Mo===null&&(Mo=e)}function Fo(e){e.tag===22?(we(Ro,Ro.current),we(jo,e),Mo===null&&(Mo=e)):Io()}function Io(){we(Ro,Ro.current),we(jo,jo.current)}function Lo(e){Ce(jo),Mo===e&&(Mo=null),Ce(Ro)}var Ro=Se(0);function zo(e,t){we(jo,jo.current),we(Ro,t)}function Bo(e){Ce(Ro),Ce(jo),Mo===e&&(Mo=null)}function Vo(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 Ho=0,Uo=null,Wo=null,Go=null,Ko=!1,qo=!1,Jo=!1,Yo=0,Xo=0,Zo=null,Qo=0;function $o(){throw Error(i(321))}function es(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qr(e[n],t[n]))return!1;return!0}function ts(e,t,n,r,i,a){return Ho=a,Uo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_e.H=e===null||e.memoizedState===null?pc:mc,Jo=!1,a=n(r,i),Jo=!1,qo&&(a=rs(t,n,r,i)),ns(e),a}function ns(e){_e.H=fc;var t=Wo!==null&&Wo.next!==null;if(Ho=0,Go=Wo=Uo=null,Ko=!1,Xo=0,Zo=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&wa(e)&&(jc=!0))}function rs(e,t,n,r){Uo=e;var a=0;do{if(qo&&(Zo=null),Xo=0,qo=!1,25<=a)throw Error(i(301));if(a+=1,Go=Wo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}_e.H=hc,o=t(n,r)}while(qo);return o}function is(){var e=_e.H,t=e.useState()[0];return t=typeof t.then==`function`?ds(t):t,e=e.useState()[0],(Wo===null?null:Wo.memoizedState)!==e&&(Uo.flags|=1024),t}function as(){var e=Yo!==0;return Yo=0,e}function os(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ss(e){if(Ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ko=!1}Ho=0,Go=Wo=Uo=null,qo=!1,Xo=Yo=0,Zo=null}function cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Go===null?Uo.memoizedState=Go=e:Go=Go.next=e,Go}function ls(){if(Wo===null){var e=Uo.alternate;e=e===null?null:e.memoizedState}else e=Wo.next;var t=Go===null?Uo.memoizedState:Go.next;if(t!==null)Go=t,Wo=e;else{if(e===null)throw Uo.alternate===null?Error(i(467)):Error(i(310));Wo=e,e={memoizedState:Wo.memoizedState,baseState:Wo.baseState,baseQueue:Wo.baseQueue,queue:Wo.queue,next:null},Go===null?Uo.memoizedState=Go=e:Go=Go.next=e}return Go}function us(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ds(e){var t=Xo;return Xo+=1,Zo===null&&(Zo=[]),e=to(Zo,e,t),t=Uo,(Go===null?t.memoizedState:Go.next)===null&&(t=t.alternate,_e.H=t===null||t.memoizedState===null?pc:mc),e}function fs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ds(e);if(e.$$typeof===de)return;if(e.$$typeof===ne)return Ea(e)}throw Error(i(438,String(e)))}function ps(e){var t=null,n=Uo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Uo.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=us(),Uo.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]=le;return t.index++,n}function ms(e,t){return typeof t==`function`?t(e):t}function hs(e){return gs(ls(),Wo,e)}function gs(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?(Ho&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===Ba&&(d=!0);else if((Ho&p)===p){u=u.next,p===Ba&&(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,Uo.lanes|=p,dd|=p;f=u.action,Jo&&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,Uo.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!qr(o,e.memoizedState)&&(jc=!0,d&&(n=Va,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 _s(e){var t=ls(),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);qr(o,t.memoizedState)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function vs(e,t,n){var r=Uo,a=ls(),o=oa;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!qr((Wo||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,U(xs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Go!==null&&!!(Go.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},bs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,td===null)throw Error(i(349));o||Ho&127||ys(r,t,n)}return n}function ys(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Uo.updateQueue,t===null?(t=us(),Uo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bs(e,t,n,r){t.value=n,t.getSnapshot=r,Ss(t)&&Cs(e)}function xs(e,t,n){return n(function(){Ss(t)&&Cs(e)})}function Ss(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qr(e,n)}catch{return!0}}function Cs(e){var t=ki(e,2);t!==null&&zd(t,e,2)}function ws(e){var t=cs();if(typeof e==`function`){var n=e;if(e=n(),Jo){nt(!0);try{n()}finally{nt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:e},t}function Ts(e,t,n,r){return e.baseState=n,gs(e,Wo,typeof r==`function`?r:ms)}function Es(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)}};_e.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ds(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ds(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=_e.T,o={};o.types=a===null?null:a.types,_e.T=o;try{var s=n(i,r),c=_e.S;c!==null&&c(o,s),Os(e,t,s)}catch(n){As(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),_e.T=a}}else try{a=n(i,r),Os(e,t,a)}catch(n){As(e,t,n)}}function Os(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ks(e,t,n)},function(n){return As(e,t,n)}):ks(e,t,n)}function ks(e,t,n){t.status=`fulfilled`,t.value=n,js(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ds(e,n)))}function As(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,js(t),t=t.next;while(t!==r)}e.action=null}function js(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ms(e,t){return t}function Ns(e,t){if(oa){var n=td.formState;if(n!==null){a:{var r=Uo;if(oa){if(aa){b:{for(var i=aa,a=ca;i.nodeType!==8;)if(!a||(i=_m(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=_m(i.nextSibling),r=i.data===`F!`;break a}}ua(r)}r=!1}r&&(t=n[0])}}return n=cs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:t},n.queue=r,n=oc.bind(null,Uo,r),r.dispatch=n,r=ws(!1),a=cc.bind(null,Uo,!1,r.queue),r=cs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Es.bind(null,Uo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ps(e){return V(ls(),Wo,e)}function V(e,t,n){if(t=gs(e,t,Ms)[0],e=hs(ms)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ds(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=ls();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Uo.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=ls(),n=Wo;if(n!==null)return V(t,n,e);ls(),t=t.memoizedState,n=ls();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Uo.updateQueue,t===null&&(t=us(),Uo.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 Rs(){return ls().memoizedState}function H(e,t,n,r){var i=cs();Uo.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=ls();r=r===void 0?null:r;var a=i.memoizedState.inst;Wo!==null&&r!==null&&es(r,Wo.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(Uo.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Bs(e,t){H(8390656,8,e,t)}function U(e,t){zs(2048,8,e,t)}function Vs(e){Uo.flags|=4;var t=Uo.updateQueue;if(t===null)t=us(),Uo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=ls().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(ed&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return zs(4,2,e,t)}function W(e,t){return zs(4,4,e,t)}function Ws(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function G(e,t,n){n=n==null?null:n.concat([e]),zs(4,4,Ws.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&es(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&es(t,r[1]))return r[0];if(r=e(),Jo){nt(!0);try{e()}finally{nt(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||Ho&1073741824&&!(rd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),Uo.lanes|=e,dd|=e,n)}function Ys(e,t,n,r){return qr(n,t)?n:Do.current===null?!(Ho&106)||Ho&1073741824&&!(rd&261930)?(jc=!0,e.memoizedState=n):(e=Ld(),Uo.lanes|=e,dd|=e,t):(e=Js(e,n,r),qr(e,t)||(jc=!0),e)}function Xs(e,t,n,r,i){var a=ve.p;ve.p=a!==0&&8>a?a:8;var o=_e.T,s={};s.types=o===null?null:o.types,_e.T=s,cc(e,!1,t,n);try{var c=i(),l=_e.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,Wa(c,r),Id(e)):sc(e,t,r,Id(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{ve.p=a,o!==null&&s.types!==null&&(o.types=s.types),_e.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,ye,n===null?Zs:function(){return ec(e),n(r)})}function $s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,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 Ea(hh)}function nc(){return ls().memoizedState}function rc(){return ls().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=vo(n);var r=yo(t,e,n);r!==null&&(zd(r,t,n),bo(r,t,n)),t={cache:Na()},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=Oi(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,qr(s,o))return Di(e,t,i,0),td===null&&Ei(),!1}catch{}if(n=Oi(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=Oi(e,n,r,2),t!==null&&zd(t,e,2)}function lc(e){var t=e.alternate;return e===Uo||t!==null&&t===Uo}function uc(e,t){qo=Ko=!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,bt(e,n)}}var fc={readContext:Ea,use:fs,useCallback:$o,useContext:$o,useEffect:$o,useImperativeHandle:$o,useLayoutEffect:$o,useInsertionEffect:$o,useMemo:$o,useReducer:$o,useRef:$o,useState:$o,useDebugValue:$o,useDeferredValue:$o,useTransition:$o,useSyncExternalStore:$o,useId:$o,useHostTransitionStatus:$o,useFormState:$o,useActionState:$o,useOptimistic:$o,useMemoCache:$o,useCacheRefresh:$o,useEffectEvent:$o},pc={readContext:Ea,use:fs,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),H(4194308,4,Ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return H(4194308,4,e,t)},useInsertionEffect:function(e,t){H(4,2,e,t)},useMemo:function(e,t){var n=cs();t=t===void 0?null:t;var r=e();if(Jo){nt(!0);try{e()}finally{nt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cs();if(n!==void 0){var i=n(t);if(Jo){nt(!0);try{n(t)}finally{nt(!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,Uo,e),[r.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:function(e){e=ws(e);var t=e.queue,n=oc.bind(null,Uo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(cs(),e,t)},useTransition:function(){var e=ws(!1);return e=Xs.bind(null,Uo,e.queue,!0,!1),cs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Uo,a=cs();if(oa){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),td===null)throw Error(i(349));rd&127||ys(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Bs(xs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},bs.bind(null,r,o,n,t),null),n},useId:function(){var e=cs(),t=td.identifierPrefix;if(oa){var n=Qi,r=Zi;n=(r&~(1<<32-rt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e){var t=cs();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,Uo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ps,useCacheRefresh:function(){return cs().memoizedState=ic.bind(null,Uo)},useEffectEvent:function(e){var t=cs(),n={impl:e};return t.memoizedState=n,function(){if(ed&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:Ea,use:fs,useCallback:Ks,useContext:Ea,useEffect:U,useImperativeHandle:G,useInsertionEffect:Us,useLayoutEffect:W,useMemo:qs,useReducer:hs,useRef:Rs,useState:function(){return hs(ms)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(ls(),Wo.memoizedState,e,t)},useTransition:function(){var e=hs(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:nc,useHostTransitionStatus:tc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){return Ts(ls(),Wo,e,t)},useMemoCache:ps,useCacheRefresh:rc,useEffectEvent:Hs},hc={readContext:Ea,use:fs,useCallback:Ks,useContext:Ea,useEffect:U,useImperativeHandle:G,useInsertionEffect:Us,useLayoutEffect:W,useMemo:qs,useReducer:_s,useRef:Rs,useState:function(){return _s(ms)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=ls();return Wo===null?Js(n,e,t):Ys(n,Wo.memoizedState,e,t)},useTransition:function(){var e=_s(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:nc,useHostTransitionStatus:tc,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=ls();return Wo===null?(n.baseState=e,[e,n.queue.dispatch]):Ts(n,Wo,e,t)},useMemoCache:ps,useCacheRefresh:rc,useEffectEvent:Hs};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=vo(r);i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(zd(t,e,r),bo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=vo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(zd(t,e,r),bo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=vo(n);r.tag=2,t!=null&&(r.callback=t),t=yo(e,r,n),t!==null&&(zd(t,e,n),bo(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?!Jr(n,r)||!Jr(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){Si(e)}function Sc(e){console.error(e)}function Cc(e){Si(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=vo(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=vo(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&&Ca(t,n,a,!0),n=jo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Mo===null?Zd():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===$a?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===$a?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(oa)return t=jo.current,t===null?(r!==la&&(t=Error(i(423),{cause:r}),ha(Wi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Wi(r,n),a=Ec(e.stateNode,r,a),xo(e,a),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==la&&(e=Error(i(422),{cause:r}),ha(Wi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Wi(o,n),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Wi(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),xo(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),xo(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?mo(t,null,n,r):po(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 Ta(t),r=ts(e,t,n,o,a,i),s=as(),e!==null&&!jc?(os(e,t,i),sl(e,t,i)):(oa&&s&&ta(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`&&!Fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Fc(e,t,a,r,i)):(e=Ri(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?Jr:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=Ii(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(Jr(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&&Ja(t,a===null?null:a.cachePool),a===null?ko():B(t,a),Fo(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),ko(),Io()):(Ja(t,a.cachePool),B(t,a),Io(),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=qa();return a=a===null?null:{parent:Ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),ko(),Fo(t),e!==null&&Ca(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 po(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,Lo(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(oa){if(r.mode===`hidden`)return e=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(Po(t),(e=aa)?(e=pm(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:R===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=536870912,null}return zc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Po(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||Ca(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(Do.current===null){if(r=td,r!==null&&(s=xt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ki(e,s),zd(r,e,s),Ac;Zd()}t=Bc(e,t,n)}else e=o.treeContext,aa=_m(s.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(t,e),t=zc(t,r),t.flags|=134221824;return t}return e=Ii(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 Ta(t),n=ts(e,t,n,r,void 0,i),r=as(),e!==null&&!jc?(os(e,t,i),sl(e,t,i)):(oa&&r&&ta(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=rs(t,r,n,i),ns(e),r=as(),e!==null&&!jc?(os(e,t,a),sl(e,t,a)):(oa&&r&&ta(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=Mi,o=n.contextType;typeof o==`object`&&o&&(a=Ea(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={},go(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):Mi,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),wo(t,r,a,i),Co(),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=Mi,typeof u==`object`&&u&&(o=Ea(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),ho=!1;var f=t.memoizedState;a.state=f,wo(t,r,a,i),Co(),l=t.memoizedState,s||f!==l||ho?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=ho||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,_o(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Mi,typeof l==`object`&&l&&(c=Ea(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),ho=!1,f=t.memoizedState,a.state=f,wo(t,r,a,i),Co();var p=t.memoizedState;o!==d||f!==p||ho||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=ho||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(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=po(t,e.child,null,i),t.child=po(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 pa(),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:Ya()}}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:!!(Ro.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(oa){if(i?No(t):Io(),(e=aa)?(e=pm(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:R===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=hm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Io(),i=t.mode,a=Qc({mode:`hidden`,children:a},i),r=zi(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)):(No(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?(Io(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ii(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=zi(i,a,n,null),i.flags|=2):i=Ii(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=Ya():(s=Ma._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)):(No(t),n=e.child,e=n.sibling,n=Ii(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=Pi(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return po(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?(No(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(Io(),o=a.fallback,s=t.mode,a=Qc({mode:`visible`,children:a.children},s),o=zi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,po(t,e.child,null,c),a=t.child,a.memoizedState=Jc(c),a.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,a)):(Io(),t.child=e.child,t.flags|=128,null);if(No(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,ha({value:a,source:null,stack:null})),$c(e,t,c)}if(jc||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(Do.current!==null)return $c(e,t,c);if(r=td,r!==null&&(a=xt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,ki(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,aa=_m(o.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(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),xa(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Vo(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=Ro.current;if(t.flags&128)return zo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,zo(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(e,t,r,n),r=oa?Ji: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&&Vo(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 ya(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(Ca(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=Ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ii(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&&wa(e)))}function ll(e,t,n){switch(t.tag){case 3:ke(t,t.stateNode.containerInfo),ya(t,Ma,e.memoizedState.cache),pa();break;case 27:case 5:je(t);break;case 4:ke(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return No(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(No(t),e=sl(e,t,n),e===null?null:e.sibling)}No(t);break;case 19:if(t.flags&128)return al(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(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),zo(t,Ro.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:ya(t,Ma,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,oa&&t.flags&1048576&&ea(t,Ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Fi(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===N){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===ne){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=he(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(ke(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,_o(e,t),wo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ya(t,Ma,r),r!==o.cache&&Sa(t,[Ma],n,!0),Co(),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=Wi(Error(i(424)),t),ha(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(aa=_m(e.firstChild),ia=t,oa=!0,sa=null,ca=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),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:oa||(t.stateNode=bp(t.type,t.pendingProps,De.current,t)):t.memoizedState=Vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&oa&&(r=t.stateNode=Cm(t.type,t.pendingProps,De.current),ia=t,ca=!0,a=aa,Ap(t.type)?(vm=a,aa=_m(r.firstChild)):aa=a),Mc(e,t,t.pendingProps.children,n),Hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&oa&&((a=r=aa)&&(r=dm(r,t.type,t.pendingProps,ca),r===null?a=!1:(t.stateNode=r,ia=t,aa=_m(r.firstChild),ca=!1,a=!0)),a||ua(t)),je(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=ts(e,t,is,null,null,n),hh._currentValue=a),Hc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&oa&&((e=n=aa)&&(n=fm(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||ua(t)),null;case 13:return Xc(e,t,n);case 4:return ke(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(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,Ta(t),a=Ea(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 Ta(t),r=Ea(Ma),e===null?(a=qa(),a===null&&(a=td,o=Na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},go(t),ya(t,Ma,a)):((e.lanes&n)!==0&&(_o(e,t),wo(t,null,null,n),Co()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ya(t,Ma,r),r!==a.cache&&Sa(t,[Ma],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ya(t,Ma,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:oa&&ta(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 ro=$a,Za}}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 ro=$a,Za}}function ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ht(),e.lanes|=t,hd|=t)}function hl(e,t){if(!oa)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(na(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),ba(Ma),Ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?dl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),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(Me(t),n=De.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=Te.current,fa(t)?da(t,e):(e=Cm(a,r,n),t.stateNode=e,dl(t))}return gl(t),t.subtreeFlags&=-33554433,null;case 5:if(Me(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=Te.current,fa(t))da(t,o);else{var s=_p(De.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[Dt]=t,o[Ot]=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=De.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||sp(e.nodeValue,n)),e||ua(t,!0)}else e=_p(e).createTextNode(r),e[Dt]=t,t.stateNode=e}return gl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(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[Dt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(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=fa(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[Dt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(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 Ae(),e===null&&Zf(t.stateNode.containerInfo),t.flags|=67108864,gl(t),null;case 10:return ba(t.type),gl(t),null;case 19:if(Bo(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=Vo(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;)Li(n,e),n=n.sibling;return zo(t,Ro.current&1|2),oa&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ge()>xd&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Vo(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&&!oa)return gl(t),null}else 2*Ge()-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=Ge(),e.sibling=null,o=Ro.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||oa?zo(t,o):(n=o,we(jo,t),we(Ro,n),Mo===null&&(Mo=t)),oa&&$i(t,r.treeForkCount),e}return gl(t),null;case 22:case 23:return Lo(t),Ao(),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&&Ce(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),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(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Me(t),null;case 31:if(t.memoizedState!==null){if(Lo(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(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 Ae(),null;case 10:return ba(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&Ce(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function yl(e,t){switch(na(t),t.tag){case 3:ba(Ma),Ae();break;case 26:case 27:case 5:Me(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ba(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&Ce(Ka);break;case 24:ba(Ma)}}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{Eo(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=I(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[Ot]=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=wn)),El(e,r),Zt=!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),Zt=!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[Dt]=e,t[Ot]=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=L(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=I(r,n),a=L(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=L(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=I(t,e.stateNode),r=zl===null?void 0:zl.get(n),i=L(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=I(t,e.stateNode);t=L(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=I(n,r),a=L(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=Qr(e),$r(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=I(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=L(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{Eo(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,Zt=!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&&It(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(tt&&typeof tt.onCommitFiberUnmount==`function`)try{tt.onCommitFiberUnmount(et,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),Zt=!0}catch(e){yf(n,t,e)}else try{bu.removeChild(n.stateNode),Zt=!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[Pt]||r[Dt]||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[Dt]=e,Vt(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[Dt]=e,Vt(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{gn(t,``),Zt=!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,Zt=!0}catch(t){yf(e,e.return,t)}}break;case 3:if(Zt=!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)),Zt=!1;break;case 4:a=au,au=ru,r=Qt(),o=ku,ku=Om(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=o,Zt&&uu&&(du=!0),Zt=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=Ge()),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=Qt(),o=uu,s=(n&335544064)===n,c=e.memoizedProps,uu=s&&L(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&Zt&&(e.flags|=4),uu=o,Zt=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&&(gn(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=I(a,o),o=I(n.memoizedProps,o);var s=L(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++)To(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&&Pa(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&&Pa(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&&Pa(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:Pa(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=Ea(Ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(Ma).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:_e.T===null?wt():Bf()}function Ld(){if(md===0){if(!(rd&536870912)||oa){var e=ct;ct<<=1,!(ct&3932160)&&(ct=262144),md=e}else md=536870912}return e=jo.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(I(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)),_t(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||ft(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;else{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-Ge(),10<a)){if(Ud(r,t,md,!od),dt(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;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wn},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-Ge():(a&4194048)===a?bd-Ge():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)):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(!qr(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=pt(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-rt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&yt(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,va=_a=null,ss(e),oo=null,so=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=Ii(e.current,null),rd=t,id=0,ad=null,od=!1,sd=ft(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=pt(e,t),Ei(),n}function qd(e,t){Uo=null,_e.H=fc,t===Xa||t===Qa?(t=io(),id=3):t===Za?(t=io(),id=4):id=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,nd===null&&(ud=1,wc(e,Wi(t,e.current)))}function Jd(){var e=jo.current;return e===null?!0:(rd&4194048)===rd?Mo===null:(rd&62914560)===rd||rd&536870912?e===Mo:!1}function Yd(){var e=_e.H;return _e.H=fc,e===null?fc:e}function Xd(){var e=_e.A;return _e.A=Qu,e}function Zd(){ud=4,od||(rd&4194048)!==rd&&jo.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:jo.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++,va=_a=null,ed=r,_e.H=i,_e.A=a,nd===null&&(td=null,rd=0,Ei()),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=Ge()+500,Kd(e,t)):sd=ft(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(eo(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:eo(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 va=_a=null,_e.H=r,_e.A=a,ed=n,nd===null?(td=null,rd=0,Ei(),ud):0}function tf(){for(;nd!==null&&!Ue();)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:ss(t);var r=t;r===ia&&(oa?(z(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(z(r),oa=!0));default:yl(n,t),t=nd=Li(t,ld),t=ul(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?of(e):nd=t}function af(e,t,n,r){va=_a=null,ss(t),oo=null,so=0;var i=t.return;try{if(kc(e,i,t,n,rd)){ud=1,wc(e,Wi(n,e.current)),nd=null;return}}catch(t){if(i!==null)throw nd=i,t;ud=1,wc(e,Wi(n,e.current)),nd=null;return}t.flags&32768?(oa||r===1?e=!0:sd||rd&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=jo.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|=Ti,vt(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=La(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(Ye,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),Rl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=_e.T,_e.T=null,i=ve.p,ve.p=2,a=ed,ed|=4;try{pu(e,t,n)}finally{ed=a,ve.p=i,_e.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=_e.T,_e.T=null;var i=ve.p;ve.p=2;var a=ed;ed|=4;try{uu=du=!1,Au(t,e,n),n=gp;var o=Qr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Zr(s.ownerDocument.documentElement,s)){if(c!==null&&$r(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 _=Xr(s,h),v=Xr(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,ve.p=i,_e.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=_e.T,_e.T=null;var r=ve.p;ve.p=2;var i=ed;ed|=4;try{hu(e,t.alternate,t)}finally{ed=i,ve.p=r,_e.T=n}}wd=3}}function mf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,We();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),Ct(r),n=n.stateNode,tt&&typeof tt.onCommitFiberRoot==`function`)try{tt.onCommitFiberRoot(et,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=_e.T,a=ve.p,ve.p=2,_e.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{_e.T=n,ve.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,Pa(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=Ct(Dd),r=_e.T,a=ve.p;try{ve.p=32>n?32:n,_e.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),tt&&typeof tt.onPostCommitFiberRoot==`function`)try{tt.onPostCommitFiberRoot(et,o)}catch{}return!0}finally{ve.p=a,_e.T=r,hf(e,t)}}function vf(e,t,n){t=Wi(n,t),t=Ec(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(_t(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=Wi(n,e),n=Dc(2),r=yo(t,n,2),r!==null&&(Oc(n,r,t,e),_t(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>Ge()-yd?ed&2?pd|=n:Kd(e,0):pd|=n,hd===rd&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=ht()),e=ki(e,t),e!==null&&(_t(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 Ve(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-rt(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=dt(r,r===td?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ft(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=Ge(),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-rt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=mt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=td,n=rd,n=dt(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&&He(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ft(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&He(r),Ct(n)){case 2:case 8:n=Je;break;case 32:n=Ye;break;case 268435456:n=Ze;break;default:n=Ye}return r=Lf.bind(null,e),n=Ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&He(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=dt(e,e===td?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,Ge()),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?Ve(qe,Pf):Ff()})}function Bf(){if(jf===0){var e=Ba;e===0&&(e=st,st<<=1,!(st&261888)&&(st=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Cn(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[Ot]||null).action),o=r.submitter;o&&(t=(t=o[Ot]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Gn(`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<vi.length;Uf++){var Wf=vi[Uf];yi(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}yi(ui,`onAnimationEnd`),yi(di,`onAnimationIteration`),yi(fi,`onAnimationStart`),yi(`dblclick`,`onDoubleClick`),yi(`focusin`,`onFocus`),yi(`focusout`,`onBlur`),yi(pi,`onTransitionRun`),yi(mi,`onTransitionStart`),yi(hi,`onTransitionCancel`),yi(gi,`onTransitionEnd`),Kt(`onMouseEnter`,[`mouseout`,`mouseover`]),Kt(`onMouseLeave`,[`mouseout`,`mouseover`]),Kt(`onPointerEnter`,[`pointerout`,`pointerover`]),Kt(`onPointerLeave`,[`pointerout`,`pointerover`]),Gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Gt(`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){Si(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){Si(e)}i.currentTarget=null,a=c}}}}function Jf(e,t){var n=t[At];n===void 0&&(n=t[At]=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,Ut.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,!Pn||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=Lt(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}jn(function(){var r=a,i=En(n),s=[];a:{var c=_i.get(e);if(c!==void 0){var l=Gn,u=e;switch(e){case`keypress`:if(Bn(n)===0)break a;case`keydown`:case`keyup`:l=lr;break;case`focusin`:u=`focus`,l=er;break;case`focusout`:u=`blur`,l=er;break;case`beforeblur`:case`afterblur`:l=er;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=Qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=$n;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=fr;break;case ui:case di:case fi:l=tr;break;case gi:l=pr;break;case`scroll`:case`scrollend`:l=qn;break;case`wheel`:l=mr;break;case`copy`:case`cut`:case`paste`:l=nr;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ur;break;case`submit`:l=dr;break;case`toggle`:case`beforetoggle`:l=hr}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=Mn(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!==Tn&&(u=n.relatedTarget||n.fromElement)&&(Lt(u)||u[kt]))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?Lt(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=Qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ur,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:zt(c),h=l==null?u:zt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Lt(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?zt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Fr;else if(kr(c)){if(Ir)_=Gr;else{_=Ur;var v=Hr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&bn(r.elementType)&&(_=Fr):_=Wr;if(_&&=_(e,r)){Ar(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?zt(r):window,e){case`focusin`:(kr(v)||v.contentEditable===`true`)&&(ti=v,ni=r,F=null);break;case`focusout`:F=ni=ti=null;break;case`mousedown`:ri=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ri=!1,ii(s,n,i);break;case`selectionchange`:if(ei)break;case`keydown`:case`keyup`:ii(s,n,i)}var y;if(_r)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 Tr?Cr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(br&&n.locale!==`ko`&&(Tr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Tr&&(y=zn()):(In=i,Ln=`value`in In?In.value:In.textContent,Tr=!0)),v=tp(r,b),0<v.length&&(b=new rr(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=wr(n),y!==null&&(b.data=y)))),(y=yr?Er(e,n):Dr(e,n))&&(b=tp(r,`onBeforeInput`),0<b.length&&(v=new rr(`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=Mn(e,n),i!=null&&r.unshift(ep(e,i,a)),i=Mn(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=Mn(n,a),l!=null&&o.unshift(ep(n,l,c))):i||(l=Mn(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===``||gn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&gn(e,``+r);else return;break;case`className`:en(e,`class`,r);break;case`tabIndex`:en(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:en(e,n,r);break;case`style`:yn(e,r,o);return;case`data`:if(t!==`object`){en(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Cn(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=Cn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=wn);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=Cn(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),$t(e,`popover`,r);break;case`xlinkActuate`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:tn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:tn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:tn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:tn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:$t(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=xn.get(n)||n,$t(e,n,r);else return}Zt=!0}function lp(e,t,n,r,a,o){switch(n){case`style`:yn(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`)gn(e,r);else if(typeof r==`number`||typeof r==`bigint`)gn(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=wn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Wt.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[Ot]||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}Zt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):$t(e,n,r)}return}Zt=!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)}}dn(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&&pn(e,!!r,n,!0):pn(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)}hn(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(bn(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&&(Zt=!0),o=m;break;case`name`:m!==f&&(Zt=!0),a=m;break;case`checked`:m!==f&&(Zt=!0),u=m;break;case`defaultChecked`:m!==f&&(Zt=!0),d=m;break;case`value`:m!==f&&(Zt=!0),s=m;break;case`defaultValue`:m!==f&&(Zt=!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)}}un(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&&(Zt=!0),p=o;break;case`defaultValue`:o!==l&&(Zt=!0),c=o;break;case`multiple`:o!==l&&(Zt=!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?pn(e,!!n,n?[]:``,!1):pn(e,!!n,t,!0)):pn(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&&(Zt=!0),p=a;break;case`defaultValue`:a!==o&&(Zt=!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)}mn(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&&(Zt=!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(bn(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[Dt]=r,n[Ot]=t,up(n,e,t),Vt(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[Pt]||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=Lt(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),It(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[Pt])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===wn&&(e.onclick=null),It(e)}function Tm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);It(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=ve.d;ve.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=Rt(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=ln(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),Vt(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="`+ln(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+ln(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+ln(n.imageSizes)+`"]`)):i+=`[href="`+ln(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[Ft]=!0,o.onload=o.onerror=function(){Ht(o)}),Vt(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="`+ln(r)+`"][href="`+ln(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),Vt(r),n.head.appendChild(r)}}}function Rm(e,t,n){km.S(e,t,n);var r=Mm;if(r&&e){var i=Bt(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`);Vt(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=Bt(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`),Vt(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=Bt(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`),Vt(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=De.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=Bt(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=Bt(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=Bt(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="`+ln(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[Ft]){r.loading=1;return}}else t=e.createElement(`link`),t[Ft]=!0,t.onload=t.onerror=Ht.bind(null,t),up(t,`link`,n),Vt(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="`+ln(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~="`+ln(n.href)+`"]`);if(r)return t.instance=r,Vt(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`),Vt(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,Vt(o),o;r=Wm(n),(a=Em.get(a))&&Xm(r,a),o=(e.ownerDocument||e).createElement(`link`),Vt(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,Vt(a),a):(r=n,(a=Em.get(o))&&(r=D({},n),Zm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Vt(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[Pt]||a[Dt]||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,Vt(a);return}a=t.ownerDocument||t,r=Wm(r),(i=Em.get(i))&&Xm(r,i),a=a.createElement(`link`),Vt(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:ne,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_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=gt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.hiddenUpdates=gt(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=Pi(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},go(a),e}function vh(e){return e?(e=Mi,e):Mi}function yh(e,t,n,r,i,a){i=vh(i),r.context===null?r.context=i:r.pendingContext=i,r=vo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=yo(e,r,t),n!==null&&(zd(n,e,t),bo(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=ki(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=St(t);var n=ki(e,t);n!==null&&zd(n,e,t),xh(e,t)}}var wh=!0;function Th(e,t,n,r){var i=_e.T;_e.T=null;var a=ve.p;try{ve.p=2,Dh(e,t,n,r)}finally{ve.p=a,_e.T=i}}function Eh(e,t,n,r){var i=_e.T;_e.T=null;var a=ve.p;try{ve.p=8,Dh(e,t,n,r)}finally{ve.p=a,_e.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=Rt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ut(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-rt(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(ed&6)&&(xd=Ge()+500,Nf(0,!1))}}break;case 31:case 13:s=ki(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=En(e),Ah(e)}var kh=null;function Ah(e){if(kh=null,e=Lt(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(Ke()){case qe:return 2;case Je:return 8;case Ye:case Xe:return 32;case Ze: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=Rt(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=Lt(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,Tt(e.priority,function(){Ch(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Tt(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);Tn=r,n.target.dispatchEvent(r),Tn=null}else return t=Rt(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=Rt(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[Ot]||null;if(typeof a==`function`)o||Yh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ot]||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[kt]=null}};function $h(e){this._internalRoot=e}$h.prototype.unstable_scheduleHydration=function(e){if(e){var t=wt();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.1`)throw Error(i(527,eg,`19.3.1`));ve.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.1`,rendererPackageName:`react-dom`,currentDispatcherRef:_e,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{et=ng.inject(tg),tt=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[kt]=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=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,y=/^[\\/]{2}/;function b(e,t){return t+e.replace(/\\/g,`/`)}var x=`popstate`;function S(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function C(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return O(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:k(t)}return j(t,n,null,e)}function w(e,t){if(e===!1||e==null)throw Error(t)}function T(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function E(){return Math.random().toString(36).substring(2,10)}function D(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function O(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?A(t):t,state:n,key:t&&t.key||r||E(),mask:i}}function k({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function A(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function j(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u()+1;let d=D(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u();let i=D(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ee(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(x,d),c=e,()=>{i.removeEventListener(x,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ee(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),w(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:k(t);return i=i.replace(/ $/,`%20`),!n&&y.test(i)&&(i=r+i),new URL(i,r)}var M=l(d(),1);function te(e,t,n=`/`){return ne(e,t,n,!1)}function ne(e,t,n,r,i){let a=Se((typeof t==`string`?A(t):t).pathname||`/`,n);if(a==null)return null;let o=i??N(e),s=null,c=xe(a);for(let e=0;s==null&&e<o.length;++e)s=_e(o[e],c,r);return s}function N(e){let t=re(e);return ae(t),t}function re(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;w(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Ae([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(w(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),re(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:he(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=be(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ie(e.path))a(e,t,!0,n)}),t}function ie(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ie(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ae(e){e.sort((e,t)=>e.score===t.score?ge(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var oe=/^:[\w-]+$/,se=/^:[\w-]+/,ce=3.5,le=3,ue=2,de=1,fe=10,pe=-2,me=e=>e===`*`;function he(e,t){let n=e.split(`/`),r=n.length;return n.some(me)&&(r+=pe),t&&(r+=ue),n.filter(e=>!me(e)).reduce((e,t)=>e+(oe.test(t)?le:se.test(t)?ce:t===``?de:fe),r)}function ge(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function _e(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ye(u,l,s.matcher,s.compiledParams):ve(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ve({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Ae([a,d.pathname]),pathnameBase:Me(Ae([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Ae([a,d.pathnameBase]))}return o}function ve(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=be(e.path,e.caseSensitive,e.end);return ye(e,t,n,r)}function ye(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=je(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=je(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function be(e,t=!1,n=!0){T(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function xe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return T(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Se(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Ce(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?A(e):e,a;return n?(n=ke(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?we(n.substring(1),`/`):we(n,t)):a=t,{pathname:a,search:Ne(r),hash:Pe(i)}}function we(e,t){let n=je(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Te(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ee(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function De(e){let t=Ee(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Oe(e,t,n,r=!1){let i;typeof e==`string`?i=A(e):(i={...e},w(!i.pathname||!i.pathname.includes(`?`),Te(`?`,`pathname`,`search`,i)),w(!i.pathname||!i.pathname.includes(`#`),Te(`#`,`pathname`,`hash`,i)),w(!i.search||!i.search.includes(`#`),Te(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ce(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ke=e=>e.replace(/[\\/]{2,}/g,`/`),Ae=e=>ke(e.join(`/`));function je(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Me=e=>je(e).replace(/^\/*/,`/`),Ne=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Pe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Fe=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ie(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Le(e){return Ae(e.map(e=>e.route.path).filter(Boolean))||`/`}var Re=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ze(e,t){let n=e;if(typeof n!=`string`||!v.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Re)try{let e=new URL(window.location.href),r=y.test(n)?new URL(b(n,e.protocol)):new URL(n),a=Se(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{T(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Be=new URL(`http://localhost`);function Ve(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Be)}catch{return Be}}function He(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Ue(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function We(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!He(i,n),s=!He(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Ue(e,i)||!He(i,a)))throw Error(`External navigation is not allowed`)}var Ge=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ge);var Ke=[`GET`,...Ge];new Set(Ke);var qe=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Je(e){try{return qe.includes(new URL(e).protocol)}catch{return!1}}var Ye=M.createContext(null);Ye.displayName=`DataRouter`;var Xe=M.createContext(null);Xe.displayName=`DataRouterState`;var Ze=M.createContext(null);Ze.displayName=`DataRouterData`;var Qe=M.createContext(null);Qe.displayName=`DataRouterNavigation`;var $e=M.createContext(!1);function et(){return M.useContext($e)}var tt=M.createContext({isTransitioning:!1});tt.displayName=`ViewTransition`;var nt=M.createContext(null);nt.displayName=`Fetchers`;var rt=M.createContext(null);rt.displayName=`Await`;var it=M.createContext(null);it.displayName=`Navigation`;var at=M.createContext(null);at.displayName=`Location`;var ot=M.createContext({outlet:null,matches:[],isDataRoute:!1});ot.displayName=`Route`;var st=M.createContext(!1);st.displayName=`IsDataRoute`;var ct=M.createContext(void 0);ct.displayName=`RouteId`;var lt=M.createContext(null);lt.displayName=`RouteError`;var ut=`REACT_ROUTER_ERROR`,dt=`REDIRECT`,ft=`ROUTE_ERROR_RESPONSE`;function pt(e){if(e.startsWith(`${ut}:${dt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function mt(e){if(e.startsWith(`${ut}:${ft}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Fe(t.status,t.statusText,t.data)}catch{}}function ht(e,{relative:t}={}){w(gt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=M.useContext(it),{hash:i,pathname:a,search:o}=Ct(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Ae([n,a])),r.createHref({pathname:s,search:o,hash:i})}function gt(){return M.useContext(at)!=null}function _t(){return w(gt(),`useLocation() may be used only in the context of a <Router> component.`),M.useContext(at).location}function vt(e){w(gt(),`useMatch() may be used only in the context of a <Router> component.`);let{pathname:t}=_t();return M.useMemo(()=>ve(e,xe(t)),[t,e])}var yt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function bt(){return M.useContext(st)?zt():xt()}function xt(){w(gt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=M.useContext(Ye),{basename:t,navigator:n}=M.useContext(it),{matches:r}=M.useContext(ot),{pathname:i}=_t(),a=JSON.stringify(De(r)),o=M.useRef(!1);return M.useLayoutEffect(()=>{o.current=!0}),M.useCallback((r,s={})=>{if(T(o.current,yt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Oe(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ae([t,c.pathname])),We(typeof r==`string`?r:k(r),n.createHref(c),Ve(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}M.createContext(null);function St(){let{matches:e}=M.useContext(ot);return e[e.length-1]?.params??{}}function Ct(e,{relative:t}={}){let{matches:n}=M.useContext(ot),{pathname:r}=_t(),i=JSON.stringify(De(n));return M.useMemo(()=>Oe(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function wt(e,t){return Tt(e,t)}function Tt(e,t,n){w(gt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=M.useContext(it),{matches:i}=M.useContext(ot),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=_t(),l;if(t){let e=typeof t==`string`?A(t):t;w(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f;f=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):te(e,{pathname:d});let p=Mt(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Ae([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:Ae([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?M.createElement(at.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Et(){let e=Rt(),t=Ie(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return M.createElement(M.Fragment,null,M.createElement(`h2`,null,`Unexpected Application Error!`),M.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?M.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Dt=M.createElement(Et,null),Ot=class extends M.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=$e;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=mt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:M.createElement(ot.Provider,{value:this.props.routeContext},M.createElement(st.Provider,{value:this.props.routeContext.isDataRoute},M.createElement(ct.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},M.createElement(lt.Provider,{value:e,children:this.props.component}))));return this.context?M.createElement(At,{error:e},t):t}},kt=new WeakMap;function At({children:e,error:t}){let{basename:n,navigator:r}=M.useContext(it);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=pt(t.digest);if(e){let i=kt.get(t);if(i)throw i;let a=ze(e.location,n),o=a.absoluteURL||a.to;if(We(e.location,o,Ve(r),`allow-explicit`),Je(o))throw Error(`Invalid redirect location`);if(Re&&!kt.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw kt.set(t,n),n}}return M.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function jt({routeContext:e,match:t,children:n}){let r=M.useContext(Ye);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),M.createElement(ot.Provider,{value:e},M.createElement(st.Provider,{value:e.isDataRoute},M.createElement(ct.Provider,{value:t.route.id},n)))}function Mt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);w(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Le(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Dt,o&&(s<0&&c===0?(Vt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?M.createElement(n.route.Component,null):n.route.element?n.route.element:e,M.createElement(jt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?M.createElement(Ot,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Nt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pt(e){let t=M.useContext(Ye);return w(t,Nt(e)),t}function Ft(e){let t=M.useContext(Xe);return w(t,Nt(e)),t}function It(e){let t=M.useContext(Ze);return w(t,Nt(e)),t}function Lt(e){let t=M.useContext(ct);return w(t,`${e} can only be used on routes that contain a unique "id"`),t}function Rt(){let e=M.useContext(lt),t=It(`useRouteError`),n=Lt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function zt(){let{router:e}=Pt(`useNavigate`),t=Lt(`useNavigate`),n=M.useRef(!1);return M.useLayoutEffect(()=>{n.current=!0}),M.useCallback(async(r,i={})=>{T(n.current,yt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Bt={};function Vt(e,t,n){!t&&!Bt[e]&&(Bt[e]=!0,T(!1,n))}M.memo(Ht);function Ht({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=M.useContext(Ye);return w(a,`You must render this element inside a <DataRouterContext.Provider> element`),Tt(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function Ut(e){w(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Wt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){w(!gt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=M.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=A(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=M.useMemo(()=>{let e=Se(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return T(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:M.createElement(it.Provider,{value:c},M.createElement(at.Provider,{children:t,value:h}))}function Gt({children:e,location:t}){return wt(Kt(e),t)}M.Component;function Kt(e,t=[]){let n=[];return M.Children.forEach(e,(e,r)=>{if(!M.isValidElement(e))return;let i=[...t,r];if(e.type===M.Fragment){n.push.apply(n,Kt(e.props.children,i));return}w(e.type===Ut,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;w(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=Kt(a.children,i)),n.push(o)}),n}var qt=`application/x-www-form-urlencoded`;function Jt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Yt(e){return Jt(e)&&e.tagName.toLowerCase()===`button`}function Xt(e){return Jt(e)&&e.tagName.toLowerCase()===`form`}function Zt(e){return Jt(e)&&e.tagName.toLowerCase()===`input`}function Qt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $t(e,t){return e.button===0&&(!t||t===`_self`)&&!Qt(e)}function en(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function tn(e,t){let n=en(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var nn=null;function rn(){if(nn===null)try{new FormData(document.createElement(`form`),0),nn=!1}catch{nn=!0}return nn}var an=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function on(e){return e!=null&&!an.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${qt}"`),null):e}function sn(e,t){let n,r,i,a,o;if(Xt(e)){let o=e.getAttribute(`action`);r=o?Se(o,t):null,n=e.getAttribute(`method`)||`get`,i=on(e.getAttribute(`enctype`))||qt,a=new FormData(e)}else if(Yt(e)||Zt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Se(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=on(e.getAttribute(`formenctype`))||on(o.getAttribute(`enctype`))||qt,a=new FormData(o,e),!rn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Jt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=qt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function cn(e,t){if(e===!1||e==null)throw Error(t)}function ln(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}var un=_(),dn=`modulepreload`,fn=function(e){return`/`+e},pn={},mn=function(e){return e.pathname.endsWith(`.css`)},hn=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},gn=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,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?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=fn(t,n);let r=s(t),i=mn(r);return hn(pn,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:dn,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).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)})};async function _n(e,t){if(e.id in t)return t[e.id];try{let n=await gn(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function vn(e){return e!=null&&typeof e.page==`string`}function yn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function bn(e,t,n){return Tn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await _n(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(yn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function xn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Sn(e,t,{includeHydrateFallback:n}={}){return Cn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Cn(e){return[...new Set(e)]}function wn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Tn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!vn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(wn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var En=M.createContext(void 0);En.displayName=`FrameworkContext`;function Dn(){let e=M.useContext(En);return cn(e,`You must render this element inside a <HydratedRouter> element`),e}function On(e,t){let n=M.useContext(En),[r,i]=M.useState(!1),[a,o]=M.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=M.useRef(null);M.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),M.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:kn(s,p),onBlur:kn(c,m),onMouseEnter:kn(l,p),onMouseLeave:kn(u,m),onTouchStart:kn(d,p)}]:[a,f,{}]:[!1,f,{}]}function kn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function An({page:e,...t}){let n=et(),{nonce:r}=Dn(),{router:i}=Pt(`PrefetchPageLinks`),a=M.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?M.createElement(Mn,{page:e,matches:a,...t}):M.createElement(Nn,{page:e,matches:a,...t})):null}function jn(e){let{manifest:t,routeModules:n}=Dn(),[r,i]=M.useState([]);return M.useEffect(()=>{let r=!1;return bn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Mn({page:e,matches:t,...n}){let r=_t(),i=M.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=ln(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return M.createElement(M.Fragment,null,i.map(e=>M.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Nn({page:e,matches:t,...n}){let r=_t(),{manifest:i,routeModules:a}=Dn(),{matches:o}=Ft(`PrefetchPageLinks`),{loaderData:s}=It(`PrefetchPageLinks`),c=M.useMemo(()=>xn(e,t,o,i,r,`data`),[e,t,o,i,r]),l=M.useMemo(()=>xn(e,t,o,i,r,`assets`),[e,t,o,i,r]),u=M.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let l=ln(e,`data`);return o&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[s,r,i,c,t,e,a]),d=M.useMemo(()=>Sn(l,i),[l,i]),f=jn(l);return M.createElement(M.Fragment,null,u.map(e=>M.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>M.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>M.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Pn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Fn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Fn&&(window.__reactRouterVersion=`8`)}catch{}function In({basename:e,children:t,useTransitions:n,window:r}){let i=M.useRef(null);i.current??=C({window:r,v5Compat:!0});let a=i.current,[o,s]=M.useState({action:a.action,location:a.location}),c=M.useCallback(e=>{n===!1?s(e):M.startTransition(()=>s(e))},[n]);return M.useLayoutEffect(()=>a.listen(c),[a,c]),M.createElement(Wt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Ln=M.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=M.useContext(it),y=typeof l==`string`&&v.test(l),b=ze(l,h);l=b.to;let x=ht(l,{relative:r}),S=_t(),C=null;if(o){let e=Oe(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Ae([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=On(n,p),D=Bn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=M.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Pn(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?M.createElement(M.Fragment,null,A,M.createElement(An,{page:x})):A});Ln.displayName=`Link`;var Rn=M.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Ct(a,{relative:c.relative}),d=_t(),f=M.useContext(Qe),{navigator:p,basename:m}=M.useContext(it),h=f!=null&&Kn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f?.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Se(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(y)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return M.createElement(Ln,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Rn.displayName=`NavLink`;var zn=M.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=M.useContext(it),g=Wn(),_=Gn(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&v.test(s);return M.createElement(`form`,{ref:m,method:y,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?M.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});zn.displayName=`Form`;function Bn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=bt(),d=_t(),f=Ct(e,{relative:o});return M.useCallback(p=>{if($t(p,t)){p.preventDefault();let t=n===void 0?k(d)===k(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?M.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Vn(e){T(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=M.useRef(en(e)),n=M.useRef(!1),r=_t(),i=M.useMemo(()=>tn(r.search,n.current?null:t.current),[r.search]),a=bt();return[i,M.useCallback((e,t)=>{let r=en(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Hn=0,Un=()=>`__${String(++Hn)}__`;function Wn(){let{router:e}=Pt(`useSubmit`),{basename:t}=M.useContext(it),n=Lt(`useSubmit`),r=e.fetch,i=e.navigate;return M.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=sn(e,t);a.navigate===!1?await r(a.fetcherKey||Un(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Gn(e,{relative:t}={}){let{basename:n}=M.useContext(it),r=M.useContext(ot);w(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Ct(e||`.`,{relative:t})},o=_t();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Ae([n,a.pathname])),k(a)}function Kn(e,{relative:t}={}){let n=M.useContext(tt);w(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Pt(`useViewTransitionState`),i=Ct(e,{relative:t});if(!n.isTransitioning)return!1;let a=Se(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Se(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ve(i.pathname,o)!=null||ve(i.pathname,a)!=null}function qn(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=qn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Jn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qn(e))&&(r&&(r+=` `),r+=t);return r}var Yn=(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},Xn=(e,t)=>({classGroupId:e,validator:t}),Zn=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Qn=`-`,$n=[],er=`arbitrary..`,tr=e=>{let t=ir(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return rr(e);let n=e.split(Qn);return nr(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Yn(i,t):t:i||$n}return n[e]||$n}}},nr=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=nr(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Qn):e.slice(t).join(Qn),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},rr=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?er+r:void 0})(),ir=e=>{let{theme:t,classGroups:n}=e;return ar(n,t)},ar=(e,t)=>{let n=Zn();for(let r in e){let i=e[r];or(i,n,r,t)}return n},or=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];sr(i,t,n,r)}},sr=(e,t,n,r)=>{typeof e==`string`?cr(e,t,n):typeof e==`function`?lr(e,t,n,r):ur(e,t,n,r)},cr=(e,t,n)=>{let r=e===``?t:dr(t,e);r.classGroupId=n},lr=(e,t,n,r)=>{fr(e)?or(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Xn(n,e)))},ur=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];or(o,dr(t,a),n,r)}},dr=(e,t)=>{let n=e,r=t.split(Qn),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Zn(),n.nextPart.set(t,i)),n=i}return n},fr=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,pr=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)}}},mr=`!`,hr=`:`,gr=[],_r=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),vr=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===hr){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(mr)?(c=s.slice(0,-1),l=!0):s.startsWith(mr)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return _r(t,l,c,u)};if(t){let e=t+hr,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):_r(gr,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},yr=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}},br=e=>({cache:pr(e.cacheSize),parseClassName:vr(e),sortModifiers:yr(e),postfixLookupClassGroupIds:xr(e),...tr(e)}),xr=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},Sr=/\s+/,Cr=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Sr),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||(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?_+mr:_,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},wr=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Tr(n))&&(i&&(i+=` `),i+=r);return i},Tr=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Tr(e[r]))&&(n&&(n+=` `),n+=t);return n},Er=(e,...t)=>{let n,r,i,a,o=o=>(n=br(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=Cr(e,n);return i(e,a),a};return a=o,(...e)=>a(wr(...e))},Dr=[],Or=e=>{let t=t=>t[e]||Dr;return t.isThemeGetter=!0,t.themeKey=e,t},kr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ar=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Mr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Nr=/\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$/,Pr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Fr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ir=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lr=e=>jr.test(e),Rr=e=>!!e&&!Number.isNaN(Number(e)),zr=e=>!!e&&Number.isInteger(Number(e)),Br=e=>e.endsWith(`%`)&&Rr(e.slice(0,-1)),Vr=e=>Mr.test(e),Hr=()=>!0,Ur=e=>Nr.test(e)&&!Pr.test(e),Wr=()=>!1,Gr=e=>Fr.test(e),Kr=e=>Ir.test(e),qr=e=>!P(e)&&!F(e),Jr=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)),Yr=e=>ui(e,mi,Wr),P=e=>kr.test(e),Xr=e=>ui(e,hi,Ur),Zr=e=>ui(e,gi,Rr),Qr=e=>ui(e,vi,Hr),$r=e=>ui(e,_i,Wr),ei=e=>ui(e,fi,Wr),ti=e=>ui(e,pi,Kr),ni=e=>ui(e,yi,Gr),F=e=>Ar.test(e),ri=e=>di(e,hi),ii=e=>di(e,_i),ai=e=>di(e,fi),oi=e=>di(e,mi),si=e=>di(e,pi),ci=e=>di(e,yi,!0),li=e=>di(e,vi,!0),ui=(e,t,n)=>{let r=kr.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},di=(e,t,n=!1)=>{let r=Ar.exec(e);return r?r[1]?t(r[1]):n:!1},fi=e=>e===`position`||e===`percentage`,pi=e=>e===`image`||e===`url`,mi=e=>e===`length`||e===`size`||e===`bg-size`,hi=e=>e===`length`,gi=e=>e===`number`,_i=e=>e===`family-name`,vi=e=>e===`number`||e===`weight`,yi=e=>e===`shadow`,bi=Er(()=>{let e=Or(`color`),t=Or(`font`),n=Or(`text`),r=Or(`font-weight`),i=Or(`tracking`),a=Or(`leading`),o=Or(`breakpoint`),s=Or(`container`),c=Or(`spacing`),l=Or(`radius`),u=Or(`shadow`),d=Or(`inset-shadow`),f=Or(`text-shadow`),p=Or(`drop-shadow`),m=Or(`blur`),h=Or(`perspective`),g=Or(`aspect`),_=Or(`ease`),v=Or(`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(),F,P],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[F,P,c],T=()=>[Lr,`full`,`auto`,...w()],E=()=>[zr,`none`,`subgrid`,F,P],D=()=>[`auto`,{span:[`full`,zr,F,P]},zr,F,P],O=()=>[zr,`auto`,F,P],k=()=>[`auto`,`min`,`max`,`fr`,F,P],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ee=()=>[`auto`,...w()],M=()=>[Lr,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[s,Lr,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[Lr,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,F,P],re=()=>[...b(),ai,ei,{position:[F,P]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,oi,Yr,{size:[F,P]}],oe=()=>[Br,ri,Xr],se=()=>[``,`none`,`full`,l,F,P],ce=()=>[``,Rr,ri,Xr],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],de=()=>[Rr,Br,ai,ei],fe=()=>[``,`none`,m,F,P],pe=()=>[`none`,Rr,F,P],me=()=>[`none`,Rr,F,P],he=()=>[Rr,F,P],ge=()=>[Lr,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Vr],breakpoint:[Vr],color:[Hr],container:[Vr],"drop-shadow":[Vr],ease:[`in`,`out`,`in-out`],font:[qr],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Vr],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Vr],shadow:[Vr],spacing:[`px`,Rr],text:[Vr],"text-shadow":[Vr],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Lr,P,F,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,F,P]}],"container-named":[Jr],columns:[{columns:[Rr,`auto`,P,F,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:[zr,`auto`,F,P]}],basis:[{basis:[Lr,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Rr,Lr,`auto`,`initial`,`none`,P]}],grow:[{grow:[``,Rr,F,P]}],shrink:[{shrink:[``,Rr,F,P]}],order:[{order:[zr,`first`,`last`,`none`,F,P]}],"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:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mbs:[{mbs:ee()}],mbe:[{mbe:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...M()]}],"font-size":[{text:[`base`,n,ri,Xr]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,li,Qr]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Br,P]}],"font-family":[{font:[ii,$r,t]}],"font-features":[{"font-features":[P]}],"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,F,P]}],"line-clamp":[{"line-clamp":[Rr,`none`,F,Zr]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,F,P]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,F,P]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[Rr,`from-font`,`auto`,F,Xr]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Rr,`auto`,F,P]}],"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:[zr,F,P]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,F,P]}],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`,F,P]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},zr,F,P],radial:[``,F,P],conic:[``,zr,F,P]},si,ti]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Rr,F,P]}],"outline-w":[{outline:[``,Rr,ri,Xr]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`inner`,`none`,u,ci,ni]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,ci,ni]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Rr,Xr]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,ci,ni]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Rr,F,P]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"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":[Rr]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[F,P]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":[Rr]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,F,P]}],filter:[{filter:[``,`none`,F,P]}],blur:[{blur:fe()}],brightness:[{brightness:[Rr,F,P]}],contrast:[{contrast:[Rr,F,P]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ci,ni]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,Rr,F,P]}],"hue-rotate":[{"hue-rotate":[Rr,F,P]}],invert:[{invert:[``,Rr,F,P]}],saturate:[{saturate:[Rr,F,P]}],sepia:[{sepia:[``,Rr,F,P]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,F,P]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[Rr,F,P]}],"backdrop-contrast":[{"backdrop-contrast":[Rr,F,P]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Rr,F,P]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rr,F,P]}],"backdrop-invert":[{"backdrop-invert":[``,Rr,F,P]}],"backdrop-opacity":[{"backdrop-opacity":[Rr,F,P]}],"backdrop-saturate":[{"backdrop-saturate":[Rr,F,P]}],"backdrop-sepia":[{"backdrop-sepia":[``,Rr,F,P]}],"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`,F,P]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Rr,`initial`,F,P]}],ease:[{ease:[`linear`,`initial`,_,F,P]}],delay:[{delay:[Rr,F,P]}],animate:[{animate:[`none`,v,F,P]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,F,P]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[F,P,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[zr,F,P]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"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`,F,P]}],"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":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"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`,F,P]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[Rr,ri,Xr,Zr]}],stroke:[{stroke:[`none`,...N()]}],"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`]}});function I(...e){return bi(Jn(e))}var xi=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})),L=o(((e,t)=>{t.exports=xi()}))();function Si({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`skeleton`,className:I(`animate-pulse rounded-md bg-muted`,e),...t})}var Ci={assign:0,create:0,clone:0,discard:0,update:0};function wi(e,t,n){return e>=t&&e<=n}function Ti(e){return e===8205}function Ei(e){return wi(e,55296,56319)}function Di(e){return wi(e,127462,127487)}function Oi(e){return wi(e,65024,65039)}function ki(e){return wi(e,768,879)||wi(e,6832,6911)||wi(e,7616,7679)||wi(e,65056,65071)}function Ai(e){return e>65535?2:1}function ji(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(ki(n)||Oi(n))t+=Ai(n);else break}return t}function Mi(e,t){let n=e.codePointAt(t),r=t+Ai(n);for(r=ji(e,r);r<e.length-1&&Ti(e.codePointAt(r));){let t=e.codePointAt(r+1);r+=1+Ai(t),r=ji(e,r)}return Di(n)&&r<e.length&&Di(e.codePointAt(r))&&(r+=Ai(e.codePointAt(r))),r}function Ni(e){return e>=768&&(Ei(e)||ki(e)||Oi(e)||Ti(e))}function Pi(e,t){let n=0,r=0;for(;r<e.length;)if(r=Mi(e,r),++n>=t)return!0;return!1}function Fi(e,t){let n=0,r=0;for(;r<e.length;)if(r=Mi(e,r),++n>t)return!1;return!0}function Ii(e,t){if(t===0)return!0;if(e.length<t)return!1;let n=0;for(;;){if(Ni(e.charCodeAt(n)))return Pi(e,t);if(++n>=t)return!0}}function Li(e,t){if(e.length<=t)return!0;let n=0;for(;;){if(Ni(e.charCodeAt(n)))return Fi(e,t);if(++n>t)return!1}}function Ri(e){return Array.isArray(e)}function zi(e){return R(typeof e,`bigint`)}function Bi(e){return R(typeof e,`boolean`)}function Vi(e){if(Xi(e)||!Hi(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Hi(e){return R(typeof e,`function`)}function Ui(e){return Number.isInteger(e)}function Wi(e){return R(e,null)}function Gi(e){return Number.isFinite(e)}function Ki(e){return qi(e)&&!Ri(e)}function qi(e){return R(typeof e,`object`)&&!Wi(e)}function Ji(e){return R(typeof e,`string`)}function Yi(e){return R(typeof e,`symbol`)}function Xi(e){return R(e,void 0)}function R(e,t){return e===t}function Zi(e,t){return e>t}function Qi(e,t){return e<t}function $i(e,t){return e<=t}function ea(e,t){return e>=t}function ta(e,t){if(zi(e)||zi(t))return BigInt(e)%BigInt(t)===0n;if(!Gi(e)||Ui(e)&&1/t%1==0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t),Math.abs(n+t))<1e-10}function na(e){if(!qi(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!Wi(t)&&R(typeof t.constructor,`function`)&&!(R(t.constructor,globalThis.Object)||R(t.constructor.name,`Object`))}function ra(e){return zi(e)||Bi(e)||Wi(e)||Gi(e)||Ji(e)||Xi(e)}function ia(e,t){return Li(e,t)}function aa(e,t){return Ii(e,t)}function oa(e,t,n){return e.every((e,r)=>r<t||n(e,r))}function sa(e,t){return e.some((e,n)=>t(e,n))}function ca(e,t){let n=!1;return e.forEach((e,r)=>{t(e,r)&&(n=!0)}),n}function la(e,t){return e.reduce((e,n,r)=>t(n,r)?++e:e,0)}function ua(e,t,n){return R(e.length,0)?n():t(e[0],e.slice(1))}function da(e){return R(e,`__proto__`)||R(e,`constructor`)||R(e,`prototype`)}function z(e,t){return da(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function fa(e){return Object.entries(e)}function pa(e){return Object.getOwnPropertyNames(e)}function ma(e){return Object.getOwnPropertySymbols(e)}function ha(e){return Object.values(e)}function ga(e,t){if(!qi(t))return!1;let n=pa(e);return R(n.length,pa(t).length)&&n.every(n=>va(e[n],t[n]))}function _a(e,t){return Ri(t)&&R(e.length,t.length)&&e.every((n,r)=>va(e[r],t[r]))}function va(e,t){return Ri(e)?_a(e,t):qi(e)?ga(e,t):R(e,t)}function ya(e){return e instanceof Boolean}function ba(e){return e instanceof Number}function xa(e){return e instanceof String}function Sa(e){return globalThis.ArrayBuffer.isView(e)}function Ca(e){return e instanceof globalThis.RegExp}function wa(e){return e instanceof globalThis.Date}function Ta(e){return e instanceof globalThis.Set}function Ea(e){return e instanceof globalThis.Map}var Da={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Oa(){return Da}function ka(e){return Oa().immutableTypes?Object.freeze(e):e}function Aa(e,t){return Ci.assign+=1,ka({...e,...t})}function ja(e){return e}function Ma(e){return z(e,`~kind`)||z(e,`~unsafe`)}function Na(e){let t={};for(let n of pa(e)){if(da(n))continue;let r=Object.getOwnPropertyDescriptor(e,n);r.value=Va(r.value),R(r.enumerable,!0)?t[n]=r.value:Object.defineProperty(t,n,r)}return t}function Pa(e){let t={};for(let n of pa(e))da(n)||(t[n]=Va(e[n]));for(let n of ma(e))t[n]=Va(e[n]);return t}function Fa(e){return na(e)?ja(e):Ma(e)?Na(e):Pa(e)}function Ia(e){return e.map(e=>Va(e))}function La(e){return e.slice()}function Ra(e){return new RegExp(e.source,e.flags)}function za(e){return new Map(Va([...e.entries()]))}function Ba(e){return new Set(Va([...e.values()]))}function Va(e){return Sa(e)?La(e):Ca(e)?Ra(e):Ea(e)?za(e):Ta(e)?Ba(e):Ri(e)?Ia(e):qi(e)?Fa(e):e}function Ha(e){return Ci.clone+=1,Va(e)}function Ua(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Wa(e,t){return{...e,...t}}function Ga(e,t,n={}){Ci.create+=1;let r=Wa(t,n);return ka(Oa().enumerableKind?Wa(r,e):Ua(r,e))}function Ka(e,t){Ci.discard+=1;let n={};for(let r of pa(e)){if(t.includes(r))continue;let i=Object.getOwnPropertyDescriptor(e,r);i.value=Ha(i.value),Object.defineProperty(n,r,i)}return ka(n)}function qa(e,t,n){Ci.update+=1;let r=Oa(),i=Ha(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return ka(i)}function Ja(e,t){return qi(e)&&z(e,`~kind`)&&R(e[`~kind`],t)}function Ya(e){return qi(e)}function Xa(e,t,n){return Ga({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function Za(e){return Ja(e,`Deferred`)}function Qa(e){return qa(e,{"~readonly":!0},{})}function $a(e,t){return qa(Qa(e),{},t)}function eo(e,t,n,r){return $a(K(e,t,n),r)}function to(e){return qa(e,{"~optional":!0},{})}function no(e,t){return qa(to(e),{},t)}function ro(e,t,n,r){return no(K(e,t,n),r)}function io(e,t){return Ga({"~kind":`Array`},{type:`array`,items:e},t)}function ao(e){return Ja(e,`Array`)}function oo(e){return Ka(e,[`~kind`,`type`,`items`])}function so(e,t,n={}){return Ga({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function co(e){return Ja(e,`Constructor`)}function lo(e){return Ka(e,[`~kind`,`type`,`parameters`,`instanceType`])}function uo(e,t,n={}){return Ga({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function fo(e){return Ja(e,`Function`)}function po(e){return Ka(e,[`~kind`,`type`,`parameters`,`returnType`])}function mo(e,t){return Ga({"~kind":`Ref`},{$ref:e},t)}function ho(e){return Ja(e,`Ref`)}function go(e,t){return Ga({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function _o(e){return Ja(e,`Generic`)}function vo(e){return Ga({"~kind":`Any`},{},e)}function yo(e){return Ja(e,`Any`)}var bo=`(?!)`;function xo(e){return Ga({"~kind":`Never`},{not:{}},e)}function So(e){return Ja(e,`Never`)}function Co(e,t={}){return no(e,t)}function wo(e){return Co(e)}function To(e){return Ya(e)&&z(e,`~optional`)}function Eo(e){return pa(e).filter(t=>!To(e[t]))}function Do(e){return pa(e)}function Oo(e){return ha(e)}function B(e,t={}){let n=Eo(e);return Ga({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function ko(e){return Ja(e,`Object`)}function Ao(e){return Ka(e,[`~kind`,`type`,`properties`,`required`])}function jo(e){return Ga({"~kind":`Unknown`},{},e)}function Mo(e){return Ja(e,`Unknown`)}function No(e,t,n){return Ga({"~kind":`Cyclic`},{$defs:pa(e).reduce((t,n)=>({...t,[n]:qa(e[n],{},{$id:n})}),{}),$ref:t},n)}function Po(e){return Ja(e,`Cyclic`)}function Fo(e){return qa(e,{"~unsafe":null},{})}function Io(e){return Ki(e)&&z(e,`~unsafe`)&&Wi(e[`~unsafe`])}function Lo(e,t){return t[e.length]?.(...e)??(()=>{throw Error(`Invalid Arguments`)})()}function Ro(e){return Ja(e,`Infer`)}function zo(e,t,n,r={}){return Ga({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function Bo(e){return Ja(e,`Dependent`)}function Vo(e){return Ka(e,[`~kind`,`if`,`then`,`else`])}function Ho(e){return Ja(e,`Enum`)}function Uo(e,t={}){return Ga({"~kind":`Intersect`},{allOf:e},t)}function Wo(e){return Ja(e,`Intersect`)}function Go(e){return Ka(e,[`~kind`,`allOf`])}function Ko(){throw Error(`Unreachable`)}function qo(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function Jo(e){return typeof e==`number`}var Yo;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(Yo||={});var Xo=BigInt(`14695981039346656037`),[Zo,Qo]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],$o=Array.from({length:256}).map((e,t)=>BigInt(t)),es=new Float64Array(1),ts=new DataView(es.buffer),ns=new Uint8Array(es.buffer);function rs(e){Xo^=$o[e],Xo=Xo*Zo%Qo}function is(e){rs(Yo.Array);for(let t of e)ys(t)}function as(e){rs(Yo.BigInt),ts.setBigInt64(0,e);for(let e of ns)rs(e)}function os(e){rs(Yo.Boolean),rs(+!!e)}function ss(e){rs(Yo.Constructor),ys(e.toString())}function cs(e){rs(Yo.Date),ys(e.getTime())}function ls(e){rs(Yo.Function),ys(e.toString())}function us(e){rs(Yo.Null)}function ds(e){rs(Yo.Number),ts.setFloat64(0,e,!0);for(let e of ns)rs(e)}function fs(e){rs(Yo.Object);for(let t of qo(e).sort())ys(t),ys(e[t])}function ps(e){rs(Yo.RegExp),hs(e.toString())}var ms=new TextEncoder;function hs(e){rs(Yo.String);for(let t of ms.encode(e))rs(t)}function gs(e){rs(Yo.Symbol),ys(e.toString())}function _s(e){rs(Yo.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)rs(t[e])}function vs(e){return rs(Yo.Undefined)}function ys(e){return Sa(e)?_s(e):wa(e)?cs(e):Ca(e)?ps(e):ya(e)?os(e.valueOf()):xa(e)?hs(e.valueOf()):ba(e)?ds(e.valueOf()):Jo(e)?ds(e):Ri(e)?is(e):Bi(e)?os(e):zi(e)?as(e):Vi(e)?ss(e):Wi(e)?us(e):qi(e)?fs(e):Ji(e)?hs(e):Yi(e)?gs(e):Xi(e)?vs(e):Hi(e)?ls(e):Ko()}function bs(e){return Xo=BigInt(`14695981039346656037`),ys(e),Xo}function xs(e){return bs(e).toString(16).padStart(16,`0`)}function Ss(e){return Ya(e)&&z(e,`~immutable`)}function Cs(e,t={}){return $a(e,t)}function ws(e){return Ya(e)&&z(e,`~readonly`)}var Ts=`-?(?:0|[1-9][0-9]*)n`;function Es(e){return Ga({"~kind":`BigInt`},{type:`bigint`},e)}function Ds(e){return Ja(e,`BigInt`)}function Os(e){return Ga({"~kind":`Boolean`},{type:`boolean`},e)}function ks(e){return Ja(e,`Boolean`)}var As=`-?(?:0|[1-9][0-9]*)`;function js(e){return Ga({"~kind":`Integer`},{type:`integer`},e)}function Ms(e){return Ja(e,`Integer`)}var Ns=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function Ps(e){return zi(e)?`bigint`:Bi(e)?`boolean`:Gi(e)?`number`:Ji(e)?`string`:(()=>{throw new Ns(e)})()}function V(e,t){return Ga({"~kind":`Literal`},{type:Ps(e),const:e},t)}function Fs(e){return zi(e)||Bi(e)||Gi(e)||Ji(e)}function Is(e){return Rs(e)&&Gi(e.const)}function Ls(e){return Rs(e)&&Ji(e.const)}function Rs(e){return Ja(e,`Literal`)}function H(e){return Ga({"~kind":`Null`},{type:`null`},e)}function zs(e){return Ja(e,`Null`)}var Bs=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function U(e){return Ga({"~kind":`Number`},{type:`number`},e)}function Vs(e){return Ja(e,`Number`)}function Hs(e){return Ga({"~kind":`Symbol`},{type:`symbol`},e)}function Us(e){return Ja(e,`Symbol`)}function W(e){return Ga({"~kind":`String`},{type:`string`},e)}function Ws(e){return Ja(e,`String`)}function G(e,t={}){return Ga({"~kind":`Union`},{anyOf:e},t)}function Gs(e){return Ja(e,`Union`)}function Ks(e){return Ka(e,[`~kind`,`anyOf`])}function qs(e){let t=Cu(e);return R(t.length,2)?t[0]:[]}function Js(e){return!0}function Ys(e){return ua(e,(e,t)=>Zs(e)?Ys(t):!1,()=>!0)}function Xs(e){return!R(e.length,0)&&Ys(e)}function Zs(e){return Gs(e)?Xs(e.anyOf):Rs(e)?Js(e.const):!1}function Qs(e){return Xs(e)}function $s(e){return Ga({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function ec(e,t,n=[]){return ua(e,(e,r)=>ec(r,t,[...n,`${e}${t}`]),()=>n)}function tc(e,t){return R(e.length,0)?[`${t}`]:ec(e,t)}function nc(e,t,n=[]){return ua(t,(t,r)=>nc(e,r,[...n,...rc(e,t)]),()=>n)}function rc(e,t){return Gs(t)?nc(e,t.anyOf):Rs(t)?tc(e,t.const):Ko()}function ic(e,t){return ua(t,(t,n)=>ic(rc(e,t),n),()=>e)}function ac(e){return e.map(e=>V(e))}function oc(e){return G(ac(ic([],e)))}function sc(e){return R(e.length,0)?Ko():R(e.length,1)&&Rs(e[0])?e[0]:oc(e)}function cc(e){let t=qs(e);return R(t.length,0)?W():Qs(t)?sc(t):$s(e)}function lc(e){let t=cc(e);return Wu(t)?W():t}function uc(e,t){return Ga({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function dc(e){return uc(_l,e)}function fc(e){return B({true:e,false:e})}function pc(e,t={}){let[n,r,i]=[e,e.length,!1];return Ga({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function mc(e){return Ja(e,`Tuple`)}function hc(e){return Ka(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function gc(e){return Ka(e,[`~readonly`])}function _c(e,t){return qa(gc(e),{},t)}function vc(e,t,n,r){return _c(K(e,t,n),r)}function yc(e,t={}){return _c(e,t)}function bc(e){return Ka(e,[`~optional`])}function xc(e,t){return qa(bc(e),{},t)}function Sc(e,t,n,r){return xc(K(e,t,n),r)}function Cc(e,t={}){return xc(e,t)}function wc(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function Tc(e){return B(wc(e.items))}function Ec(e){return ko(e)||mc(e)}function Dc(e,t){return ws(e)?!!ws(t):!1}function Oc(e,t){return To(e)?!!To(t):!1}function kc(e,t){let n=Dc(e,t),r=Oc(e,t),i=yc(Cc(qc([e,t])));return n&&r?Cs(Co(i)):n&&!r?Cs(i):!n&&r?Co(i):i}function Ac(e,t,n){return n in e?n in t?kc(e[n],t[n]):e[n]:n in t?t[n]:xo()}function jc(e,t){return[...new Set([...pa(e),...pa(t)])].reduce((n,r)=>({...n,[r]:Ac(e,t,r)}),{})}function Mc(e){return ko(e)?e.properties:mc(e)?wc(e.items):{}}function Nc(e,t){return B(jc(Mc(e),Mc(t)))}function Pc(e,t){let n=Yf(e,t);return R(n,2)?e:R(n,3)||R(n,0)?t:xo()}function Fc(e,t){let n=Ec(e),r=Ec(t);return n&&r?Nc(e,t):n&&!r?e:!n&&r?t:Pc(e,t)}function Ic(e,t){return So(e)||yo(e)?e:Mo(e)||So(t)||yo(t)?t:Mo(t)?e:Fc(e,t)}function Lc(e,t){return Gs(e)||Gs(t)}function Rc(e,t){let n=Xc(e),r=Xc(t);return Lc(n,r)?qc([n,r]):Ic(n,r)}function zc(e,t,n=[]){return ua(t,(t,r)=>zc(e,r,[...n,Rc(t,e)]),()=>R(n.length,0)?[e]:n)}function Bc(e,t,n=[]){return ua(e,(e,r)=>Bc(r,t,[...n,...Vc([e],t)]),()=>n)}function Vc(e,t=[]){return ua(e,(e,n)=>Gs(e)?Vc(n,Bc(e.anyOf,t)):Vc(n,zc(e,t)),()=>t)}function Hc(e,t){return Zu(Jf({},e,t))?[]:[e]}function Uc(e,t,n=[]){return ua(e,(e,r)=>Uc(r,t,[...n,...Hc(e,t)]),()=>n)}function Wc(e,t){let n=Xc(e);return Yc(Uc(Gs(n)?n.anyOf:[n],t))}function Gc(e,t,n){return Yc([qc([e,t]),Wc(n,e)])}function Kc(e,t=[]){return ua(e,(e,n)=>Kc(n,[...t,V(e)]),()=>Yc(t))}function qc(e){return Yc($f(Vc(e)))}function Jc(e){return Xc(lc(e))}function Yc(e){return Zc($f(e))}function Xc(e){return Bo(e)?Gc(e.if,e.then,e.else):Ho(e)?Kc(e.enum):Wo(e)?qc(e.allOf):Wu(e)?Jc(e.pattern):Gs(e)?Yc(e.anyOf):e}function Zc(e){return R(e.length,1)?e[0]:R(e.length,0)?xo():G(e)}function Qc(e,t){return fl(Kc(e),t)}function $c(e,t){return uc(hl,t)}function el(e,t){return fl(qc(e),t)}function tl(e,t){return Ji(e)||Gi(e)?B({[e]:t}):R(e,!1)?B({false:t}):R(e,!0)?B({true:t}):B({})}function nl(e,t){return uc(gl,t)}function rl(e,t){return z(e,`pattern`)&&(Ji(e.pattern)||e.pattern instanceof RegExp)?uc(e.pattern.toString(),t):uc(_l,t)}function il(e,t){return Qs(qs(e))?fl(Jc(e),t):uc(e,t)}function al(e){return Gs(e)?ol(e.anyOf):[e]}function ol(e,t=[]){return ua(e,(e,n)=>ol(n,[...t,...al(e)]),()=>t)}function sl(e){return e.some(e=>Ws(e)||Vs(e)||Ms(e))}function cl(e,t){return R(sl(e),!0)?uc(_l,t):void 0}function ll(e,t){return e.reduce((e,n)=>Rs(n)&&(Ji(n.const)||Gi(n.const))?{...e,[n.const]:t}:e,{})}function ul(e,t){return B(ll(e,t))}function dl(e,t){let n=ol(e),r=cl(n,t);return Ya(r)?r:ul(n,t)}function fl(e,t){return yo(e)?dc(t):ks(e)?fc(t):Ho(e)?Qc(e.enum,t):Ms(e)?$c(e,t):Wo(e)?el(e.allOf,t):Rs(e)?tl(e.const,t):Vs(e)?nl(e,t):Gs(e)?dl(e.anyOf,t):Ws(e)?rl(e,t):Wu(e)?il(e.pattern,t):B({})}function pl(e,t,n){return jg([e])?qa(fl(e,t),{},n):vl(e,t,n)}function ml(e,t,n,r,i){return pl(K(e,t,n),K(e,t,r),i)}var hl=`^${As}$`,gl=`^${Bs}$`,_l=`^.*$`;function vl(e,t,n={}){return Xa(`Record`,[e,t],n)}function yl(e,t,n={}){return pl(e,t,n)}function bl(e,t){return uc(e,t)}function xl(e){return R(e,_l)?W():R(e,hl)?js():R(e,gl)?U():cc(e)}function Sl(e){return pa(e.patternProperties)[0]}function Cl(e){return xl(Sl(e))}function wl(e){return e.patternProperties[Sl(e)]}function Tl(e){return Ja(e,`Record`)}function El(e){return Ga({"~kind":`Rest`},{type:`rest`,items:e},{})}function Dl(e){return Ja(e,`Rest`)}function Ol(e){return Ja(e,`This`)}function kl(e){return Ga({"~kind":`Undefined`},{type:`undefined`},e)}function Al(e){return Ja(e,`Undefined`)}function jl(e){return Ja(e,`Void`)}function Ml(e){return Es()}function Nl(e){return W()}function Pl(e){return U()}function Fl(e){return js()}function Il(e){return xo()}function Ll(e){return V(e)}function Rl(e){return e}function zl(e){return G(e[1])}function Bl(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Vl(e){return[e[0],...e[1]]}function Hl(e){return e}function Ul(e){return e[1]}function Wl(e){return R(e.length,2)}function Gl(e,t,n){return Wl(e)?t(e[0],e[1]):n()}function Kl(e,t){return R(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function ql(e,t){for(let n=0;n<e.length;n++){let r=Kl(e[n],t);if(Wl(r))return r}return[]}function Jl(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var Yl=[...Jl(97,122),...Jl(65,90)],Xl=[`0`,...Jl(49,57)],Zl=`//`,Ql=`/*`,$l=`*/`;function eu(e){let t=e.indexOf($l);return R(t,-1)?``:e.slice(t+2)}function tu(e){let t=e.indexOf(`
|
|
11
|
+
`);return R(t,-1)?``:e.slice(t)}function nu(e){return e.replace(/^[ \t\r\f\v]+/,``)}function ru(e){let t=nu(e);return t.startsWith(Ql)?ru(eu(t.slice(2))):t.startsWith(Zl)?ru(tu(t.slice(2))):t}function iu(e){let t=e.trimStart();return t.startsWith(Ql)?iu(eu(t.slice(2))):t.startsWith(Zl)?iu(tu(t.slice(2))):t}[...Xl];function au(e,t){return ql([e],t)}function ou(e,t){return R(e,``)?[``,t]:e.startsWith(`
|
|
12
|
+
`)?au(e,ru(t)):e.startsWith(` `)?au(e,t):au(e,iu(t))}[...Yl,...Xl],[...Xl];function su(e){return R(e,``)?[]:[e.slice(0,1),e.slice(1)]}function cu(e,t){return ua(e,(e,n)=>t.startsWith(e)?!0:cu(n,t),()=>!1)}function lu(e,t,n=``){return Gl(su(t),(r,i)=>cu(e,t)?[n,t]:lu(e,i,`${n}${r}`),()=>[])}function uu(e,t){return Gl(lu(e,t),(e,t)=>R(e,``)?[]:[e,t],()=>[])}var du=(e,t,n=()=>[])=>e.length===2?t(e):n(),fu=e=>du(ou(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[Ml(e),t]),pu=e=>du(ou(`.*`,e),([e,t])=>[Nl(e),t]),mu=e=>du(ou(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[Pl(e),t]),hu=e=>du(ou(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[Fl(e),t]),gu=e=>du(ou(`(?!)`,e),([e,t])=>[Il(e),t]),_u=e=>du(uu([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[Ll(e),t]),vu=e=>du(du(fu(e),([e,t])=>[e,t],()=>du(pu(e),([e,t])=>[e,t],()=>du(mu(e),([e,t])=>[e,t],()=>du(hu(e),([e,t])=>[e,t],()=>du(gu(e),([e,t])=>[e,t],()=>du(yu(e),([e,t])=>[e,t],()=>du(_u(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[Rl(e),t]),yu=e=>du(du(ou(`(`,e),([e,t])=>du(Su(t),([t,n])=>du(ou(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[zl(e),t]),bu=e=>du(du(du(xu(e),([e,t])=>du(ou(`|`,t),([t,n])=>du(bu(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>du(du(xu(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>du([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[Bl(e),t]),xu=e=>du(du(vu(e),([e,t])=>du(Su(t),([t,n])=>[[e,t],n])),([e,t])=>[Vl(e),t]),Su=e=>du(du(bu(e),([e,t])=>[e,t],()=>du(xu(e),([e,t])=>[e,t],()=>[])),([e,t])=>[Hl(e),t]),Cu=e=>du(du(ou(`^`,e),([e,t])=>du(Su(t),([t,n])=>du(ou(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[Ul(e),t]);function wu(e){return e.join(`|`)}function Tu(e){return e.slice(1,e.length-1)}function Eu(e,t,n){return Lu(t,`${n}${e}`)}function Du(e,t){return Lu(e,`${t}${Ts}`)}function Ou(e,t){return Lu(e,`${t}${As}`)}function ku(e,t){return Lu(e,`${t}${Bs}`)}function Au(e,t){return Iu(G([V(`false`),V(`true`)]),e,t)}function ju(e,t){return Lu(e,`${t}.*`)}function Mu(e,t,n){return Lu(t,`${n}${Tu(e)}`)}function Nu(e,t,n){return Iu(Bu(e,{}),t,n)}function Pu(e,t,n){return Iu(Kc(e),t,n)}function Fu(e,t,n,r=[]){return ua(e,(e,i)=>Fu(i,t,n,[...r,Iu(e,[],``)]),()=>Lu(t,`${n}(${wu(r)})`))}function Iu(e,t,n){return Ho(e)?Pu(e.enum,t,n):Ms(e)?Ou(t,n):Rs(e)?Eu(e.const,t,n):Ds(e)?Du(t,n):ks(e)?Au(t,n):Vs(e)?ku(t,n):Ws(e)?ju(t,n):Wu(e)?Mu(e.pattern,t,n):Uu(e)?Nu(e.parameters[0],t,n):Gs(e)?Fu(e.anyOf,t,n):bo}function Lu(e,t){return ua(e,(e,n)=>Iu(e,n,t),()=>t)}function Ru(e){return`^${Lu(e,``)}$`}function zu(e){return $s(Ru(e))}function Bu(e,t){return jg(e)?qa(zu(e),{},t):Hu(e,t)}function Vu(e,t,n,r){return Bu(Pg(e,t,n),r)}function Hu(e,t={}){return Xa(`TemplateLiteral`,[e],t)}function Uu(e){return Ya(e)&&z(e,`action`)&&R(e.action,`TemplateLiteral`)}function Wu(e){return Ja(e,`TemplateLiteral`)}function Gu(e){return Ga({"~kind":`ExtendsUnion`},{inferred:e})}function Ku(e){return qi(e)&&z(e,`~kind`)&&z(e,`inferred`)&&R(e[`~kind`],`ExtendsUnion`)&&qi(e.inferred)}function qu(e){return Ga({"~kind":`ExtendsTrue`},{inferred:e})}function Ju(e){return qi(e)&&z(e,`~kind`)&&z(e,`inferred`)&&R(e[`~kind`],`ExtendsTrue`)&&qi(e.inferred)}function Yu(){return Ga({"~kind":`ExtendsFalse`},{})}function Xu(e){return qi(e)&&z(e,`~kind`)&&R(e[`~kind`],`ExtendsFalse`)}function Zu(e){return Ku(e)||Ju(e)}function Qu(e,t,n){return Zu(e)?t(e.inferred):n()}function $u(e,t,n,r){return Qu(vf(e,n,r),r=>qu(Aa(Aa(e,r),{[t]:n})),()=>Yu())}function ed(e,t){return qu(e)}function td(e,t,n,r,i){return Qu(vf(e,t,n),e=>Qu(vf(e,t,r),e=>qu(e),()=>Yu()),()=>Qu(vf(e,t,i),e=>qu(e),()=>Yu()))}function nd(e,t,n){return vf(e,t,Kc(n))}function rd(e,t,n){return ua(n,(n,r)=>Qu(vf(e,t,n),e=>rd(e,t,r),()=>Yu()),()=>qu(e))}function id(e,t,n){return vf(e,t,Jc(n))}function ad(e,t,n){return ua(n,(n,r)=>Qu(vf(e,t,n),e=>qu(e),()=>ad(e,t,r)),()=>Yu())}function od(e,t,n){return yo(n)?ed(e,t):Bo(n)?td(e,t,n.if,n.then,n.else):Ho(n)?nd(e,t,n.enum):Ro(n)?$u(e,n.name,t,n.extends):Wo(n)?rd(e,t,n.allOf):Wu(n)?id(e,t,n.pattern):Gs(n)?ad(e,t,n.anyOf):Mo(n)?qu(e):Yu()}function sd(e,t,n){return Ro(n)?od(e,t,n):yo(n)||Mo(n)?qu(e):Gu(e)}function cd(e,t){let n=Ss(e),r=Ss(t);return n&&r||!n&&r?!0:!(n&&!r)}function ld(e,t,n,r){return ao(r)?cd(t,r)?vf(e,n,r.items):Yu():od(e,t,r)}function ud(e,t,n){return Ds(n)?qu(e):od(e,t,n)}function dd(e,t,n){return ks(n)?qu(e):od(e,t,n)}function fd(e,t,n,r,i){let a=Ro(r)?t:r,o=Ro(r)?r:t,s=To(t),c=To(r);return!s&&c?Yu():Qu(vf(e,a,o),e=>hd(e,n,i),()=>Yu())}function pd(e,t,n,r){return ua(r,(r,i)=>fd(e,t,n,r,i),()=>To(t)?qu(e):Yu())}function md(e,t,n){return ua(t,(t,r)=>pd(e,t,r,n),()=>qu(e))}function hd(e,t,n){return md(e,t,n)}function gd(e,t,n){return jl(n)?qu(e):vf(e,t,n)}function _d(e,t,n,r){return yo(r)||Mo(r)?qu(e):co(r)?Qu(hd(e,t,r.parameters),e=>gd(e,n,r.instanceType),()=>Yu()):Yu()}function vd(e,t,n,r,i){return Qu(vf(e,t,i),()=>vf(e,n,i),()=>vf(e,r,i))}function yd(e,t,n){return vf(e,Kc(t),n)}function bd(e,t,n,r){return yo(r)||Mo(r)?qu(e):fo(r)?Qu(hd(e,t,r.parameters),e=>gd(e,n,r.returnType),()=>Yu()):Yu()}function xd(e,t,n){return Ms(n)||Vs(n)?qu(e):od(e,t,n)}function Sd(e,t,n){return vf(e,qc(t),n)}function Cd(e,t,n){return t===n?qu(e):Yu()}function wd(e,t,n){return Rs(n)?Cd(e,t,n.const):Ds(n)?qu(e):od(e,V(t),n)}function Td(e,t,n){return Rs(n)?Cd(e,t,n.const):ks(n)?qu(e):od(e,V(t),n)}function Ed(e,t,n){return Rs(n)?Cd(e,t,n.const):Vs(n)?qu(e):od(e,V(t),n)}function Dd(e,t,n){return Rs(n)?Cd(e,t,n.const):Ws(n)?qu(e):od(e,V(t),n)}function Od(e,t,n){return zi(t.const)?wd(e,t.const,n):Bi(t.const)?Td(e,t.const,n):Gi(t.const)?Ed(e,t.const,n):Ji(t.const)?Dd(e,t.const,n):Ko()}function kd(e,t,n){return Ro(n)?od(e,t,n):qu(e)}function Ad(e,t,n){return zs(n)?qu(e):od(e,t,n)}function jd(e,t,n){return Vs(n)?qu(e):od(e,t,n)}function Md(e,t,n){return To(t)?To(n)?qu(e):Yu():qu(e)}function Nd(e,t,n){return Ro(n)&&So(n.extends)?Yu():Qu(vf(e,t,n),e=>Md(e,t,n),()=>Yu())}function Pd(e,t){return e.reduce((e,n)=>n in t&&Zu(t[n])?{...e,...t[n].inferred}:Ko(),{})}function Fd(e,t,n){let r={};for(let i of pa(n))r[i]=i in t?Nd({},t[i],n[i]):To(n[i])?Ro(n[i])?qu(Aa(e,{[n[i].name]:n[i].extends})):qu(e):Yu();let i=ha(r).every(e=>Zu(e)),a=i?Pd(pa(r),r):{};return i?qu(a):Yu()}function Id(e,t,n){let r=Fd(e,t,n);return Zu(r)?qu(Aa(e,r.inferred)):Yu()}function Ld(e,t,n){return Id(e,t,n)}function Rd(e,t){return pa(t).reduce((n,r)=>({...n,[r]:z(e,r)?Gs(n[r])?G([...n[r].anyOf,t[r]]):G([e[r],t[r]]):t[r]}),e)}function zd(e,t,n,r){return ua(t,(t,i)=>Qu(vf({},e[t],n),t=>zd(e,i,n,Rd(r,t)),()=>Yu()),()=>qu(r))}function Bd(e,t,n,r){return zd(t,pa(t),r,e)}function Vd(e,t,n){return Tl(n)?Bd(e,t,Sl(n),wl(n)):ko(n)?Ld(e,t,n.properties):od(e,B(t),n)}function Hd(e,t){return R(pa(t).length,0)?qu(e):Yu()}function Ud(e,t,n,r,i){return vf(e,n,i)}function Wd(e,t,n,r){return Tl(r)?Ud(e,xl(t),n,xl(Sl(r)),wl(r)):ko(r)?Hd(e,r.properties):yo(r)||Mo(r)?qu(e):Yu()}function Gd(e,t,n){return Ws(n)?qu(e):od(e,t,n)}function Kd(e,t,n){return Us(n)?qu(e):od(e,t,n)}function qd(e,t,n){return vf(e,Jc(t),n)}function Jd(e,t){return Ga({"~kind":`Inferrable`},{name:e,type:t},{})}function Yd(e){return qi(e)&&z(e,`~kind`)&&z(e,`name`)&&z(e,`type`)&&R(e[`~kind`],`Inferrable`)&&Ji(e.name)&&qi(e.type)}function Xd(e){return Dl(e)?Ro(e.items)?ao(e.items.extends)?Jd(e.items.name,e.items.extends.items):Mo(e.items.extends)?Jd(e.items.name,e.items.extends):void 0:Ko():void 0}function Zd(e){return Ro(e)?Jd(e.name,e.extends):void 0}function Qd(e,t,n=[]){return ua(e,(e,r)=>Qu(vf({},e,t),()=>Qd(r,t,[...n,e]),()=>void 0),()=>n)}function $d(e,t,n,r){let i=Qd(n,r);return Ri(i)?qu(Aa(e,{[t]:pc(i)})):Yu()}function ef(e,t,n,r){let i=Qd(n,r);return Ri(i)?qu(Aa(e,{[t]:G(i)})):Yu()}function tf(e){return[...e].reverse()}function nf(e,t){return t?tf(e):e}function rf(e){let t=e.length>0?e[0]:void 0;return Ya(Ya(t)?Xd(t):void 0)}function af(e,t,n,r,i,a){return Qu(vf(e,n,i),e=>cf(e,t,r,a),()=>Yu())}function of(e,t,n,r,i){let a=Xd(r);return Yd(a)?$d(e,a.name,nf(n,t),a.type):ua(n,(n,a)=>af(e,t,n,a,r,i),()=>Yu())}function sf(e,t,n,r){return ua(r,(r,i)=>of(e,t,n,r,i),()=>R(n.length,0)?qu(e):Yu())}function cf(e,t,n,r){return sf(e,t,n,r)}function lf(e,t,n){let r=Ng(e,Ag([],[]),n),i=rf(r);return cf(e,i,nf(t,i),nf(r,i))}function uf(e,t,n){let r=Zd(n);return Yd(r)?ef(e,r.name,t,r.type):ua(t,(t,r)=>Qu(vf(e,t,n),e=>uf(e,r,n),()=>Yu()),()=>qu(e))}function df(e,t,n){let r=Ng(e,Ag([],[]),t);return mc(n)?lf(e,r,n.items):ao(n)?uf(e,r,n.items):od(e,pc(r),n)}function ff(e,t,n){return jl(n)||Al(n)?qu(e):od(e,t,n)}function pf(e,t,n){return ua(n,(n,r)=>Qu(vf(e,t,n),e=>qu(e),()=>pf(e,t,r)),()=>Yu())}function mf(e,t,n){return ua(t,(t,r)=>Qu(pf(e,t,n),e=>mf(e,r,n),()=>Yu()),()=>qu(e))}function hf(e,t,n){let r=Zd(n);return Yd(r)?ef(e,r.name,t,r.type):Gs(n)?mf(e,t,n.anyOf):mf(e,t,[n])}function gf(e,t,n){return Ro(n)?od(e,t,n):yo(n)||Mo(n)?qu(e):Yu()}function _f(e,t,n){return jl(n)?qu(e):od(e,t,n)}function vf(e,t,n){return yo(t)?sd(e,t,n):ao(t)?ld(e,t,t.items,n):Ds(t)?ud(e,t,n):ks(t)?dd(e,t,n):co(t)?_d(e,t.parameters,t.instanceType,n):Bo(t)?vd(e,t.if,t.then,t.else,n):Ho(t)?yd(e,t.enum,n):fo(t)?bd(e,t.parameters,t.returnType,n):Ms(t)?xd(e,t,n):Wo(t)?Sd(e,t.allOf,n):Rs(t)?Od(e,t,n):So(t)?kd(e,t,n):zs(t)?Ad(e,t,n):Vs(t)?jd(e,t,n):ko(t)?Vd(e,t.properties,n):Tl(t)?Wd(e,Sl(t),wl(t),n):Ws(t)?Gd(e,t,n):Us(t)?Kd(e,t,n):Wu(t)?qd(e,t.pattern,n):mc(t)?df(e,t.items,n):Al(t)?ff(e,t,n):Gs(t)?hf(e,t.anyOf,n):Mo(t)?gf(e,t,n):jl(t)?_f(e,t,n):Yu()}function yf(e,t){return qc([...e,B(t)])}function bf(e,t,n){return jg(e)?qa(yf(e,t),{},n):Sf(e,t,n)}function xf(e,t,n,r,i){return bf(Pg(e,t,n),Mg(e,t,r),i)}function Sf(e,t,n={}){return Xa(`Interface`,[e,t],n)}function Cf(e){return Ya(e)&&z(e,`action`)&&R(e.action,`Interface`)}function wf(e,t,n){return e.includes(n)?!0:Df([...e,n],t,t[n])}function Tf(e,t,n){return Ef(e,t,Oo(n))}function Ef(e,t,n){return ua(n,(n,r)=>Df(e,t,n)?!0:Ef(e,t,r),()=>!1)}function Df(e,t,n){return ho(n)?wf(e,t,n.$ref):ao(n)?Df(e,t,n.items):co(n)?Ef(e,t,[...n.parameters,n.instanceType]):fo(n)?Ef(e,t,[...n.parameters,n.returnType]):Cf(n)?Tf(e,t,n.parameters[1]):Wo(n)?Ef(e,t,n.allOf):ko(n)?Tf(e,t,n.properties):Gs(n)?Ef(e,t,n.anyOf):mc(n)?Ef(e,t,n.items):Tl(n)?Df(e,t,wl(n)):!1}function Of(e,t,n){return Df(e,t,n)}function kf(e,t){return t.reduce((t,n)=>Of([n],e,e[n])?[...t,n]:t,[])}function Af(e){return kf(e,Do(e))}function jf(e,t,n){return n.includes(t)?n:t in e?Pf(e,e[t],[...n,t]):Ko()}function Mf(e,t,n){return Nf(e,Oo(t),n)}function Nf(e,t,n){return t.reduce((t,n)=>Pf(e,n,t),n)}function Pf(e,t,n){return ho(t)?jf(e,t.$ref,n):ao(t)?Pf(e,t.items,n):co(t)?Nf(e,[...t.parameters,t.instanceType],n):fo(t)?Nf(e,[...t.parameters,t.returnType],n):Cf(t)?Mf(e,t.parameters[1],n):Wo(t)?Nf(e,t.allOf,n):ko(t)?Mf(e,t.properties,n):Gs(t)?Nf(e,t.anyOf,n):mc(t)?Nf(e,t.items,n):Tl(t)?Pf(e,wl(t),n):n}function Ff(e,t,n){return Pf(e,n,[t])}function If(e){return vo()}function Lf(e){return pa(e).reduce((t,n)=>({...t,[n]:zf(e[n])}),{})}function Rf(e){return e.reduce((e,t)=>[...e,zf(t)],[])}function zf(e){return ho(e)?If(e.$ref):ao(e)?io(zf(e.items),oo(e)):co(e)?so(Rf(e.parameters),zf(e.instanceType)):fo(e)?uo(Rf(e.parameters),zf(e.returnType)):Wo(e)?Uo(Rf(e.allOf)):ko(e)?B(Lf(e.properties)):Tl(e)?yl(Cl(e),zf(wl(e))):Gs(e)?G(Rf(e.anyOf)):mc(e)?pc(Rf(e.items)):e}function Bf(e,t){return t in e?zf(e[t]):jo()}function Vf(e){return Bf(e.$defs,e.$ref)}function Hf(e,t,n){let r=Pg(e,Ag([],[]),t),i=Mg({},Ag([],[]),n);return qc([...r,B(i)])}function Uf(e,t){return pa(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=Cf(r)?Hf(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function Wf(e,t,n){return No(Uf(e,Ff(e,t,n)),t)}function Gf(e,t){return t in e?ho(e[t])?Gf(e,e[t].$ref):e[t]:xo()}function Kf(e,t){return Gf(e,t)}function qf(e){return Po(e)?Vf(e):Io(e)?jo():e}function Jf(e,t,n){return vf(e,qf(t),qf(n))}function Yf(e,t){let n=[Jf({},e,t),Jf({},t,e)];return Zu(n[0])&&Zu(n[1])?0:Zu(n[0])&&Xu(n[1])?2:Xu(n[0])&&Zu(n[1])?3:1}function Xf(e,t,n=[],r=t){return ua(t,(t,i)=>{let a=Yf(e,t);return R(a,2)||R(a,0)?r:R(a,1)?Xf(e,i,[...n,t],r):Xf(e,i,n,r)},()=>[...n,e])}function Zf(e,t,n){let r=Xc(e);return yo(r)||Mo(r)?[r]:So(r)?Qf(t,n):ko(r)?Qf(t,[...n,r]):Qf(t,Xf(r,n))}function Qf(e,t=[]){return ua(e,(e,n)=>Zf(e,n,t),()=>t)}function $f(e){return ol(Qf(e))}function ep(e,t){return qa(Xc(e),{},t)}function tp(e,t,n,r){return ep(K(e,t,n),r)}function np(e,t=[]){return Za(e)&&R(e.action,`Conditional`)?ho(e.parameters[0])?np(e.parameters[2],np(e.parameters[3],[...t,e.parameters[0].$ref])):np(e.parameters[2],np(e.parameters[3],t)):Za(e)&&R(e.action,`Mapped`)&&Za(e.parameters[1])&&R(e.parameters[1].action,`KeyOf`)&&ho(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function rp(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function ip(e,t,n=[]){return ua(e,(e,r)=>ua(t,(t,i)=>ip(r,i,[...n,[t,e]]),()=>n),()=>n)}function ap(e){return Wu(e)?Jc(e.pattern):Ho(e)?Kc(e.enum):e}function op(e){let t=ap(e);return Gs(t)?[...t.anyOf]:[t]}function sp(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function cp(e,t){return t.reduce((t,n)=>[...t,...sp(e,n)],[])}function lp(e){return e.reduce((e,t)=>R(t[0],!0)?cp(e,op(t[1])):cp(e,[t[1]]),[[]])}function up(e,t,n){let r=ip(t,rp(e,np(n)));return Za(n)&&R(n.action,`Conditional`)||Za(n)&&R(n.action,`Mapped`)?lp(r):[t]}function dp(){return[`(not-resolvable)`,xo()]}function fp(){return[`(not-generic)`,xo()]}function pp(e,t,n){return[e,go(t,n)]}function mp(e,t,n){return t in e?hp(e,t,e[t],n):dp()}function hp(e,t,n,r){return _o(n)?pp(t,n.parameters,n.expression):ho(n)?mp(e,n.$ref,r):fp()}function gp(e,t,n){return hp(e,`(anonymous)`,t,n)}function _p(e,t,n){if(Ro(t)||Pp(t)||Zu(Jf({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function vp(e,t,n,r,i){let a=K(e,t,i);return _p(n,a,r),Aa(e,{[n]:a})}function yp(e,t,n,r,i){let a=K(e,t,n.extends),o=K(e,t,n.equals);return ua(i,(i,o)=>bp(vp(e,t,n.name,a,i),t,r,o),()=>bp(vp(e,t,n.name,a,o),t,r,[]))}function bp(e,t,n,r){return ua(n,(n,i)=>yp(e,t,n,i,r),()=>e)}function xp(e,t,n,r){return bp(e,t,n,r)}var Sp=0,Cp=0;function wp(){if(!Qi(Cp,Oa().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function Tp(){wp(),Cp++,Sp++}function Ep(){Sp--,R(Sp,0)&&(Cp=0)}function Dp(e){return Zi(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function Op(e,t){return R(Dp(e),t)}function kp(e,t,n,r,i,a){Tp();try{let o=xp(e,t,r,a),s=K(o,Ag([...t.callstack,n.$ref],t.visited),i);return K(o,Ag([],[]),s)}finally{Ep()}}function Ap(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=kp(e,t,n,r,i,o);return[...a,s]},[])}function jp(e,t,n,r,i,a){let o=Ap(e,t,n,r,i,up(r,a,i));return R(o.length,1)?o[0]:Yc(o)}function Mp(e,t,n,r){let i=Pg(e,t,r),a=gp(e,n,r),o=a[0],s=a[1];return _o(s)?Op(t,o)?Np(mo(o),i):jp(e,t,mo(o),s.parameters,s.expression,i):Np(n,i)}function Np(e,t){return Ga({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function Pp(e){return Ja(e,`Call`)}function Fp(e){return Ka(e,[`~immutable`])}function Ip(e,t){return qa(Fp(e),{},t)}function Lp(e,t,n,r){return Ip(K(e,t,n),r)}function Rp(e,t){return e(t)}function zp(e,t){return Ji(t)?V(Rp(e,t)):V(t)}function Bp(e,t){return Hp(e,Jc(t))}function Vp(e,t){return G(t.map(t=>Hp(e,t)))}function Hp(e,t){return Rs(t)?zp(e,t.const):Wu(t)?Bp(e,t.pattern):Gs(t)?Vp(e,t.anyOf):t}function Up(e,t={}){return Xa(`Capitalize`,[e],t)}function Wp(e,t={}){return Xa(`Lowercase`,[e],t)}function Gp(e,t={}){return Xa(`Uncapitalize`,[e],t)}function Kp(e,t={}){return Xa(`Uppercase`,[e],t)}var qp=e=>e[0].toUpperCase()+e.slice(1),Jp=e=>e.toLowerCase(),Yp=e=>e[0].toLowerCase()+e.slice(1),Xp=e=>e.toUpperCase();function Zp(e,t){return jg([e])?qa(Hp(qp,e),{},t):Up(e,t)}function Qp(e,t){return jg([e])?qa(Hp(Jp,e),{},t):Wp(e,t)}function $p(e,t){return jg([e])?qa(Hp(Yp,e),{},t):Gp(e,t)}function em(e,t){return jg([e])?qa(Hp(Xp,e),{},t):Kp(e,t)}function tm(e,t,n,r){return Zp(K(e,t,n),r)}function nm(e,t,n,r){return Qp(K(e,t,n),r)}function rm(e,t,n,r){return $p(K(e,t,n),r)}function im(e,t,n,r){return em(K(e,t,n),r)}function am(e,t,n,r,i={}){return Xa(`Conditional`,[e,t,n,r],i)}function om(e,t,n,r,i,a){let o=Jf(e,n,r);return Ku(o)?G([K(o.inferred,t,i),K(e,t,a)]):Ju(o)?K(o.inferred,t,i):K(e,t,a)}function sm(e,t,n,r,i,a,o){return jg([n,r])?qa(om(e,t,n,r,i,a),{},o):am(n,r,i,a,o)}function cm(e,t,n,r,i,a,o){return sm(e,t,K(e,t,n),K(e,t,r),i,a,o)}function lm(e,t={}){return Xa(`ConstructorParameters`,[e],t)}function um(e){let t=co(e)?e.parameters:[];return pc(Ng({},Ag([],[]),t))}function dm(e,t){return jg([e])?qa(um(e),{},t):lm(e,t)}function fm(e,t,n,r){return dm(K(e,t,n),r)}function pm(e,t,n={}){return Xa(`Exclude`,[e,t],n)}function mm(e,t,n){return jg([e,t])?qa(Wc(e,t),{},n):pm(e,t,n)}function hm(e,t,n,r,i){return mm(K(e,t,n),K(e,t,r),i)}function gm(e,t,n={}){return Xa(`Extract`,[e,t],n)}function _m(e,t){return Zu(Jf({},e,t))?[e]:[]}function vm(e,t,n=[]){return ua(e,(e,r)=>vm(r,t,[...n,..._m(e,t)]),()=>n)}function ym(e,t){let n=Xc(e);return Yc(vm(Gs(n)?n.anyOf:[n],t))}function bm(e,t,n){return jg([e,t])?qa(ym(e,t),{},n):gm(e,t,n)}function xm(e,t,n,r,i){return bm(K(e,t,n),K(e,t,r),i)}function Sm(e,t,n={}){return Xa(`Index`,[e,t],n)}function Cm(e,t){return Mm(Kf(e,t))}function wm(e,t,n){return Mm(Gc(e,t,n))}function Tm(e,t){let n=pa(e).filter(e=>!z(t,e)),r=pa(t).filter(t=>!z(e,t)),i=pa(e).filter(e=>z(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:qc([e[r],t[r]])}),{});return Aa(Aa(a,o),s)}function Em(e){return e.reduce((e,t)=>Tm(e,Mm(t)),{})}function Dm(e){return e}function Om(e){return Mm(Tc(pc(e)))}function km(e,t){return pa(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:Yc([e[r],t[r]])}),{})}function Am(e,t){return ua(e,(e,n)=>Am(n,km(t,Mm(e))),()=>t)}function jm(e){return ua(e,(e,t)=>Am(t,Mm(e)),()=>Ko())}function Mm(e){return Po(e)?Cm(e.$defs,e.$ref):Bo(e)?wm(e.if,e.then,e.else):Wo(e)?Em(e.allOf):Gs(e)?jm(e.anyOf):mc(e)?Om(e.items):ko(e)?Dm(e.properties):{}}function Nm(e){return B(Mm(e))}var Pm=RegExp(`^(?:0|[1-9][0-9]*)$`);function Fm(e){let t=`${e}`;return Pm.test(t)?parseInt(t):e}function Im(e){return V(Fm(e))}function Lm(e){return e.map(e=>Rm(e))}function Rm(e){return Wo(e)?Uo(Lm(e.allOf)):Gs(e)?G(Lm(e.anyOf)):Rs(e)?Im(e.const):e}function zm(e,t){return Zu(Jf({},Rm(t),U()))?e:Rs(t)&&R(t.const,`length`)?U():xo()}function Bm(e,t){return qm(Kf(e,t))}function Vm(e,t,n){return qm(Gc(e,t,n))}function Hm(e){return qm(Kc(e))}function Um(e){return qm(qc(e))}function Wm(e){return[`${e}`]}function Gm(e){return qm(Jc(e))}function Km(e){return e.reduce((e,t)=>[...e,...qm(t)],[])}function qm(e){return Po(e)?Bm(e.$defs,e.$ref):Bo(e)?Vm(e.if,e.then,e.else):Ho(e)?Hm(e.enum):Wo(e)?Um(e.allOf):Rs(e)?Wm(e.const):Wu(e)?Gm(e.pattern):Gs(e)?Km(e.anyOf):[]}function Jm(e){return qm(e)}function Ym(e,t){return t.map(t=>Xm(e,t))}function Xm(e,t){return ao(t)?io(Xm(e,t.items)):co(t)?so(Ym(e,t.parameters),Xm(e,t.instanceType)):fo(t)?uo(Ym(e,t.parameters),Xm(e,t.returnType)):mc(t)?pc(Ym(e,t.items)):Gs(t)?G(Ym(e,t.anyOf)):Wo(t)?Uo(Ym(e,t.allOf)):Ol(t)?B(e):t}function Zm(e,t){return Xm(e,t)}function Qm(e,t){return Zm(e,t in e?e[t]:xo())}function $m(e,t){return t.reduce((t,n)=>[...t,Qm(e,n)],[])}function eh(e,t){return Yc($m(e,Jm(t)))}var th=new RegExp(hl);function nh(e){return e.filter(e=>th.test(e))}function rh(e){return Yc($m(e,nh(Do(e))))}function ih(e,t){return Vs(t)?rh(e):eh(e,t)}function ah(e){return V(Fm(e))}function oh(e){return e.map(e=>sh(e))}function sh(e){return Wo(e)?Uo(oh(e.allOf)):Gs(e)?G(oh(e.anyOf)):Rs(e)?ah(e.const):e}function ch(e,t){return e.reduceRight((e,n,r)=>Zu(Jf({},V(r),t))?[n,...e]:e,[])}function lh(e,t){return Zc(ch(e,sh(t)))}function uh(e){return Zc(e)}function dh(e,t){return Rs(t)&&R(t.const,`length`)?V(e.length):Vs(t)||Ms(t)?uh(e):lh(e,t)}function fh(e,t){return ao(e)?zm(e.items,t):ko(e)?ih(e.properties,t):mc(e)?dh(e.items,t):xo()}function ph(e){return Po(e)||Bo(e)||Wo(e)||Gs(e)?Nm(e):e}function mh(e,t,n){return jg([e,t])?qa(fh(ph(e),t),{},n):Sm(e,t,n)}function hh(e,t,n,r,i){return mh(K(e,t,n),K(e,t,r),i)}function gh(e,t={}){return Xa(`InstanceType`,[e],t)}function _h(e){return co(e)?e.instanceType:xo()}function vh(e,t){return jg([e])?qa(_h(e),{},t):gh(e,t)}function yh(e,t,n,r={}){return vh(K(e,t,n),r)}function bh(e,t={}){return Xa(`KeyOf`,[e],t)}function xh(){return G([U(),W(),Hs()])}function Sh(e){return U()}function Ch(e){return e.reduce((e,t)=>Fs(t)?[...e,V(Fm(t))]:Ko(),[])}function wh(e){return Zc(Ch(pa(e)))}function Th(e){return Cl(e)}function Eh(e){return Zc(e.map((e,t)=>V(t)))}function Dh(e){return yo(e)?xh():ao(e)?Sh(e.items):ko(e)?wh(e.properties):Tl(e)?Th(e):mc(e)?Eh(e.items):xo()}function Oh(e){return Po(e)||Bo(e)||Wo(e)||Gs(e)?Nm(e):e}function kh(e,t){return jg([e])?qa(Dh(Oh(e)),{},t):bh(e,t)}function Ah(e,t,n,r){return kh(K(e,t,n),r)}function jh(e,t,n,r,i={}){return Xa(`Mapped`,[e,t,n,r],i)}function Mh(e){return Ih(Jc(e))}function Nh(e){return e.reduce((e,t)=>[...e,...Ih(t)],[])}function Ph(e){return Ih(Kc(e))}function Fh(e){return Gi(e)?[V(`${e}`)]:[V(e)]}function Ih(e){return Ho(e)?Ph(e.enum):Rs(e)?Fh(e.const):Wu(e)?Mh(e.pattern):Gs(e)?Nh(e.anyOf):[e]}function Lh(e){return Ih(e)}function Rh(e){return Wu(e)?Jc(e.pattern):e}function zh(e,t,n,r,i,a){let o=Aa(e,{[n.name]:r}),s=Rh(K(o,t,i)),c=K(o,t,a);return Is(s)||Ls(s)?{[s.const]:c}:{}}function Bh(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,zh(e,t,n,o,i,a)],[])}function Vh(e){return e.reduce((e,t)=>[...e,B(t)],[])}function Hh(e,t,n,r,i,a){return qc(Vh(Bh(e,t,n,Lh(r),i,a)))}function Uh(e,t,n,r,i,a,o){return jg([r])?qa(Hh(e,t,n,r,i,a),{},o):jh(n,r,i,a,o)}function Wh(e,t,n,r,i,a,o){return Uh(e,t,n,K(e,t,r),i,a,o)}function Gh(e,t,n){let r=Aa(e,t);return pa(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:Wf(r,n,t[n])}),{})}function Kh(e,t,n){let r=Aa(e,t);return pa(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:K(r,Ag([],[]),t[n])}),{})}function qh(e,t,n){let r=Af(t),i=Gh(e,t,r),a=Kh(e,t,r);return qa({...i,...a},{},n)}function Jh(e,t,n,r){return qh(e,n,r)}function Yh(e,t={}){return Xa(`NonNullable`,[e],t)}function Xh(e){return mm(e,G([H(),kl()]),{})}function Zh(e,t){return jg([e])?qa(Xh(e),{},t):Yh(e,t)}function Qh(e,t,n,r){return Zh(K(e,t,n),r)}function $h(e,t,n={}){return Xa(`Omit`,[e,t],n)}function eg(e){let t=Nm(e);return ko(t)?t.properties:Ko()}function tg(e,t){return pa(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function ng(e,t){return B(tg(eg(e),Jm(t)))}function rg(e,t,n){return jg([e,t])?qa(ng(e,t),{},n):$h(e,t,n)}function ig(e,t,n,r,i){return rg(K(e,t,n),K(e,t,r),i)}function eee(e,t={}){return Xa(`Parameters`,[e],t)}function tee(e){let t=fo(e)?e.parameters:[];return pc(Ng({},Ag([],[]),t))}function nee(e,t){return jg([e])?qa(tee(e),{},t):eee(e,t)}function ree(e,t,n,r){return nee(K(e,t,n),r)}function iee(e,t={}){return Xa(`Partial`,[e],t)}function aee(e,t){let n=ag(Kf(e,t));return No(Aa(e,{[t]:n}),t)}function oee(e,t,n){return ag(Gc(e,t,n))}function see(e){return ag(qc(e))}function cee(e){return G(e.map(e=>ag(e)))}function lee(e){return B(pa(e).reduce((t,n)=>({...t,[n]:Co(e[n])}),{}))}function ag(e){return Po(e)?aee(e.$defs,e.$ref):Bo(e)?oee(e.if,e.then,e.else):Wo(e)?see(e.allOf):Gs(e)?cee(e.anyOf):ko(e)?lee(e.properties):B({})}function og(e,t){return jg([e])?qa(ag(e),{},t):iee(e,t)}function sg(e,t,n,r){return og(K(e,t,n),r)}function cg(e,t,n={}){return Xa(`Pick`,[e,t],n)}function lg(e,t){return pa(e).reduce((n,r)=>t.includes(r)?Aa(n,{[r]:e[r]}):n,{})}function ug(e,t){return B(lg(eg(e),Jm(t)))}function dg(e,t,n){return jg([e,t])?qa(ug(e,t),{},n):cg(e,t,n)}function fg(e,t,n,r,i){return dg(K(e,t,n),K(e,t,r),i)}function pg(e,t={}){return Xa(`ReadonlyObject`,[e],t)}function mg(e){return Ig(io(e))}function hg(e,t){let n=xg(Kf(e,t));return No(Aa(e,{[t]:n}),t)}function gg(e,t,n){return xg(Gc(e,t,n))}function _g(e){return xg(qc(e))}function vg(e){return B(pa(e).reduce((t,n)=>({...t,[n]:Cs(e[n])}),{}))}function yg(e){return Ig(pc(e))}function bg(e){return G(e.map(e=>xg(e)))}function xg(e){return ao(e)?mg(e.items):Po(e)?hg(e.$defs,e.$ref):Bo(e)?gg(e.if,e.then,e.else):Wo(e)?_g(e.allOf):ko(e)?vg(e.properties):mc(e)?yg(e.items):Gs(e)?bg(e.anyOf):e}function Sg(e,t){return jg([e])?qa(xg(e),{},t):pg(e)}function Cg(e,t,n,r){return Sg(K(e,t,n),r)}function wg(e,t,n,r){return t.visited.includes(r)?n:r in e?K(e,Ag(t.callstack,[...t.visited,r]),e[r]):n}function Tg(e,t){let n=Og(Kf(e,t));return No(Aa(e,{[t]:n}),t)}function Eg(e,t,n){return Og(Gc(e,t,n))}function Dg(e){return Og(qc(e))}function uee(e){return G(e.map(e=>Og(e)))}function dee(e){return B(pa(e).reduce((t,n)=>({...t,[n]:Cc(e[n])}),{}))}function Og(e){return Po(e)?Tg(e.$defs,e.$ref):Bo(e)?Eg(e.if,e.then,e.else):Wo(e)?Dg(e.allOf):Gs(e)?uee(e.anyOf):ko(e)?dee(e.properties):B({})}function fee(e,t={}){return Xa(`Required`,[e],t)}function pee(e,t){return jg([e])?qa(Og(e),{},t):fee(e,t)}function mee(e,t,n,r){return pee(K(e,t,n),r)}function hee(e,t={}){return Xa(`ReturnType`,[e],t)}function gee(e){return fo(e)?e.returnType:xo()}function _ee(e,t){return jg([e])?qa(gee(e),{},t):hee(e,t)}function vee(e,t,n,r={}){return _ee(K(e,t,n),r)}function yee(e,t){return Xa(`With`,[e,t],{})}function bee(e,t){return jg([e])?qa(e,{},t):yee(e,t)}function xee(e,t,n,r){return bee(K(e,t,n),r)}function See(e){return Dl(e)?mc(e.items)?kg(e.items.items):Ro(e.items)||ho(e.items)?[e]:[xo()]:[e]}function kg(e){return e.reduce((e,t)=>[...e,...See(t)],[])}function Ag(e,t){return{callstack:e,visited:t}}function jg(e){return ua(e,(e,t)=>!ho(e)&&jg(t),()=>!0)}function Mg(e,t,n){return pa(n).reduce((r,i)=>({...r,[i]:K(e,t,n[i])}),{})}function Ng(e,t,n){return kg(Pg(e,t,n))}function Pg(e,t,n){return n.map(n=>K(e,t,n))}function Cee(e,t){let n=To(e)?no(t,{}):t,r=ws(e)?$a(n,{}):n;return Ss(e)?Fg(r,{}):r}function wee(e,t,n,r,i){return R(n,`AddImmutable`)?Dee(e,t,r[0],i):R(n,`RemoveImmutable`)?Lp(e,t,r[0],i):R(n,`AddReadonly`)?eo(e,t,r[0],i):R(n,`RemoveReadonly`)?vc(e,t,r[0],i):R(n,`AddOptional`)?ro(e,t,r[0],i):R(n,`RemoveOptional`)?Sc(e,t,r[0],i):R(n,`Capitalize`)?tm(e,t,r[0],i):R(n,`Conditional`)?cm(e,t,r[0],r[1],r[2],r[3],i):R(n,`ConstructorParameters`)?fm(e,t,r[0],i):R(n,`Evaluate`)?tp(e,t,r[0],i):R(n,`Exclude`)?hm(e,t,r[0],r[1],i):R(n,`Extract`)?xm(e,t,r[0],r[1],i):R(n,`Index`)?hh(e,t,r[0],r[1],i):R(n,`InstanceType`)?yh(e,t,r[0],i):R(n,`Interface`)?xf(e,t,r[0],r[1],i):R(n,`KeyOf`)?Ah(e,t,r[0],i):R(n,`Lowercase`)?nm(e,t,r[0],i):R(n,`Mapped`)?Wh(e,t,r[0],r[1],r[2],r[3],i):R(n,`Module`)?Jh(e,t,r[0],i):R(n,`NonNullable`)?Qh(e,t,r[0],i):R(n,`Pick`)?fg(e,t,r[0],r[1],i):R(n,`Parameters`)?ree(e,t,r[0],i):R(n,`Partial`)?sg(e,t,r[0],i):R(n,`Omit`)?ig(e,t,r[0],r[1],i):R(n,`ReadonlyObject`)?Cg(e,t,r[0],i):R(n,`Record`)?ml(e,t,r[0],r[1],i):R(n,`Required`)?mee(e,t,r[0],i):R(n,`ReturnType`)?vee(e,t,r[0],i):R(n,`TemplateLiteral`)?Vu(e,t,r[0],i):R(n,`Uncapitalize`)?rm(e,t,r[0],i):R(n,`Uppercase`)?im(e,t,r[0],i):R(n,`With`)?xee(e,t,r[0],r[1]):Xa(n,r,i)}function Tee(e,t,n){return Cee(n,ho(n)?wg(e,t,n,n.$ref):ao(n)?io(K(e,t,n.items),oo(n)):Pp(n)?Mp(e,t,n.target,n.arguments):co(n)?so(Pg(e,t,n.parameters),K(e,t,n.instanceType),lo(n)):fo(n)?uo(Pg(e,t,n.parameters),K(e,t,n.returnType),po(n)):Bo(n)?zo(K(e,t,n.if),K(e,t,n.then),K(e,t,n.else),Vo(n)):Wo(n)?Uo(Pg(e,t,n.allOf),Go(n)):ko(n)?B(Mg(e,t,n.properties),Ao(n)):Tl(n)?bl(Sl(n),K(e,t,wl(n))):Dl(n)?El(K(e,t,n.items)):mc(n)?pc(Ng(e,t,n.items),hc(n)):Gs(n)?G(Pg(e,t,n.anyOf),Ks(n)):n)}function K(e,t,n){return Za(n)?wee(e,t,n.action,n.parameters,n.options):Tee(e,t,n)}function Eee(e){return qa(e,{"~immutable":!0},{})}function Fg(e,t){return qa(Eee(e),{},t)}function Dee(e,t,n,r){return Fg(K(e,t,n),r)}function Ig(e,t={}){return Fg(e,t)}var Oee=G([V(`browser`),V(`phone`),V(`cli`),V(`machine`)]),Lg=B({id:W({minLength:1}),name:W(),kind:Oee,createdAt:U(),lastSeenAt:U(),current:Os(),os:wo(W()),tauVersion:wo(W()),protocolVersion:wo(W())}),Rg=G([V(`device`),V(`machine`)]),zg=B({kind:wo(Rg),name:wo(W({maxLength:120}))}),Bg=3e5,Vg=B({kind:Rg,code:W(),shortCode:W(),link:G([W(),H()]),expiresAt:U()}),Hg=B({code:W({minLength:1,maxLength:256}),deviceName:W({maxLength:120})}),Ug=B({deviceId:W(),secret:wo(W())}),Wg=B({name:W({minLength:1,maxLength:120})}),Gg=e=>typeof e==`object`&&!!e,Kg=new Set([`__proto__`,`constructor`,`prototype`]),qg=class extends Error{segment;constructor(e){super(`unsafe path segment: ${String(e)}`),this.segment=e,this.name=`UnsafePathError`}};function Jg(e){if(!Array.isArray(e)||e.length===0)throw TypeError(`op is not a tuple`);switch(e[0]){case`r`:if(e.length!==2)throw TypeError(`r arity`);return;case`s`:if(e.length!==3)throw TypeError(`s arity`);Yg(e[1],!0);return;case`d`:if(e.length!==2)throw TypeError(`d arity`);Yg(e[1],!0);return;case`a`:if(e.length!==3||typeof e[2]!=`string`)throw TypeError(`a shape`);Yg(e[1],!0);return;case`t`:if(e.length!==3||!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t shape`);Yg(e[1],!0);return;case`p`:if(e.length!==5)throw TypeError(`p arity`);if(Yg(e[1]),!Number.isInteger(e[2])||e[2]<0)throw TypeError(`p index`);if(!Number.isInteger(e[3])||e[3]<0)throw TypeError(`p remove`);if(!Array.isArray(e[4]))throw TypeError(`p items`);return;case`m`:if(e.length!==3)throw TypeError(`m arity`);Yg(e[1]),Xg(e[2]);return;default:throw TypeError(`unknown op verb: ${String(e[0])}`)}}function Yg(e,t=!1){if(!Array.isArray(e))throw TypeError(`path is not an array`);if(t&&e.length===0)throw TypeError(`path is empty`);Zg(e)}function Xg(e){if(!Array.isArray(e))throw TypeError(`m permutation is not an array`);let t=new Uint8Array(e.length);for(let n of e){if(!Number.isInteger(n)||n<0||n>=e.length||t[n]!==0)throw TypeError(`m permutation is not a bijection`);t[n]=1}}function Zg(e){for(let t of e)if(typeof t==`string`){if(Kg.has(t))throw new qg(t)}else if(!Number.isInteger(t)||t<0)throw new qg(t)}function Qg(e,t){if(t>e.length)throw new qg(t)}var $g=class extends Error{path;constructor(e){super(`unresolvable path: ${JSON.stringify(e)}`),this.path=e,this.name=`PathError`}};function e_(e,t){let n=e;for(let e of t){if(Jg(e),e[0]===`r`){n=e[1];continue}let t=e[1];if(Zg(t),e[0]===`p`){let r=t.length===0?n:o_(n,t);if(!Array.isArray(r))throw new $g(t);r.splice(e[2],e[3]);let i=1e4;for(let t=0;t<e[4].length;t+=i)r.splice(e[2]+t,0,...e[4].slice(t,t+i));continue}if(e[0]===`m`){let r=t.length===0?n:o_(n,t);if(!Array.isArray(r)||r.length!==e[2].length)throw new $g(t);let i=r.slice();for(let t=0;t<e[2].length;t++)r[t]=i[e[2][t]];continue}let r=o_(n,t.slice(0,-1)),i=t[t.length-1];if(Array.isArray(r)){if(typeof i!=`number`)throw new qg(i);Qg(r,i)}let a=e=>{Object.defineProperty(r,i,{value:e,writable:!0,enumerable:!0,configurable:!0})},o=()=>Object.hasOwn(r,i)?r[i]:void 0;switch(e[0]){case`s`:a(e[2]);break;case`d`:if(Array.isArray(r)){if(typeof i!=`number`||i>=r.length)throw new $g(t);r.splice(i,1)}else delete r[i];break;case`a`:{let n=o();if(typeof n!=`string`)throw new $g(t);a(`${n}${e[2]}`);break}case`t`:{let n=o();if(typeof n!=`string`)throw new $g(t);a(n.slice(e[2]));break}}}return n}function t_(e,t){return n_(e,[t])}function n_(e,t){let n=e,r=new WeakSet;for(let e of t)for(let t of e)if(Jg(t),t[0]===`r`)n=t[1];else{if(t[0]===`p`){let e=r_(n,t,r);if(e!==void 0){n=e;continue}}n=i_(n,t[0]===`p`||t[0]===`m`?t[1]:t[1].slice(0,-1),r),n=e_(n,[t])}return n}function r_(e,t,n){let[,r,i,a,o]=t;if(a!==0)return;let s=e;for(let e of r){if(!(typeof e==`string`?!Kg.has(e)&&Gg(s)&&!Array.isArray(s):Number.isInteger(e)&&e>=0&&Array.isArray(s))||!Object.hasOwn(s,e))return;s=s[e]}if(!Array.isArray(s)||n.has(s)||i!==s.length)return;let c=s.concat(o);if(n.add(c),r.length===0)return c;let l=r.slice(0,-1),u=i_(e,l,n);return Object.defineProperty(o_(u,l),r[r.length-1],{value:c,writable:!0,enumerable:!0,configurable:!0}),u}function i_(e,t,n){let r=e=>{if(Array.isArray(e))return e.slice();if(!Gg(e))throw new $g(t);let n=Object.create(Object.getPrototypeOf(e)===null?null:Object.prototype);for(let t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0});return n};if(!Gg(e))throw new $g(t);let i;n.has(e)?i=e:(i=r(e),n.add(i));let a=i;for(let e of t){if(!Object.hasOwn(a,e))throw new $g(t);if(Array.isArray(a)&&typeof e!=`number`)throw new qg(e);let i=a[e];if(!Gg(i))throw new $g(t);if(n.has(i)){a=i;continue}let o=r(i);Object.defineProperty(a,e,{value:o,writable:!0,enumerable:!0,configurable:!0}),n.add(o),a=o}return i}function a_(e,t){let n=e;for(let e of t){if(!Gg(n))throw new $g(t);if(Array.isArray(n)&&typeof e!=`number`)throw new qg(e);if(!Object.hasOwn(n,e))throw new $g(t);n=n[e]}return n}function o_(e,t){let n=a_(e,t);if(!Gg(n))throw new $g(t);return n}function s_(e){return e[0]?.[0]===`r`}function c_(e,t){return e==null&&!s_(t)?e:t_(e,t)}var l_=B({force:Os()}),u_=B({deleted:io(W()),kept:io(B({id:W(),reason:W()}))}),d_=e=>e.startsWith(`Uncommitted changes and`)?`Uncommitted + unmerged`:e.startsWith(`Uncommitted changes`)?`Uncommitted changes`:e.startsWith(`Unmerged commits`)?`Unmerged commits`:`Unmerged work`,f_=`app.monitor_event`,p_=`app.process_exit`,m_=`app.timer_fired`,h_=`app.notice`,g_=`app.goal_verdict`,__=G([B({exitCode:G([U(),H()])}),V(`timeout`)]),v_=B({processId:W(),description:W(),lines:io(W()),dropped:U(),ended:wo(__)}),y_=B({processId:W(),name:W(),command:W(),exitCode:G([U(),H()]),logTail:W()}),b_=G([V(`agent`),V(`loop`)]),x_=G([V(`wakeup`),V(`repeat`)]),S_=B({timerId:W(),kind:x_,prompt:W(),reason:G([W(),H()]),source:b_,firedCount:U()}),C_=B({text:W()}),w_=G([V(`active`),V(`paused`),V(`achieved`),V(`failed`),V(`cleared`)]),T_=G([V(`not_met`),V(`met`),V(`impossible`)]),E_=B({goalId:W(),verdict:T_,reason:W(),turnsEvaluated:U()}),D_=B({id:W(),conversationId:W(),kind:x_,every:G([W(),H()]),prompt:W(),reason:G([W(),H()]),source:b_,createdAt:U(),expiresAt:G([U(),H()]),nextAt:U(),firedCount:U()}),O_=B({every:wo(W({minLength:1})),prompt:W({minLength:1})}),k_=4e3,A_=B({id:W(),condition:W(),state:w_,startedAt:U(),turnsEvaluated:U(),tokensSpent:U(),lastVerdict:G([T_,H()]),lastReason:G([W(),H()])}),j_=B({condition:W({minLength:1,maxLength:k_})}),M_=B({state:w_,condition:W()}),N_=[`subagent-notification`,`monitor-event`,`process-exit`,`timer-fired`,`notice`,`goal-verdict`],P_=e=>{let t=e.trimStart();return N_.some(e=>t.startsWith(`<${e}`))},F_=G([V(`off`),V(`starting`),V(`online`),V(`reconnecting`),V(`error`)]),I_=B({enabled:Os()}),L_=B({state:F_,url:G([W(),H()]),since:G([U(),H()]),message:G([W(),H()]),pendingRemoval:Os(),canRecreate:Os()}),R_=B({ok:V(!0)}),z_=B({provider:W(),modelId:W()}),B_=G([V(`off`),V(`minimal`),V(`low`),V(`medium`),V(`high`),V(`xhigh`),V(`max`)]),V_=B({provider:W(),modelId:W(),name:W(),contextWindow:U(),reasoning:Os(),images:Os(),thinkingLevels:io(B_),providerName:W()}),H_=G([V(`steer`),V(`queue`)]),U_=G([V(`worktree`),V(`checkout`)]),W_=G([U_,V(`per-project`)]),kee=B({mode:U_,path:W(),branch:G([W(),H()]),base:G([W(),H()]),state:G([V(`ready`),V(`merged`),V(`removed`)]),mergedSha:G([W(),H()]),pullRequestUrl:G([W(),H()])}),G_=B({enabled:io(W()),alwaysAllow:io(W()),askBeforeWrites:Os()}),Aee=B({defaultModel:G([z_,H()]),defaultThinkingLevel:G([B_,H()]),fastModel:G([z_,H()]),fastThinkingLevel:G([B_,H()]),projectsFolder:W(),messageMode:H_,workspaceDefault:W_,claudeCliNoticeAt:G([U(),H()]),claudeConnectors:G_,remote:I_}),K_=G([V(`openrouter`),V(`openai`),V(`anthropic`),V(`google`),V(`opencode`),V(`claude-cli`)]),q_=G([V(`api_key`),V(`chatgpt`),V(`claude_cli`)]),jee=B({method:q_,source:G([V(`file`),V(`env`),V(`cli`)]),valid:G([Os(),H()])}),Mee=G([V(`ready`),V(`needs_notice`),V(`missing`),V(`logged_out`),V(`not_plan`),V(`blocked`),V(`error`),V(`sdk_missing`)]),Nee=B({status:G([V(`allowed`),V(`allowed_warning`),V(`rejected`)]),fiveHour:G([U(),H()]),resetsAt:G([U(),H()]),updatedAt:U()}),Pee=G([V(`connected`),V(`needs_auth`),V(`failed`),V(`disabled`),V(`pending`)]),Fee=B({name:W(),source:G([V(`claudeai`),V(`user`)]),status:Pee,toolCount:U(),readOnlyCount:U()}),Iee=B({state:Mee,plan:G([W(),H()]),org:G([W(),H()]),cliVersion:G([W(),H()]),sdkCliVersion:G([W(),H()]),message:G([W(),H()]),usage:G([Nee,H()]),processCount:U(),connectors:G([io(Fee),H()])}),J_=B({id:K_,name:W(),methods:io(q_),keyUrl:W(),connection:G([jee,H()]),cli:G([Iee,H()])}),Lee=G([V(`starting`),V(`waiting`),V(`done`),V(`failed`),V(`cancelled`)]),Y_=B({id:W(),provider:V(`openai`),method:V(`chatgpt`),state:Lee,authUrl:G([W(),H()]),error:G([W(),H()])}),Ree=B({path:W(),kind:G([V(`file`),V(`directory`)])}),zee=B({name:W(),description:W(),scope:G([V(`project`),V(`user`),V(`app`)]),path:W()}),Bee=B({instructions:wo(W({maxLength:2e3}))}),Vee=G([V(`home`),V(`folder`),V(`git`)]),Hee=G([V(`ready`),V(`cloning`),V(`failed`)]),X_=B({id:W(),name:W(),path:W(),createdAt:U(),kind:Vee,gitUrl:wo(W()),status:Hee,isGitRepo:Os(),error:wo(W()),iconUrl:wo(G([W(),H()])),lastWorkspaceMode:wo(U_)}),Uee=G([V(`idle`),V(`running`),V(`error`)]),Wee=G([V(`running`),V(`done`),V(`failed`),V(`stopped`)]),Gee=`app.subagent_notification`,Kee=B({childId:W(),status:G([V(`done`),V(`failed`),V(`stopped`)]),title:W(),report:W()}),Z_=B({id:W(),projectId:W(),title:W(),createdAt:U(),updatedAt:U(),archivedAt:G([U(),H()]),status:Uee,lastRunEndedAt:G([U(),H()]),avatarIndex:U(),lastActivityAt:U(),model:G([z_,H()]),workspace:kee,forkOf:G([B({conversationId:W(),entryId:W()}),H()]),parentId:G([W(),H()]),agentType:G([W(),H()]),agentModel:G([z_,H()]),agentStatus:G([Wee,H()]),background:Os(),agentThinking:G([B_,H()]),timers:U(),nextTimerAt:G([W(),H()]),goal:G([M_,H()]),unmergedWarning:G([W(),H()])}),qee=G([B({resource:V(`projects`)}),B({resource:V(`providers`)}),B({resource:V(`conversations`),projectId:W()}),B({resource:V(`processes`),conversationId:W()}),B({resource:V(`terminals`),conversationId:W()}),B({resource:V(`timers`),conversationId:W()}),B({resource:V(`mcp`)}),B({resource:V(`approvals`),conversationId:W()}),B({resource:V(`remote`)}),B({resource:V(`devices`)}),B({resource:V(`machines`)})]),Jee=B({mimeType:G([V(`image/png`),V(`image/jpeg`),V(`image/webp`),V(`image/gif`)]),data:W({maxLength:5242880})}),Q_={text:W(),images:wo(io(Jee,{maxItems:8})),requestId:W({minLength:1})},Yee=G([V(`steer`),V(`followUp`)]),Xee=B({...Q_,whenBusy:wo(Yee)}),Zee=B({...Q_,projectId:W({minLength:1}),model:wo(z_),thinkingLevel:wo(B_),workspace:wo(U_)}),Qee=B({model:wo(z_),thinkingLevel:wo(B_)},{minProperties:1}),$ee=B({requestId:W({minLength:1})}),ete=G([B({state:V(`connected`),login:W(),gitProtocol:G([V(`https`),V(`ssh`)]),tokenSource:W()}),B({state:V(`not_installed`)}),B({state:V(`not_logged_in`),hint:W()}),B({state:V(`error`),message:W()})]),$_=B({nameWithOwner:W({pattern:`^[A-Za-z0-9-]+/[A-Za-z0-9._-]+$`}),description:G([W(),H()]),private:Os(),pushedAt:U(),localPath:G([W(),H()]),projectId:G([W(),H()])}),tte=B({nameWithOwner:W({pattern:`^[A-Za-z0-9-]+/[A-Za-z0-9._-]+$`}),mode:G([V(`local`),V(`clone`),V(`folder`)]),path:wo(W({minLength:1}))}),nte=G([B({path:W()}),H()]),rte=B({path:W(),display:W(),isGitRepo:Os()}),ite=B({prefix:W(),limit:wo(js({minimum:1,maximum:200}))});B({name:W({minLength:1})});var ate=B({name:W(),url:W()}),ote=1048576,ste=G([V(`online`),V(`reconnecting`),V(`offline`),V(`update-required`)]),cte=B({id:W({minLength:1}),name:W(),os:W(),tauVersion:W(),protocolVersion:W(),status:ste,lastSeenAt:U(),threadCount:U(),linkedTo:wo(W())}),lte=B({name:W({minLength:1,maxLength:120})}),ute=B({state:G([V(`none`),V(`connecting`),V(`linked`),V(`reconnecting`),V(`unreachable`),V(`update-required`),V(`refused`)]),hubName:G([W(),H()]),hubUrl:G([W(),H()]),since:G([U(),H()]),message:G([W(),H()]),os:wo(W())}),dte=B({name:W({minLength:1,maxLength:120}),os:W({maxLength:120}),tauVersion:W({maxLength:60}),protocolVersion:W({maxLength:80}),threadCount:U()}),fte=B({savedAt:U(),projects:io(B({id:W(),name:W()})),threads:io(B({id:W(),projectId:W(),title:W(),updatedAt:U()}))}),pte=`/api/m`,ev=e=>`${pte}/${encodeURIComponent(e)}`,mte=B({ahead:U(),behind:U(),dirtyFiles:io(W()),unmergedCommits:U(),canMerge:Os(),reason:G([W(),H()])}),hte=B({path:W(),added:U(),removed:U(),status:G([V(`A`),V(`M`),V(`D`),V(`R`)])}),gte=B({id:W(),requestId:W(),entryId:G([W(),H()]),kind:G([V(`before`),V(`after`)]),at:U(),files:io(hte)}),_te=B({checkpointId:W(),changes:io(B({path:W(),action:G([V(`write`),V(`delete`)])}))}),vte=B({id:W(),conversationId:W(),name:W(),command:W(),state:G([V(`running`),V(`exited`),V(`killed`)]),exitCode:G([U(),H()]),startedAt:U(),urls:io(W()),kind:G([V(`process`),V(`monitor`)])}),tv=yl(W(),W()),yte=G([B({name:W({minLength:1}),command:W({minLength:1}),args:io(W()),env:tv}),B({name:W({minLength:1}),url:W({minLength:1}),headers:tv})]),bte=B({name:W(),source:G([V(`settings`),V(`project`)]),transport:G([V(`stdio`),V(`http`)]),state:G([V(`idle`),V(`connected`),V(`error`)]),toolCount:G([U(),H()]),error:G([W(),H()])}),xte=G([V(`allow`),V(`allow_always`),V(`deny`)]),Ste=B({toolUseId:W(),conversationId:W(),server:W(),tool:W(),arguments:yl(W(),jo()),requestedAt:U()}),nv=B({id:W(),conversationId:W(),title:W(),status:G([V(`running`),V(`exited`)]),exitCode:G([U(),H()]),createdAt:U()}),rv=js({minimum:1,maximum:500}),Cte=B({cols:rv,rows:rv}),wte=B({available:Os()}),iv=B({current:W(),latest:G([W(),H()]),checkedAt:G([U(),H()]),behind:Os()}),q=`/api`,Tte=`${q}/live`,av=44040192,ov=B({id:W({minLength:1})}),sv=B({id:K_}),cv=B({sid:W({minLength:1})}),Ete=B({id:W({minLength:1}),itemId:W({minLength:1})}),Dte=B({id:W({minLength:1}),cid:W({minLength:1})}),Ote=B({id:W({minLength:1}),toolUseId:W({minLength:1})}),lv=B({force:wo(G([V(`true`),V(`false`)]))}),uv=B({name:W({minLength:1})}),dv=B({entryId:W({minLength:1})}),fv={getHealth:{method:`GET`,path:`${q}/health`,status:200,response:R_},getRemoteStatus:{method:`GET`,path:`${q}/remote`,status:200,response:L_},enableRemote:{method:`POST`,path:`${q}/remote/enable`,status:200,response:L_},disableRemote:{method:`POST`,path:`${q}/remote/disable`,status:200,response:L_},recreateRemote:{method:`POST`,path:`${q}/remote/recreate`,status:200,response:L_},listDevices:{method:`GET`,path:`${q}/access/devices`,status:200,response:io(Lg)},renameDevice:{method:`PUT`,path:`${q}/access/devices/:id`,status:204,params:ov,body:Wg},revokeDevice:{method:`DELETE`,path:`${q}/access/devices/:id`,status:204,params:ov},signOutAllDevices:{method:`POST`,path:`${q}/access/sign-out-all`,status:204},mintPairing:{method:`POST`,path:`${q}/pair`,status:200,query:zg,response:Vg},redeemPairing:{method:`POST`,path:`${q}/pair/redeem`,status:200,body:Hg,response:Ug},listMachines:{method:`GET`,path:`${q}/machines`,status:200,response:io(cte)},renameMachine:{method:`PUT`,path:`${q}/machines/:id`,status:204,params:ov,body:lte},getMachineSummary:{method:`GET`,path:`${q}/machines/:id/summary`,status:200,params:ov,response:fte},disconnectMachine:{method:`DELETE`,path:`${q}/machines/:id`,status:204,params:ov},getHubLink:{method:`GET`,path:`${q}/machines/hub`,status:200,response:ute},disconnectHub:{method:`POST`,path:`${q}/machines/hub/disconnect`,status:204},linkMachine:{method:`GET`,path:`${q}/machines/link`,status:200},getUpdateStatus:{method:`GET`,path:`${q}/update`,status:200,response:iv},refreshUpdateStatus:{method:`POST`,path:`${q}/update/refresh`,status:200,response:iv},getSettings:{method:`GET`,path:`${q}/settings`,status:200,response:Aee},setDefaultModel:{method:`PUT`,path:`${q}/settings/default-model`,status:204,body:z_},setDefaultThinking:{method:`PUT`,path:`${q}/settings/default-thinking`,status:204,body:B({thinkingLevel:G([B_,H()])})},setFastThinking:{method:`PUT`,path:`${q}/settings/fast-thinking`,status:204,body:B({thinkingLevel:G([B_,H()])})},setFastModel:{method:`PUT`,path:`${q}/settings/fast-model`,status:204,body:B({model:G([z_,H()])})},setMessageMode:{method:`PUT`,path:`${q}/settings/message-mode`,status:204,body:B({mode:H_})},setWorkspaceDefault:{method:`PUT`,path:`${q}/settings/workspace-default`,status:204,body:B({mode:W_})},setClaudeConnectors:{method:`PUT`,path:`${q}/settings/claude-connectors`,status:204,body:G_},setProjectsFolder:{method:`PUT`,path:`${q}/settings/projects-folder`,status:204,body:B({path:W({minLength:1})})},getSuggestedCodeFolder:{method:`GET`,path:`${q}/settings/suggested-code-folder`,status:200,response:nte},suggestDirectories:{method:`POST`,path:`${q}/fs/suggest`,status:200,body:ite,response:io(rte)},getGithubStatus:{method:`GET`,path:`${q}/github/status`,status:200,response:ete},listGithubRepos:{method:`GET`,path:`${q}/github/repos`,status:200,response:io($_)},refreshGithubRepos:{method:`POST`,path:`${q}/github/repos/refresh`,status:200,response:io($_)},useGithubRepo:{method:`POST`,path:`${q}/github/use`,status:201,body:tte,response:X_},listProviders:{method:`GET`,path:`${q}/providers`,status:200,response:io(J_)},setProviderKey:{method:`PUT`,path:`${q}/providers/:id/key`,status:200,params:sv,body:B({key:W({minLength:1})}),response:J_},disconnectProvider:{method:`DELETE`,path:`${q}/providers/:id`,status:200,params:sv,response:J_},acknowledgeClaudeCli:{method:`POST`,path:`${q}/providers/claude-cli/notice`,status:200,response:J_},refreshClaudeCli:{method:`POST`,path:`${q}/providers/claude-cli/refresh`,status:200,response:J_},installClaudeCliSdk:{method:`POST`,path:`${q}/providers/claude-cli/install`,status:200,response:J_},startLogin:{method:`POST`,path:`${q}/providers/:id/login`,status:201,params:sv,response:Y_},getLogin:{method:`GET`,path:`${q}/logins/:sid`,status:200,params:cv,response:Y_},submitLoginUrl:{method:`POST`,path:`${q}/logins/:sid/url`,status:200,params:cv,body:B({url:W({minLength:1,maxLength:4096})}),response:Y_},cancelLogin:{method:`DELETE`,path:`${q}/logins/:sid`,status:204,params:cv},listModels:{method:`GET`,path:`${q}/models`,status:200,response:io(V_)},listProjects:{method:`GET`,path:`${q}/projects`,status:200,response:io(X_)},addProject:{method:`POST`,path:`${q}/projects`,status:201,body:B({path:W({minLength:1}),name:wo(W({minLength:1}))}),response:X_},cloneProject:{method:`POST`,path:`${q}/projects/clone`,status:201,body:B({url:W({minLength:1}),name:wo(W({minLength:1}))}),response:X_},retryClone:{method:`POST`,path:`${q}/projects/:id/retry-clone`,status:204,params:ov},renameProject:{method:`PATCH`,path:`${q}/projects/:id`,status:204,params:ov,body:B({name:W({minLength:1})})},setProjectFolder:{method:`PUT`,path:`${q}/projects/:id/folder`,status:200,params:ov,body:B({path:W({minLength:1})}),response:X_},removeProject:{method:`DELETE`,path:`${q}/projects/:id`,status:204,params:ov},getProjectIcon:{method:`GET`,path:`${q}/projects/:id/icon`,status:200,params:ov,responseKind:`image`},setProjectIcon:{method:`PUT`,path:`${q}/projects/:id/icon`,status:204,params:ov,body:B({png:W({minLength:1})}),bodyLimit:ote},resetProjectIcon:{method:`DELETE`,path:`${q}/projects/:id/icon`,status:204,params:ov},listIconCandidates:{method:`GET`,path:`${q}/projects/:id/icon-candidates`,status:200,params:ov,response:io(ate)},getIconCandidate:{method:`GET`,path:`${q}/projects/:id/icon-candidates/file`,status:200,params:ov,query:B({name:W({minLength:1})}),responseKind:`image`},suggestProjectFiles:{method:`POST`,path:`${q}/projects/:id/files/suggest`,status:200,params:ov,body:B({query:W({maxLength:500})}),response:io(Ree)},listSkills:{method:`GET`,path:`${q}/skills`,status:200,query:B({projectId:wo(W({minLength:1}))}),response:io(zee)},listConversations:{method:`GET`,path:`${q}/projects/:id/conversations`,status:200,params:ov,response:io(Z_)},listAllConversations:{method:`GET`,path:`${q}/conversations`,status:200,response:io(Z_)},startConversation:{method:`POST`,path:`${q}/conversations`,status:201,body:Zee,response:Z_,bodyLimit:av},renameConversation:{method:`PATCH`,path:`${q}/conversations/:id`,status:204,params:ov,body:B({title:W({minLength:1})})},sendMessage:{method:`POST`,path:`${q}/conversations/:id/messages`,status:204,params:ov,body:Xee,bodyLimit:av},archiveConversation:{method:`PUT`,path:`${q}/conversations/:id/archived`,status:204,params:ov,body:B({archived:Os()})},deleteArchivedConversations:{method:`POST`,path:`${q}/conversations/archived/delete`,status:200,body:l_,response:u_},removeConversation:{method:`DELETE`,path:`${q}/conversations/:id`,status:204,params:ov,query:lv},configureConversation:{method:`PATCH`,path:`${q}/conversations/:id/agent`,status:204,params:ov,body:Qee},retryConversation:{method:`POST`,path:`${q}/conversations/:id/retry`,status:204,params:ov,body:$ee},compactConversation:{method:`POST`,path:`${q}/conversations/:id/compact`,status:204,params:ov,body:Bee},abortConversation:{method:`POST`,path:`${q}/conversations/:id/abort`,status:204,params:ov},stopAgent:{method:`POST`,path:`${q}/conversations/:id/stop-agent`,status:204,params:ov},forkConversation:{method:`POST`,path:`${q}/conversations/:id/fork`,status:201,params:ov,body:dv,response:Z_},rewindPreview:{method:`POST`,path:`${q}/conversations/:id/rewind/preview`,status:200,params:ov,body:dv,response:_te},rewindConversation:{method:`POST`,path:`${q}/conversations/:id/rewind`,status:200,params:ov,body:dv,response:B({conversation:Z_,draft:W()})},cancelQueued:{method:`DELETE`,path:`${q}/conversations/:id/queue/:itemId`,status:200,params:Ete,response:B({cancelled:Os()})},listCheckpoints:{method:`GET`,path:`${q}/conversations/:id/checkpoints`,status:200,params:ov,response:io(gte)},getCheckpointDiff:{method:`GET`,path:`${q}/conversations/:id/checkpoints/:cid/diff`,status:200,params:Dte,query:B({path:W({minLength:1})}),response:B({diff:W()})},getWorkspace:{method:`GET`,path:`${q}/conversations/:id/workspace`,status:200,params:ov,response:mte},mergeWorkspace:{method:`POST`,path:`${q}/conversations/:id/workspace/merge`,status:200,params:ov,response:Z_},createPullRequest:{method:`POST`,path:`${q}/conversations/:id/workspace/pull-request`,status:200,params:ov,response:Z_},removeWorkspace:{method:`DELETE`,path:`${q}/conversations/:id/workspace`,status:200,params:ov,query:lv,response:Z_},listProcesses:{method:`GET`,path:`${q}/conversations/:id/processes`,status:200,params:ov,response:io(vte)},getProcessLogs:{method:`GET`,path:`${q}/processes/:id/logs`,status:200,params:ov,query:B({tail:wo(W({pattern:`^[1-9][0-9]{0,3}$`}))}),response:B({logs:W()})},stopProcess:{method:`DELETE`,path:`${q}/processes/:id`,status:204,params:ov},getTerminalsAvailable:{method:`GET`,path:`${q}/terminals/available`,status:200,response:wte},listTerminals:{method:`GET`,path:`${q}/conversations/:id/terminals`,status:200,params:ov,response:io(nv)},openTerminal:{method:`POST`,path:`${q}/conversations/:id/terminals`,status:200,params:ov,body:Cte,response:nv},closeTerminal:{method:`DELETE`,path:`${q}/terminals/:id`,status:204,params:ov},listApprovals:{method:`GET`,path:`${q}/conversations/:id/approvals`,status:200,params:ov,response:io(Ste)},decideApproval:{method:`POST`,path:`${q}/conversations/:id/approvals/:toolUseId`,status:204,params:Ote,body:B({decision:xte})},listTimers:{method:`GET`,path:`${q}/conversations/:id/timers`,status:200,params:ov,response:io(D_)},deleteTimer:{method:`DELETE`,path:`${q}/timers/:id`,status:204,params:ov},startLoop:{method:`POST`,path:`${q}/conversations/:id/loop`,status:204,params:ov,body:O_},stopLoop:{method:`DELETE`,path:`${q}/conversations/:id/loop`,status:204,params:ov},getGoal:{method:`GET`,path:`${q}/conversations/:id/goal`,status:200,params:ov,response:G([A_,H()])},setGoal:{method:`PUT`,path:`${q}/conversations/:id/goal`,status:204,params:ov,body:j_},clearGoal:{method:`DELETE`,path:`${q}/conversations/:id/goal`,status:204,params:ov},listMcpServers:{method:`GET`,path:`${q}/mcp/servers`,status:200,query:B({projectId:wo(W({minLength:1}))}),response:io(bte)},saveMcpServer:{method:`PUT`,path:`${q}/mcp/servers/:name`,status:204,params:uv,body:yte},removeMcpServer:{method:`DELETE`,path:`${q}/mcp/servers/:name`,status:204,params:uv}};function pv(e,t){return e.replace(/:(\w+)/g,(e,n)=>encodeURIComponent(t?.[n]??``))}var kte=`invalid_key.path_not_found.not_a_directory.duplicate_project.not_found.no_provider.no_default_model.invalid_request.unauthorized.images_not_supported.invalid_git_url.too_large.project_not_ready.git_missing.github_unavailable.needs_folder.remote_mismatch.login_failed.nothing_to_compact.thread_busy.merge_conflict.base_dirty.not_on_base.worktree_dirty.has_unmerged_work.internal`.split(`.`);B({error:B({code:G([V(`invalid_key`),V(`path_not_found`),V(`not_a_directory`),V(`duplicate_project`),V(`not_found`),V(`no_provider`),V(`no_default_model`),V(`invalid_request`),V(`unauthorized`),V(`images_not_supported`),V(`invalid_git_url`),V(`too_large`),V(`project_not_ready`),V(`git_missing`),V(`github_unavailable`),V(`needs_folder`),V(`remote_mismatch`),V(`login_failed`),V(`nothing_to_compact`),V(`thread_busy`),V(`merge_conflict`),V(`base_dirty`),V(`not_on_base`),V(`worktree_dirty`),V(`has_unmerged_work`),V(`internal`)]),message:W()})});var mv=class extends Error{code;constructor(e,t){super(t),this.name=`AppError`,this.code=e}};function hv(e){return e instanceof mv}function Ate(e){return kte.includes(e)}function jte(e){if(typeof e!=`object`||!e)return!1;let{error:t}=e;return Ate(t?.code)&&typeof t?.message==`string`}function Mte(e){return z(e,`~refine`)&&Ri(e[`~refine`])&&oa(e[`~refine`],0,e=>qi(e)&&z(e,`check`)&&z(e,`error`)&&Hi(e.check)&&Hi(e.error))}function gv(e){return qi(e)&&!Ri(e)}function _v(e){return Bi(e)}function vv(e){return gv(e)||_v(e)}function Nte(e){return z(e,`additionalItems`)&&vv(e.additionalItems)}function Pte(e){return z(e,`additionalProperties`)&&vv(e.additionalProperties)}function Fte(e){return z(e,`allOf`)&&Ri(e.allOf)&&e.allOf.every(e=>vv(e))}function yv(e){return z(e,`$anchor`)&&Ji(e.$anchor)}function bv(e){return z(e,`anyOf`)&&Ri(e.anyOf)&&e.anyOf.every(e=>vv(e))}function xv(e){return z(e,`const`)}function Sv(e){return z(e,`contains`)&&vv(e.contains)}function Cv(e){return z(e,`dependencies`)&&qi(e.dependencies)&&Object.values(e.dependencies).every(e=>vv(e)||Ri(e)&&e.every(e=>Ji(e)))}function wv(e){return z(e,`dependentRequired`)&&qi(e.dependentRequired)&&Object.values(e.dependentRequired).every(e=>Ri(e)&&e.every(e=>Ji(e)))}function Tv(e){return z(e,`dependentSchemas`)&&qi(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(e=>vv(e))}function Ev(e){return z(e,`$dynamicAnchor`)&&Ji(e.$dynamicAnchor)}function Dv(e){return z(e,`$dynamicRef`)&&Ji(e.$dynamicRef)}function Ov(e){return z(e,`else`)&&vv(e.else)}function kv(e){return z(e,`enum`)&&Ri(e.enum)}function Av(e){return z(e,`exclusiveMaximum`)&&(Gi(e.exclusiveMaximum)||zi(e.exclusiveMaximum))}function jv(e){return z(e,`exclusiveMinimum`)&&(Gi(e.exclusiveMinimum)||zi(e.exclusiveMinimum))}function Mv(e){return z(e,`format`)&&Ji(e.format)}function Nv(e){return z(e,`$id`)&&Ji(e.$id)}function Pv(e){return z(e,`if`)&&vv(e.if)}function Fv(e){return z(e,`items`)&&(vv(e.items)||Ri(e.items)&&e.items.every(e=>vv(e)))}function Iv(e){return Fv(e)&&Ri(e.items)}function Lv(e){return z(e,`maximum`)&&(Gi(e.maximum)||zi(e.maximum))}function Rv(e){return z(e,`maxContains`)&&Gi(e.maxContains)}function zv(e){return z(e,`maxItems`)&&Gi(e.maxItems)}function Bv(e){return z(e,`maxLength`)&&Gi(e.maxLength)}function Vv(e){return z(e,`maxProperties`)&&Gi(e.maxProperties)}function Hv(e){return z(e,`minimum`)&&(Gi(e.minimum)||zi(e.minimum))}function Uv(e){return z(e,`minContains`)&&Gi(e.minContains)}function Wv(e){return z(e,`minItems`)&&Gi(e.minItems)}function Gv(e){return z(e,`minLength`)&&Gi(e.minLength)}function Kv(e){return z(e,`minProperties`)&&Gi(e.minProperties)}function qv(e){return z(e,`multipleOf`)&&(Gi(e.multipleOf)||zi(e.multipleOf))}function Jv(e){return z(e,`not`)&&vv(e.not)}function Yv(e){return z(e,`oneOf`)&&Ri(e.oneOf)&&e.oneOf.every(e=>vv(e))}function Xv(e){return z(e,`pattern`)&&(Ji(e.pattern)||e.pattern instanceof RegExp)}function Zv(e){return z(e,`patternProperties`)&&qi(e.patternProperties)&&Object.values(e.patternProperties).every(e=>vv(e))}function Qv(e){return z(e,`prefixItems`)&&Ri(e.prefixItems)&&e.prefixItems.every(e=>vv(e))}function $v(e){return z(e,`properties`)&&qi(e.properties)&&Object.values(e.properties).every(e=>vv(e))}function ey(e){return z(e,`propertyNames`)&&(qi(e.propertyNames)||vv(e.propertyNames))}function ty(e){return z(e,`$recursiveAnchor`)&&Bi(e.$recursiveAnchor)}function ny(e){return ty(e)&&R(e.$recursiveAnchor,!0)}function ry(e){return z(e,`$recursiveRef`)&&Ji(e.$recursiveRef)}function iy(e){return z(e,`$ref`)&&Ji(e.$ref)}function ay(e){return z(e,`required`)&&Ri(e.required)&&e.required.every(e=>Ji(e))}function oy(e){return z(e,`then`)&&vv(e.then)}function sy(e){return z(e,`type`)&&(Ji(e.type)||Ri(e.type)&&e.type.every(e=>Ji(e)))}function cy(e){return z(e,`uniqueItems`)&&Bi(e.uniqueItems)}function ly(e){return z(e,`unevaluatedItems`)&&vv(e.unevaluatedItems)}function uy(e){return z(e,`unevaluatedProperties`)&&vv(e.unevaluatedProperties)}var dy=class{constructor(){let e=new Set,t=new Set;this.stack=[{indices:e,keys:t}]}Push(){let e=new Set,t=new Set;return this.stack.push({indices:e,keys:t}),!0}Pop(){return this.stack.pop(),!0}AddIndex(e){return this.GetIndices().add(e),!0}AddKey(e){return this.GetKeys().add(e),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(e){for(let t of e)t.GetIndices().forEach(e=>this.GetIndices().add(e)),t.GetKeys().forEach(e=>this.GetKeys().add(e));return!0}};function fy(e,t,n,r){return oa(n[`~refine`],0,(e,t)=>e.check(r))}function py(e){return Fv(e)&&Ri(e.items)}function my(e,t,n,r){return!py(n)||oa(r,0,(r,i)=>Qi(i,n.items.length)||fS(e,t,n.additionalItems,r)&&t.AddIndex(i))}function hy(e){return new RegExp(e,`u`)}function gy(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}$`}function _y(e){let t=[];return Zv(e)&&t.push(...pa(e.patternProperties)),$v(e)&&t.push(...pa(e.properties).map(gy)),R(t.length,0)?`(?!)`:`(${t.join(`|`)})`}function vy(e,t,n,r){let i=hy(_y(n));return oa(pa(r),0,(a,o)=>i.test(a)||fS(e,t,n.additionalProperties,r[a])&&t.AddKey(a))}function yy(e,t,n,r){let i=n.allOf.reduce((t,n)=>{let i=new dy;return pS(e,i,n,r)?[...t,i]:t},[]);return R(i.length,n.allOf.length)&&t.Merge(i)}function by(e,t,n,r){let i=n.anyOf.reduce((t,n)=>{let i=new dy;return pS(e,i,n,r)?[...t,i]:t},[]);return Zi(i.length,0)&&t.Merge(i)}function xy(e,t,n,r){return n}function Sy(e,t,n,r){return ra(n.const)?R(r,n.const):va(r,n.const)}function Cy(e){return!(Uv(e)&&R(e.minContains,0))}function wy(e,t,n,r){return!Cy(n)||!R(r.length,0)&&ca(r,(r,i)=>pS(e,t,n.contains,r)&&t.AddIndex(i))}function Ty(e,t,n,r){let i=R(pa(r).length,0),a=oa(fa(n.dependencies),0,([n,i])=>!z(r,n)||(Ri(i)?i.every(e=>z(r,e)):pS(e,t,i,r)));return i||a}function Ey(e,t,n,r){let i=R(pa(r).length,0),a=oa(fa(n.dependentRequired),0,([e,t])=>!z(r,e)||t.every(e=>z(r,e)));return i||a}function Dy(e,t,n,r){let i=R(pa(r).length,0),a=oa(fa(n.dependentSchemas),0,([n,i])=>!z(r,n)||pS(e,t,i,r));return i||a}function Oy(e,t,n,r){let i=e.DynamicRef(n)??!1;return vv(i)&&pS(e,t,i,r)}function ky(e,t,n,r){return sa(n.enum,e=>ra(e)?R(r,e):va(r,e))}function Ay(e,t,n,r){return Qi(r,n.exclusiveMaximum)}function jy(e,t,n,r){return Zi(r,n.exclusiveMinimum)}var My=[0,31,28,31,30,31,30,31,31,30,31,30,31],Ny=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Py(e){return e%4==0&&(e%100!=0||e%400==0)}function Fy(e){let t=Ny.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r===2&&Py(n)?29:My[r])}var Iy=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function Ly(e,t=!0){let n=Iy.exec(e);if(!n||t&&!n[4]&&!n[5])return!1;let r=+n[1],i=+n[2],a=+n[3];if(r>23||i>59||a>60)return!1;if(n[5]){let e=+n[6],t=+n[7];if(e>23||t>59)return!1}if(a<60)return!0;let o=n[5]===`-`?-1:1,s=+(n[6]||0),c=+(n[7]||0);return((r*60+i-o*(s*60+c))%1440+1440)%1440==1439}function Ry(e){let t=e.split(/T/i);return t.length===2&&Fy(t[0])&&Ly(t[1])}var zy=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function By(e){return zy.test(e)}var Vy=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function Hy(e){return Vy.test(e)}var Uy=/^(?!-).*(?<!-)$/,Wy=/^(?!..--)/,Gy=/^[a-zA-Z0-9-]*$/,Ky=/[^\p{ASCII}]/u,qy=/[0-9]/,Jy=/[\u{0660}-\u{0669}]/u,Yy=/[\u{06f0}-\u{06f9}]/u,Xy=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,Zy=/[\u{002d}\u{002b}]/u,Qy=/\p{Mn}/u,$y=/\p{Mc}/u,eb=/[\p{Mn}\p{Mc}\p{Me}]/u,tb=/\p{L}/u,nb=/\p{Nd}/u,rb=/\p{Script=Greek}/u,ib=/\p{Script=Hebrew}/u,ab=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,ob=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,sb=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,cb=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,lb=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,ub=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,db=new RegExp([qy,Yy].map(e=>e.source).join(`|`),`u`),fb=new RegExp([tb,Zy,Xy,nb,Qy,$y,lb,ub].map(e=>e.source).join(`|`),`u`);function pb(e){return Uy.test(e)&&Wy.test(e)&&Gy.test(e)}var mb=36,hb=1,gb=26,_b=38,vb=700,yb=72,bb=128;function xb(){throw null}function Sb(e){return e.toLowerCase().startsWith(`xn--`)}function Cb(e,t,n){e=n?Math.floor(e/vb):e>>1,e+=Math.floor(e/t);let r=0;for(;e>455;)e=Math.floor(e/35),r+=mb;return r+Math.floor(36*e/(e+_b))}function wb(e){let t=[],n=bb,r=0,i=yb,a=e.lastIndexOf(`-`);if(a>0)for(let n=0;n<a;n++){let r=e.charCodeAt(n);r>=128&&xb(),t.push(r)}let o=a<0?0:a+1;for(;o<e.length;){let a=r,s=1,c=mb;for(;;){o>=e.length&&xb();let t=e.charCodeAt(o++),n;t>=97&&t<=122?n=t-97:t>=48&&t<=57?n=t-48+26:xb(),r+=n*s;let a=c<=i?hb:c>=i+gb?gb:c-i;if(n<a)break;s*=mb-a,c+=mb}let l=t.length+1;i=Cb(r-a,l,a===0),n+=Math.floor(r/l),r%=l,t.splice(r,0,n),r++}return String.fromCodePoint(...t)}function Tb(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var Eb=new RegExp(Ky.source,`gu`);function Db(e){let t=e.replace(Eb,``),n=t.length,r=n>0?[t,`-`]:[],i=Array.from(e,e=>e.codePointAt(0)),a=bb,o=0,s=yb,c=n;for(;c<i.length;){let e=1/0;for(let t of i)t>=a&&t<e&&(e=t);o+=(e-a)*(c+1),a=e;for(let e of i)if(e<a&&o++,e===a){let e=o;for(let t=mb;;t+=mb){let n=t<=s?hb:t>=s+gb?gb:t-s;if(e<n)break;let i=n+(e-n)%(mb-n);r.push(Tb(i)),e=Math.floor((e-n)/(mb-n))}r.push(Tb(e)),s=Cb(o,c+1,c===n),o=0,c++}o++,a++}return r.join(``)}var Ob=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,kb=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,Ab=/^(?:R|AL|AN)$/;function jb(e){if(Sb(e))try{return Nb(wb(e.slice(4).toLowerCase()))}catch{return!1}return Nb(e)}function Mb(e){let t=String.fromCodePoint(e);return db.test(t)?`EN`:Jy.test(t)?`AN`:Qy.test(t)?`NSM`:ib.test(t)?`R`:ob.test(t)?`AL`:tb.test(t)?`L`:`ON`}function Nb(e){for(let t of e)if(Ab.test(Mb(t.codePointAt(0))))return!0;return!1}function Pb(e){let t=!1,n=kb,r=!1,i=!1,a=!0;for(let o of e){let e=Mb(o.codePointAt(0));if(a){if(e!==`L`&&e!==`R`&&e!==`AL`)return!1;t=e===`R`||e===`AL`,n=t?Ob:kb,a=!1}if(!n.test(e))return!1;e===`EN`?r=!0:e===`AN`&&(i=!0)}return!(t&&r&&i)}function Fb(e){return Ky.test(e)&&Db(e).length+4>63}function Ib(e){return e[0]===`-`||e[e.length-1]===`-`||e.slice(2).join(``).startsWith(`--`)}function Lb(e){if(Fb(e)||Nb(e)&&!Pb(e))return!1;let t=[...e],n=t.map(e=>e.codePointAt(0)),r=n.length;if(Ib(t)||eb.test(t[0]))return!1;let i=!1;for(let e=0;e<r;e++){let r=n[e],a=t[e];if(cb.test(a)||!fb.test(a))return!1;ab.test(a)&&(i=!0);let o=n[e-1],s=n[e+1];switch(r){case 183:if(o!==108||s!==108)return!1;break;case 885:if(!s||!rb.test(t[e+1]))return!1;break;case 1523:case 1524:if(!o||!ib.test(t[e-1]))return!1;break;case 8204:if(!o||o<128&&!sb.test(t[e-1]))return!1;break;case 8205:if(!o||!sb.test(t[e-1]))return!1}}return!(e.includes(`・`)&&!i)}function Rb(e){if(!Sb(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf(`-`)===0)return!1;let n=wb(t);return Ky.test(n)?Lb(n):!1}catch{return!1}}function zb(e){return e.length>0&&e.length<=63}function Bb(e){return zb(e)&&(Rb(e)||pb(e))}function Vb(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(`.`).every(e=>Bb(e))}function Hb(e){return e.length>0&&e.length<=63}function Ub(e){return Hb(e)&&(Rb(e)||Lb(e))}function Wb(e){return e.replace(/[\uff01-\uff5e]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248)).normalize(`NFC`).replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,``).replace(/[\u002E\u3002\uFF0E\uFF61]/g,`.`)}function Gb(e){if(e.length===0||e.includes(` `))return!1;let t=Wb(e);if(t.length>253)return!1;let n=t.split(`.`),r=n.some(e=>jb(e));return n.every(e=>Ub(e)&&(!r||Pb(e)))}function Kb(e){return Vb(e)}var qb=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function Jb(e){return qb.test(e.normalize(`NFC`))}function Yb(e){return Gb(e)}var Xb=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function Zb(e){return Xb.test(e)}var Qb=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function $b(e){return Qb.test(e)}var ex=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,tx=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function nx(e){return!ex.test(e)&&!tx.test(e)&&URL.canParse(e,`http://example.com`)}var rx=2048,ix=/\[[vV][0-9a-fA-F]+\.[^\]]+\]/,ax=/[\x00-\x20<>\^`{|}\\]/,ox=/%(?![0-9a-fA-F]{2})/;function sx(e){return e.length<rx?e.replace(ix,`[::1]`):e}function cx(e){return ax.test(e)||ox.test(e)?!1:URL.canParse(sx(e))}var lx=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function ux(e){return lx.test(e)}var dx=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function fx(e){return dx.test(e)}function px(e){try{return new RegExp(e,`u`),!0}catch{return!1}}var mx=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function hx(e){return mx.test(e)}var gx=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _x(e){return gx.test(e)}var vx=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function yx(e){return vx.test(e)}var bx=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function xx(e){return bx.test(e)}function Sx(e){return URL.canParse(e)}var Cx=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function wx(e){return Cx.test(e)}var Tx=new Map;function Ex(){Tx.clear()}function Dx(e,t){return Tx.get(e)?.(t)??!0}function Ox(){Ex(),Tx.set(`date-time`,Ry),Tx.set(`date`,Fy),Tx.set(`duration`,By),Tx.set(`email`,Hy),Tx.set(`hostname`,Kb),Tx.set(`idn-email`,Jb),Tx.set(`idn-hostname`,Yb),Tx.set(`ipv4`,Zb),Tx.set(`ipv6`,$b),Tx.set(`iri-reference`,nx),Tx.set(`iri`,cx),Tx.set(`json-pointer-uri-fragment`,ux),Tx.set(`json-pointer`,fx),Tx.set(`regex`,px),Tx.set(`relative-json-pointer`,hx),Tx.set(`time`,Ly),Tx.set(`uri-reference`,_x),Tx.set(`uri-template`,yx),Tx.set(`uri`,xx),Tx.set(`url`,Sx),Tx.set(`uuid`,wx)}Ox();function kx(e,t,n,r){return Dx(n.format,r)}function Ax(e,t,n,r){let i=!oy(n)||n.then,a=!Ov(n)||n.else;return pS(e,t,n.if,r)?pS(e,t,i,r):pS(e,t,a,r)}function jx(e,t,n,r){return oa(n.items,0,(n,i)=>$i(r.length,i)||fS(e,t,n,r[i])&&t.AddIndex(i))}function Mx(e,t,n,r){return oa(r,Qv(n)?n.prefixItems.length:0,(r,i)=>fS(e,t,n.items,r)&&t.AddIndex(i))}function Nx(e,t,n,r){return Iv(n)?jx(e,t,n,r):Mx(e,t,n,r)}function Px(e){return Sv(e)}function Fx(e,t,n,r){return!Px(n)||$i(la(r,r=>pS(e,t,n.contains,r)),n.maxContains)}function Ix(e,t,n,r){return $i(r,n.maximum)}function Lx(e,t,n,r){return $i(r.length,n.maxItems)}function Rx(e,t,n,r){return ia(r,n.maxLength)}function zx(e,t,n,r){return $i(pa(r).length,n.maxProperties)}function Bx(e){return Sv(e)}function Vx(e,t,n,r){return!Bx(n)||ea(la(r,(r,i)=>pS(e,t,n.contains,r)&&t.AddIndex(i)),n.minContains)}function Hx(e,t,n,r){return ea(r,n.minimum)}function Ux(e,t,n,r){return ea(r.length,n.minItems)}function Wx(e,t,n,r){return aa(r,n.minLength)}function Gx(e,t,n,r){return ea(pa(r).length,n.minProperties)}function Kx(e,t,n,r){return ta(r,n.multipleOf)}function qx(e,t,n,r){let i=new dy;return!pS(e,i,n.not,r)&&t.Merge([i])}function Jx(e,t,n,r){let i=n.oneOf.reduce((t,n)=>{let i=new dy;return pS(e,i,n,r)?[...t,i]:t},[]);return R(i.length,1)&&t.Merge(i)}function Yx(e,t,n,r){return(Ji(n.pattern)?hy(n.pattern):n.pattern).test(r)}function Xx(e,t,n,r){return oa(fa(n.patternProperties),0,([n,i])=>{let a=hy(n);return oa(fa(r),0,([n,r])=>!a.test(n)||fS(e,t,i,r)&&t.AddKey(n))})}function Zx(e,t,n,r){return R(r.length,0)||oa(n.prefixItems,0,(n,i)=>$i(r.length,i)||fS(e,t,n,r[i])&&t.AddIndex(i))}function Qx(e,t){return e.includes(t)||Oa().exactOptionalPropertyTypes}function $x(e,t){return Xi(e[t])}function eS(e,t,n,r){let i=ay(n)?n.required:[];return oa(fa(n.properties),0,([n,a])=>{let o=!z(r,n)||fS(e,t,a,r[n])&&t.AddKey(n);return Qx(i,n)?o:$x(r,n)||o})}function tS(e,t,n,r){return oa(pa(r),0,(r,i)=>pS(e,t,n.propertyNames,r))}function nS(e,t,n,r){let i=e.RecursiveRef(n)??!1;return vv(i)&&pS(e,t,i,r)}function rS(e,t,n,r){let i=e.Ref(n)??!1,a=new dy,o=vv(i)&&pS(e,a,i,r);return o&&t.Merge([a]),o}function iS(e,t,n,r){return oa(n.required,0,e=>z(r,e))}function aS(e,t,n,r,i){return R(n,`object`)?Ki(i):R(n,`array`)?Ri(i):R(n,`boolean`)?Bi(i):R(n,`integer`)?Ui(i):R(n,`number`)?Gi(i):R(n,`null`)?Wi(i):R(n,`string`)?Ji(i):R(n,`bigint`)?zi(i):R(n,`constructor`)?Vi(i):R(n,`function`)?Hi(i):R(n,`symbol`)?Yi(i):R(n,`undefined`)?Xi(i):!R(n,`void`)||Xi(i)}function oS(e,t,n,r,i){return sa(n,n=>aS(e,t,n,r,i))}function sS(e,t,n,r){return Ri(n.type)?oS(e,t,n.type,n,r):aS(e,t,n.type,n,r)}function cS(e,t,n,r){let i=t.GetIndices();return oa(r,0,(r,a)=>(i.has(a)||pS(e,t,n.unevaluatedItems,r))&&t.AddIndex(a))}function lS(e,t,n,r){let i=t.GetKeys();return oa(fa(r),0,([r,a])=>i.has(r)||pS(e,t,n.unevaluatedProperties,a)&&t.AddKey(r))}function uS(e){return!R(e.uniqueItems,!1)}function dS(e,t,n,r){if(!uS(n))return!0;let i=new Set(r.map(xs)).size,a=r.length;return R(i,a)}function fS(e,t,n,r){return t.Push()&&pS(e,t,n,r)&&t.Pop()}function pS(e,t,n,r){e.Push(n);let i=_v(n)?xy(e,t,n,r):(!sy(n)||sS(e,t,n,r))&&(!(qi(r)&&!Ri(r))||(!ay(n)||iS(e,t,n,r))&&(!Pte(n)||vy(e,t,n,r))&&(!Cv(n)||Ty(e,t,n,r))&&(!wv(n)||Ey(e,t,n,r))&&(!Tv(n)||Dy(e,t,n,r))&&(!Zv(n)||Xx(e,t,n,r))&&(!$v(n)||eS(e,t,n,r))&&(!ey(n)||tS(e,t,n,r))&&(!Kv(n)||Gx(e,t,n,r))&&(!Vv(n)||zx(e,t,n,r)))&&(!Ri(r)||(!Nte(n)||my(e,t,n,r))&&(!Sv(n)||wy(e,t,n,r))&&(!Fv(n)||Nx(e,t,n,r))&&(!Rv(n)||Fx(e,t,n,r))&&(!zv(n)||Lx(e,t,n,r))&&(!Uv(n)||Vx(e,t,n,r))&&(!Wv(n)||Ux(e,t,n,r))&&(!Qv(n)||Zx(e,t,n,r))&&(!cy(n)||dS(e,t,n,r)))&&(!Ji(r)||(!Bv(n)||Rx(e,t,n,r))&&(!Gv(n)||Wx(e,t,n,r))&&(!Mv(n)||kx(e,t,n,r))&&(!Xv(n)||Yx(e,t,n,r)))&&(!(Gi(r)||zi(r))||(!Av(n)||Ay(e,t,n,r))&&(!jv(n)||jy(e,t,n,r))&&(!Lv(n)||Ix(e,t,n,r))&&(!Hv(n)||Hx(e,t,n,r))&&(!qv(n)||Kx(e,t,n,r)))&&(!iy(n)||rS(e,t,n,r))&&(!ry(n)||nS(e,t,n,r))&&(!Dv(n)||Oy(e,t,n,r))&&(!xv(n)||Sy(e,t,n,r))&&(!kv(n)||ky(e,t,n,r))&&(!Pv(n)||Ax(e,t,n,r))&&(!Jv(n)||qx(e,t,n,r))&&(!Fte(n)||yy(e,t,n,r))&&(!bv(n)||by(e,t,n,r))&&(!Yv(n)||Jx(e,t,n,r))&&(!ly(n)||!Ri(r)||cS(e,t,n,r))&&(!uy(n)||!qi(r)||lS(e,t,n,r))&&(!Mte(n)||fy(e,t,n,r));return e.Pop(n),i}function mS(e,t){return qi(t)&&!da(e)?t[e]:void 0}function hS(e,t){return e.reduce((e,t)=>mS(t,e),t)}function gS(e){if(R(e.length,0))return[];let t=e.split(`/`).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`));return t.length>0&&t[0]===``?t.slice(1):t}function _S(e,t){return hS(gS(t),e)}var vS=`https://json-schema.org`;function yS(e,t){if(qi(e)&&Ev(e)&&R(e.$dynamicAnchor,t))return e;if(qi(e))for(let n of pa(e)){let r=yS(e[n],t);if(r)return r}}function bS(e,t,n){if(R(e,n))return t.href;let r=gv(e)&&Nv(e)?new URL(e.$id,t.href):t;if(Ri(e))for(let t of e){let e=bS(t,r,n);if(!Xi(e))return e}else if(qi(e))for(let t of pa(e)){let i=bS(e[t],r,n);if(!Xi(i))return i}}function xS(e,t,n){if(R(e.$id,n.hash))return e;let r=new URL(n.href,t.href);if(R(t.pathname,r.pathname))return n.hash.startsWith(`#`)?wS(e,n):e}function SS(e,t,n){let r=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);return R(r.href,i.href)?e:void 0}function CS(e,t,n){let r=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(n.href,t.href);return R(r.href,i.href)?e:void 0}function wS(e,t){if(t.href.endsWith(`#`))return e;if(!t.hash.startsWith(`#`))return;let n=decodeURIComponent(t.hash.slice(1));if(n.startsWith(`/`))return _S(e,n)}function TS(e,t,n){if(Nv(e)){let r=xS(e,t,n);if(!Xi(r))return r}if(yv(e)){let r=SS(e,t,n);if(!Xi(r))return r}if(Ev(e)){let r=CS(e,t,n);if(!Xi(r))return r}return wS(e,n)}function ES(e,t,n){return e.reduce((e,r)=>{let i=kS(r,t,n);return Xi(i)?e:i},void 0)}function DS(e){return R(e,`const`)||R(e,`enum`)}function OS(e,t,n){return pa(e).reduce((r,i)=>{if(DS(i))return r;let a=kS(e[i],t,n);return Xi(a)?r:a},void 0)}function kS(e,t,n){let r=gv(e)&&Nv(e)?new URL(e.$id,t.href):t;if(gv(e)){let t=TS(e,r,n);if(!Xi(t))return t}if(Ri(e))return ES(e,r,n);if(qi(e))return OS(e,r,n)}function AS(e,t,n){return bS(e,new URL(t||`.`,vS),n)}function jS(e,t,n,r){let i=BS(e,t,n,r,!1);return gv(i)&&Nv(i)?i:void 0}function MS(e){return e.href.split(`#`)[0]}function NS(e,t){return z(e,t)?e[t]:void 0}function PS(e,t,n){return kS(e,t,n)}function FS(e,t,n){let r=MS(n);if(R(r,MS(t))||!z(e,r))return;let i=e[r],a=gv(i)&&Nv(i)?new URL(i.$id,r):new URL(r);return R(n.hash,``)?i:kS(i,a,n)}function IS(e,t,n,r,i){if(!r.$ref.startsWith(`#`)||z(e,`$schema`))return;let a=AS(t,n,i);if(!(Xi(a)||R(a,n)))return{target:i,base:a,root:t}}function LS(e,t,n){let r=e[t];if(gv(r))return{target:n,base:t,root:r}}function RS(e,t,n,r,i){let a=i?LS(e.context,r,n):void 0;return Xi(a)?IS(e.root,e.lexicalSchema,e.referenceBase,t,n):a}function zS(e,t,n,r,i,a){if(Nv(i))return;let o=jS(e,t,n,r);if(o&&!a.includes(o))return{target:i,resource:o}}function BS(e,t,n,r,i=!0){let a=new URL(n||`.`,vS),o=i&&Nv(t)?new URL(t.$id,a):a,s=new URL(r,o.href);return NS(e,r)??PS(t,o,s)??FS(e,o,s)}function VS(e,t,n,r,i,a){let o=new URL(n||`.`,vS),s=BS(e,i.$dynamicRef.startsWith(`#`)?r:t,n,i.$dynamicRef,!1);if(Xi(s)){let e=new URL(i.$dynamicRef,o).hash;if(!e.startsWith(`#/`)&&e.startsWith(`#`)){let n=decodeURIComponent(e.slice(1));return a.find(e=>R(e.$dynamicAnchor,n))??yS(t,n)}}else return!gv(s)||!Ev(s)||new URL(i.$dynamicRef,o).hash.startsWith(`#/`)?s:a.find(e=>R(e.$dynamicAnchor,s.$dynamicAnchor))??s}function HS(e,t){let n=e.inRetrievedFrame?e.lexicalSchema:e.root,r=t.$ref.startsWith(`#`)?e.lexicalSchema:n,i=BS(e.context,r,e.referenceBase,t.$ref,!1);if(!i||!gv(i))return{schema:i};let a=new URL(t.$ref,e.referenceBase).href.split(`#`)[0],o=!R(a,e.resourceBase);return{schema:i,retrievedResource:RS(e,t,i,a,o),resolvedResource:o?zS(e.context,e.root,e.referenceBase,a,i,e.ids):void 0}}function US(e,t){let n=ny(e.lexicalSchema)?e.recursiveAnchors[0]:e.lexicalSchema;return BS(e.context,n,e.lexicalBase,t.$recursiveRef,!1)}function WS(e,t){return VS(e.context,e.root,e.lexicalBase,e.lexicalSchema,t,e.dynamicAnchors)}var GS=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,Ite=class{constructor(e,t){KS.add(this),this.context=e,this.schema=t,this.ids=[],this.resourceIds=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[],this.retrievedResources=new Map,this.retrievedFrames=[],this.resolvedResources=new Map,this.pendingResource=!0}LexicalBaseURL(){return GS(this,KS,`m`,YS).call(this,this.ids)}Push(e){if(!gv(e))return;Nv(e)&&GS(this,KS,`m`,rC).call(this,e),yv(e)&&this.anchors.push(e),ny(e)&&this.recursiveAnchors.push(e),Ev(e)&&this.dynamicAnchors.push(e);let t=this.retrievedResources.get(e);t&&this.retrievedFrames.push({schema:t.root,base:t.base,idDepth:this.ids.length,resourceDepth:this.resourceIds.length})}Pop(e){gv(e)&&(Nv(e)&&GS(this,KS,`m`,iC).call(this,e),yv(e)&&this.anchors.pop(),ny(e)&&this.recursiveAnchors.pop(),Ev(e)&&this.dynamicAnchors.pop(),this.retrievedResources.has(e)&&this.retrievedFrames.pop(),GS(this,KS,`m`,oC).call(this,e))}Ref(e){let t=HS(GS(this,KS,`m`,qS).call(this),e);return GS(this,KS,`m`,JS).call(this,t),t.schema}RecursiveRef(e){let t=US(GS(this,KS,`m`,qS).call(this),e);return t&&(this.pendingResource=!0),t}DynamicRef(e){let t=WS(GS(this,KS,`m`,qS).call(this),e);return t&&(this.pendingResource=!0),t}};KS=new WeakSet,qS=function(){return{context:this.context,root:this.schema,ids:this.ids,lexicalSchema:GS(this,KS,`m`,QS).call(this),lexicalBase:this.LexicalBaseURL(),referenceBase:GS(this,KS,`m`,ZS).call(this),resourceBase:GS(this,KS,`m`,XS).call(this),recursiveAnchors:this.recursiveAnchors,dynamicAnchors:this.dynamicAnchors,inRetrievedFrame:this.retrievedFrames.length>0}},JS=function(e){Xi(e.schema)||(this.pendingResource=!0),Xi(e.resolvedResource)||GS(this,KS,`m`,aC).call(this,e.resolvedResource.target,e.resolvedResource.resource),Xi(e.retrievedResource)||this.retrievedResources.set(e.retrievedResource.target,{base:e.retrievedResource.base,root:e.retrievedResource.root})},YS=function(e){let t=this.retrievedFrames[this.retrievedFrames.length-1],n=t?new URL(t.base):new URL(vS);return(t?e.slice(t.idDepth):e).reduce((e,t)=>new URL(t.$id,e),n).href},XS=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.resourceIds.slice(e.resourceDepth).reduce((e,t)=>new URL(t.$id,e),new URL(e.base)).href:GS(this,KS,`m`,YS).call(this,this.resourceIds)},ZS=function(){if(this.retrievedFrames.length>0)return GS(this,KS,`m`,XS).call(this);let e=this.ids[this.ids.length-1];return e&&!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)?this.LexicalBaseURL():GS(this,KS,`m`,XS).call(this)},QS=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.ids.length>e.idDepth?this.ids[this.ids.length-1]:e.schema:this.ids.length>0?this.ids[this.ids.length-1]:this.schema},$S=function(e){e.forEach(e=>GS(this,KS,`m`,tC).call(this,e,!1))},eC=function(e){e.forEach(e=>GS(this,KS,`m`,nC).call(this,e,!1))},tC=function e(t,n=!0){if(_v(t))return;if(Ri(t))return GS(this,KS,`m`,$S).call(this,t);if(!gv(t))return;let r=t;if(n||!Nv(r)){!n&&Ev(r)&&this.dynamicAnchors.push(r);for(let t of pa(r))GS(this,KS,`m`,e).call(this,r[t],!1)}},nC=function e(t,n=!0){if(_v(t))return;if(Ri(t))return GS(this,KS,`m`,eC).call(this,t);if(!gv(t))return;let r=t;if(n||!Nv(r)){!n&&Ev(r)&&this.dynamicAnchors.pop();for(let t of pa(r))GS(this,KS,`m`,e).call(this,r[t],!1)}},rC=function(e){this.ids.push(e);let t=this.pendingResource;this.pendingResource=!1,t&&this.resourceIds.push(e),GS(this,KS,`m`,tC).call(this,e,!0)},iC=function(e){this.ids.pop(),this.resourceIds.length>0&&R(this.resourceIds[this.resourceIds.length-1],e)&&this.resourceIds.pop(),GS(this,KS,`m`,nC).call(this,e,!0)},aC=function(e,t){GS(this,KS,`m`,rC).call(this,t),this.resolvedResources.set(e,t)},oC=function(e){if(!this.resolvedResources.has(e))return;let t=this.resolvedResources.get(e);GS(this,KS,`m`,iC).call(this,t),this.resolvedResources.delete(e)};function Lte(...e){let[t,n,r]=Lo(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return pS(new Ite(t,n),new dy,n,r)}function sC(...e){let[t,n,r]=Lo(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return Lte(t,n,r)}BigInt(2**53-1),BigInt(-(2**53-1)),G([B({type:V(`insert`),path:W(),value:jo()}),Object({type:V(`update`),path:W(),value:jo()}),B({type:V(`delete`),path:W()})]);var cC=W({minLength:1});G([B({type:V(`subscribe`),conversationId:cC}),B({type:V(`unsubscribe`),conversationId:cC})]);var Rte=Fo(io(io(jo()))),zte=G([B({type:V(`ops`),conversationId:cC,ops:Rte}),Uo([B({type:V(`changed`)}),qee])]);function Bte(e){try{return JSON.parse(e)}catch{return}}function Vte(e){let t=Bte(e);return sC(zte,t)?t:void 0}function Hte(e){return JSON.stringify(e)}function lC(e,t){return e.docs[t]}function Ute(e){return e.mode===`steer`||e.mode===`followUp`}function uC(e){let t=e.content;if(typeof t==`string`)return t;let n=t?.content;return typeof n==`string`||Array.isArray(n)?n:[]}function Wte(e){let t=uC(e);return typeof t==`string`?t:t.map(e=>e.type===`text`?e.text:``).join(``)}function Gte(e){let t=uC(e);return typeof t==`string`?[]:t.filter(e=>e.type===`image`)}function Kte(e){return{id:Number(e.id),mode:e.mode,text:Wte(e),images:Gte(e)}}function qte(e){let t=e.generation;if(t?.retry)return{attempt:t.attempt,...t.retry}}function dC(e){let t=lC(e,`pi.live`)??{},n=lC(e,`pi.inbox`);return{busy:t.run!==void 0,streaming:t.generation?.message,retry:qte(t),slots:t.tools??[],compacting:(t.compactions?.length??0)>0,queued:(n?.items??[]).filter(Ute).map(Kte)}}var Jte=`${q}/terminals/:id/stream`,Yte=e=>Jte.replace(`:id`,encodeURIComponent(e)),Xte=G([B({type:V(`ready`),status:nv.properties.status,exitCode:nv.properties.exitCode}),B({type:V(`exit`),exitCode:nv.properties.exitCode})]);B({type:V(`resize`),cols:js({minimum:1,maximum:500}),rows:js({minimum:1,maximum:500})});var fC=js({minimum:1,maximum:4294967295});G([B({type:V(`hello`),...dte.properties}),B({type:V(`request`),id:fC,method:W(),path:W(),query:W(),hubDevice:W({maxLength:120}),contentType:wo(W()),bodyBytes:wo(js({minimum:0}))}),B({type:V(`response`),id:fC,status:js({minimum:100,maximum:599}),headers:yl(W(),W())}),B({type:V(`open`),id:fC,path:W(),query:W(),hubDevice:W({maxLength:120})}),B({type:V(`close`),id:fC,code:js(),reason:W({maxLength:123})}),B({type:V(`credit`),id:fC,bytes:js({minimum:1})}),B({type:V(`ping`)}),B({type:V(`pong`)})]);var Zte=`52f4e01e45d4338519dfea5564becdf1`,Qte=[`pi.user`,`app.retry`,`pi.assistant`,`pi.tool-result`],$te=[`stop`,`length`],ene=e=>e.docs[`pi.live`]?.run!==void 0;function tne(e){let t=e.model?.[0];return e.kind===`pi.assistant`&&t?.role===`assistant`&&$te.includes(t.stopReason)}function nne(e){if(ene(e))return!1;let t=e.entries.filter(e=>Qte.includes(e.kind)).at(-1);return t!==void 0&&!tne(t)}var rne=/^(\d+)\.(\d+)\.(\d+)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;function pC(e){let t=rne.exec(e);if(!t)throw Error(`Not a version: ${e}`);return{core:[Number(t[1]),Number(t[2]),Number(t[3])],prerelease:e.includes(`-`)}}function ine(e,t){let n=pC(e),r=pC(t);for(let e=0;e<3;e++){let t=(n.core[e]??0)-(r.core[e]??0);if(t!==0)return t}return Number(r.prerelease)-Number(n.prerelease)}function ane(e,t){try{return ine(e,t)<0}catch{return}}function one(e){return`${window.location.protocol===`https:`?`wss`:`ws`}://${window.location.host}${e}${Tte}`}function sne(e=``){return{open(t){let n=new WebSocket(one(e));return n.addEventListener(`open`,()=>t.onOpen()),n.addEventListener(`close`,()=>t.onClose()),n.addEventListener(`message`,e=>{let n=typeof e.data==`string`?Vte(e.data):void 0;n&&t.onFrame(n)}),{send:e=>n.send(Hte(e)),close:()=>n.close()}}}}function cne(e,t,n=``){let r=window.location.protocol===`https:`?`wss`:`ws`,i=new WebSocket(`${r}://${window.location.host}${n}${e}`);return i.binaryType=`arraybuffer`,i.addEventListener(`open`,()=>t.onOpen()),i.addEventListener(`close`,e=>t.onClose(e.code,e.reason)),i.addEventListener(`message`,e=>t.onMessage(typeof e.data==`string`?e.data:new Uint8Array(e.data))),{send:e=>i.send(e),close:()=>i.close()}}function lne(e,t,n){let r=Object.entries(t.query??{}).filter(e=>e[1]!==void 0),i=new URLSearchParams(r).toString();return n+pv(e.path,t.params)+(i?`?${i}`:``)}function une(e,t){if(e.body&&!sC(e.body,t))throw new mv(`invalid_request`,`The request is invalid`)}function dne(e,t){if(e.response&&!sC(e.response,t))throw new mv(`internal`,`The server sent an unexpected response`)}function fne(e){return e===401||e===403?`unauthorized`:`internal`}async function pne(e){let t=await e.json().catch(()=>void 0);return jte(t)?new mv(t.error.code,t.error.message):new mv(fne(e.status),`Request failed (${e.status})`)}function mne(e,t){return{method:e.method,credentials:`same-origin`,...e.body?{headers:{"content-type":`application/json`},body:JSON.stringify(t)}:{}}}async function hne(e,t,n){une(e,t.body);let r;try{r=await fetch(lne(e,t,n),mne(e,t.body))}catch{throw new mv(`internal`,`Could not reach the server`)}if(!r.ok)throw await pne(r);if(e.status===204)return;let i=await r.json();return dne(e,i),i}function mC({prefix:e=``}={}){return{async request(t,n){return await hne(fv[t],n,e)},live:sne(e),openStream:(t,n)=>cne(t,n,e)}}var gne=e=>e.connection!==null,_ne=e=>btoa(Array.from(e,e=>String.fromCharCode(e)).join(``));function hC(e){let{request:t}=e;return{fs:{suggestDirectories:e=>t(`suggestDirectories`,{body:e})},settings:{get:()=>t(`getSettings`,{}),setDefaultModel:e=>t(`setDefaultModel`,{body:e}),setFastModel:e=>t(`setFastModel`,{body:{model:e}}),setDefaultThinkingLevel:e=>t(`setDefaultThinking`,{body:{thinkingLevel:e}}),setFastThinkingLevel:e=>t(`setFastThinking`,{body:{thinkingLevel:e}}),setProjectsFolder:e=>t(`setProjectsFolder`,{body:{path:e}}),suggestedCodeFolder:()=>t(`getSuggestedCodeFolder`,{}),setMessageMode:e=>t(`setMessageMode`,{body:{mode:e}}),setWorkspaceDefault:e=>t(`setWorkspaceDefault`,{body:{mode:e}}),setClaudeConnectors:e=>t(`setClaudeConnectors`,{body:e})},github:{status:()=>t(`getGithubStatus`,{}),repos:()=>t(`listGithubRepos`,{}),refreshRepos:()=>t(`refreshGithubRepos`,{}),use:e=>t(`useGithubRepo`,{body:e})},providers:{list:()=>t(`listProviders`,{}),setKey:(e,n)=>t(`setProviderKey`,{params:{id:e},body:{key:n}}),disconnect:e=>t(`disconnectProvider`,{params:{id:e}}),acknowledgeClaudeCli:()=>t(`acknowledgeClaudeCli`,{}),refreshClaudeCli:()=>t(`refreshClaudeCli`,{}),installClaudeCliSdk:()=>t(`installClaudeCliSdk`,{})},logins:{start:()=>t(`startLogin`,{params:{id:`openai`}}),get:e=>t(`getLogin`,{params:{sid:e}}),submitUrl:(e,n)=>t(`submitLoginUrl`,{params:{sid:e},body:{url:n}}),cancel:e=>t(`cancelLogin`,{params:{sid:e}})},models:{list:()=>t(`listModels`,{})},skills:{list:e=>t(`listSkills`,{query:e?{projectId:e}:{}})},projects:{list:()=>t(`listProjects`,{}),add:e=>t(`addProject`,{body:e}),clone:e=>t(`cloneProject`,{body:e}),retryClone:e=>t(`retryClone`,{params:{id:e}}),suggestFiles:(e,n)=>t(`suggestProjectFiles`,{params:{id:e},body:{query:n}}),rename:(e,n)=>t(`renameProject`,{params:{id:e},body:{name:n}}),setFolder:(e,n)=>t(`setProjectFolder`,{params:{id:e},body:{path:n}}),remove:e=>t(`removeProject`,{params:{id:e}}),iconUrl:e=>pv(fv.getProjectIcon.path,{id:e}),iconCandidates:e=>t(`listIconCandidates`,{params:{id:e}}),setIcon:(e,n)=>t(`setProjectIcon`,{params:{id:e},body:{png:_ne(n)}}),resetIcon:e=>t(`resetProjectIcon`,{params:{id:e}})},conversations:{list:e=>t(`listConversations`,{params:{id:e}}),listAll:()=>t(`listAllConversations`,{}),start:e=>t(`startConversation`,{body:e}),rename:(e,n)=>t(`renameConversation`,{params:{id:e},body:{title:n}}),send:(e,n)=>t(`sendMessage`,{params:{id:e},body:n}),abort:e=>t(`abortConversation`,{params:{id:e}}),archive:(e,n)=>t(`archiveConversation`,{params:{id:e},body:{archived:n}}),remove:(e,n)=>t(`removeConversation`,{params:{id:e},query:n?.force?{force:`true`}:{}}),deleteArchived:e=>t(`deleteArchivedConversations`,{body:e}),fork:(e,n)=>t(`forkConversation`,{params:{id:e},body:{entryId:n}}),rewindPreview:(e,n)=>t(`rewindPreview`,{params:{id:e},body:{entryId:n}}),rewind:(e,n)=>t(`rewindConversation`,{params:{id:e},body:{entryId:n}}),stopAgent:e=>t(`stopAgent`,{params:{id:e}}),cancelQueued:(e,n)=>t(`cancelQueued`,{params:{id:e,itemId:n}}),checkpoints:e=>t(`listCheckpoints`,{params:{id:e}}),checkpointDiff:async(e,n,r)=>(await t(`getCheckpointDiff`,{params:{id:e,cid:n},query:{path:r}})).diff,configure:(e,n)=>t(`configureConversation`,{params:{id:e},body:n}),retry:(e,n)=>t(`retryConversation`,{params:{id:e},body:n}),compact:(e,n)=>t(`compactConversation`,{params:{id:e},body:n})},workspaces:{status:e=>t(`getWorkspace`,{params:{id:e}}),merge:e=>t(`mergeWorkspace`,{params:{id:e}}),createPullRequest:e=>t(`createPullRequest`,{params:{id:e}}),remove:(e,n=!1)=>t(`removeWorkspace`,{params:{id:e},query:{force:n?`true`:`false`}})},processes:{list:e=>t(`listProcesses`,{params:{id:e}}),logs:async(e,n)=>(await t(`getProcessLogs`,{params:{id:e},query:n?{tail:String(n)}:{}})).logs,stop:e=>t(`stopProcess`,{params:{id:e}})},approvals:{list:e=>t(`listApprovals`,{params:{id:e}}),decide:(e,n,r)=>t(`decideApproval`,{params:{id:e,toolUseId:n},body:{decision:r}})},timers:{list:e=>t(`listTimers`,{params:{id:e}}),delete:e=>t(`deleteTimer`,{params:{id:e}}),loop:(e,n)=>t(`startLoop`,{params:{id:e},body:n}),stopLoop:e=>t(`stopLoop`,{params:{id:e}})},goals:{set:(e,n)=>t(`setGoal`,{params:{id:e},body:{condition:n}}),get:e=>t(`getGoal`,{params:{id:e}}),clear:e=>t(`clearGoal`,{params:{id:e}})},mcp:{servers:e=>t(`listMcpServers`,{query:e?{projectId:e}:{}}),save:e=>t(`saveMcpServer`,{params:{name:e.name},body:e}),remove:e=>t(`removeMcpServer`,{params:{name:e}})},remote:{status:()=>t(`getRemoteStatus`,{}),enable:()=>t(`enableRemote`,{}),disable:()=>t(`disableRemote`,{}),recreate:()=>t(`recreateRemote`,{})},access:{devices:()=>t(`listDevices`,{}),renameDevice:(e,n)=>t(`renameDevice`,{params:{id:e},body:{name:n}}),revokeDevice:e=>t(`revokeDevice`,{params:{id:e}}),signOutAll:()=>t(`signOutAllDevices`,{}),mintPairing:e=>t(`mintPairing`,{query:e}),redeemPairing:e=>t(`redeemPairing`,{body:e})},updates:{status:()=>t(`getUpdateStatus`,{}),refresh:()=>t(`refreshUpdateStatus`,{})},machines:{list:()=>t(`listMachines`,{}),rename:(e,n)=>t(`renameMachine`,{params:{id:e},body:{name:n}}),disconnect:e=>t(`disconnectMachine`,{params:{id:e}}),summary:e=>t(`getMachineSummary`,{params:{id:e}}),hubLink:()=>t(`getHubLink`,{}),disconnectHub:()=>t(`disconnectHub`,{})},terminals:{available:async()=>(await t(`getTerminalsAvailable`,{})).available,list:e=>t(`listTerminals`,{params:{id:e}}),open:(e,n)=>t(`openTerminal`,{params:{id:e},body:n}),close:e=>t(`closeTerminal`,{params:{id:e}}),openStream:(t,n)=>e.openStream(Yte(t),n)},live:e.live}}function vne(){return mC()}var gC=hC(vne());function _C(e){return hv(e)||e instanceof Error?e.message:`Something went wrong. Try again.`}var vC=M.createContext(void 0),yC=e=>{let t=M.useContext(vC);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},yne=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,L.jsx)(vC.Provider,{value:e,children:t})),bne={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},bC=new class{#e=bne;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function xne(e){setTimeout(e,0)}var Sne=typeof window>`u`||`Deno`in globalThis;function xC(){}function Cne(e,t){return typeof e==`function`?e(t):e}function SC(e){return typeof e==`number`&&e>=0&&e!==1/0}function CC(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wC(e,t){return typeof e==`function`?e(t):e}function TC(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==DC(o,t.options))return!1}else if(!kC(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function EC(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(OC(t.options.mutationKey)!==OC(a))return!1}else if(!kC(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function DC(e,t){return(t?.queryKeyHashFn||OC)(e)}function OC(e){return JSON.stringify(e,(e,t)=>NC(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function kC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!kC(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!kC(e[r],t[r]))return!1;return!0}return!1}var wne=Object.prototype.hasOwnProperty;function AC(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=MC(e)&&MC(t);if(!r&&!(NC(e)&&NC(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:wne.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=AC(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function jC(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function MC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function NC(e){if(!PC(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!PC(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function PC(e){return Object.prototype.toString.call(e)===`[object Object]`}function Tne(e){return new Promise(t=>{bC.setTimeout(t,e)})}function FC(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:AC(e,t)}function IC(e){return e}function Ene(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Dne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var LC=Symbol();function RC(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===LC?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function zC(e,t){return typeof e==`function`?e(...t):!!e}function One(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var kne=()=>Sne,BC=()=>kne(),VC=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},HC=new class extends VC{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Ane=xne;function jne(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Ane,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var UC=jne(),WC=new class extends VC{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Mne(e){return Math.min(1e3*2**e,3e4)}function GC(e){return(e??`online`)!==`online`||WC.isOnline()}var KC=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function qC(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(xC);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new KC(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>HC.isFocused()&&(e.networkMode===`always`||WC.isOnline())&&e.canRun(),p=()=>GC(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(BC()?0:3),a=e.retryDelay??Mne,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Tne(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var JC=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),SC(this.gcTime)&&(this.#e=bC.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(BC()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(bC.clearTimeout(this.#e),this.#e=void 0)}};function Nne(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{One(e,()=>t.signal,()=>n=!0)},u=RC(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Dne:Ene;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Pne:YC,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:YC(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function YC(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Pne(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Fne=class extends JC{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=QC(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=QC(this.options);e.data!==void 0&&(this.setState(ZC(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=FC(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(xC).catch(xC):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>wC(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===LC||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>wC(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!CC(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=RC(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Nne(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=qC({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof KC&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof KC){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...XC(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ZC(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),UC.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function XC(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:GC(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ZC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function QC(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var $C=class extends VC{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ew(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tw(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tw(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof wC(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!jC(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&nw(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||wC(this.options.enabled,this.#t)!==wC(t.enabled,this.#t)||wC(this.options.staleTime,this.#t)!==wC(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||wC(this.options.enabled,this.#t)!==wC(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return jC(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(xC)),t}#h(e){return!BC()&&wC(this.options.enabled,this.#t)!==!1&&SC(e)}#g(){this.#b();let e=wC(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=CC(this.#r.dataUpdatedAt,e)+1;this.#u=bC.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return wC(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=bC.setInterval(()=>{(this.options.refetchIntervalInBackground||HC.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(bC.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(bC.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ew(e,t),o=i&&nw(e,n,t,r);(a||o)&&(l={...l,...XC(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=FC(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=FC(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:rw(e,t),refetch:this.refetch,isEnabled:wC(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),jC(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();UC.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Ine(e,t){return wC(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||wC(t.retryOnMount,e)!==!1)}function ew(e,t){return Ine(e,t)||e.state.data!==void 0&&tw(e,t,t.refetchOnMount)}function tw(e,t,n){if(wC(t.enabled,e)!==!1&&wC(t.staleTime,e)!==`static`){let r=wC(n,e);return r===`always`||r!==!1&&rw(e,t)}return!1}function nw(e,t,n,r){return(e!==t||wC(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&rw(e,n)}function rw(e,t){return wC(t.enabled,e)!==!1&&e.isStaleByTime(wC(t.staleTime,e))}var Lne=class extends JC{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||iw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=qC({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),UC.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function iw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Rne=class extends VC{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Lne({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=aw(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=aw(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=aw(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=aw(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){UC.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>EC(t,e))}findAll(e={}){return this.getAll().filter(t=>EC(e,t))}notify(e){UC.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return UC.batch(()=>Promise.all(e.map(e=>e.continue().catch(xC))))}};function aw(e){return e.options.scope?.id}var zne=class extends VC{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),jC(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&OC(t.mutationKey)!==OC(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??iw();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){UC.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function ow(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Bne=class extends VC{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,UC.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!jC(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(ow(e,n).forEach(e=>{e.destroy()}),ow(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=AC(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new $C(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&UC.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Vne=class extends VC{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??DC(r,t),a=this.get(i);return a||(a=new Fne({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){UC.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>TC(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>TC(e,t)):t}notify(e){UC.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){UC.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){UC.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Hne=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Vne,this.#t=e.mutationCache||new Rne,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=HC.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=WC.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(wC(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Cne(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return UC.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;UC.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return UC.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=UC.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(xC).catch(xC)}invalidateQueries(e,t={}){return UC.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=UC.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(xC)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(xC)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(wC(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(wC(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xC).catch(xC)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xC).catch(xC)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return WC.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(OC(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{kC(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(OC(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{kC(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=DC(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===LC&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},sw=M.createContext(!1),cw=()=>M.useContext(sw);sw.Provider;function Une(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Wne=M.createContext(Une()),lw=()=>M.useContext(Wne),uw=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?zC(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},dw=e=>{M.useEffect(()=>{e.clearReset()},[e])},fw=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||zC(n,[e.error,r])),pw=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},mw=(e,t)=>e?.suspense&&t.isPending,hw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Gne({queries:e,...t},n){let r=yC(n),i=cw(),a=lw(),o=t.subscribed!==!1,s=M.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{pw(e);let t=r.getQueryCache().get(e.queryHash);uw(e,a,t)}),dw(a);let[c]=M.useState(()=>new Bne(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;M.useSyncExternalStore(M.useCallback(e=>f?c.subscribe(UC.batchCalls(e)):xC,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),M.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>mw(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&mw(n,e)?hw(n,new $C(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&fw({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function Kne(e,t,n){let r=cw(),i=lw(),a=yC(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,pw(o),uw(o,i,s),dw(i);let[l]=M.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(M.useSyncExternalStore(M.useCallback(e=>{let t=d?l.subscribe(UC.batchCalls(e)):xC;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),M.useEffect(()=>{l.setOptions(o)},[o,l]),mw(o,u))throw hw(o,l,i);if(fw({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function gw(e,t){return Kne(e,$C,t)}function _w(e,t){let n=yC(t),[r]=M.useState(()=>new zne(n,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);let i=M.useSyncExternalStore(M.useCallback(e=>r.subscribe(UC.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=M.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(xC)},[r]);if(i.error&&zC(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function qne(e){return mC({prefix:ev(e)})}var vw=new Map;function yw(e){if(e===void 0)return gC;let t=vw.get(e);return t||(t=hC(qne(e)),vw.set(e,t)),t}var bw=(0,M.createContext)(void 0);function Jne({machineId:e,api:t,children:n}){let[r]=(0,M.useState)(()=>({machineId:e,api:t??yw(e)}));return(0,L.jsx)(bw.Provider,{value:r,children:n})}function xw(){let e=(0,M.useContext)(bw);if(!e)throw Error(`useApi and useMachineId need a MachineProvider`);return e}var J=()=>xw().api,Sw=()=>xw().machineId,Y={providers:[`providers`],settings:[`settings`],models:[`models`],skills:e=>[`skills`,e],projects:[`projects`],conversations:e=>[`conversations`,e],allConversations:[`conversations`,`all`],githubStatus:[`github`,`status`],githubRepos:[`github`,`repos`],suggestedCodeFolder:[`settings`,`suggested-code-folder`],pathSuggestions:e=>[`fs`,`suggest`,e],iconCandidates:e=>[`projects`,e,`icon-candidates`],workspace:e=>[`workspace`,e],checkpoints:e=>[`checkpoints`,e],processes:e=>[`processes`,e],allProcesses:[`processes`],timers:e=>[`timers`,e],approvals:e=>[`approvals`,e],goal:e=>[`goal`,e],processLogs:(e,t)=>[`process-logs`,e,t??null],mcpServers:e=>[`mcp`,`servers`,e],allMcpServers:[`mcp`],remoteStatus:[`remote`],devices:[`devices`],machines:[`machines`],hubLink:[`machines`,`hub`],updateStatus:[`update`],machineData:e=>[`machine-data`,e]},Cw=()=>{let e=J();return gw({queryKey:Y.providers,queryFn:()=>e.providers.list()})},ww=()=>{let e=J();return gw({queryKey:Y.settings,queryFn:()=>e.settings.get()})},Tw=()=>{let e=J();return gw({queryKey:Y.projects,queryFn:()=>e.projects.list()})},Ew=()=>{let e=J();return gw({queryKey:Y.models,queryFn:()=>e.models.list()})},Yne=e=>{let t=J();return gw({queryKey:Y.skills(e),queryFn:()=>t.skills.list(e)})},Dw=async e=>{await Promise.all([e.invalidateQueries({queryKey:Y.providers}),e.invalidateQueries({queryKey:Y.models})])};function Xne(){let e=J(),t=yC();return _w({mutationFn:({id:t,key:n})=>e.providers.setKey(t,n),onSuccess:()=>Dw(t)})}function Zne(){let e=J(),t=yC();return _w({mutationFn:t=>e.providers.disconnect(t),onSuccess:()=>Dw(t)})}function Ow(){let e=J(),t=yC();return _w({mutationFn:()=>e.providers.acknowledgeClaudeCli(),onSuccess:()=>Dw(t)})}function kw(){let e=J(),t=yC();return _w({mutationFn:()=>e.providers.refreshClaudeCli(),onSuccess:()=>Dw(t)})}function Aw(){let e=J(),t=yC();return _w({mutationFn:()=>e.providers.installClaudeCliSdk(),onSuccess:()=>Dw(t)})}var jw=(e,t)=>t.lastActivityAt-e.lastActivityAt||(e.id<t.id?1:e.id>t.id?-1:0),Mw=()=>{let e=J();return gw({queryKey:Y.allConversations,queryFn:async()=>[...await e.conversations.listAll()].sort(jw)})},Nw=()=>{let e=J();return gw({queryKey:Y.githubStatus,queryFn:()=>e.github.status()})},Qne=e=>{let t=J();return gw({queryKey:Y.githubRepos,queryFn:()=>t.github.repos(),enabled:e})},$ne=()=>{let e=J();return gw({queryKey:Y.suggestedCodeFolder,queryFn:()=>e.settings.suggestedCodeFolder()})},ere=(e,t=!0)=>{let n=J();return gw({queryKey:Y.pathSuggestions(e),queryFn:()=>n.fs.suggestDirectories({prefix:e}),enabled:t,placeholderData:IC,staleTime:5e3})},tre=(e,t=!0)=>{let n=J();return gw({queryKey:Y.iconCandidates(e),queryFn:()=>n.projects.iconCandidates(e),enabled:t})},Pw=(e,t=!0)=>{let n=J();return gw({queryKey:Y.workspace(e),queryFn:()=>n.workspaces.status(e),enabled:t})},nre=(e,t=!0)=>{let n=J();return gw({queryKey:Y.checkpoints(e),queryFn:()=>n.conversations.checkpoints(e),enabled:t})},rre=(e,t=!0)=>{let n=J();return gw({queryKey:Y.processes(e),queryFn:()=>n.processes.list(e),enabled:t})},ire=(e,t=!0)=>{let n=J();return gw({queryKey:Y.timers(e),queryFn:()=>n.timers.list(e),enabled:t})},Fw=(e,t=!0)=>{let n=J();return gw({queryKey:Y.approvals(e),queryFn:()=>n.approvals.list(e),enabled:t})};function are(e){let t=J(),n=yC();return _w({mutationFn:n=>t.approvals.decide(e,n.toolUseId,n.decision),onSuccess:()=>n.invalidateQueries({queryKey:Y.approvals(e)})})}function ore(){let e=J(),t=yC();return _w({mutationFn:t=>e.settings.setClaudeConnectors(t),onSuccess:()=>t.invalidateQueries({queryKey:Y.settings})})}var sre=(e,t=!0)=>{let n=J();return gw({queryKey:Y.goal(e),queryFn:()=>n.goals.get(e),enabled:t})},Iw=e=>{let t=J();return gw({queryKey:Y.mcpServers(e),queryFn:()=>t.mcp.servers(e)})},Lw=()=>{let e=J();return gw({queryKey:Y.remoteStatus,queryFn:()=>e.remote.status()})},Rw=()=>{let e=J();return gw({queryKey:Y.devices,queryFn:()=>e.access.devices()})};function zw(e){let t=yC();return _w({mutationFn:e,onSuccess:()=>{t.invalidateQueries({queryKey:Y.remoteStatus}),t.invalidateQueries({queryKey:Y.settings}),t.invalidateQueries({queryKey:Y.devices})}})}var cre=()=>{let e=J();return zw(()=>e.remote.enable())},Bw=()=>{let e=J();return zw(()=>e.remote.disable())},Vw=()=>{let e=J();return zw(()=>e.remote.recreate())},Hw=()=>{let e=J();return _w({mutationFn:t=>e.access.mintPairing(t)})};function Uw(e){let t=yC();return _w({mutationFn:e,onSuccess:()=>t.invalidateQueries({queryKey:Y.devices})})}var Ww=()=>{let e=J();return Uw(({id:t,name:n})=>e.access.renameDevice(t,n))},Gw=()=>{let e=J();return Uw(t=>e.access.revokeDevice(t))},Kw=()=>{let e=J();return Uw(()=>e.access.signOutAll())},qw=e=>{let t=J();return gw({queryKey:[`machines`,`summary`,e],queryFn:()=>t.machines.summary(e),retry:!1})},Jw=()=>{let e=J();return gw({queryKey:Y.hubLink,queryFn:()=>e.machines.hubLink()})};function Yw(e){let t=yC();return _w({mutationFn:e,onSuccess:()=>t.invalidateQueries({queryKey:Y.machines})})}var Xw=()=>{let e=J();return Yw(({id:t,name:n})=>e.machines.rename(t,n))},Zw=()=>{let e=J();return Yw(t=>e.machines.disconnect(t))},Qw=()=>{let e=J();return Yw(()=>e.machines.disconnectHub())},$w=5e3,eT=6e5,tT=()=>{let e=J();return gw({queryKey:Y.updateStatus,queryFn:()=>e.updates.status(),refetchInterval:e=>e.state.data?.latest==null?$w:eT})},nT=()=>{let e=J(),t=yC();return _w({mutationFn:()=>e.updates.refresh(),onSuccess:e=>t.setQueryData(Y.updateStatus,e)})},rT=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,iT=Jn,aT=(e,t)=>n=>{if(t?.variants==null)return iT(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=rT(t)||rT(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 iT(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)},oT=Object.defineProperty,sT=(e,t)=>oT(e,`name`,{value:t,configurable:!0});function cT(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}sT(cT,`setRef`);function lT(...e){return t=>{let n=!1,r=e.map(e=>{let r=cT(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():cT(e[t],null)}}}}sT(lT,`composeRefs`);function uT(...e){return M.useCallback(lT(...e),e)}sT(uT,`useComposedRefs`);var dT=l(h(),1),fT=Object.defineProperty,pT=(e,t)=>fT(e,`name`,{value:t,configurable:!0});function mT(e){let t=M.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=TT(r),M.Children.forEach(r,e=>{if(xT(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;CT(n)&&typeof kT==`function`;)n=kT(n._payload);a=vT(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=M.cloneElement(a,void 0,s):!o&&M.Children.count(r)===1&&M.isValidElement(r)&&(a=r);let c=a?bT(a):void 0,l=uT(n,c);if(!a){if(r||r===0)throw Error(o?OT(e):DT(e));return r}let u=yT(i,a.props??{});return a.type!==M.Fragment&&(u.ref=n?l:c),M.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}pT(mT,`createSlot`);var hT=mT(`Slot`),gT=Symbol.for(`radix.slottable`);function _T(e){let t=pT(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=gT,t}pT(_T,`createSlottable`);var vT=pT((e,t)=>`child`in e.props?M.isValidElement(t)?M.cloneElement(t,void 0,e.props.children(t.props.children)):null:M.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function yT(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=ET(a,i))}return{...e,...n}}pT(yT,`mergeProps`);function bT(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}pT(bT,`getElementRef`);function xT(e){return M.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===gT}pT(xT,`isSlottable`);var ST=Symbol.for(`react.lazy`);function CT(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ST&&`_payload`in e&&wT(e._payload)}pT(CT,`isLazyComponent`);function wT(e){return typeof e==`object`&&!!e&&`then`in e}pT(wT,`isPromiseLike`);function TT(e){let t=e;for(;CT(t)&&typeof kT==`function`;)t=kT(t._payload);return t}pT(TT,`useUnwrappedLazy`);function ET(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}pT(ET,`concatAriaDescribedby`);var DT=pT(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),OT=pT(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),kT=M.use,AT=Object.defineProperty,jT=(e,t)=>AT(e,`name`,{value:t,configurable:!0}),MT=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=mT(`Primitive.${t}`),r=M.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function NT(e,t){e&&dT.flushSync(()=>e.dispatchEvent(t))}jT(NT,`dispatchDiscreteCustomEvent`);var PT=Object.defineProperty,FT=(e,t)=>PT(e,`name`,{value:t,configurable:!0}),IT=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),LT=M.forwardRef(FT(function(e,t){return(0,L.jsx)(MT.span,{...e,ref:t,style:{...IT,...e.style}})},`VisuallyHidden`)),RT=Object.defineProperty,zT=(e,t)=>RT(e,`name`,{value:t,configurable:!0});function BT(e,t){let n=M.createContext(t);n.displayName=e+`Context`;let r=zT(e=>{let{children:t,...r}=e,i=M.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=M.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return zT(i,`useContext`),[r,i]}zT(BT,`createContext`);function VT(e,t=[]){let n=[];function r(t,r){let i=M.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=zT(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=M.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=M.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return zT(s,`useContext`),[o,s]}zT(r,`createContext`);let i=zT(()=>{let t=n.map(e=>M.createContext(e));return zT(function(n){let r=n?.[e]||t;return M.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,HT(i,...t)]}zT(VT,`createContextScope`);function HT(...e){let t=e[0];if(e.length===1)return t;let n=zT(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return zT(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}zT(HT,`composeContextScopes`);var UT=globalThis?.document?M.useLayoutEffect:()=>{},WT=Object.defineProperty,GT=(e,t)=>WT(e,`name`,{value:t,configurable:!0});function KT(e){let t=e+`CollectionProvider`,[n,r]=VT(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=GT(e=>{let{scope:t,children:n}=e,r=M.useRef(null),a=M.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=mT(s),l=M.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=uT(t,a(s,n).collectionRef);return(0,L.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=mT(u),p=M.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=M.useRef(null),s=uT(t,o),c=a(u,n);return M.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return M.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return GT(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}GT(KT,`createCollection`);var qT=new WeakMap,JT=class e extends Map{static{GT(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],qT.set(this,!0)}set(e,t){return qT.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=ZT(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=YT(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=YT(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return YT(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function YT(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=XT(e,t);return n===-1?void 0:e[n]}GT(YT,`at`);function XT(e,t){let n=e.length,r=ZT(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}GT(XT,`toSafeIndex`);function ZT(e){return e!==e||e===0?0:Math.trunc(e)}GT(ZT,`toSafeInteger`);function QT(e){let t=e+`CollectionProvider`,[n,r]=VT(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=GT(({state:e,...t})=>e?(0,L.jsx)(u,{...t,state:e}):(0,L.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=GT(e=>{let t=_();return(0,L.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=GT(e=>{let{scope:t,children:n,state:r}=e,a=M.useRef(null),[s,c]=M.useState(null),l=uT(a,c),[u,d]=r,f=M.useRef(new JT),p=M.useCallback(()=>{let e=f.current;return tE(e)||e.sort(nE),e},[]);return M.useEffect(()=>{if(!s)return;let e=rE(()=>{d(e=>{let t=e.toSorted(nE);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,L.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,L.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=mT(d),p=M.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=uT(t,a(d,n).collectionElementRef);return(0,L.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=mT(m),g=M.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=M.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=M.useRef(i);$T(l.current,i)||(l.current=i);let u=l.current,d=uT(t,M.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);UT(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=M.useRef(null);return M.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new JT(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(nE)}))}),M.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new JT(t);return n.delete(e.element),n})},[s]),(0,L.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return M.useState(new JT)}GT(_,`useInitCollection`);function v(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}GT(v,`useCollection`);function y(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return GT(y,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:v,useGetCollection:y,useInitCollection:_}]}GT(QT,`createCollection`);function $T(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}GT($T,`shallowEqual`);function eE(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}GT(eE,`isElementPreceding`);function tE(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}GT(tE,`isInDocumentOrder`);function nE(e,t){return!e[1].element||!t[1].element?0:eE(e[1].element,t[1].element)?-1:1}GT(nE,`sortByDocumentPosition`);function rE(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}GT(rE,`getChildListObserver`);var iE=Object.defineProperty,aE=(e,t)=>iE(e,`name`,{value:t,configurable:!0}),oE=!!(typeof window<`u`&&window.document&&window.document.createElement);function X(e,t,{checkForDefaultPrevented:n=!0}={}){return aE(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}aE(X,`composeEventHandlers`);function sE(e){if(!oE)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}aE(sE,`getOwnerWindow`);function cE(e){if(!oE)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}aE(cE,`getOwnerDocument`);function lE(e,t=!1){let{activeElement:n}=cE(e);if(!n?.nodeName)return null;if(uE(n)&&n.contentDocument)return lE(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=cE(n).getElementById(e);if(t)return t}}return n}aE(lE,`getActiveElement`);function uE(e){return e.tagName===`IFRAME`}aE(uE,`isFrame`);var dE=Object.defineProperty,fE=(e,t)=>dE(e,`name`,{value:t,configurable:!0}),pE=M.useEffectEvent,mE=M.useInsertionEffect;function hE(e){if(typeof pE==`function`)return pE(e);let t=M.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof mE==`function`?mE(()=>{t.current=e}):UT(()=>{t.current=e}),M.useMemo(()=>((...e)=>t.current?.(...e)),[])}fE(hE,`useEffectEvent`);var gE=Object.defineProperty,_E=(e,t)=>gE(e,`name`,{value:t,configurable:!0}),vE=M.useInsertionEffect||UT;function yE({prop:e,defaultProp:t,onChange:n=_E(()=>{},`onChange`),caller:r}){let[i,a,o]=bE({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,M.useCallback(t=>{if(s){let n=xE(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}_E(yE,`useControllableState`);function bE({defaultProp:e,onChange:t}){let[n,r]=M.useState(e),i=M.useRef(n),a=M.useRef(t);return vE(()=>{a.current=t},[t]),M.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}_E(bE,`useUncontrolledState`);function xE(e){return typeof e==`function`}_E(xE,`isFunction`);var SE=Symbol(`RADIX:SYNC_STATE`);function CE(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=hE(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=M.useReducer((t,n)=>{if(n.type===SE)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=M.useRef(p);M.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=M.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return M.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:SE,state:i})},[i,d.state,c]),[h,f]}_E(CE,`useControllableStateReducer`);var wE=Object.defineProperty,TE=(e,t)=>wE(e,`name`,{value:t,configurable:!0});function EE(e,t){return M.useReducer((e,n)=>t[e][n]??e,e)}TE(EE,`useStateMachine`);var DE=TE(e=>{let{present:t,children:n}=e,r=OE(t),i=typeof n==`function`?n({present:r.isPresent}):M.Children.only(n),a=AE(r.ref,ME(i));return typeof n==`function`||r.isPresent?M.cloneElement(i,{ref:a}):null},`Presence`);function OE(e){let[t,n]=M.useState(),r=M.useRef(null),i=M.useRef(e),a=M.useRef(`none`),o=M.useRef(void 0),[s,c]=EE(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return M.useEffect(()=>{s===`mounted`?(a.current=o.current??jE(r.current),o.current=void 0):a.current=`none`},[s]),UT(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=jE(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),UT(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=TE(a=>{let o=jE(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=TE(e=>{e.target===t&&(a.current=jE(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:M.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=jE(t)}else r.current=null;n(e)},[])}}TE(OE,`usePresence`);function kE(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}TE(kE,`setRef`);function AE(...e){let t=M.useRef(e);return t.current=e,M.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=kE(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():kE(n[e],null)}}},[])}TE(AE,`useStableComposedRefs`);function jE(e){return e?.animationName||`none`}TE(jE,`getAnimationName`);function ME(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}TE(ME,`getElementRef`);var NE=Object.defineProperty,PE=(e,t)=>NE(e,`name`,{value:t,configurable:!0}),FE=M.useId||(()=>void 0),IE=0;function LE(e){let[t,n]=M.useState(FE());return UT(()=>{e||n(e=>e??String(IE++))},[e]),e||(t?`radix-${t}`:``)}PE(LE,`useId`);var RE=Object.defineProperty,zE=(e,t)=>RE(e,`name`,{value:t,configurable:!0}),BE=`Collapsible`,[VE,lre]=VT(BE),[HE,UE]=VE(BE),WE=M.forwardRef(zE(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=yE({prop:r,defaultProp:i??!1,onChange:o,caller:BE});return(0,L.jsx)(HE,{scope:n,disabled:a,contentId:LE(),open:c,onOpenToggle:M.useCallback(()=>l(e=>!e),[l]),children:(0,L.jsx)(MT.div,{"data-state":XE(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),GE=`CollapsibleTrigger`,KE=M.forwardRef(zE(function(e,t){let{__scopeCollapsible:n,...r}=e,i=UE(GE,n);return(0,L.jsx)(MT.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":XE(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:X(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),qE=`CollapsibleContent`,JE=M.forwardRef(zE(function(e,t){let{forceMount:n,...r}=e,i=UE(qE,e.__scopeCollapsible);return(0,L.jsx)(DE,{present:n||i.open,children:({present:e})=>(0,L.jsx)(YE,{...r,ref:t,present:e})})},`CollapsibleContent`)),YE=M.forwardRef(zE(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=UE(qE,n),[s,c]=M.useState(r),l=M.useRef(null),u=uT(t,l),d=M.useRef(0),f=d.current,p=M.useRef(0),m=p.current,h=o.open||s,g=M.useRef(h),_=M.useRef(void 0);return M.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),UT(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,L.jsx)(MT.div,{"data-state":XE(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})},`CollapsibleContentImpl`));function XE(e){return e?`open`:`closed`}zE(XE,`getState`);var ZE=Object.defineProperty,QE=(e,t)=>ZE(e,`name`,{value:t,configurable:!0}),$E={LTR:`ltr`,RTL:`rtl`},eD=M.createContext(void 0);function tD(e){let t=M.useContext(eD);return e||t||$E.LTR}QE(tD,`useDirection`);var nD=Object.defineProperty,rD=(e,t)=>nD(e,`name`,{value:t,configurable:!0}),iD=M.useInsertionEffect;function aD(e){let t=M.useRef(e);return typeof iD==`function`?iD(()=>{t.current=e}):UT(()=>{t.current=e}),M.useMemo(()=>((...e)=>t.current?.(...e)),[])}rD(aD,`useCallbackRef`);var oD=Object.defineProperty,sD=(e,t)=>oD(e,`name`,{value:t,configurable:!0}),cD=`dismissableLayer.update`,lD=`dismissableLayer.pointerDownOutside`,uD=`dismissableLayer.focusOutside`,dD,fD=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),pD=M.forwardRef(sD(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=M.useContext(fD),[d,f]=M.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=M.useState({}),h=uT(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=M.useRef(!1),C=gD(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:M.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=_D(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=aD(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return M.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),M.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(dD=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),vD(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=dD))}},[d,p,n,u]),M.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),vD())},[d,u]),M.useEffect(()=>{let e=sD(()=>m({}),`handleUpdate`);return document.addEventListener(cD,e),()=>document.removeEventListener(cD,e)},[]),(0,L.jsx)(MT.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:X(e.onFocusCapture,w.onFocusCapture),onBlurCapture:X(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function mD(){let e=M.useContext(fD),[t,n]=M.useState(null);return M.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}sD(mD,`useDismissableLayerSurface`);var hD=sD(()=>!0,`IS_TRUE`);function gD(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=hD}=t,s=aD(e),c=M.useRef(!1),l=M.useRef(!1),u=M.useRef(new Map),d=M.useRef(()=>{});return M.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}sD(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}sD(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}sD(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}sD(p,`handleInteractionBubble`);let m=sD(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||yD(lD,s,p,{discrete:!0})};if(sD(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:sD(()=>c.current=!0,`onPointerDownCapture`)}}sD(gD,`usePointerDownOutside`);function _D(e,t=globalThis?.document){let n=aD(e),r=M.useRef(!1);return M.useEffect(()=>{let e=sD(e=>{e.target&&!r.current&&yD(uD,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:sD(()=>r.current=!0,`onFocusCapture`),onBlurCapture:sD(()=>r.current=!1,`onBlurCapture`)}}sD(_D,`useFocusOutside`);function vD(){let e=new CustomEvent(cD);document.dispatchEvent(e)}sD(vD,`dispatchUpdate`);function yD(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?NT(i,a):i.dispatchEvent(a)}sD(yD,`handleAndDispatchCustomEvent`);var bD=Object.defineProperty,xD=(e,t)=>bD(e,`name`,{value:t,configurable:!0}),SD=`focusScope.autoFocusOnMount`,CD=`focusScope.autoFocusOnUnmount`,wD={bubbles:!1,cancelable:!0},TD=M.forwardRef(xD(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=M.useState(null),u=aD(a),d=aD(o),f=M.useRef(null),p=uT(t,l),m=M.useRef(i);M.useEffect(()=>{m.current=i});let h=M.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:ID(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||ID(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ID(c)};xD(e,`handleFocusIn`),xD(t,`handleFocusOut`),xD(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),M.useEffect(()=>{if(c){LD.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(SD,wD);c.addEventListener(SD,u),c.dispatchEvent(t),t.defaultPrevented||(AD(BD(MD(c)),{select:!0}),document.activeElement===e&&ID(c))}return()=>{c.removeEventListener(SD,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(CD,wD);c.addEventListener(CD,d),c.dispatchEvent(r),r.defaultPrevented||ID(e??t.body,{select:!0}),c.removeEventListener(CD,d),LD.remove(g)},0)}}},[c,u,d,g]);let _=M.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=jD(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ID(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ID(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,L.jsx)(MT.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),ED=M.createContext(null);function DD({registry:e,children:t}){return e?(0,L.jsx)(ED.Provider,{value:e,children:t}):t}xD(DD,`FocusScopeBranchProvider`);function OD(){let[e,t]=M.useState([]);return{nodes:e,registry:M.useMemo(()=>({add:xD(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:xD(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}xD(OD,`useFocusScopeBranchRegistry`);function kD(e){let t=M.useContext(ED);M.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}xD(kD,`useFocusScopeBranch`);function AD(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ID(r,{select:t}),document.activeElement!==n)return}xD(AD,`focusFirst`);function jD(e){let t=MD(e);return[ND(t,e),ND(t.reverse(),e)]}xD(jD,`getTabbableEdges`);function MD(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:xD(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}xD(MD,`getTabbableCandidates`);function ND(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):PD(r,{upTo:t})))return r}xD(ND,`findVisible`);function PD(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}xD(PD,`isHidden`);function FD(e){return e.tagName===`INPUT`&&typeof e.select==`function`}xD(FD,`isSelectableInput`);function ID(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&FD(e)&&t&&e.select()}}xD(ID,`focus`);var LD=RD();function RD(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=zD(e,t),e.unshift(t)},remove(t){e=zD(e,t),e[0]?.resume()}}}xD(RD,`createFocusScopesStack`);function zD(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}xD(zD,`arrayRemove`);function BD(e){return e.filter(e=>e.tagName!==`A`)}xD(BD,`removeLinks`);var VD=Object.defineProperty,HD=M.forwardRef(((e,t)=>VD(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=M.useState(!1);UT(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?dT.createPortal((0,L.jsx)(MT.div,{...r,ref:t}),o):null},`Portal`)),UD=Object.defineProperty,WD=(e,t)=>UD(e,`name`,{value:t,configurable:!0}),GD=0,KD=null;function qD(e){return JD(),e.children}WD(qD,`FocusGuards`);function JD(){M.useEffect(()=>{KD||={start:YD(),end:YD()};let{start:e,end:t}=KD;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),GD++,()=>{GD===1&&(KD?.start.remove(),KD?.end.remove(),KD=null),GD=Math.max(0,GD-1)}},[])}WD(JD,`useFocusGuards`);function YD(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}WD(YD,`createFocusGuard`);var XD=function(){return XD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},XD.apply(this,arguments)};function ZD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function QD(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var $D=`right-scroll-bar-position`,eO=`width-before-scroll-bar`,tO=`with-scroll-bars-hidden`,nO=`--removed-body-scroll-bar-size`;function rO(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function iO(e,t){var n=(0,M.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var aO=typeof window<`u`?M.useLayoutEffect:M.useEffect,oO=new WeakMap;function sO(e,t){var n=iO(t||null,function(t){return e.forEach(function(e){return rO(e,t)})});return aO(function(){var t=oO.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||rO(e,null)}),i.forEach(function(e){r.has(e)||rO(e,a)})}oO.set(n,e)},[e]),n}function cO(e){return e}function lO(e,t){t===void 0&&(t=cO);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function uO(e){e===void 0&&(e={});var t=lO(null);return t.options=XD({async:!0,ssr:!1},e),t}var dO=function(e){var t=e.sideCar,n=ZD(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return M.createElement(r,XD({},n))};dO.isSideCarExport=!0;function fO(e,t){return e.useMedium(t),dO}var pO=uO(),mO=function(){},hO=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:mO,onWheelCapture:mO,onTouchMoveCapture:mO}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=ZD(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=sO([n,t]),C=XD(XD({},b),i);return M.createElement(M.Fragment,null,u&&M.createElement(x,{sideCar:pO,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?M.cloneElement(M.Children.only(s),XD(XD({},C),{ref:S})):M.createElement(v,XD({},C,{className:c,ref:S}),s))});hO.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},hO.classNames={fullWidth:eO,zeroRight:$D};var gO=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function _O(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=gO();return t&&e.setAttribute(`nonce`,t),e}function vO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function yO(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var bO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_O())&&(vO(t,n),yO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xO=function(){var e=bO();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},SO=function(){var e=xO();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},CO={left:0,top:0,right:0,gap:0},wO=function(e){return parseInt(e||``,10)||0},TO=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[wO(n),wO(r),wO(i)]},EO=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return CO;var t=TO(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},DO=SO(),OO=`data-scroll-locked`,kO=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
13
|
+
.${tO} {
|
|
14
|
+
overflow: hidden ${r};
|
|
15
|
+
padding-right: ${s}px ${r};
|
|
16
|
+
}
|
|
17
|
+
body[${OO}] {
|
|
18
|
+
overflow: hidden ${r};
|
|
19
|
+
overscroll-behavior: contain;
|
|
20
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
21
|
+
padding-left: ${i}px;
|
|
22
|
+
padding-top: ${a}px;
|
|
23
|
+
padding-right: ${o}px;
|
|
24
|
+
margin-left:0;
|
|
25
|
+
margin-top:0;
|
|
26
|
+
margin-right: ${s}px ${r};
|
|
27
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.${$D} {
|
|
31
|
+
right: ${s}px ${r};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.${eO} {
|
|
35
|
+
margin-right: ${s}px ${r};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.${$D} .${$D} {
|
|
39
|
+
right: 0 ${r};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.${eO} .${eO} {
|
|
43
|
+
margin-right: 0 ${r};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body[${OO}] {
|
|
47
|
+
${nO}: ${s}px;
|
|
48
|
+
}
|
|
49
|
+
`},AO=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},jO=function(){M.useEffect(function(){return document.body.setAttribute(OO,(AO()+1).toString()),function(){var e=AO()-1;e<=0?document.body.removeAttribute(OO):document.body.setAttribute(OO,e.toString())}},[])},MO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;jO();var a=M.useMemo(function(){return EO(i)},[i]);return M.createElement(DO,{styles:kO(a,!t,i,n?``:`!important`)})},NO=!1;if(typeof window<`u`)try{var PO=Object.defineProperty({},"passive",{get:function(){return NO=!0,!0}});window.addEventListener(`test`,PO,PO),window.removeEventListener(`test`,PO,PO)}catch{NO=!1}var FO=NO?{passive:!1}:!1,IO=function(e){return e.tagName===`TEXTAREA`},LO=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!IO(e)&&n[t]===`visible`)},RO=function(e){return LO(e,`overflowY`)},zO=function(e){return LO(e,`overflowX`)},BO=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),UO(e,r)){var i=WO(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},VO=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},HO=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},UO=function(e,t){return e===`v`?RO(t):zO(t)},WO=function(e,t){return e===`v`?VO(t):HO(t)},GO=function(e,t){return e===`h`&&t===`rtl`?-1:1},KO=function(e,t,n,r,i){var a=GO(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=WO(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&UO(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},qO=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},JO=function(e){return[e.deltaX,e.deltaY]},YO=function(e){return e&&`current`in e?e.current:e},XO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZO=function(e){return`
|
|
50
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
51
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
52
|
+
`},QO=0,$O=[];function ek(e){var t=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(QO++)[0],a=M.useState(SO)[0],o=M.useRef(e);M.useEffect(function(){o.current=e},[e]),M.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=QD([e.lockRef.current],(e.shards||[]).map(YO),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=M.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=qO(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=BO(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=BO(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return KO(h,t,e,h===`h`?s:c,!0)},[]),c=M.useCallback(function(e){var n=e;if($O.length&&$O[$O.length-1]===a){var r=`deltaY`in n?JO(n):qO(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&XO(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(YO).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=M.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:tk(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=M.useCallback(function(e){n.current=qO(e),r.current=void 0},[]),d=M.useCallback(function(t){l(t.type,JO(t),t.target,s(t,e.lockRef.current))},[]),f=M.useCallback(function(t){l(t.type,qO(t),t.target,s(t,e.lockRef.current))},[]);M.useEffect(function(){return $O.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,FO),document.addEventListener(`touchmove`,c,FO),document.addEventListener(`touchstart`,u,FO),function(){$O=$O.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,FO),document.removeEventListener(`touchmove`,c,FO),document.removeEventListener(`touchstart`,u,FO)}},[]);var p=e.removeScrollBar,m=e.inert;return M.createElement(M.Fragment,null,m?M.createElement(a,{styles:ZO(i)}):null,p?M.createElement(MO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tk(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var nk=fO(pO,ek),rk=M.forwardRef(function(e,t){return M.createElement(hO,XD({},e,{ref:t,sideCar:nk}))});rk.classNames=hO.classNames;var ik=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ak=new WeakMap,ok=new WeakMap,sk={},ck=0,lk=function(e){return e&&(e.host||lk(e.parentNode))},uk=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=lk(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},dk=function(e,t,n,r){var i=uk(t,Array.isArray(e)?e:[e]);sk[n]||(sk[n]=new WeakMap);var a=sk[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(ak.get(e)||0)+1,l=(a.get(e)||0)+1;ak.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ok.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ck++,function(){o.forEach(function(e){var t=ak.get(e)-1,i=a.get(e)-1;ak.set(e,t),a.set(e,i),t||(ok.has(e)||e.removeAttribute(r),ok.delete(e)),i||e.removeAttribute(n)}),ck--,ck||(ak=new WeakMap,ak=new WeakMap,ok=new WeakMap,sk={})}},fk=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ik(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),dk(r,i,n,`aria-hidden`)):function(){return null}},pk=Object.defineProperty,mk=(e,t)=>pk(e,`name`,{value:t,configurable:!0}),hk=`Dialog`,[gk,_k]=VT(hk),[vk,yk]=gk(hk),bk=mk(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=M.useRef(null),c=M.useRef(null),{nodes:l,registry:u}=OD(),[d,f]=yE({prop:r,defaultProp:i??!1,onChange:a,caller:hk}),[p,m]=M.useState(0),[h,g]=M.useState(0);return(0,L.jsx)(vk,{scope:t,triggerRef:s,contentRef:c,contentId:LE(),titleId:LE(),descriptionId:LE(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:M.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),xk=`DialogTrigger`,Sk=M.forwardRef(mk(function(e,t){let{__scopeDialog:n,...r}=e,i=yk(xk,n),a=uT(t,i.triggerRef);return(0,L.jsx)(MT.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Vk(i.open),...r,ref:a,onClick:X(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Ck=`DialogPortal`,[wk,Tk]=gk(Ck,{forceMount:void 0}),Ek=mk(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=yk(Ck,t);return(0,L.jsx)(wk,{scope:t,forceMount:n,children:M.Children.map(r,e=>(0,L.jsx)(DE,{present:n||a.open,children:(0,L.jsx)(HD,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Dk=`DialogOverlay`,Ok=M.forwardRef(mk(function(e,t){let n=Tk(Dk,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=yk(Dk,e.__scopeDialog);return a.modal?(0,L.jsx)(DE,{present:r||a.open,children:(0,L.jsx)(Ak,{...i,ref:t})}):null},`DialogOverlay`)),kk=mT(`DialogOverlay.RemoveScroll`),Ak=M.forwardRef(mk(function(e,t){let{__scopeDialog:n,...r}=e,i=yk(Dk,n),a=uT(t,mD());return(0,L.jsx)(rk,{as:kk,allowPinchZoom:!0,shards:M.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,L.jsx)(MT.div,{"data-state":Vk(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),jk=`DialogContent`,Mk=M.forwardRef(mk(function(e,t){let n=Tk(jk,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=yk(jk,e.__scopeDialog);return(0,L.jsx)(DE,{present:r||a.open,children:a.modal?(0,L.jsx)(Nk,{...i,ref:t}):(0,L.jsx)(Pk,{...i,ref:t})})},`DialogContent`)),Nk=M.forwardRef(mk(function(e,t){let n=yk(jk,e.__scopeDialog),r=M.useRef(null),i=uT(t,n.contentRef,r);return M.useEffect(()=>{let e=r.current;if(e)return fk(e)},[]),(0,L.jsx)(Fk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Pk=M.forwardRef(mk(function(e,t){let n=yk(jk,e.__scopeDialog),r=M.useRef(!1),i=M.useRef(!1);return(0,L.jsx)(Fk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Fk=M.forwardRef(mk(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=yk(jk,n);return JD(),(0,L.jsx)(DD,{registry:l.branchRegistry,children:(0,L.jsx)(TD,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(pD,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Bk(o,l.descriptionId):o,"data-state":Vk(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Ik=M.forwardRef(mk(function(e,t){let{__scopeDialog:n,...r}=e,i=yk(`DialogTitle`,n),{setTitleCount:a}=i;return UT(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(MT.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Lk=M.forwardRef(mk(function(e,t){let{__scopeDialog:n,...r}=e,i=yk(`DialogDescription`,n),{setDescriptionCount:a}=i;return UT(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(MT.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Rk=`DialogClose`,zk=M.forwardRef(mk(function(e,t){let{__scopeDialog:n,...r}=e,i=yk(Rk,n);return(0,L.jsx)(MT.button,{type:`button`,...r,ref:t,onClick:X(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Bk(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}mk(Bk,`concatAriaDescribedby`);function Vk(e){return e?`open`:`closed`}mk(Vk,`getState`);var Hk=Object.defineProperty,Uk=(e,t)=>Hk(e,`name`,{value:t,configurable:!0}),[Wk,ure]=VT(`AlertDialog`,[_k]),Gk=_k(),Kk=Uk(e=>{let{__scopeAlertDialog:t,...n}=e,r=Gk(t);return(0,L.jsx)(bk,{...r,...n,modal:!0})},`AlertDialog`);M.forwardRef(Uk(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Gk(n);return(0,L.jsx)(Sk,{...i,...r,ref:t})},`AlertDialogTrigger`));var qk=Uk(e=>{let{__scopeAlertDialog:t,...n}=e,r=Gk(t);return(0,L.jsx)(Ek,{...r,...n})},`AlertDialogPortal`),Jk=M.forwardRef(Uk(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Gk(n);return(0,L.jsx)(Ok,{...i,...r,ref:t})},`AlertDialogOverlay`)),[Yk,Xk]=Wk(`AlertDialogContent`),Zk=M.forwardRef(Uk(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=Gk(n),o=uT(t,M.useRef(null)),s=M.useRef(null);return(0,L.jsx)(Yk,{scope:n,cancelRef:s,children:(0,L.jsx)(Mk,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:X(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Qk=M.forwardRef(Uk(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Gk(n);return(0,L.jsx)(Ik,{...i,...r,ref:t})},`AlertDialogTitle`)),$k=M.forwardRef(Uk(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Gk(n);return(0,L.jsx)(Lk,{...i,...r,ref:t})},`AlertDialogDescription`)),eA=M.forwardRef(Uk(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Gk(n);return(0,L.jsx)(zk,{...i,...r,ref:t})},`AlertDialogAction`)),tA=`AlertDialogCancel`,nA=M.forwardRef(Uk(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Xk(tA,n),a=Gk(n),o=uT(t,i);return(0,L.jsx)(zk,{...a,...r,ref:o})},`AlertDialogCancel`)),rA=Object.defineProperty,iA=(e,t)=>rA(e,`name`,{value:t,configurable:!0}),aA=`Avatar`,[oA,dre]=VT(aA),sA={Idle:`idle`,Loading:`loading`,Loaded:`loaded`,Error:`error`},cA=[0,()=>void 0],[lA,uA]=oA(aA),dA=M.forwardRef(iA(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=M.useState(sA.Idle),[o,s]=vA();return(0,L.jsx)(lA,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:o,setImageCount:s,children:(0,L.jsx)(MT.span,{...r,ref:t})})},`Avatar`)),fA=`AvatarImage`,pA=M.forwardRef(iA(function(e,t){let{__scopeAvatar:n,src:r,onLoadingStatusChange:i,...a}=e,o=uA(fA,n);o.setImageCount;let s=gA(r,{referrerPolicy:a.referrerPolicy,crossOrigin:a.crossOrigin,loadingStatus:o.imageLoadingStatus,setLoadingStatus:o.setImageLoadingStatus}),c=aD(e=>{i?.(e)}),l=M.useRef(s);return UT(()=>{let e=l.current;l.current=s,s!==e&&c(s)},[s,c]),s===sA.Loaded?(0,L.jsx)(MT.img,{...a,ref:t,src:r}):null},`AvatarImage`)),mA=`AvatarFallback`,hA=M.forwardRef(iA(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=uA(mA,n),[o,s]=M.useState(r===void 0);return M.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==sA.Loaded?(0,L.jsx)(MT.span,{...i,ref:t}):null},`AvatarFallback`));function gA(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return UT(()=>{if(!e){n(sA.Error);return}let t=new window.Image,a=iA(e=>{let t=e.currentTarget;n(_A(t))},`handleLoad`),o=iA(()=>n(sA.Error),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(_A(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(sA.Idle)}},[e,i,r,n]),t}iA(gA,`useImageLoadingStatus`);function _A(e){return e.complete?e.naturalWidth>0?sA.Loaded:sA.Error:sA.Loading}iA(_A,`getImageLoadingStatus`);function vA(){return cA}iA(vA,`useImageCount`);function yA(e){}iA(yA,`useUpdateImageCount`);var bA=Object.defineProperty,xA=(e,t)=>bA(e,`name`,{value:t,configurable:!0});function SA(e){let[t,n]=M.useState(void 0);return UT(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}xA(SA,`useSize`);var CA=Object.defineProperty,wA=(e,t)=>CA(e,`name`,{value:t,configurable:!0}),TA=`Checkbox`,[EA,fre]=VT(TA),[DA,OA]=EA(TA);function kA(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=yE({prop:n,defaultProp:i??!1,onChange:c,caller:TA}),[m,h]=M.useState(null),[g,_]=M.useState(null),[v,y]=M.useState(null),b=!m||!!o||!!m.closest(`form`),x={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,userClick:v,onUserClick:y,required:l,defaultChecked:!RA(i)&&i,isFormControl:b,bubbleInput:g,setBubbleInput:_};return(0,L.jsx)(DA,{scope:t,...x,children:LA(d)?d(x):r})}wA(kA,`CheckboxProvider`);var AA=`CheckboxTrigger`,jA=M.forwardRef(wA(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,onUserClick:f,isFormControl:p,bubbleInput:m}=OA(AA,e),h=uT(i,u),g=M.useRef(c);return M.useEffect(()=>{let e=a?.form;if(e){let t=wA(()=>d(g.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,L.jsx)(MT.button,{type:`button`,role:`checkbox`,"aria-checked":RA(c)?`mixed`:c,"aria-required":l,"data-state":zA(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:X(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:X(n,e=>{let t=e.isPropagationStopped();f({requestedChecked:RA(c)?!0:!c,hasConsumerStoppedPropagation:t}),d(e=>RA(e)?!0:!e),m&&p&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),MA=M.forwardRef(wA(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,L.jsx)(kA,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(jA,{...d,ref:t,__scopeCheckbox:n}),e&&(0,L.jsx)(IA,{__scopeCheckbox:n})]})})},`Checkbox`)),NA=`CheckboxIndicator`,PA=M.forwardRef(wA(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=OA(NA,n);return(0,L.jsx)(DE,{present:r||RA(a.checked)||a.checked===!0,children:(0,L.jsx)(MT.span,{"data-state":zA(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),FA=`CheckboxBubbleInput`,IA=M.forwardRef(wA(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,userClick:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=OA(FA,e),h=uT(r,m),g=SA(i),_=M.useRef(!1),v=M.useRef(o),y=M.useRef(a),b=M.useRef(null);M.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=v.current!==o;v.current=o;let i=a!==null&&a!==y.current;if(y.current=a,i)b.current=r?null:a,r&&(e.indeterminate=RA(o),n.call(e,!RA(o)&&o)),e.dispatchEvent(new Event(`click`,{bubbles:!a.hasConsumerStoppedPropagation}));else if(r){let t=b.current;b.current=null;let r=t?.requestedChecked===o;_.current=!0,e.indeterminate=RA(o),n.call(e,!RA(o)&&o),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),_.current=!1}},[p,o,a]);let x=M.useRef(!RA(o)&&o);return(0,L.jsx)(MT.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??x.current,required:c,disabled:l,name:u,value:d,form:f,...n,tabIndex:-1,ref:h,onClick:X(t,e=>{_.current&&e.stopPropagation()}),style:{...n.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function LA(e){return typeof e==`function`}wA(LA,`isFunction`);function RA(e){return e===`indeterminate`}wA(RA,`isIndeterminate`);function zA(e){return RA(e)?`indeterminate`:e?`checked`:`unchecked`}wA(zA,`getState`);var BA=[`top`,`right`,`bottom`,`left`],VA=Math.min,HA=Math.max,UA=Math.round,WA=Math.floor,GA=e=>({x:e,y:e}),KA={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function qA(e,t,n){return HA(e,VA(t,n))}function JA(e,t){return typeof e==`function`?e(t):e}function YA(e){return e.split(`-`)[0]}function XA(e){return e.split(`-`)[1]}function ZA(e){return e===`x`?`y`:`x`}function QA(e){return e===`y`?`height`:`width`}function $A(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ej(e){return ZA($A(e))}function tj(e,t,n){n===void 0&&(n=!1);let r=XA(e),i=ej(e),a=QA(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=uj(o)),[o,uj(o)]}function nj(e){let t=uj(e);return[rj(e),t,rj(t)]}function rj(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ij=[`left`,`right`],aj=[`right`,`left`],oj=[`top`,`bottom`],sj=[`bottom`,`top`];function cj(e,t,n){switch(e){case`top`:case`bottom`:return n?t?aj:ij:t?ij:aj;case`left`:case`right`:return t?oj:sj;default:return[]}}function lj(e,t,n,r){let i=XA(e),a=cj(YA(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(rj)))),a}function uj(e){let t=YA(e);return KA[t]+e.slice(t.length)}function dj(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function fj(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:dj(e)}function pj(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 mj(e,t,n){let{reference:r,floating:i}=e,a=$A(t),o=ej(t),s=QA(o),c=YA(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=XA(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function hj(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}=JA(t,e),p=fj(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=pj(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=pj(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 gj=50,_j=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:hj},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=mj(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<gj&&(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}=mj(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},vj=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}=JA(e,t)||{};if(l==null)return{};let d=fj(u),f={x:n,y:r},p=ej(i),m=QA(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=VA(d[_],T),D=VA(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=qA(E,k,O),j=!c.arrow&&XA(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,ee=j?k<E?k-E:k-O:0;return{[p]:f[p]+ee,data:{[p]:A,centerOffset:k-A-ee,...j&&{alignmentOffset:ee}},reset:j}}}),yj=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}=JA(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=YA(r),_=$A(o),v=YA(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[uj(o)]:nj(o)),x=p!==`none`;!d&&x&&b.push(...lj(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=tj(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`||_===$A(t)||T.every(e=>$A(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=$A(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{}}}};function bj(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xj(e){return BA.some(t=>e[t]>=0)}var Sj=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=JA(e,t);switch(i){case`referenceHidden`:{let e=bj(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:xj(e)}}}case`escaped`:{let e=bj(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:xj(e)}}}default:return{}}}}},Cj=new Set([`left`,`top`]);async function wj(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=YA(n),s=XA(n),c=$A(n)===`y`,l=Cj.has(o)?-1:1,u=a&&c?-1:1,d=JA(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 Tj=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 wj(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}}}}},Ej=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}=JA(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$A(i),p=ZA(f),m=u[p],h=u[f],g=(e,t)=>qA(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}}}}}},Dj=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}=JA(e,t),u={x:n,y:r},d=$A(i),f=ZA(d),p=u[f],m=u[d],h=JA(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=Cj.has(YA(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}}}},Oj=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}=JA(e,t),c=await i.detectOverflow(t,s),l=YA(n),u=XA(n),d=$A(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=VA(p-c[m],g),y=VA(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*HA(c.left,c.right):S=p-2*HA(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 kj(){return typeof window<`u`}function Aj(e){return Nj(e)?(e.nodeName||``).toLowerCase():`#document`}function jj(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mj(e){return((Nj(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Nj(e){return kj()?e instanceof Node||e instanceof jj(e).Node:!1}function Pj(e){return kj()?e instanceof Element||e instanceof jj(e).Element:!1}function Fj(e){return kj()?e instanceof HTMLElement||e instanceof jj(e).HTMLElement:!1}function Ij(e){return!kj()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof jj(e).ShadowRoot}function Lj(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Jj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Rj(e){return/^(table|td|th)$/.test(Aj(e))}function zj(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Bj=/transform|translate|scale|rotate|perspective|filter/,Vj=/paint|layout|strict|content/,Hj=e=>!!e&&e!==`none`,Uj;function Wj(e){let t=Pj(e)?Jj(e):e;return Hj(t.transform)||Hj(t.translate)||Hj(t.scale)||Hj(t.rotate)||Hj(t.perspective)||!Kj()&&(Hj(t.backdropFilter)||Hj(t.filter))||Bj.test(t.willChange||``)||Vj.test(t.contain||``)}function Gj(e){let t=Xj(e);for(;Fj(t)&&!qj(t);){if(Wj(t))return t;if(zj(t))return null;t=Xj(t)}return null}function Kj(){return Uj??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Uj}function qj(e){return/^(html|body|#document)$/.test(Aj(e))}function Jj(e){return jj(e).getComputedStyle(e)}function Yj(e){return Pj(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xj(e){if(Aj(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ij(e)&&e.host||Mj(e);return Ij(t)?t.host:t}function Zj(e){let t=Xj(e);return qj(t)?(e.ownerDocument||e).body:Fj(t)&&Lj(t)?t:Zj(t)}function Qj(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Zj(e),i=r===e.ownerDocument?.body,a=jj(r);if(i){let e=$j(a);return t.concat(a,a.visualViewport||[],Lj(r)?r:[],e&&n?Qj(e):[])}return t.concat(r,Qj(r,[],n))}function $j(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eM(e){let t=Jj(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Fj(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=UA(n)!==a||UA(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function tM(e){return Pj(e)?e:e.contextElement}function nM(e){let t=tM(e);if(!Fj(t))return GA(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=eM(t),o=(a?UA(n.width):n.width)/r,s=(a?UA(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var rM=GA(0);function iM(e){let t=jj(e);return!Kj()||!t.visualViewport?rM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function aM(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===jj(e)}function oM(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=tM(e),o=GA(1);t&&(r?Pj(r)&&(o=nM(r)):o=nM(e));let s=aM(a,n,r)?iM(a):GA(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=jj(a),t=Pj(r)?jj(r):r,n=e,i=$j(n);for(;i&&t!==n;){let e=nM(i),t=i.getBoundingClientRect(),r=Jj(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=jj(i),i=$j(n)}}return pj({width:u,height:d,x:c,y:l})}function sM(e,t){let n=Yj(e).scrollLeft;return t?t.left+n:oM(Mj(e)).left+n}function cM(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-sM(e,n),y:n.top+t.scrollTop}}function lM(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Mj(r),s=t?zj(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=GA(1),u=GA(0),d=Fj(r);if((d||!a)&&((Aj(r)!==`body`||Lj(o))&&(c=Yj(r)),d)){let e=oM(r);l=nM(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?cM(o,c):GA(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 uM(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function dM(e){let t=Yj(e),n=e.ownerDocument.body,r=HA(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=HA(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+sM(e),o=-t.scrollTop;return Jj(n).direction===`rtl`&&(a+=HA(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var fM=25;function pM(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=jj(e),a=Mj(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Kj()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(sM(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<=fM&&(s-=o)}return{width:s,height:c,x:l,y:u}}function mM(e,t){let n=oM(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=nM(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function hM(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=pM(e,n,t);else if(t===`document`)r=dM(Mj(e));else if(Pj(t))r=mM(t,n);else{let n=iM(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pj(r)}function gM(e,t){let n=t.get(e);if(n)return n;let r=Qj(e,[],!1).filter(e=>Pj(e)&&Aj(e)!==`body`),i=null,a=Jj(e).position===`fixed`,o=a?Xj(e):e;for(;Pj(o)&&!qj(o);){let e=Jj(o),t=Wj(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Xj(o)}return t.set(e,r),r}function _M(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?zj(t)?[]:gM(t,this._c):[].concat(n),r],o=hM(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=hM(t,a[e],i);s=HA(n.top,s),c=VA(n.right,c),l=VA(n.bottom,l),u=HA(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function vM(e){let{width:t,height:n}=eM(e);return{width:t,height:n}}function yM(e,t,n){let r=Fj(t),i=Mj(t),a=n===`fixed`,o=oM(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=GA(0);if((r||!a)&&((Aj(t)!==`body`||Lj(i))&&(s=Yj(t)),r)){let e=oM(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=sM(i));let l=i&&!r&&!a?cM(i,s):GA(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 bM(e){return Jj(e).position===`static`}function xM(e,t){if(!Fj(e)||Jj(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Mj(e)===n&&(n=n.ownerDocument.body),n}function SM(e,t){let n=jj(e);if(zj(e))return n;if(!Fj(e)){let t=Xj(e);for(;t&&!qj(t);){if(Pj(t)&&!bM(t))return t;t=Xj(t)}return n}let r=xM(e,t);for(;r&&Rj(r)&&bM(r);)r=xM(r,t);return r&&qj(r)&&bM(r)&&!Wj(r)?n:r||Gj(e)||n}var CM=async function(e){let t=this.getOffsetParent||SM,n=this.getDimensions,r=await n(e.floating);return{reference:yM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wM(e){return Jj(e).direction===`rtl`}var TM={convertOffsetParentRelativeRectToViewportRelativeRect:lM,getDocumentElement:Mj,getClippingRect:_M,getOffsetParent:SM,getElementRects:CM,getClientRects:uM,getDimensions:vM,getScale:nM,isElement:Pj,isRTL:wM};function EM(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DM(e,t,n){let r=null,i,a=Mj(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=WA(d),h=WA(a.clientWidth-(u+f)),g=WA(a.clientHeight-(d+p)),_=WA(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:HA(0,VA(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!EM(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=jj(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function OM(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=tM(e),u=i||a?[...l?Qj(l):[],...t?Qj(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?DM(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?oM(e):null;c&&g();function g(){let t=oM(e);h&&!EM(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 kM=Tj,AM=Ej,jM=yj,MM=Oj,NM=Sj,PM=vj,FM=Dj,IM=(e,t,n)=>{let r=new Map,i=n??{},a={...TM,...i.platform,_c:r};return _j(e,t,{...i,platform:a})},LM=typeof document<`u`?M.useLayoutEffect:function(){};function RM(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(!RM(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)&&!RM(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function zM(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function BM(e,t){let n=zM(e);return Math.round(t*n)/n}function VM(e){let t=M.useRef(e);return LM(()=>{t.current=e}),t}function HM(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]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=M.useState(r);RM(f,r)||p(r);let[m,h]=M.useState(null),[g,_]=M.useState(null),v=M.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=M.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=M.useRef(null),C=M.useRef(null),w=M.useRef(u),T=c!=null,E=VM(c),D=VM(i),O=VM(l),k=M.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),IM(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!RM(w.current,t)&&(w.current=t,dT.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);LM(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=M.useRef(!1);LM(()=>(A.current=!0,()=>{A.current=!1}),[]),LM(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=M.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ee=M.useMemo(()=>({reference:b,floating:x}),[b,x]),te=M.useMemo(()=>{let e={position:n,left:0,top:0};if(!ee.floating)return e;let t=BM(ee.floating,u.x),r=BM(ee.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...zM(ee.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ee.floating,u.x,u.y]);return M.useMemo(()=>({...u,update:k,refs:j,elements:ee,floatingStyles:te}),[u,k,j,ee,te])}var UM=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:PM({element:r.current,padding:i}).fn(n):r?PM({element:r,padding:i}).fn(n):{}}}},WM=(e,t)=>{let n=kM(e);return{name:n.name,fn:n.fn,options:[e,t]}},GM=(e,t)=>{let n=AM(e);return{name:n.name,fn:n.fn,options:[e,t]}},KM=(e,t)=>({fn:FM(e).fn,options:[e,t]}),qM=(e,t)=>{let n=jM(e);return{name:n.name,fn:n.fn,options:[e,t]}},JM=(e,t)=>{let n=MM(e);return{name:n.name,fn:n.fn,options:[e,t]}},YM=(e,t)=>{let n=NM(e);return{name:n.name,fn:n.fn,options:[e,t]}},XM=(e,t)=>{let n=UM(e);return{name:n.name,fn:n.fn,options:[e,t]}},ZM=Object.defineProperty,QM=M.forwardRef(((e,t)=>ZM(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(MT.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),$M=Object.defineProperty,eN=(e,t)=>$M(e,`name`,{value:t,configurable:!0}),tN={Partial:`partial`,Always:`always`},nN={Optimized:`optimized`,Always:`always`},rN=`Popper`,[iN,aN]=VT(rN),[oN,sN]=iN(rN),cN=eN(e=>{let{__scopePopper:t,children:n}=e,[r,i]=M.useState(null),[a,o]=M.useState(void 0);return(0,L.jsx)(oN,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),lN=`PopperAnchor`,uN=M.forwardRef(eN(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=sN(lN,n),o=M.useRef(null),s=a.onAnchorChange,c=uT(t,M.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=M.useRef(null);M.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&bN(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(MT.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),dN=`PopperContent`,[fN,pN]=iN(dN),mN=M.forwardRef(eN(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=tN.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=nN.Optimized,onPlaced:m,...h}=e,g=sN(dN,n),[_,v]=M.useState(null),y=uT(t,v),[b,x]=M.useState(null),S=SA(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(vN),altBoundary:O},{refs:A,floatingStyles:j,placement:ee,isPositioned:te,middlewareData:ne}=HM({strategy:`fixed`,placement:T,whileElementsMounted:eN((...e)=>OM(...e,{animationFrame:p===nN.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[WM({mainAxis:i+w,alignmentAxis:o}),c&&GM({mainAxis:!0,crossAxis:!1,...d===tN.Partial?{limiter:KM()}:{},...k}),c&&qM({...k}),JM({...k,apply:eN(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&XM({element:b,padding:s}),yN({arrowWidth:C,arrowHeight:w}),f&&YM(O?{strategy:`referenceHidden`,...k}:{strategy:`referenceHidden`,padding:k.padding,altBoundary:k.altBoundary})]}),N=g.setPlacementState;UT(()=>(N(ee),()=>{N(void 0)}),[ee,N]);let[re,ie]=bN(ee),ae=aD(m);UT(()=>{te&&ae?.()},[te,ae]);let oe=ne.arrow?.x,se=ne.arrow?.y,ce=ne.arrow?.centerOffset!==0,[le,ue]=M.useState();return UT(()=>{_&&ue(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:te?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[ne.transformOrigin?.x,ne.transformOrigin?.y].join(` `),...ne.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(fN,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:x,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,L.jsx)(MT.div,{"data-side":re,"data-align":ie,...h,ref:y,style:{...h.style,animation:te?h.style?.animation:`none`}})})})},`PopperContent`)),hN=`PopperArrow`,gN={top:`bottom`,right:`left`,bottom:`top`,left:`right`},_N=M.forwardRef(eN(function(e,t){let{__scopePopper:n,...r}=e,i=pN(hN,n),a=gN[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(QM,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function vN(e){return e!==null}eN(vN,`isNotNull`);var yN=eN(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=bN(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function bN(e){let[t,n=`center`]=e.split(`-`);return[t,n]}eN(bN,`getSideAndAlignFromPlacement`);var xN=Object.defineProperty,SN=(e,t)=>xN(e,`name`,{value:t,configurable:!0}),CN=!1;function wN(){let[e,t]=M.useState(CN);return M.useEffect(()=>{CN||(CN=!0,t(!0))},[]),e}SN(wN,`useIsHydrated`);var TN=M.useSyncExternalStore;function EN(){return()=>{}}SN(EN,`subscribe`);function DN(){return TN(EN,()=>!0,()=>!1)}SN(DN,`useIsHydratedModern`);var pre=typeof TN==`function`?DN:wN,mre=Object.defineProperty,ON=(e,t)=>mre(e,`name`,{value:t,configurable:!0}),kN=`rovingFocusGroup.onEntryFocus`,hre={bubbles:!1,cancelable:!0},AN=`RovingFocusGroup`,[jN,MN,gre]=KT(AN),[_re,NN]=VT(AN,[gre]),PN={Vertical:`vertical`,Horizontal:`horizontal`},vre={LTR:`ltr`,RTL:`rtl`},[yre,bre]=_re(AN),FN=M.forwardRef(ON(function(e,t){return(0,L.jsx)(jN.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(jN.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(xre,{...e,ref:t})})})},`RovingFocusGroup`)),xre=M.forwardRef(ON(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=M.useRef(null),p=uT(t,f),m=tD(a),[h,g]=yE({prop:o,defaultProp:s??null,onChange:c,caller:AN}),[_,v]=M.useState(!1),y=aD(l),b=MN(n),x=M.useRef(!1),[S,C]=M.useState(0);return M.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(kN,y),()=>e.removeEventListener(kN,y)},[y]),(0,L.jsx)(yre,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:M.useCallback(e=>g(e),[g]),onItemShiftTab:M.useCallback(()=>v(!0),[]),onFocusableItemAdd:M.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:M.useCallback(()=>C(e=>e-1),[]),children:(0,L.jsx)(MT.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:X(e.onMouseDown,()=>{x.current=!0}),onFocus:X(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(kN,hre);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);zN([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:X(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),Sre=`RovingFocusGroupItem`,IN=M.forwardRef(ON(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=LE(),l=a||c,u=bre(Sre,n),d=u.currentTabStopId===l,f=MN(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=pre();return UT(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),M.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,L.jsx)(jN.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(MT.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:X(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:X(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:X(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=RN(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?BN(n,r+1):n.slice(r+1)}setTimeout(()=>zN(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Cre={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function LN(e,t){return t===vre.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}ON(LN,`getDirectionAwareKey`);function RN(e,t,n){let r=LN(e.key,n);if(!(t===PN.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===PN.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Cre[r]}ON(RN,`getFocusIntent`);function zN(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}ON(zN,`focusFirst`);function BN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}ON(BN,`wrapArray`);var wre=Object.defineProperty,VN=(e,t)=>wre(e,`name`,{value:t,configurable:!0}),HN=[`Enter`,` `],Tre=[`ArrowDown`,`PageUp`,`Home`],UN=[`ArrowUp`,`PageDown`,`End`],Ere=[...Tre,...UN];[...HN],[...HN];var WN=`Menu`,[GN,Dre,Ore]=KT(WN),[KN,qN]=VT(WN,[Ore,aN,NN]),JN=aN(),YN=NN(),[kre,XN]=KN(WN),[Are,ZN]=KN(WN),QN=VN(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=JN(t),[c,l]=M.useState(null),u=M.useRef(!1),d=aD(a),f=tD(i);return M.useEffect(()=>{let e=VN(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=VN(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),M.useEffect(()=>{if(!n)return;let e=VN(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,L.jsx)(cN,{...s,children:(0,L.jsx)(kre,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,L.jsx)(Are,{scope:t,onClose:M.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),$N=M.forwardRef(VN(function(e,t){let{__scopeMenu:n,...r}=e,i=JN(n);return(0,L.jsx)(uN,{...i,...r,ref:t})},`MenuAnchor`)),eP=`MenuPortal`,[jre,Mre]=KN(eP,{forceMount:void 0}),tP=VN(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=XN(eP,t);return(0,L.jsx)(jre,{scope:t,forceMount:n,children:(0,L.jsx)(DE,{present:n||a.open,children:(0,L.jsx)(HD,{asChild:!0,container:i,children:r})})})},`MenuPortal`),nP=`MenuContent`,[Nre,rP]=KN(nP),iP=M.forwardRef(VN(function(e,t){let n=Mre(nP,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=XN(nP,e.__scopeMenu),o=ZN(nP,e.__scopeMenu);return(0,L.jsx)(GN.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(DE,{present:r||a.open,children:(0,L.jsx)(GN.Slot,{scope:e.__scopeMenu,children:o.modal?(0,L.jsx)(Pre,{...i,ref:t}):(0,L.jsx)(Fre,{...i,ref:t})})})})},`MenuContent`)),Pre=M.forwardRef(VN(function(e,t){let n=XN(nP,e.__scopeMenu),r=M.useRef(null),i=uT(t,r);return M.useEffect(()=>{let e=r.current;if(e)return fk(e)},[]),(0,L.jsx)(aP,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Fre=M.forwardRef(VN(function(e,t){let n=XN(nP,e.__scopeMenu);return(0,L.jsx)(aP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Ire=mT(`MenuContent.ScrollLock`),aP=M.forwardRef(VN(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=XN(nP,n),_=ZN(nP,n),v=JN(n),y=YN(n),b=Dre(n),[x,S]=M.useState(null),C=M.useRef(null),[w,T]=M.useState(null);kD(w);let{nodes:E,registry:D}=OD(),O=!!(i||m),k=uT(t,C,g.onContentChange,T),A=M.useRef(0),j=M.useRef(``),ee=M.useRef(0),te=M.useRef(null),ne=M.useRef(`right`),N=M.useRef(0),re=M.useMemo(()=>m?[C,...E.map(e=>({current:e}))]:[],[C,E,m]),ie=m?rk:M.Fragment,ae=m?{as:Ire,allowPinchZoom:!0,shards:re}:void 0,oe=VN(e=>{let t=j.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=pP(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){j.current=e,window.clearTimeout(A.current),e!==``&&(A.current=window.setTimeout(()=>s(``),1e3))}VN(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);M.useEffect(()=>()=>window.clearTimeout(A.current),[]),JD();let se=M.useCallback(e=>ne.current===te.current?.side&&hP(e,te.current?.area),[]);return(0,L.jsx)(Nre,{scope:n,searchRef:j,onItemEnter:M.useCallback(e=>{se(e)&&e.preventDefault()},[se]),onItemLeave:M.useCallback(e=>{se(e)||(C.current?.focus(),S(null))},[se]),onTriggerLeave:M.useCallback(e=>{se(e)&&e.preventDefault()},[se]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:M.useCallback(e=>{te.current=e},[]),children:(0,L.jsx)(DD,{registry:O?D:null,children:(0,L.jsx)(ie,{...ae,children:(0,L.jsx)(TD,{asChild:!0,trapped:i,branches:E,onMountAutoFocus:X(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,L.jsx)(pD,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,L.jsx)(FN,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:X(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,L.jsx)(mN,{role:`menu`,"aria-orientation":`vertical`,"data-state":lP(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:k,style:{outline:`none`,...h.style},onKeyDown:X(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&oe(e.key));let i=C.current;if(e.target!==i||!Ere.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);UN.includes(e.key)&&a.reverse(),dP(a)}),onBlur:X(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),j.current=``)}),onPointerMove:X(e.onPointerMove,gP(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?`right`:`left`;ne.current=t,N.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),oP=`MenuItem`,sP=`menu.itemSelect`,cP=M.forwardRef(VN(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=M.useRef(null),o=ZN(oP,e.__scopeMenu),s=rP(oP,e.__scopeMenu),c=uT(t,a),l=M.useRef(!1),u=VN(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(sP,{bubbles:!0,cancelable:!0});e.addEventListener(sP,e=>r?.(e),{once:!0}),NT(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,L.jsx)(Lre,{...i,ref:c,disabled:n,onClick:X(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:X(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:X(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&HN.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Lre=M.forwardRef(VN(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=rP(oP,n),s=YN(n),c=M.useRef(null),l=uT(t,c),[u,d]=M.useState(!1),[f,p]=M.useState(``);return M.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,L.jsx)(GN.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,L.jsx)(IN,{asChild:!0,...s,focusable:!r,children:(0,L.jsx)(MT.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:X(e.onPointerMove,gP(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:X(e.onPointerLeave,gP(e=>o.onItemLeave(e))),onFocus:X(e.onFocus,()=>d(!0)),onBlur:X(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Rre,zre]=KN(`MenuRadioGroup`,{value:void 0,onValueChange:VN(()=>{},`onValueChange`)}),[Bre,Vre]=KN(`MenuItemIndicator`,{checked:!1}),Hre=M.forwardRef(VN(function(e,t){let{__scopeMenu:n,...r}=e;return(0,L.jsx)(MT.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[Ure,Wre]=KN(`MenuSub`);function lP(e){return e?`open`:`closed`}VN(lP,`getOpenState`);function uP(e){return e===`indeterminate`}VN(uP,`isIndeterminate`);function Gre(e){return uP(e)?`indeterminate`:e?`checked`:`unchecked`}VN(Gre,`getCheckedState`);function dP(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}VN(dP,`focusFirst`);function fP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}VN(fP,`wrapArray`);function pP(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=fP(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}VN(pP,`getNextMatch`);function mP(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}VN(mP,`isPointInPolygon`);function hP(e,t){return t?mP({x:e.clientX,y:e.clientY},t):!1}VN(hP,`isPointerInGraceArea`);function gP(e){return t=>t.pointerType===`mouse`?e(t):void 0}VN(gP,`whenMouse`);var Kre=Object.defineProperty,_P=(e,t)=>Kre(e,`name`,{value:t,configurable:!0}),vP=`ContextMenu`,[qre,Jre]=VT(vP,[qN]),yP=qN(),[Yre,bP]=qre(vP),Xre=_P(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:a,modal:o=!0}=e,s=M.useRef(!1),[c,l]=yE({prop:i,defaultProp:!1,onChange:r,caller:vP}),u=yP(t);return(0,L.jsx)(Yre,{scope:t,open:c,onOpenChange:l,modal:o,hasInteractedRef:s,children:(0,L.jsx)(QN,{...u,dir:a,open:c,onOpenChange:l,modal:o,children:n})})},`ContextMenu`),Zre=`ContextMenuTrigger`,Qre=M.forwardRef(_P(function(e,t){let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=bP(Zre,n),o=yP(n),[s,c]=M.useState({x:0,y:0}),l=M.useMemo(()=>({current:{getBoundingClientRect:_P(()=>DOMRect.fromRect({width:0,height:0,...s}),`getBoundingClientRect`)}}),[s]),u=M.useRef(0),d=M.useCallback(()=>window.clearTimeout(u.current),[]),f=_P(e=>{a.hasInteractedRef.current=!0,c({x:e.clientX,y:e.clientY}),a.onOpenChange(!0)},`handleOpen`);return M.useEffect(()=>d,[d]),M.useEffect(()=>void(r&&d()),[r,d]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)($N,{...o,virtualRef:l}),(0,L.jsx)(MT.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:X(e.onContextMenu,e=>{d(),f(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:X(e.onPointerDown,xP(e=>{d(),a.open&&a.onOpenChange(!1),u.current=window.setTimeout(()=>f(e),700)})),onPointerMove:r?e.onPointerMove:X(e.onPointerMove,xP(d)),onPointerCancel:r?e.onPointerCancel:X(e.onPointerCancel,xP(d)),onPointerUp:r?e.onPointerUp:X(e.onPointerUp,xP(d))})]})},`ContextMenuTrigger`)),$re=_P(e=>{let{__scopeContextMenu:t,...n}=e,r=yP(t);return(0,L.jsx)(tP,{...r,...n})},`ContextMenuPortal`),eie=`ContextMenuContent`,tie=M.forwardRef(_P(function(e,t){let{__scopeContextMenu:n,...r}=e,i=bP(eie,n),a=yP(n),o=M.useRef(!1);return(0,L.jsx)(iP,{...a,side:`right`,sideOffset:2,align:`start`,...r,ref:t,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`ContextMenuContent`)),nie=M.forwardRef(_P(function(e,t){let{__scopeContextMenu:n,...r}=e,i=yP(n);return(0,L.jsx)(cP,{...i,...r,ref:t})},`ContextMenuItem`));function xP(e){return t=>t.pointerType===`mouse`?void 0:e(t)}_P(xP,`whenTouchOrPen`);var rie=Object.defineProperty,SP=(e,t)=>rie(e,`name`,{value:t,configurable:!0}),CP=`DropdownMenu`,[iie,aie]=VT(CP,[qN]),wP=qN(),[oie,TP]=iie(CP),sie=SP(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=wP(t),l=M.useRef(null),[u,d]=yE({prop:i,defaultProp:a??!1,onChange:o,caller:CP});return(0,L.jsx)(oie,{scope:t,triggerId:LE(),triggerRef:l,contentId:LE(),open:u,onOpenChange:d,onOpenToggle:M.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,L.jsx)(QN,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),cie=`DropdownMenuTrigger`,lie=M.forwardRef(SP(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=TP(cie,n),o=wP(n),s=uT(t,a.triggerRef);return(0,L.jsx)($N,{asChild:!0,...o,children:(0,L.jsx)(MT.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:X(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:X(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),uie=SP(e=>{let{__scopeDropdownMenu:t,...n}=e,r=wP(t);return(0,L.jsx)(tP,{...r,...n})},`DropdownMenuPortal`),die=`DropdownMenuContent`,fie=M.forwardRef(SP(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=TP(die,n),a=wP(n),o=M.useRef(!1);return(0,L.jsx)(iP,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:X(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),pie=M.forwardRef(SP(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=wP(n);return(0,L.jsx)(cP,{...i,...r,ref:t})},`DropdownMenuItem`)),mie=M.forwardRef(SP(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=wP(n);return(0,L.jsx)(Hre,{...i,...r,ref:t})},`DropdownMenuSeparator`)),hie=Object.defineProperty,gie=M.forwardRef(((e,t)=>hie(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,L.jsx)(MT.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),_ie=Object.defineProperty,vie=(e,t)=>_ie(e,`name`,{value:t,configurable:!0});function EP(e,[t,n]){return Math.min(n,Math.max(t,e))}vie(EP,`clamp`);var yie=Object.defineProperty,DP=(e,t)=>yie(e,`name`,{value:t,configurable:!0}),OP=`Popover`,[kP,bie]=VT(OP,[aN]),AP=aN(),[xie,jP]=kP(OP),Sie=DP(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=AP(t),c=M.useRef(null),[l,u]=M.useState(!1),[d,f]=M.useState(0),[p,m]=M.useState(0),[h,g]=yE({prop:r,defaultProp:i??!1,onChange:a,caller:OP});return(0,L.jsx)(cN,{...s,children:(0,L.jsx)(xie,{scope:t,contentId:LE(),titleId:LE(),descriptionId:LE(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:M.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:M.useCallback(()=>u(!0),[]),onCustomAnchorRemove:M.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Cie=`PopoverAnchor`,wie=M.forwardRef(DP(function(e,t){let{__scopePopover:n,...r}=e,i=jP(Cie,n),a=AP(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return M.useEffect(()=>(o(),()=>s()),[o,s]),(0,L.jsx)(uN,{...a,...r,ref:t})},`PopoverAnchor`)),Tie=`PopoverTrigger`,Eie=M.forwardRef(DP(function(e,t){let{__scopePopover:n,...r}=e,i=jP(Tie,n),a=AP(n),o=uT(t,i.triggerRef),s=(0,L.jsx)(MT.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":FP(i.open),...r,ref:o,onClick:X(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(uN,{asChild:!0,...a,children:s})},`PopoverTrigger`)),MP=`PopoverPortal`,[Die,Oie]=kP(MP,{forceMount:void 0}),kie=DP(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=jP(MP,t);return(0,L.jsx)(Die,{scope:t,forceMount:n,children:(0,L.jsx)(DE,{present:n||a.open,children:(0,L.jsx)(HD,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),NP=`PopoverContent`,Aie=M.forwardRef(DP(function(e,t){let n=Oie(NP,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=jP(NP,e.__scopePopover);return(0,L.jsx)(DE,{present:r||a.open,children:a.modal?(0,L.jsx)(Mie,{...i,ref:t}):(0,L.jsx)(Nie,{...i,ref:t})})},`PopoverContent`)),jie=mT(`PopoverContent.RemoveScroll`),Mie=M.forwardRef(DP(function(e,t){let n=jP(NP,e.__scopePopover),r=M.useRef(null),i=uT(t,r),a=M.useRef(!1),{nodes:o,registry:s}=OD();return M.useEffect(()=>{let e=r.current;if(e)return fk(e)},[]),(0,L.jsx)(rk,{as:jie,allowPinchZoom:!0,shards:M.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,L.jsx)(PP,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Nie=M.forwardRef(DP(function(e,t){let n=jP(NP,e.__scopePopover),r=M.useRef(!1),i=M.useRef(!1);return(0,L.jsx)(PP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),PP=M.forwardRef(DP(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=jP(NP,n),g=AP(n),[_,v]=M.useState(null),y=uT(t,v);return kD(_),JD(),(0,L.jsx)(DD,{registry:p,children:(0,L.jsx)(TD,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(pD,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,L.jsx)(mN,{"data-state":FP(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?IP(d,h.descriptionId):d,...g,...m,ref:y,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function FP(e){return e?`open`:`closed`}DP(FP,`getState`);function IP(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}DP(IP,`concatAriaDescribedby`);var Pie=Object.defineProperty,LP=(e,t)=>Pie(e,`name`,{value:t,configurable:!0});function RP(e,t){return M.useReducer((e,n)=>t[e][n]??e,e)}LP(RP,`useStateMachine`);var zP={Auto:`auto`,Always:`always`,Scroll:`scroll`,Hover:`hover`},BP={Vertical:`vertical`,Horizontal:`horizontal`},VP={LTR:`ltr`,RTL:`rtl`},HP=`ScrollArea`,[UP,Fie]=VT(HP),[Iie,WP]=UP(HP),Lie=M.forwardRef(LP(function(e,t){let{__scopeScrollArea:n,type:r=zP.Hover,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=M.useState(null),[l,u]=M.useState(null),[d,f]=M.useState(null),[p,m]=M.useState(null),[h,g]=M.useState(null),[_,v]=M.useState(0),[y,b]=M.useState(0),[x,S]=M.useState(!1),[C,w]=M.useState(!1),T=uT(t,c),E=tD(i);return(0,L.jsx)(Iie,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,L.jsx)(MT.div,{dir:E,...o,ref:T,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})},`ScrollArea`)),GP=`ScrollAreaViewport`,KP=_T(GP),Rie=M.forwardRef(LP(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,disableImplicitContentElement:a,...o}=e,s=WP(GP,n),c=uT(t,M.useRef(null),s.onViewportChange),l=M.isValidElement(r);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(zie,{nonce:i}),(0,L.jsx)(MT.div,{"data-radix-scroll-area-viewport":``,...o,ref:c,style:{overflowX:s.scrollbarXEnabled?`scroll`:`hidden`,overflowY:s.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:a?r:l?(0,L.jsx)(KP,{child:r,children:e=>(0,L.jsx)(qP,{__scopeScrollArea:n,children:e})}):(0,L.jsx)(KP,{children:(0,L.jsx)(qP,{__scopeScrollArea:n,children:r})})})]})},`ScrollAreaViewport`)),zie=M.memo(LP(function({nonce:e}){return(0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),Bie=`ScrollAreaContent`,qP=M.forwardRef(LP(function(e,t){let{__scopeScrollArea:n,children:r,...i}=e,a=uT(t,WP(Bie,n).onContentChange);return(0,L.jsx)(MT.div,{...i,ref:a,style:{minWidth:`100%`,display:`table`,...e.style},children:r})},`ScrollAreaContent`)),JP=`ScrollAreaScrollbar`,Vie=M.forwardRef(LP(function(e,t){let{forceMount:n,...r}=e,i=WP(JP,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===BP.Horizontal;return M.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===zP.Hover?(0,L.jsx)(Hie,{...r,ref:t,forceMount:n}):i.type===zP.Scroll?(0,L.jsx)(Uie,{...r,ref:t,forceMount:n}):i.type===zP.Auto?(0,L.jsx)(YP,{...r,ref:t,forceMount:n}):i.type===zP.Always?(0,L.jsx)(XP,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),Hie=M.forwardRef(LP(function(e,t){let{forceMount:n,...r}=e,i=WP(JP,e.__scopeScrollArea),[a,o]=M.useState(!1);return M.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=LP(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=LP(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,L.jsx)(DE,{present:n||a,children:(0,L.jsx)(YP,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),Uie=M.forwardRef(LP(function(e,t){let{forceMount:n,...r}=e,i=WP(JP,e.__scopeScrollArea),a=e.orientation===BP.Horizontal,o=cF(()=>c(`SCROLL_END`),100),[s,c]=RP(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return M.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),M.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=LP(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,L.jsx)(DE,{present:n||s!==`hidden`,children:(0,L.jsx)(XP,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:X(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:X(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),YP=M.forwardRef(LP(function(e,t){let n=WP(JP,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=M.useState(!1),s=e.orientation===BP.Horizontal,c=cF(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return lF(n.viewport,c),lF(n.content,c),(0,L.jsx)(DE,{present:r||a,children:(0,L.jsx)(XP,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),XP=M.forwardRef(LP(function(e,t){let{orientation:n=BP.Vertical,...r}=e,i=WP(JP,e.__scopeScrollArea),a=M.useRef(null),o=M.useRef(0),[s,c]=M.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=nF(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:LP(e=>a.current=e,`onThumbChange`),onThumbPointerUp:LP(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:LP(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return iF(e,o.current,s,t)}return LP(d,`getScrollPosition`),n===BP.Horizontal?(0,L.jsx)(Wie,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=aF(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===BP.Vertical?(0,L.jsx)(Gie,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=aF(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),Wie=M.forwardRef(LP(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=WP(JP,e.__scopeScrollArea),[o,s]=M.useState(),c=M.useRef(null),l=uT(t,c,a.onScrollbarXChange);return M.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,L.jsx)(QP,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===VP.RTL?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===VP.LTR?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":rF(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),sF(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:tF(o.paddingLeft),paddingEnd:tF(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),Gie=M.forwardRef(LP(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=WP(JP,e.__scopeScrollArea),[o,s]=M.useState(),c=M.useRef(null),l=uT(t,c,a.onScrollbarYChange);return M.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,L.jsx)(QP,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===VP.LTR?0:void 0,left:a.dir===VP.RTL?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":rF(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),sF(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:tF(o.paddingTop),paddingEnd:tF(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[Kie,ZP]=UP(JP),QP=M.forwardRef(LP(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=WP(JP,n),[m,h]=M.useState(null),g=uT(t,h),_=M.useRef(null),v=M.useRef(``),y=p.viewport,b=r.content-r.viewport,x=aD(u),S=aD(c),C=cF(d,10);function w(e){if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;l({x:t,y:n})}}return LP(w,`handleDragScroll`),M.useEffect(()=>{let e=LP(e=>{let t=e.target;m?.contains(t)&&x(e,b)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),M.useEffect(S,[r,S]),lF(m,C),lF(p.content,C),(0,L.jsx)(Kie,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:aD(a),onThumbPointerUp:aD(o),onThumbPositionChange:S,onThumbPointerDown:aD(s),children:(0,L.jsx)(MT.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:X(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),w(e))}),onPointerMove:X(e.onPointerMove,w),onPointerUp:X(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})},`ScrollAreaScrollbarImpl`)),$P=`ScrollAreaThumb`,qie=M.forwardRef(LP(function(e,t){let{forceMount:n,...r}=e,i=ZP($P,e.__scopeScrollArea);return(0,L.jsx)(DE,{present:n||i.hasThumb,children:(0,L.jsx)(Jie,{ref:t,...r})})},`ScrollAreaThumb`)),Jie=M.forwardRef(LP(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=WP($P,n),o=ZP($P,n),{onThumbPositionChange:s}=o,c=uT(t,o.onThumbChange),l=M.useRef(void 0),u=cF(()=>{l.current&&=(l.current(),void 0)},100);return M.useEffect(()=>{let e=a.viewport;if(e){let t=LP(()=>{if(u(),!l.current){let t=Zie(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,L.jsx)(MT.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:X(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:X(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),eF=`ScrollAreaCorner`,Yie=M.forwardRef(LP(function(e,t){let n=WP(eF,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==zP.Scroll&&r?(0,L.jsx)(Xie,{...e,ref:t}):null},`ScrollAreaCorner`)),Xie=M.forwardRef(LP(function(e,t){let{__scopeScrollArea:n,...r}=e,i=WP(eF,n),[a,o]=M.useState(0),[s,c]=M.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return lF(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),lF(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),M.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,L.jsx)(MT.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===VP.LTR?0:void 0,left:i.dir===VP.RTL?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function tF(e){return e?parseInt(e,10):0}LP(tF,`toInt`);function nF(e,t){let n=e/t;return isNaN(n)?0:n}LP(nF,`getThumbRatio`);function rF(e){let t=nF(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}LP(rF,`getThumbSize`);function iF(e,t,n,r=VP.LTR){let i=rF(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===VP.LTR?[0,u]:[u*-1,0];return oF([c,l],d)(e)}LP(iF,`getScrollPositionFromPointer`);function aF(e,t,n=VP.LTR){let r=rF(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=EP(e,n===VP.LTR?[0,o]:[o*-1,0]);return oF([0,o],[0,s])(c)}LP(aF,`getThumbOffsetFromScroll`);function oF(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}LP(oF,`linearScale`);function sF(e,t){return e>0&&e<t}LP(sF,`isScrollingWithinScrollbarBounds`);var Zie=LP((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}return LP(i,`loop`),i(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function cF(e,t){let n=aD(e),r=M.useRef(0);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),M.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}LP(cF,`useDebounceCallback`);function lF(e,t){let n=aD(t);UT(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}LP(lF,`useResizeObserver`);var Qie=Object.defineProperty,uF=(e,t)=>Qie(e,`name`,{value:t,configurable:!0}),dF={Horizontal:`horizontal`,Vertical:`vertical`},fF=dF.Horizontal,$ie=Object.values(dF),eae=M.forwardRef(uF(function(e,t){let{decorative:n,orientation:r=fF,...i}=e,a=pF(r)?r:fF,o=a===dF.Vertical?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,L.jsx)(MT.div,{"data-orientation":a,...s,...i,ref:t})},`Separator`));function pF(e){return $ie.includes(e)}uF(pF,`isValidOrientation`);var tae=Object.defineProperty,mF=(e,t)=>tae(e,`name`,{value:t,configurable:!0}),hF=`Switch`,[nae,rae]=VT(hF),[iae,gF]=nae(hF);function _F(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=yE({prop:n,defaultProp:i??!1,onChange:c,caller:hF}),[m,h]=M.useState(null),[g,_]=M.useState(null),[v,y]=M.useState(null),b={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,userClick:v,onUserClick:y,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,L.jsx)(iae,{scope:t,...b,children:vF(d)?d(b):r})}mF(_F,`SwitchProvider`);var aae=`SwitchTrigger`,oae=M.forwardRef(mF(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,onUserClick:f,isFormControl:p,bubbleInput:m}=gF(aae,e),h=uT(r,u),g=M.useRef(c);return M.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=mF(()=>d(g.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,L.jsx)(MT.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":yF(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:h,onClick:X(t,e=>{let t=e.isPropagationStopped();f({requestedChecked:!c,hasConsumerStoppedPropagation:t}),d(e=>!e),m&&p&&(t||e.stopPropagation())})})},`SwitchTrigger`)),sae=M.forwardRef(mF(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,L.jsx)(_F,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(oae,{...d,ref:t,__scopeSwitch:n}),e&&(0,L.jsx)(dae,{__scopeSwitch:n})]})})},`Switch`)),cae=`SwitchThumb`,lae=M.forwardRef(mF(function(e,t){let{__scopeSwitch:n,...r}=e,i=gF(cae,n);return(0,L.jsx)(MT.span,{"data-state":yF(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),uae=`SwitchBubbleInput`,dae=M.forwardRef(mF(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,userClick:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=gF(uae,e),h=uT(r,m),g=SA(i),_=M.useRef(!1),v=M.useRef(o),y=M.useRef(a),b=M.useRef(null);M.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=v.current!==o;v.current=o;let i=a!==null&&a!==y.current;if(y.current=a,i)b.current=r?null:a,r&&n.call(e,o),e.dispatchEvent(new Event(`click`,{bubbles:!a.hasConsumerStoppedPropagation}));else if(r){let t=b.current;b.current=null;let r=t?.requestedChecked===o;_.current=!0,n.call(e,o),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),_.current=!1}},[p,o,a]);let x=M.useRef(o);return(0,L.jsx)(MT.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??x.current,required:c,disabled:l,name:u,value:d,form:f,...n,tabIndex:-1,ref:h,onClick:X(t,e=>{_.current&&e.stopPropagation()}),style:{...n.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function vF(e){return typeof e==`function`}mF(vF,`isFunction`);function yF(e){return e?`checked`:`unchecked`}mF(yF,`getState`);var fae=Object.defineProperty,bF=(e,t)=>fae(e,`name`,{value:t,configurable:!0}),xF={Automatic:`automatic`,Manual:`manual`},SF=`Tabs`,[pae,mae]=VT(SF,[NN]),CF=NN(),[hae,wF]=pae(SF),gae=M.forwardRef(bF(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=xF.Automatic,...l}=e,u=tD(s),[d,f]=yE({prop:r,onChange:i,defaultProp:a??``,caller:SF});return(0,L.jsx)(hae,{scope:n,baseId:LE(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,L.jsx)(MT.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),_ae=`TabsList`,vae=M.forwardRef(bF(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=wF(_ae,n),o=CF(n);return(0,L.jsx)(FN,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,L.jsx)(MT.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),yae=`TabsTrigger`,bae=M.forwardRef(bF(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=wF(yae,n),s=CF(n),c=TF(o.baseId,r),l=EF(o.baseId,r),u=r===o.value;return(0,L.jsx)(IN,{asChild:!0,...s,focusable:!i,active:u,children:(0,L.jsx)(MT.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:X(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:X(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:X(e.onFocus,()=>{let e=o.activationMode!==xF.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),xae=`TabsContent`,Sae=M.forwardRef(bF(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=wF(xae,n),c=TF(s.baseId,r),l=EF(s.baseId,r),u=r===s.value,d=M.useRef(u);return M.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,L.jsx)(DE,{present:i||u,children:({present:n})=>(0,L.jsx)(MT.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function TF(e,t){return`${e}-trigger-${t}`}bF(TF,`makeTriggerId`);function EF(e,t){return`${e}-content-${t}`}bF(EF,`makeContentId`);var Cae=Object.defineProperty,wae=(e,t)=>Cae(e,`name`,{value:t,configurable:!0}),Tae=`Toggle`,Eae=M.forwardRef(wae(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=yE({prop:n,onChange:i,defaultProp:r??!1,caller:Tae});return(0,L.jsx)(MT.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:X(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Dae=Object.defineProperty,DF=(e,t)=>Dae(e,`name`,{value:t,configurable:!0}),OF=`ToggleGroup`,kF={Single:`single`,Multiple:`multiple`},[AF,Oae]=VT(OF,[NN]),jF=NN(),kae=M.forwardRef(DF(function(e,t){let{type:n,...r}=e;if(n===kF.Single)return(0,L.jsx)(Aae,{role:`radiogroup`,...r,ref:t});if(n===kF.Multiple)return(0,L.jsx)(jae,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${OF}\``)},`ToggleGroup`)),[MF,NF]=AF(OF),Aae=M.forwardRef(DF(function(e,t){let{value:n,defaultValue:r,onValueChange:i=DF(()=>{},`onValueChange`),...a}=e,[o,s]=yE({prop:n,defaultProp:r??``,onChange:i,caller:OF});return(0,L.jsx)(MF,{scope:e.__scopeToggleGroup,type:kF.Single,value:M.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:M.useCallback(()=>s(``),[s]),children:(0,L.jsx)(PF,{...a,ref:t})})},`ToggleGroupImplSingle`)),jae=M.forwardRef(DF(function(e,t){let{value:n,defaultValue:r,onValueChange:i=DF(()=>{},`onValueChange`),...a}=e,[o,s]=yE({prop:n,defaultProp:r??[],onChange:i,caller:OF}),c=M.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=M.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,L.jsx)(MF,{scope:e.__scopeToggleGroup,type:kF.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,L.jsx)(PF,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[Mae,Nae]=AF(OF),PF=M.forwardRef(DF(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=jF(n),u=tD(o),d={dir:u,...c};return(0,L.jsx)(Mae,{scope:n,rovingFocus:i,disabled:r,children:i?(0,L.jsx)(FN,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,L.jsx)(MT.div,{...d,ref:t})}):(0,L.jsx)(MT.div,{...d,ref:t})})},`ToggleGroupImpl`)),FF=`ToggleGroupItem`,Pae=M.forwardRef(DF(function(e,t){let n=NF(FF,e.__scopeToggleGroup),r=Nae(FF,e.__scopeToggleGroup),i=jF(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=M.useRef(null);return r.rovingFocus?(0,L.jsx)(IN,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,L.jsx)(IF,{...s,ref:t})}):(0,L.jsx)(IF,{...s,ref:t})},`ToggleGroupItem`)),IF=M.forwardRef(DF(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=NF(FF,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===kF.Single?o:void 0;return(0,L.jsx)(Eae,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),Fae=Object.defineProperty,LF=(e,t)=>Fae(e,`name`,{value:t,configurable:!0}),[RF,Iae]=VT(`Tooltip`,[aN]),zF=aN(),Lae=`TooltipProvider`,Rae=700,BF=`tooltip.open`,[zae,VF]=RF(Lae),Bae=LF(e=>{let{__scopeTooltip:t,delayDuration:n=Rae,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=M.useRef(!0),s=M.useRef(!1),c=M.useRef(0);return M.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(zae,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:M.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:M.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:M.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),HF=`Tooltip`,[Vae,UF]=RF(HF),Hae=LF(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=VF(HF,e.__scopeTooltip),l=zF(t),[u,d]=M.useState(null),[f,p]=M.useState(void 0),m=LE(),h=M.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=M.useRef(!1),[y,b]=yE({prop:r,defaultProp:i??!1,onChange:LF(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(BF))):c.onClose(),a?.(e)},`onChange`),caller:HF}),x=M.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=M.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=M.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=M.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);M.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,L.jsx)(cN,{...l,children:(0,L.jsx)(Vae,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:M.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:M.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),WF=`TooltipTrigger`,Uae=M.forwardRef(LF(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=UF(WF,n),o=VF(WF,n),s=zF(n),c=uT(t,M.useRef(null),a.onTriggerChange),l=M.useRef(!1),u=M.useRef(!1),d=M.useCallback(()=>l.current=!1,[]);return M.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,L.jsx)(uN,{asChild:!0,...s,children:(0,L.jsx)(MT.button,{"aria-describedby":a.open?eI(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:X(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:X(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:X(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:X(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:X(e.onBlur,a.onClose),onClick:X(e.onClick,a.onClose)})})},`TooltipTrigger`)),GF=`TooltipPortal`,[Wae,Gae]=RF(GF,{forceMount:void 0}),Kae=LF(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=UF(GF,t);return(0,L.jsx)(Wae,{scope:t,forceMount:n,children:(0,L.jsx)(DE,{present:n||a.open,children:(0,L.jsx)(HD,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),KF=`TooltipContent`,qae=M.forwardRef(LF(function(e,t){let n=Gae(KF,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=UF(KF,e.__scopeTooltip);return(0,L.jsx)(DE,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(qF,{side:i,...a,ref:t}):(0,L.jsx)(Jae,{side:i,...a,ref:t})})},`TooltipContent`)),Jae=M.forwardRef(LF(function(e,t){let n=UF(KF,e.__scopeTooltip),r=VF(KF,e.__scopeTooltip),i=M.useRef(null),a=uT(t,i),[o,s]=M.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=M.useCallback(()=>{s(null),d(!1)},[d]),p=M.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=YF(r,JF(r,n.getBoundingClientRect())),a=XF(t.getBoundingClientRect()),o=QF([...i,...a]);s(o),d(!0)},[d]);return M.useEffect(()=>()=>f(),[f]),M.useEffect(()=>{if(c&&u){let e=LF(e=>p(e,u),`handleTriggerLeave`),t=LF(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),M.useEffect(()=>{if(o){let e=LF(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ZF(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(qF,{...e,ref:a})},`TooltipContentHoverable`)),Yae=_T(`TooltipContent`),qF=M.forwardRef(LF(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=UF(KF,n),u=zF(n),{onClose:d}=l,[f,p]=M.useState(null),m=uT(t,p);kD(f),M.useEffect(()=>(document.addEventListener(BF,d),()=>document.removeEventListener(BF,d)),[d]),M.useEffect(()=>{if(l.trigger){let e=LF(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return UT(()=>(h(a),()=>{h(void 0)}),[a,h]),(0,L.jsx)(pD,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(mN,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(Yae,{children:r}),i?(0,L.jsx)(LT,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Xae=M.forwardRef(LF(function(e,t){let{__scopeTooltip:n,...r}=e,i=zF(n);return(0,L.jsx)(_N,{...i,...r,ref:t})},`TooltipArrow`));function JF(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}LF(JF,`getExitSideFromRect`);function YF(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}LF(YF,`getPaddedExitPoints`);function XF(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}LF(XF,`getPointsFromRect`);function ZF(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}LF(ZF,`isPointInPolygon`);function QF(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),$F(t)}LF(QF,`getHull`);function $F(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}LF($F,`getHullPresorted`);function eI(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}LF(eI,`concatAriaDescribedby`);var tI=768;function nI(){let[e,t]=M.useState(void 0);return M.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<tI)};return e.addEventListener(`change`,n),t(window.innerWidth<tI),()=>e.removeEventListener(`change`,n)},[]),!!e}var rI=aT(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Z({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?hT:`button`;return(0,L.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:I(rI({variant:t,size:n,className:e})),...i})}function iI({className:e,type:t,...n}){return(0,L.jsx)(`input`,{type:t,"data-slot":`input`,className:I(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function aI({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,L.jsx)(eae,{"data-slot":`separator`,decorative:n,orientation:t,className:I(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}var Zae=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Qae(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Zae(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var $ae=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},eoe=e=>{let t=$ae(e);return t.charAt(0).toUpperCase()+t.slice(1)},oI=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),sI={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 cI(e){return e!=null}function toe(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??sI.width,a=e.size??e.height??sI.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?oI(...c):oI(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??sI[`stroke-width`])*Number(e.size??e.width??sI.width)/Number(t.size??t.width??sI.width):t.strokeWidth??sI[`stroke-width`];return[`svg`,{...Object.entries(sI).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&cI(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&cI(t.width)&&{[r(`width`)]:t.width},...`height`in t&&cI(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 noe(e,t={}){return toe(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var roe=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ioe=(0,M.createContext)({}),aoe=()=>(0,M.useContext)(ioe),ooe=(0,M.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:v=``}=aoe()??{},y=!!c||roe(d),[b,x,S=[]]=noe(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:oI(v,s),hasA11yProp:y,attributes:d});return(0,M.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,M.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Q(e,t=[],n=[]){let r=typeof e==`string`?Qae(e,t,n):e,i=(0,M.forwardRef)(({className:e,...t},n)=>(0,M.createElement)(ooe,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=eoe(r.name)),i}var lI={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};lI.node;var soe=Q(lI),uI={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};uI.node;var coe=Q(uI),dI={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};dI.node;var loe=Q(dI),fI={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};fI.node;var pI=Q(fI),mI={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`}]]};mI.node;var hI=Q(mI),gI={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`}]]};gI.node;var _I=Q(gI),vI={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};vI.node;var yI=Q(vI),bI={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};bI.node;var uoe=Q(bI),xI={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};xI.node;var SI=Q(xI),CI={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`}]]};CI.node;var doe=Q(CI),wI={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};wI.node;var TI=Q(wI),EI={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`}]]};EI.node;var foe=Q(EI),DI={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};DI.node;var poe=Q(DI),OI={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};OI.node;var moe=Q(OI),kI={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};kI.node;var hoe=Q(kI),AI={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`}]]};AI.node;var goe=Q(AI),jI={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`]};jI.node;var MI=Q(jI),NI={name:`file-down`,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:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]};NI.node;var PI=Q(NI),FI={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};FI.node;var II=Q(FI),LI={name:`file-plus-corner`,size:24,node:[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]],aliases:[`file-plus-2`]};LI.node;var RI=Q(LI),zI={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`}]]};zI.node;var BI=Q(zI),VI={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 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 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};VI.node;var HI=Q(VI),UI={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`}]]};UI.node;var WI=Q(UI),GI={name:`folders`,size:24,node:[[`path`,{d:`M20 5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h2.5a1.5 1.5 0 0 1 1.2.6l.6.8a1.5 1.5 0 0 0 1.2.6z`,key:`a4852j`}],[`path`,{d:`M3 8.268a2 2 0 0 0-1 1.738V19a2 2 0 0 0 2 2h11a2 2 0 0 0 1.732-1`,key:`yxbcw3`}]]};GI.node;var KI=Q(GI),qI={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`}]]};qI.node;var JI=Q(qI),YI={name:`git-fork`,size:24,node:[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]};YI.node;var XI=Q(YI),ZI={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};ZI.node;var QI=Q(ZI),$I={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`}]]};$I.node;var eL=Q($I),tL={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`]};tL.node;var nL=Q(tL),rL={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`}]]};rL.node;var iL=Q(rL),aL={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`}]]};aL.node;var oL=Q(aL),sL={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};sL.node;var cL=Q(sL),lL={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};lL.node;var uL=Q(lL),dL={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`}]]};dL.node;var fL=Q(dL),pL={name:`message-square-plus`,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:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};pL.node;var mL=Q(pL),hL={name:`message-square`,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`}]]};hL.node;var gL=Q(hL),_L={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`}]]};_L.node;var vL=Q(_L),yL={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`}]]};yL.node;var bL=Q(yL),xL={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};xL.node;var SL=Q(xL),CL={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};CL.node;var wL=Q(CL),TL={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`}]]};TL.node;var EL=Q(TL),DL={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};DL.node;var OL=Q(DL),kL={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`}]]};kL.node;var AL=Q(kL),jL={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`}]]};jL.node;var ML=Q(jL),NL={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};NL.node;var PL=Q(NL),FL={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`}]]};FL.node;var IL=Q(FL),LL={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`}]]};LL.node;var RL=Q(LL),zL={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};zL.node;var BL=Q(zL),VL={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`}]]};VL.node;var HL=Q(VL),UL={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`}]]};UL.node;var WL=Q(UL),GL={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`}]]};GL.node;var KL=Q(GL),qL={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`]};qL.node;var JL=Q(qL),YL={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};YL.node;var XL=Q(YL),ZL={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`}]]};ZL.node;var QL=Q(ZL),$L={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`}]]};$L.node;var eR=Q($L),tR={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};tR.node;var nR=Q(tR),rR={name:`timer`,size:24,node:[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]};rR.node;var iR=Q(rR),aR={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`]};aR.node;var oR=Q(aR),sR={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`]};sR.node;var cR=Q(sR),lR={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`}]]};lR.node;var uR=Q(lR),dR={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};dR.node;var fR=Q(dR);function pR({...e}){return(0,L.jsx)(bk,{"data-slot":`sheet`,...e})}function mR({...e}){return(0,L.jsx)(Ek,{"data-slot":`sheet-portal`,...e})}function hR({className:e,...t}){return(0,L.jsx)(Ok,{"data-slot":`sheet-overlay`,className:I(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function gR({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,L.jsxs)(mR,{children:[(0,L.jsx)(hR,{}),(0,L.jsxs)(Mk,{"data-slot":`sheet-content`,"data-side":n,className:I(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...i,children:[t,r&&(0,L.jsx)(zk,{"data-slot":`sheet-close`,asChild:!0,children:(0,L.jsxs)(Z,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,L.jsx)(fR,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function _R({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`sheet-header`,className:I(`flex flex-col gap-0.5 p-4`,e),...t})}function vR({className:e,...t}){return(0,L.jsx)(Ik,{"data-slot":`sheet-title`,className:I(`font-heading text-base font-medium text-foreground`,e),...t})}function yR({className:e,...t}){return(0,L.jsx)(Lk,{"data-slot":`sheet-description`,className:I(`text-sm text-muted-foreground`,e),...t})}function bR({delayDuration:e=0,...t}){return(0,L.jsx)(Bae,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function xR({...e}){return(0,L.jsx)(Hae,{"data-slot":`tooltip`,...e})}function SR({...e}){return(0,L.jsx)(Uae,{"data-slot":`tooltip-trigger`,...e})}function CR({className:e,sideOffset:t=0,children:n,...r}){return(0,L.jsx)(Kae,{children:(0,L.jsxs)(qae,{"data-slot":`tooltip-content`,sideOffset:t,className:I(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,L.jsx)(Xae,{className:`fill-foreground`})]})})}function wR(e){return Number.isFinite(e)?Math.min(480,Math.max(200,Math.round(e))):256}function TR(e){return e<140?{open:!1}:{open:!0,width:wR(e)}}var ER=`sidebar_state`,DR=604800,OR=`18rem`,kR=`3rem`,AR=`b`,jR=M.createContext(null);function MR(){let e=M.useContext(jR);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function NR({defaultOpen:e=!0,open:t,onOpenChange:n,defaultWidth:r=256,onWidthChange:i,className:a,style:o,children:s,...c}){let l=nI(),[u,d]=M.useState(!1),[f,p]=M.useState(e),m=t??f,h=M.useCallback(e=>{let t=typeof e==`function`?e(m):e;p(t),n?.(t),document.cookie=`${ER}=${t}; path=/; max-age=${DR}`},[n,m]),[g,_]=M.useState(()=>wR(r)),[v,y]=M.useState(!1),b=M.useCallback(e=>{let t=wR(e);_(t),i?.(t)},[i]),x=M.useCallback(()=>l?d(e=>!e):h(e=>!e),[l,h,d]);M.useEffect(()=>{let e=e=>{e.key===AR&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x]);let S=m?`expanded`:`collapsed`,C=M.useMemo(()=>({state:S,open:m,setOpen:h,isMobile:l,openMobile:u,setOpenMobile:d,toggleSidebar:x,width:g,setWidth:b,resizing:v,setResizing:y}),[S,m,h,l,u,d,x,g,b,v]);return(0,L.jsx)(jR.Provider,{value:C,children:(0,L.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`${g}px`,"--sidebar-width-icon":kR,...o},className:I(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,a),...c,children:s})})}function PR({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u,resizing:d}=MR();return n===`none`?(0,L.jsx)(`div`,{"data-slot":`sidebar`,className:I(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,L.jsx)(pR,{open:l,onOpenChange:u,...o,children:(0,L.jsxs)(gR,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":OR},side:e,children:[(0,L.jsxs)(_R,{className:`sr-only`,children:[(0,L.jsx)(vR,{children:`Sidebar`}),(0,L.jsx)(yR,{children:`Displays the mobile sidebar.`})]}),(0,L.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,L.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-resizing":d,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,L.jsx)(`div`,{"data-slot":`sidebar-gap`,className:I(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear motion-reduce:transition-none group-data-[resizing=true]:transition-none`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,L.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:I(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear motion-reduce:transition-none group-data-[resizing=true]:transition-none data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,L.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function FR({className:e,onClick:t,...n}){let{toggleSidebar:r}=MR();return(0,L.jsxs)(Z,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:I(e),onClick:e=>{t?.(e),r()},...n,children:[(0,L.jsx)(wL,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function IR({className:e,onKeyDown:t,onDoubleClick:n,...r}){let{state:i,width:a,setWidth:o,setOpen:s,setResizing:c}=MR(),l=M.useRef(!1),u=M.useRef(`left`),d=i===`collapsed`,f=e=>{let t=TR(e);s(t.open),t.open&&o(t.width)},p=e=>u.current===`left`?e.clientX:window.innerWidth-e.clientX,m=()=>{l.current&&(l.current=!1,c(!1),document.body.style.removeProperty(`user-select`))},h=()=>u.current===`left`?1:-1;return(0,L.jsx)(`div`,{"data-sidebar":`rail`,"data-slot":`sidebar-rail`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,"aria-valuenow":d?0:a,"aria-valuemin":200,"aria-valuemax":480,tabIndex:0,title:`Drag to resize, double-click to reset`,onPointerDown:e=>{e.button===0&&(u.current=e.currentTarget.closest(`[data-side]`)?.dataset.side===`right`?`right`:`left`,l.current=!0,c(!0),document.body.style.userSelect=`none`,e.currentTarget.setPointerCapture?.(e.pointerId),e.preventDefault())},onPointerMove:e=>{l.current&&f(p(e))},onPointerUp:m,onPointerCancel:m,onLostPointerCapture:m,onDoubleClick:e=>{n?.(e),s(!0),o(256)},onKeyDown:e=>{if(t?.(e),e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let n=(e.key===`ArrowRight`?1:-1)*h()*16;d?n>0&&s(!0):f(a+n)},className:I(`absolute inset-y-0 z-20 hidden w-4 touch-none select-none outline-none sm:flex group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border focus-visible:after:bg-sidebar-ring active:after:bg-sidebar-ring ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`cursor-col-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...r})}function LR({className:e,...t}){return(0,L.jsx)(`main`,{"data-slot":`sidebar-inset`,className:I(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function RR({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:I(`flex flex-col gap-2 p-2`,e),...t})}function zR({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:I(`flex flex-col gap-2 p-2`,e),...t})}function BR({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:I(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function VR({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:I(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function HR({className:e,asChild:t=!1,...n}){let r=t?hT:`div`;return(0,L.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:I(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e),...n})}function UR({className:e,asChild:t=!1,...n}){let r=t?hT:`button`;return(0,L.jsx)(r,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:I(`absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,e),...n})}function WR({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:I(`w-full text-sm`,e),...t})}function GR({className:e,...t}){return(0,L.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:I(`flex w-full min-w-0 flex-col gap-0`,e),...t})}function KR({className:e,...t}){return(0,L.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:I(`group/menu-item relative`,e),...t})}var qR=aT(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function JR({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let s=e?hT:`button`,{isMobile:c,state:l}=MR(),u=(0,L.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:I(qR({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:u}),(0,L.jsx)(CR,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}function YR({className:e,showIcon:t=!1,...n}){let[r]=M.useState(()=>`${Math.floor(Math.random()*40)+50}%`);return(0,L.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:I(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,L.jsx)(Si,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,L.jsx)(Si,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":r}})]})}function XR({className:e,...t}){return(0,L.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:I(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden`,e),...t})}function ZR({className:e,...t}){return(0,L.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:I(`group/menu-sub-item relative`,e),...t})}var QR=(e,t)=>t===void 0?e:`${e}:m:${t}`,$R=(e,t)=>t===void 0?e:`m:${t}:${e}`,ez=`tau:`,tz={lastProject:`${ez}last-project`,lastModel:`${ez}last-model`,lastThinkingLevel:`${ez}last-thinking-level`,notifications:`${ez}notifications`,lastSeenAt:`${ez}last-seen-at`,seenBaseline:`${ez}seen-baseline`,sidebarMode:`tau-sidebar-mode`,closedProjects:`tau-sidebar-closed-projects`,projectOpenOverrides:`tau-sidebar-project-overrides`,collapsedThreads:`tau-sidebar-collapsed-threads`,collapsedMachines:`tau-sidebar-collapsed-machines`,theme:`${ez}theme`,sidebarOpen:`${ez}sidebar-open`,sidebarWidth:`${ez}sidebar-width`};function nz(e){try{return window.localStorage.getItem(e)}catch{return null}}function rz(e,t){try{window.localStorage.setItem(e,t)}catch{}}function iz(e,t){let n=nz(e);if(n===null)return null;try{let e=JSON.parse(n);return t(e)?e:null}catch{return null}}var az=e=>typeof e==`object`&&!!e&&typeof e.provider==`string`&&typeof e.modelId==`string`,oz=e=>typeof e==`object`&&!!e&&Object.values(e).every(e=>typeof e==`number`),sz=e=>e===`system`||e===`light`||e===`dark`,cz=new Set,lz=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),uz=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.values(e).every(e=>typeof e==`boolean`),dz=e=>Object.fromEntries(e.map(e=>[e,!1])),fz={getSidebarMode:()=>nz(tz.sidebarMode)===`projects`?`projects`:`threads`,setSidebarMode:e=>rz(tz.sidebarMode,e),getSidebarOpen:()=>nz(tz.sidebarOpen)!==`closed`,setSidebarOpen:e=>rz(tz.sidebarOpen,e?`open`:`closed`),getSidebarWidth:()=>{let e=nz(tz.sidebarWidth);return e===null?256:wR(Number(e))},setSidebarWidth:e=>rz(tz.sidebarWidth,String(wR(e))),getProjectOpenOverrides:e=>({...dz(iz(QR(tz.closedProjects,e),lz)??[]),...iz(QR(tz.projectOpenOverrides,e),uz)??{}}),setProjectOpenOverrides:(e,t)=>rz(QR(tz.projectOpenOverrides,t),JSON.stringify(e)),getCollapsedThreads:e=>iz(QR(tz.collapsedThreads,e),lz)??[],setCollapsedThreads:(e,t)=>rz(QR(tz.collapsedThreads,t),JSON.stringify(e)),getCollapsedMachines:()=>iz(tz.collapsedMachines,lz)??[],setCollapsedMachines:e=>rz(tz.collapsedMachines,JSON.stringify(e)),getTheme:()=>{let e=nz(tz.theme);return sz(e)?e:`system`},setTheme:e=>{rz(tz.theme,e);for(let e of cz)e()},subscribeTheme:e=>{cz.add(e);let t=t=>{t.key===tz.theme&&e()};return window.addEventListener(`storage`,t),()=>{cz.delete(e),window.removeEventListener(`storage`,t)}},getLastProjectId:e=>nz(QR(tz.lastProject,e)),setLastProjectId:(e,t)=>rz(QR(tz.lastProject,t),e),getLastModel:e=>iz(QR(tz.lastModel,e),az),setLastModel:(e,t)=>rz(QR(tz.lastModel,t),JSON.stringify(e)),getLastThinkingLevel:e=>nz(QR(tz.lastThinkingLevel,e)),setLastThinkingLevel:(e,t)=>rz(QR(tz.lastThinkingLevel,t),e),getNotificationsEnabled:()=>nz(tz.notifications)===`on`,setNotificationsEnabled:e=>rz(tz.notifications,e?`on`:`off`),getLastSeenAt:(e,t)=>iz(QR(tz.lastSeenAt,t),oz)?.[e]??null,setLastSeenAt:(e,t,n)=>{let r=QR(tz.lastSeenAt,n);rz(r,JSON.stringify({...iz(r,oz),[e]:t}))},getSeenBaseline:(e,t)=>{let n=QR(tz.seenBaseline,t),r=Number(nz(n));return Number.isFinite(r)&&r>0?r:(rz(n,String(e)),e)}},pz=(0,M.createContext)(void 0);function mz({isHub:e,client:t,children:n}){return e?(0,L.jsx)(pz.Provider,{value:t,children:n}):n}function hz(){let e=(0,M.useContext)(pz),t=yC();return e??t}var gz=e=>Array.from(e.dataTransfer.types).includes(`Files`);function _z({onFiles:e,disabled:t,label:n=`Drop to attach`,className:r,children:i,...a}){let[o,s]=M.useState(0),c=o>0&&!t,l=e=>n=>{!t&&gz(n)&&(n.preventDefault(),s(t=>Math.max(0,t+e)))};return(0,L.jsxs)(`div`,{"data-slot":`drop-zone`,"data-active":c||void 0,className:I(`relative`,r),onDragEnter:l(1),onDragLeave:l(-1),onDragOver:e=>gz(e)&&!t&&e.preventDefault(),onDrop:n=>{!t&&gz(n)&&(n.preventDefault(),s(0),e(Array.from(n.dataTransfer.files)))},...a,children:[i,c?(0,L.jsx)(`div`,{"data-slot":`drop-zone-overlay`,className:`pointer-events-none absolute inset-0 z-50 flex items-center justify-center rounded-lg border-2 border-dashed border-primary/60 bg-background/80 text-sm font-medium`,children:n}):null]})}function vz({...e}){return(0,L.jsx)(Sie,{"data-slot":`popover`,...e})}function yz({...e}){return(0,L.jsx)(Eie,{"data-slot":`popover-trigger`,...e})}function bz({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,L.jsx)(kie,{children:(0,L.jsx)(Aie,{"data-slot":`popover-content`,align:t,sideOffset:n,className:I(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function xz({...e}){return(0,L.jsx)(wie,{"data-slot":`popover-anchor`,...e})}function Sz({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`popover-header`,className:I(`flex flex-col gap-0.5 text-sm`,e),...t})}function Cz({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`popover-title`,className:I(`font-medium`,e),...t})}var wz=1,Tz=.9,Ez=.8,Dz=.17,Oz=.1,kz=.999,Az=.9999,jz=.99,Mz=/[\\\/_+.#"@\[\(\{&]/,Nz=/[\\\/_+.#"@\[\(\{&]/g,Pz=/[\s-]/,Fz=/[\s-]/g;function Iz(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?wz:jz;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Iz(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=wz:Mz.test(e.charAt(l-1))?(d*=Ez,p=e.slice(i,l-1).match(Nz),p&&i>0&&(d*=kz**+p.length)):Pz.test(e.charAt(l-1))?(d*=Tz,m=e.slice(i,l-1).match(Fz),m&&i>0&&(d*=kz**+m.length)):(d*=Dz,i>0&&(d*=kz**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Az)),(d<Oz&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Iz(e,t,n,r,l+1,a+2,o),f*Oz>d&&(d=f*Oz)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Lz(e){return e.toLowerCase().replace(Fz,` `)}function Rz(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Iz(e,t,Lz(e),Lz(t),0,0,{})}var zz=`[cmdk-group=""]`,Bz=`[cmdk-group-items=""]`,Vz=`[cmdk-group-heading=""]`,Hz=`[cmdk-item=""]`,Uz=`${Hz}:not([aria-disabled="true"])`,Wz=`cmdk-item-select`,Gz=`data-value`,Kz=(e,t,n)=>Rz(e,t,n),qz=M.createContext(void 0),Jz=()=>M.useContext(qz),Yz=M.createContext(void 0),Xz=()=>M.useContext(Yz),Zz=M.createContext(void 0),Qz=M.forwardRef((e,t)=>{let n=fB(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=fB(()=>new Set),i=fB(()=>new Map),a=fB(()=>new Map),o=fB(()=>new Set),s=uB(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=LE(),y=LE(),b=LE(),x=M.useRef(null),S=hB();dB(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),dB(()=>{S(6,k)},[]);let C=M.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=M.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Kz;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Bz);t?t.appendChild(e.parentElement===t?e:e.closest(`${Bz} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Bz} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${zz}[${Gz}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Gz);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(zz)?.querySelector(Vz))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Hz}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(Uz)||[])}function ee(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(Gz))}function te(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(Gz))}function ne(e){let t=A()?.closest(zz),n;for(;t&&!n;)t=e>0?cB(t,zz):lB(t,zz),n=t?.querySelector(Uz);n?C.setState(`value`,n.getAttribute(Gz)):te(e)}let N=()=>ee(j().length-1),re=e=>{e.preventDefault(),e.metaKey?N():e.altKey?ne(1):te(1)},ie=e=>{e.preventDefault(),e.metaKey?ee(0):e.altKey?ne(-1):te(-1)};return M.createElement(MT.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&re(e);break;case`ArrowDown`:re(e);break;case`p`:case`k`:g&&e.ctrlKey&&ie(e);break;case`ArrowUp`:ie(e);break;case`Home`:e.preventDefault(),ee(0);break;case`End`:e.preventDefault(),N();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(Wz);t.dispatchEvent(e)}}}}},M.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:vB},c),_B(e,e=>M.createElement(Yz.Provider,{value:C},M.createElement(qz.Provider,{value:w},e))))}),$z=M.forwardRef((e,t)=>{let n=LE(),r=M.useRef(null),i=M.useContext(Zz),a=Jz(),o=uB(e),s=o.current?.forceMount??i?.forceMount;dB(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=mB(n,r,[e.value,e.children,r],e.keywords),l=Xz(),u=pB(e=>e.value&&e.value===c.current),d=pB(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);M.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(Wz,f),()=>t.removeEventListener(Wz,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return M.createElement(MT.div,{ref:lT(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),eB=M.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=LE(),s=M.useRef(null),c=M.useRef(null),l=LE(),u=Jz(),d=pB(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));dB(()=>u.group(o),[]),mB(o,s,[e.value,e.heading,c]);let f=M.useMemo(()=>({id:o,forceMount:i}),[i]);return M.createElement(MT.div,{ref:lT(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&M.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),_B(e,e=>M.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},M.createElement(Zz.Provider,{value:f},e))))}),tB=M.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=M.useRef(null),a=pB(e=>!e.search);return!n&&!a?null:M.createElement(MT.div,{ref:lT(i,t),...r,"cmdk-separator":``,role:`separator`})}),nB=M.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Xz(),o=pB(e=>e.search),s=pB(e=>e.selectedItemId),c=Jz();return M.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),M.createElement(MT.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),rB=M.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=M.useRef(null),o=M.useRef(null),s=pB(e=>e.selectedItemId),c=Jz();return M.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),M.createElement(MT.div,{ref:lT(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},_B(e,e=>M.createElement(`div`,{ref:lT(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),iB=M.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return M.createElement(bk,{open:n,onOpenChange:r},M.createElement(Ek,{container:o},M.createElement(Ok,{"cmdk-overlay":``,className:i}),M.createElement(Mk,{"aria-label":e.label,"cmdk-dialog":``,className:a},M.createElement(Qz,{ref:t,...s}))))}),aB=M.forwardRef((e,t)=>pB(e=>e.filtered.count===0)?M.createElement(MT.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),oB=M.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return M.createElement(MT.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},_B(e,e=>M.createElement(`div`,{"aria-hidden":!0},e)))}),sB=Object.assign(Qz,{List:rB,Item:$z,Input:nB,Group:eB,Separator:tB,Dialog:iB,Empty:aB,Loading:oB});function cB(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function lB(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uB(e){let t=M.useRef(e);return dB(()=>{t.current=e}),t}var dB=typeof window>`u`?M.useEffect:M.useLayoutEffect;function fB(e){let t=M.useRef();return t.current===void 0&&(t.current=e()),t}function pB(e){let t=Xz(),n=()=>e(t.snapshot());return M.useSyncExternalStore(t.subscribe,n,n)}function mB(e,t,n,r=[]){let i=M.useRef(),a=Jz();return dB(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Gz,s),i.current=s}),i}var hB=()=>{let[e,t]=M.useState(),n=fB(()=>new Map);return dB(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function gB(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function _B({asChild:e,children:t},n){return e&&M.isValidElement(t)?M.cloneElement(gB(t),{ref:t.ref},n(t.props.children)):n(t)}var vB={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function yB({...e}){return(0,L.jsx)(bk,{"data-slot":`dialog`,...e})}function bB({...e}){return(0,L.jsx)(Ek,{"data-slot":`dialog-portal`,...e})}function xB({className:e,...t}){return(0,L.jsx)(Ok,{"data-slot":`dialog-overlay`,className:I(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function SB({className:e,children:t,showCloseButton:n=!0,...r}){return(0,L.jsxs)(bB,{children:[(0,L.jsx)(xB,{}),(0,L.jsxs)(Mk,{"data-slot":`dialog-content`,className:I(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,L.jsx)(zk,{"data-slot":`dialog-close`,asChild:!0,children:(0,L.jsxs)(Z,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,L.jsx)(fR,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function CB({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`dialog-header`,className:I(`flex flex-col gap-2`,e),...t})}function wB({className:e,showCloseButton:t=!1,children:n,...r}){return(0,L.jsxs)(`div`,{"data-slot":`dialog-footer`,className:I(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,L.jsx)(zk,{asChild:!0,children:(0,L.jsx)(Z,{variant:`outline`,children:`Close`})})]})}function TB({className:e,...t}){return(0,L.jsx)(Ik,{"data-slot":`dialog-title`,className:I(`font-heading text-base leading-none font-medium`,e),...t})}function EB({className:e,...t}){return(0,L.jsx)(Lk,{"data-slot":`dialog-description`,className:I(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function DB({className:e,...t}){return(0,L.jsx)(`textarea`,{"data-slot":`textarea`,className:I(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function OB({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:I(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var kB=aT(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function AB({className:e,align:t=`inline-start`,...n}){return(0,L.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:I(kB({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var jB=aT(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function MB({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,L.jsx)(Z,{type:t,"data-size":r,variant:n,className:I(jB({size:r}),e),...i})}function NB({className:e,...t}){return(0,L.jsx)(iI,{"data-slot":`input-group-control`,className:I(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}function PB({className:e,...t}){return(0,L.jsx)(sB,{"data-slot":`command`,className:I(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function FB({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!1,...a}){return(0,L.jsxs)(yB,{...a,children:[(0,L.jsxs)(CB,{className:`sr-only`,children:[(0,L.jsx)(TB,{children:e}),(0,L.jsx)(EB,{children:t})]}),(0,L.jsx)(SB,{className:I(`top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0`,r),showCloseButton:i,children:n})]})}function IB({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,L.jsxs)(OB,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,L.jsx)(sB.Input,{"data-slot":`command-input`,className:I(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,L.jsx)(AB,{children:(0,L.jsx)(BL,{className:`size-4 shrink-0 opacity-50`})})]})})}function LB({className:e,...t}){return(0,L.jsx)(sB.List,{"data-slot":`command-list`,className:I(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function RB({className:e,...t}){return(0,L.jsx)(sB.Empty,{"data-slot":`command-empty`,className:I(`py-6 text-center text-sm`,e),...t})}function zB({className:e,...t}){return(0,L.jsx)(sB.Group,{"data-slot":`command-group`,className:I(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function BB({className:e,children:t,...n}){return(0,L.jsxs)(sB.Item,{"data-slot":`command-item`,className:I(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,L.jsx)(yI,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}function VB({className:e,...t}){return(0,L.jsx)(`span`,{"data-slot":`command-shortcut`,className:I(`ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground`,e),...t})}function HB(e){let t=new Map;return e.forEach((e,n)=>{let r=e.group??``;t.set(r,[...t.get(r)??[],{item:e,index:n}])}),[...t.entries()]}function UB({item:e,index:t,active:n,onActiveIndexChange:r,onSelect:i}){let a=M.useRef(null);return M.useEffect(()=>{n&&a.current?.scrollIntoView({block:`nearest`})},[n]),(0,L.jsxs)(BB,{ref:a,value:e.id,disabled:e.disabled,"data-selected":n,"aria-selected":n,onMouseMove:()=>!n&&r(t),onSelect:()=>i(e),children:[e.icon,(0,L.jsx)(`span`,{className:`truncate`,children:e.label}),e.description&&(0,L.jsx)(`span`,{className:`ml-auto truncate text-xs text-muted-foreground`,children:e.description})]})}function WB({open:e,items:t,activeIndex:n,onActiveIndexChange:r,onSelect:i,onClose:a,emptyText:o,anchor:s}){let c=M.useMemo(()=>({current:s}),[s]);return(0,L.jsxs)(vz,{open:e,onOpenChange:e=>!e&&a(),children:[(0,L.jsx)(xz,{virtualRef:c}),(0,L.jsx)(bz,{side:`top`,align:`start`,className:`w-(--radix-popover-trigger-width) p-0`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>s?.contains(e.target)&&e.preventDefault(),onMouseDown:e=>e.preventDefault(),children:(0,L.jsx)(PB,{shouldFilter:!1,value:t[n]?.id??``,onValueChange:()=>{},children:(0,L.jsxs)(LB,{children:[t.length===0&&(0,L.jsx)(RB,{children:o}),HB(t).map(([e,t])=>(0,L.jsx)(zB,{heading:e||void 0,children:t.map(({item:e,index:t})=>(0,L.jsx)(UB,{item:e,index:t,active:t===n,onActiveIndexChange:r,onSelect:i},e.id))},e))]})})})]})}function GB({src:e,alt:t,onRemove:n,onOpen:r,className:i,...a}){let o=(0,L.jsx)(`img`,{src:e,alt:t,className:`size-full object-cover`,draggable:!1});return(0,L.jsxs)(`div`,{"data-slot":`image-thumbnail`,className:I(`relative size-16 shrink-0 overflow-hidden rounded-lg border bg-muted`,i),...a,children:[r?(0,L.jsx)(`button`,{type:`button`,"aria-label":`Open ${t}`,onClick:r,className:`size-full cursor-zoom-in outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:o}):o,n?(0,L.jsx)(Z,{type:`button`,variant:`secondary`,size:`icon-xs`,"aria-label":`Remove ${t}`,onClick:n,className:`absolute top-0.5 right-0.5 size-5 rounded-full`,children:(0,L.jsx)(fR,{})}):null]})}var KB=`tau:attachments:`,qB=new Map,JB=1,YB=e=>KB+e;function XB(e){return typeof e==`object`&&!!e&&typeof e.mimeType==`string`&&e.mimeType.startsWith(`image/`)&&typeof e.data==`string`&&e.data.length>0}function ZB(e){try{let t=window.localStorage.getItem(YB(e));if(!t)return null;let n=JSON.parse(t);return!Array.isArray(n)||!n.every(XB)?(window.localStorage.removeItem(YB(e)),null):n.map(e=>tV(e))}catch{return null}}function QB(e,t){try{t.length===0?window.localStorage.removeItem(YB(e)):window.localStorage.setItem(YB(e),JSON.stringify(t.map(e=>e.image)))}catch{}}function $B(e){let t=qB.get(e);if(t)return t;let n=ZB(e);return n&&qB.set(e,n),qB.get(e)??[]}function eV(e,t){t.length===0?qB.delete(e):qB.set(e,t),QB(e,t)}function tV(e){return{id:JB++,image:e}}function nV(e){return 8-e.length}function rV(e){return`data:${e.mimeType};base64,${e.data}`}function iV({attachments:e,onRemove:t}){return e.length===0?null:(0,L.jsx)(`ul`,{"aria-label":`Attached images`,className:`flex flex-wrap gap-2 px-1 pt-1`,children:e.map((e,n)=>(0,L.jsx)(`li`,{children:(0,L.jsx)(GB,{src:rV(e.image),alt:`Attachment ${n+1}`,onRemove:()=>t(e.id)})},e.id))})}var aV=`tau:draft:`;function oV(e){try{return window.localStorage.getItem(aV+e)??``}catch{return``}}function sV(e,t){try{t?window.localStorage.setItem(aV+e,t):window.localStorage.removeItem(aV+e)}catch{return}}function cV(e,t){let n=e.slice(0,t),r=n.lastIndexOf(`@`);if(r<0)return null;let i=n.slice(r+1);return(r===0||/\s/.test(n[r-1]??``))&&!/\s/.test(i)?{start:r,query:i}:null}function lV(e,t,n,r){let i=`${e.slice(0,t.start)}@${r} `;return{text:i+e.slice(n),caret:i.length}}function uV(e,t){return e.toLowerCase().includes(t.toLowerCase())}function dV(e,t){return!t||e.nativeEvent.isComposing?null:e.key===`ArrowDown`?`next`:e.key===`ArrowUp`?`previous`:e.key===`Escape`?`close`:e.key===`Tab`||e.key===`Enter`&&!e.shiftKey?`pick`:null}function fV(e,t,n){return n===0?0:(e+t+n)%n}var pV=`tau:composer-restore`;function mV(e,t){return[e,t].filter(e=>e.trim().length>0).join(`
|
|
53
|
+
|
|
54
|
+
`)}function hV({mimeType:e,data:t}){return{mimeType:e,data:t}}function gV(e,t){sV(e,mV(t.text,oV(e))),eV(e,[...$B(e),...t.images.map(e=>tV(e))].slice(0,8)),window.dispatchEvent(new CustomEvent(pV,{detail:e}))}function _V(e,t){t.length!==0&&gV(e,{text:t.map(e=>e.text).filter(e=>e.trim().length>0).join(`
|
|
55
|
+
|
|
56
|
+
`),images:t.flatMap(e=>e.images.map(hV))})}function vV(e,t){let n=n=>{n.detail===e&&t()};return window.addEventListener(pV,n),()=>window.removeEventListener(pV,n)}var yV=[{name:`compact`,description:`Summarize older messages [instructions]`},{name:`new`,description:`Start a new thread in this project`},{name:`model`,description:`Change the model`},{name:`thinking`,description:`Change the thinking level`},{name:`rename`,description:`Rename this thread`},{name:`archive`,description:`Archive this thread`},{name:`goal`,description:`Work until a condition is met [condition | clear]`},{name:`loop`,description:`Repeat a prompt: [5m] <prompt>, or stop`}];function bV(e){return yV.filter(t=>e[t.name])}function xV(e){return/^\/(\S*)$/.exec(e)?.[1]??null}function SV(e,t){return e.filter(e=>e.name.startsWith(t.toLowerCase()))}function CV(e){let t=/^\/(\S+)(?:\s+([\s\S]*))?$/.exec(e.trim()),n=yV.find(e=>e.name===t?.[1]);return n?{name:n.name,args:(t?.[2]??``).trim()}:null}function wV(e,t){let[n,r]=(0,M.useState)(e);return(0,M.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function TV(e,t){let n=wV(e,t);return n===null||e===null?e:n}var EV=120,DV=8,OV={id:`status:files`,label:`Searching files…`,group:`Files`,disabled:!0},kV=e=>`file:${e}`,AV=e=>`skill:${e}`,jV=e=>e.slice(e.indexOf(`:`)+1);function MV(e,t){let n=J(),r=TV(t,EV),i=Yne(e??null).data??[],a=gw({queryKey:[`suggest-files`,e,r],queryFn:()=>n.projects.suggestFiles(e,r),enabled:!!e&&r!==null,placeholderData:IC}).data;if(t===null)return[];let o=(a??[]).map(e=>({id:kV(e.path),label:e.path,group:`Files`})),s=e&&a===void 0?[OV]:o,c=i.filter(e=>uV(e.name,t)).slice(0,DV).map(e=>({id:AV(e.name),label:e.name,description:e.scope===`app`?`App · ${e.description}`:e.description,group:`Skills`}));return[...s,...c]}var NV=e=>`cmd:${e}`;function PV(e,t){return t===null?[]:SV(bV(e),t).map(e=>({id:NV(e.name),label:`/${e.name}`,description:e.description}))}function FV({text:e,caret:t,commands:n,projectId:r,pastedText:i}){let[a,o]=(0,M.useState)(0),[s,c]=(0,M.useState)(null),l=xV(e),u=l===null&&i!==e?cV(e,t):null,d=MV(r,u?.query??null),f=l===null?d:PV(n,l),p=f.length>0&&s!==e,m=`${l}|${u?.start}|${u?.query}`;return(0,M.useEffect)(()=>o(0),[m]),{open:p,items:f,activeIndex:Math.min(a,Math.max(f.length-1,0)),mention:u,setActiveIndex:o,move:e=>o(t=>fV(t,e,f.length)),close:()=>c(e),activeItem:()=>f[Math.min(a,f.length-1)]}}function IV(e){return Array.from(e.dataTransfer?.types??[]).includes(`Files`)}function LV(e){let[t,n]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{if(!e)return;let t=e=>IV(e)&&n(!0),r=()=>n(!1),i=e=>e.relatedTarget===null&&n(!1);return window.addEventListener(`dragenter`,t),window.addEventListener(`dragleave`,i),window.addEventListener(`dragend`,r),window.addEventListener(`drop`,r),()=>{window.removeEventListener(`dragenter`,t),window.removeEventListener(`dragleave`,i),window.removeEventListener(`dragend`,r),window.removeEventListener(`drop`,r)}},[e]),[t,()=>n(!1)]}function RV(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 zV=e=>{switch(e){case`success`:return HV;case`info`:return WV;case`warning`:return UV;case`error`:return GV;default:return null}},BV=Array(12).fill(0),VV=({visible:e,className:t})=>M.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},M.createElement(`div`,{className:`sonner-spinner`},BV.map((e,t)=>M.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),HV=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},M.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`})),UV=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},M.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`})),WV=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},M.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`})),GV=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},M.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`})),KV=M.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`},M.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),M.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),qV=()=>{let[e,t]=M.useState(document.hidden);return M.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},JV=1,YV=100,XV=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:JV++,ZV=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-YV;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=XV(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],M.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if($V(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`&&!M.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`&&!M.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`&&!M.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`&&!M.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=XV(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}},QV=(e,t)=>ZV.message(e,t),$V=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,eH=Object.assign(QV,{success:ZV.success,info:ZV.info,warning:ZV.warning,error:ZV.error,custom:ZV.custom,message:ZV.message,promise:ZV.promise,dismiss:ZV.dismiss,loading:ZV.loading},{getHistory:()=>ZV.toasts,getToasts:()=>ZV.getActiveToasts()});RV(`[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 tH(e){return e.label!==void 0}var nH=3,rH=`24px`,iH=`16px`,aH=4e3,oH=356,sH=14,cH=45,lH=200;function uH(...e){return e.filter(Boolean).join(` `)}function dH(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var fH=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:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=M.useState(null),[O,k]=M.useState(null),[A,j]=M.useState(!1),[ee,te]=M.useState(!1),[ne,N]=M.useState(!1),[re,ie]=M.useState(!1),[ae,oe]=M.useState(!1),[se,ce]=M.useState(0),[le,ue]=M.useState(0),de=M.useRef(n.duration||y||aH),fe=M.useRef(null),pe=M.useRef(null),me=c===0,he=c+1<=o,ge=n.type,_e=ge??`default`,ve=n.dismissible!==!1,ye=n.className||``,be=n.descriptionClassName||``,xe=M.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),Se=M.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Ce=M.useMemo(()=>n.duration||y||aH,[n.duration,y]),we=M.useRef(0),Te=M.useRef(0),Ee=M.useRef(0),De=M.useRef(null),[Oe,ke]=b.split(`-`),Ae=M.useMemo(()=>s.reduce((e,t,n)=>n>=xe?e:e+t.height,0),[s,xe]),je=qV(),Me=M.useMemo(()=>e.swipeDirections??dH(b),[e.swipeDirections,b]),Ne=n.invert||t,Pe=ge===`loading`;Te.current=M.useMemo(()=>xe*x+Ae,[xe,Ae]),M.useEffect(()=>{de.current=Ce},[Ce]),M.useEffect(()=>{j(!0)},[]),M.useEffect(()=>{let e=pe.current;if(e){let t=e.getBoundingClientRect().height;return ue(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),M.useLayoutEffect(()=>{if(!A)return;let e=pe.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ue(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])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Fe=M.useCallback(()=>{te(!0),ce(Te.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},lH)},[n,d,a,Te]);M.useEffect(()=>{if(n.promise&&ge===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||je?(()=>{if(Ee.current<we.current){let e=new Date().getTime()-we.current;de.current-=e}Ee.current=new Date().getTime()})():de.current!==1/0&&(we.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Fe()},de.current)),()=>clearTimeout(e)},[u,i,n,ge,je,Fe]),M.useEffect(()=>{n.delete&&(Fe(),n.onDismiss==null||n.onDismiss.call(n,n))},[Fe,n.delete]);function Ie(){return w?.loading?M.createElement(`div`,{className:uH(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ge===`loading`},w.loading):M.createElement(VV,{className:uH(C?.loader,n?.classNames?.loader),visible:ge===`loading`})}let Le=n.icon||w?.[ge]||zV(ge);return M.createElement(`li`,{tabIndex:0,ref:pe,className:uH(_,ye,C?.toast,n?.classNames?.toast,C?.[_e],n?.classNames?.[_e]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":ae,"data-removed":ee,"data-visible":he,"data-y-position":Oe,"data-x-position":ke,"data-index":c,"data-front":me,"data-swiping":ne,"data-dismissible":ve,"data-type":ge,"data-invert":Ne,"data-swipe-out":re,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${ee?se:Te.current}px`,"--initial-height":S?`auto`:`${le}px`,...m,...n.style},onDragEnd:()=>{N(!1),D(null),De.current=null},onPointerDown:e=>{e.button!==2&&!Pe&&ve&&(fe.current=new Date,ce(Te.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(N(!0),De.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(re||!ve)return;De.current=null;let e=Number(pe.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(pe.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-fe.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?Me.includes(e>0?`right`:`left`):Me.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=cH||a>.11))ce(Te.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Fe(),ie(!0);else{var o,s;(o=pe.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=pe.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),oe(!1),N(!1),D(null)}},onPointerMove:e=>{var t,n;if(!De.current||!ve||window.getSelection()?.toString().length>0)return;let r=e.clientY-De.current.y,i=e.clientX-De.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(Me.includes(`top`)||Me.includes(`bottom`)){if(Me.includes(`top`)&&r<0||Me.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(E===`x`&&(Me.includes(`left`)||Me.includes(`right`))){if(Me.includes(`left`)&&i<0||Me.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)&&oe(!0),(t=pe.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=pe.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},Se&&!n.jsx&&ge!==`loading`?M.createElement(`button`,{"aria-label":T,"data-disabled":Pe,"data-close-button":!0,onClick:Pe||!ve?()=>{}:()=>{Fe(),n.onDismiss==null||n.onDismiss.call(n,n)},className:uH(C?.closeButton,n?.classNames?.closeButton)},w?.close??KV):null,(ge||n.icon||n.promise)&&n.icon!==null&&(w?.[ge]!==null||n.icon)?M.createElement(`div`,{"data-icon":``,className:uH(C?.icon,n?.classNames?.icon)},ge===`loading`?n.icon||Ie():n.promise?Ie():null,ge===`loading`?null:Le):null,M.createElement(`div`,{"data-content":``,className:uH(C?.content,n?.classNames?.content)},M.createElement(`div`,{"data-title":``,className:uH(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?M.createElement(`div`,{"data-description":``,className:uH(v,be,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),M.isValidElement(n.cancel)?n.cancel:n.cancel&&tH(n.cancel)?M.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{tH(n.cancel)&&ve&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Fe())},className:uH(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,M.isValidElement(n.action)?n.action:n.action&&tH(n.action)?M.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{tH(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Fe())},className:uH(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function pH(){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 mH(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?iH:rH;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 hH=M.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=nH,toastOptions:g,dir:_=pH(),gap:v=sH,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=M.useState([]),w=M.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=M.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=M.useState([]),[O,k]=M.useState(!1),[A,j]=M.useState(!1),[ee,te]=M.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),ne=M.useRef(null),N=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),re=M.useRef(null),ie=M.useRef(!1),ae=M.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||ZV.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return M.useEffect(()=>ZV.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{dT.flushSync(()=>{C(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)]})})})}),[]),M.useEffect(()=>{if(d!==`system`){te(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?te(`dark`):te(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{te(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{te(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),M.useEffect(()=>{S.length<=1&&k(!1)},[S]),M.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=ne.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===ne.current||ne.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),M.useEffect(()=>{if(ne.current)return()=>{re.current&&(re.current.focus({preventScroll:!0}),re.current=null,ie.current=!1)}},[ne.current]),M.createElement(`section`,{ref:t,"aria-label":b??`${x} ${N}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?M.createElement(`ol`,{key:t,dir:_===`auto`?pH():_,tabIndex:-1,ref:ne,className:c,"data-sonner-toaster":!0,"data-sonner-theme":ee,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${oH}px`,"--gap":`${v}px`,...m,...mH(l,u)},onBlur:e=>{ie.current&&!e.currentTarget.contains(e.relatedTarget)&&(ie.current=!1,re.current&&=(re.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ie.current||(ie.current=!0,re.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>M.createElement(fH,{key:n.id,icons:y,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:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ae,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),gH=2048,_H=[`image/png`,`image/jpeg`,`image/webp`,`image/gif`];function vH(e){return _H.includes(e)}function yH(e,t){let n=Math.min(1,gH/Math.max(e,t));return{width:Math.max(1,Math.round(e*n)),height:Math.max(1,Math.round(t*n))}}function bH(e,t,n){return Math.max(e,t)>2048||n>1572864}async function xH(e){let t=await createImageBitmap(e),n={width:t.width,height:t.height};return t.close(),n}function SH(e,t){return new Promise(n=>e.toBlob(n,t,.85))}async function CH(e){let t=await createImageBitmap(e),{width:n,height:r}=yH(t.width,t.height),i=document.createElement(`canvas`);i.width=n,i.height=r,i.getContext(`2d`)?.drawImage(t,0,0,n,r),t.close();let a=await SH(i,`image/webp`);if(a?.type===`image/webp`)return a;let o=await SH(i,`image/jpeg`);if(!o)throw Error(`Could not encode the image.`);return o}var wH=class extends Error{};function TH(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error),r.onload=()=>t(String(r.result).split(`,`)[1]??``),r.readAsDataURL(e)})}async function EH(e,t){return{mimeType:t,data:await TH(e)}}async function DH(e){let t=await CH(e);return{mimeType:t.type,data:await TH(t)}}async function OH(e,t){if(t===`image/gif`)return EH(e,t);let{width:n,height:r}=await xH(e);return bH(n,r,e.size)?DH(e):EH(e,t)}function kH(e,t){return e.name||t}async function AH(e){if(!vH(e.type))throw new wH(`${kH(e,`File`)} is not a PNG, JPEG, WebP or GIF image.`);let t=await OH(e,e.type).catch(()=>{throw new wH(`${kH(e,`Image`)} could not be read.`)});if(t.data.length>5242880)throw new wH(`${kH(e,`Image`)} is too large, even after compression.`);return t}var jH=`This model does not accept images.`;async function MH(e){let t=[];for(let n of e)try{t.push(tV(await AH(n)))}catch(e){eH.error(e instanceof Error?e.message:`Could not add the image.`)}return t}function NH(e){return e.filter(e=>e.type.startsWith(`image/`))}function PH(e,t){let[n,r]=(0,M.useState)(()=>$B(e)),[i,a]=(0,M.useState)(0),o=(0,M.useCallback)(t=>{eV(e,t),r(t)},[e]),s=(0,M.useCallback)(async n=>{let r=NH(n);if(r.length===0)return;if(!t)return void eH.error(jH);let i=nV($B(e));r.length>i&&eH.error(`You can attach up to 8 images per message.`),a(e=>e+1);let s=await MH(r.slice(0,Math.max(0,i)));a(e=>e-1),o([...$B(e),...s])},[t,o,e]),c=(0,M.useCallback)(t=>o($B(e).filter(e=>e.id!==t)),[o,e]);return{attachments:n,preparing:i>0,addFiles:s,remove:c,replace:o}}function FH(e){return e instanceof Error?e.message:`Could not reach the server.`}function IH(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}var LH=(e,t=`steer`)=>e?t===`followUp`?`Queue a message…`:`Steer the agent…`:`Message the agent…`,RH=(e=`steer`)=>e===`steer`?`followUp`:`steer`;function zH(e){return Array.from(e.clipboardData.files)}function BH({target:e,imagesAllowed:t,busy:n=!1,disabled:r=!1,footer:i,hint:a,toolbar:o,toolbarStart:s,abovePanel:c,whenBusy:l,commands:u={},projectId:d,onSend:f,onStop:p,onSent:m}){let h=$R(e,Sw()),[g,_]=(0,M.useState)(()=>oV(h)),[v,y]=(0,M.useState)(),[b,x]=(0,M.useState)(!1),S=(0,M.useRef)(null),{attachments:C,preparing:w,addFiles:T,remove:E,replace:D}=PH(h,t),[O,k]=LV(!0),[A,j]=(0,M.useState)(0),[ee,te]=(0,M.useState)(null),[ne,N]=(0,M.useState)(null),re=(0,M.useRef)(!1),ie=(0,M.useRef)(null),ae=FV({text:g,caret:A,commands:u,projectId:d,pastedText:ne}),oe=(g.trim().length>0||C.length>0)&&!w&&!r;(0,M.useEffect)(()=>vV(h,()=>{_(oV(h)),D($B(h)),requestAnimationFrame(()=>ie.current?.focus())}),[h,D]);let se=e=>{sV(h,e),_(e)},ce=(e,t)=>{se(``),y(void 0),Promise.resolve(u[e]?.(t)).catch(e=>y(FH(e)))},le=e=>{if(!ae.mention)return;let t=lV(g,ae.mention,A,e);se(t.text),j(t.caret),requestAnimationFrame(()=>ie.current?.setSelectionRange(t.caret,t.caret))},ue=e=>{if(e.disabled)return;if(!e.id.startsWith(NV(``)))return le(jV(e.id));let t=jV(e.id);if(t===`compact`||t===`goal`||t===`loop`)return se(`/${t} `);ce(t,``)},de=(e=l)=>{let t=CV(g);if(t&&u[t.name])return ce(t.name,t.args);let r=g.trim(),i=C;oe&&(se(``),D([]),y(void 0),m?.(),f({text:r,images:i.map(e=>e.image),...n&&e&&{whenBusy:e}}).catch(e=>{se(r),D(i),y(FH(e))}))},fe=()=>{p&&(x(!0),p().catch(e=>y(FH(e))).finally(()=>x(!1)))},pe=e=>{let t=dV(e,ae.open);if(!t)return!1;e.preventDefault(),t===`next`&&ae.move(1),t===`previous`&&ae.move(-1),t===`close`&&ae.close();let n=ae.activeItem();return t===`pick`&&n&&ue(n),!0},me=e=>{if(!pe(e)){if(e.key===`Escape`&&n)return fe();IH(e)&&(e.preventDefault(),de(e.altKey||e.metaKey?RH(l):l))}},he=e=>{j(e.target.selectionStart),re.current&&N(e.target.value),re.current=!1,se(e.target.value)},ge=e=>{let t=zH(e).filter(e=>e.type.startsWith(`image/`));t.length===0?re.current=!0:(e.preventDefault(),T(t))},_e=e=>{T(Array.from(e??[])),S.current&&(S.current.value=``)};return(0,L.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),de()},className:`space-y-2`,children:[c,O?(0,L.jsx)(_z,{className:`fixed inset-0 z-50`,onFiles:e=>{k(),T(e)},children:(0,L.jsx)(`span`,{className:`sr-only`,children:`Drop images to attach`})}):null,v?(0,L.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:v}):null,(0,L.jsx)(WB,{open:ae.open,items:ae.items,activeIndex:ae.activeIndex,onActiveIndexChange:ae.setActiveIndex,onSelect:ue,onClose:ae.close,emptyText:`No matches`,anchor:ee}),(0,L.jsxs)(`div`,{ref:te,className:`rounded-2xl border bg-card p-2 shadow-xs focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,children:[(0,L.jsx)(iV,{attachments:C,onRemove:E}),(0,L.jsx)(DB,{ref:ie,"aria-label":`Message`,value:g,onChange:he,onSelect:e=>j(e.currentTarget.selectionStart),onKeyDown:me,onPaste:ge,placeholder:LH(n,l),rows:1,className:`max-h-48 min-h-9 resize-none border-0 bg-transparent px-2 py-1.5 shadow-none focus-visible:ring-0 dark:bg-transparent`}),(0,L.jsxs)(`div`,{className:`flex items-start gap-1`,children:[s,t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(iI,{ref:S,type:`file`,accept:`image/png,image/jpeg,image/webp,image/gif`,multiple:!0,tabIndex:-1,"aria-label":`Choose images`,className:`hidden`,onChange:e=>_e(e.target.files)}),(0,L.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Attach images`,onClick:()=>S.current?.click(),children:(0,L.jsx)(EL,{})})]}):null,(0,L.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:o}),a,n&&p?(0,L.jsx)(Z,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Stop`,disabled:b,onClick:fe,children:(0,L.jsx)(XL,{className:`fill-current`})}):null,(0,L.jsx)(Z,{type:`submit`,size:`icon`,"aria-label":n?`Send as steer`:`Send`,disabled:!oe,children:(0,L.jsx)(pI,{})})]})]}),i]})}function VH(e){return(0,L.jsx)(BH,{...e},e.target)}function HH(e){let[t,n]=(0,M.useState)(()=>Date.now());return(0,M.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var UH=[`clear`,`stop`,`off`,`reset`,`none`,`cancel`];function WH(e){let t=e.trim();return t===``?{kind:`status`}:UH.includes(t.toLowerCase())?{kind:`clear`}:{kind:`set`,condition:t}}var GH=e=>e.length>k_,KH=6e4,qH=60*KH;function JH(e){let t=Math.max(0,e);return t<KH?`${Math.floor(t/1e3)}s`:t<qH?`${Math.floor(t/KH)}m`:`${Math.floor(t/qH)}h ${Math.floor(t%qH/KH)}m`}var YH=e=>e<1e3?String(e):`${(e/1e3).toFixed(1)}k`,XH=e=>e===`cleared`?`cleared`:e;function ZH(e,t){return[{label:`Condition`,value:e.condition},{label:`State`,value:XH(e.state)},{label:`Elapsed`,value:JH(t-e.startedAt)},{label:`Turns evaluated`,value:String(e.turnsEvaluated)},{label:`Tokens`,value:YH(e.tokensSpent)},{label:`Last reason`,value:e.lastReason??`none yet`}]}var QH=(e,t)=>ZH(e,t).map(({label:e,value:t})=>`${e}: ${t}`).join(`
|
|
57
|
+
`),$H={active:eR,paused:OL,achieved:TI,failed:poe,cleared:eR},eU=e=>e.state===`active`?`Goal`:`Goal · ${XH(e.state)}`;function tU({goal:e,onClear:t}){let n=HH(15e3);return(0,L.jsxs)(bz,{align:`end`,className:`w-80`,"data-testid":`goal-popover`,children:[(0,L.jsx)(Sz,{children:(0,L.jsx)(Cz,{children:`Goal`})}),(0,L.jsx)(`dl`,{className:`flex flex-col gap-1.5`,children:ZH(e,n).map(({label:e,value:t})=>(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[(0,L.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsx)(`dd`,{className:`break-words`,children:t})]},e))}),(0,L.jsx)(Z,{variant:`outline`,size:`sm`,onClick:t,children:`Clear`})]})}function nU({conversationId:e}){let t=J(),n=sre(e).data,r=yC();if(!n)return null;let i=$H[n.state];return(0,L.jsxs)(vz,{children:[(0,L.jsx)(yz,{asChild:!0,children:(0,L.jsxs)(Z,{variant:`outline`,size:`sm`,"aria-label":`Goal ${XH(n.state)}`,children:[(0,L.jsx)(i,{}),eU(n)]})}),(0,L.jsx)(tU,{goal:n,onClear:()=>t.goals.clear(e).then(()=>r.invalidateQueries({queryKey:[`goal`]})).catch(e=>void eH.error(_C(e)))})]})}var rU=e=>e===void 0?``:`/m/${encodeURIComponent(e)}`,iU=(e,t,n)=>`${rU(n)}/p/${encodeURIComponent(e)}/c/${encodeURIComponent(t)}`,aU=(e,t)=>{let n=[...e===void 0?[]:[`project=${encodeURIComponent(e)}`],...t===void 0?[]:[`machine=${encodeURIComponent(t)}`]];return n.length===0?`/new`:`/new?${n.join(`&`)}`},oU=(e,t,n,r)=>n===void 0?`${iU(e,t,r)}/terminal`:`${iU(e,t,r)}/terminal/${encodeURIComponent(n)}`,sU=`/p/:projectId/c/:conversationId/*`,cU=`/m/:machineId/p/:projectId/c/:conversationId/*`,lU=(e,t)=>t===void 0||!e.startsWith(`/`)?e:`${ev(t)}${e}`;function uU(){let e=vt({path:sU,end:!0})?.params,t=vt({path:cU,end:!0})?.params;return t===void 0?e===void 0?{}:{projectId:e.projectId,conversationId:e.conversationId}:{machineId:t.machineId,projectId:t.projectId,conversationId:t.conversationId}}function dU(){let{conversationId:e}=uU(),t=Sw(),n=Mw().data?.find(t=>t.id===e)?.lastRunEndedAt??0;return(0,M.useEffect)(()=>{e&&fz.setLastSeenAt(e,Math.max(Date.now(),n),t)},[e,n,t]),null}var fU={available:[`terminals`,`available`],list:e=>[`terminals`,e]},pU={cols:80,rows:24},mU=()=>{let e=J();return gw({queryKey:fU.available,queryFn:()=>e.terminals.available(),staleTime:1/0})};function hU(e,t){let n=J();return gw({queryKey:fU.list(e),queryFn:()=>n.terminals.list(e),enabled:t})}function gU(e){let t=J(),n=yC();return _w({mutationFn:()=>t.terminals.open(e,pU),onSuccess:()=>n.invalidateQueries({queryKey:fU.list(e)})})}function _U(e){let t=J(),n=yC();return _w({mutationFn:e=>t.terminals.close(e),onSuccess:()=>n.invalidateQueries({queryKey:fU.list(e)})})}function vU(e,t){let n=Sw(),r=gU(t),i=bt();return{run:()=>r.mutate(void 0,{onSuccess:r=>i(oU(e,t,r.id,n)),onError:e=>void eH.error(_C(e))}),pending:r.isPending}}function yU({projectId:e,conversationId:t}){let n=mU().data===!0,r=vU(e,t);return n?(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsx)(Z,{variant:`outline`,size:`icon-sm`,"aria-label":`Terminal`,onClick:r.run,disabled:r.pending,children:(0,L.jsx)(JL,{})})}),(0,L.jsx)(CR,{children:`Terminal`})]}):null}function bU(){let{projectId:e,conversationId:t}=uU();return!e||!t?null:(0,L.jsx)(yU,{projectId:e,conversationId:t})}var xU=2;function SU({value:e,min:t,max:n,containerRef:r,onChange:i,onReset:a,label:o=`Resize panes`}){let s=(0,M.useRef)(!1),c=e=>Math.min(n,Math.max(t,e));return(0,L.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":o,"aria-valuenow":Math.round(e),"aria-valuemin":t,"aria-valuemax":n,tabIndex:0,"data-slot":`pane-splitter`,title:`Drag to resize, double-click to reset`,className:I(`relative w-px shrink-0 cursor-col-resize bg-border outline-none transition-colors`,`after:absolute after:inset-y-0 after:-left-1.5 after:-right-1.5 after:content-['']`,`hover:bg-ring focus-visible:bg-ring`),onPointerDown:e=>{e.button===0&&(s.current=!0,document.body.style.userSelect=`none`,e.currentTarget.setPointerCapture?.(e.pointerId),e.preventDefault())},onPointerMove:e=>{let t=r.current?.getBoundingClientRect();s.current&&t&&t.width!==0&&i(c((e.clientX-t.left)/t.width*100))},onPointerUp:()=>{s.current=!1,document.body.style.removeProperty(`user-select`)},onPointerCancel:()=>{s.current=!1,document.body.style.removeProperty(`user-select`)},onDoubleClick:a,onKeyDown:t=>{let n=t.key===`ArrowLeft`?-2:t.key===`ArrowRight`?xU:0;n!==0&&(t.preventDefault(),i(c(e+n)))}})}var CU=aT(`inline-block size-2 shrink-0 rounded-full`,{variants:{status:{running:`animate-pulse bg-warning`,error:`bg-destructive`,unseen:`bg-primary`}}}),wU={running:`Running`,error:`Failed`,unseen:`New activity`};function TU({status:e,className:t,...n}){return(0,L.jsx)(`span`,{"data-slot":`status-dot`,"data-status":e,role:`img`,"aria-label":wU[e],className:I(CU({status:e}),t),...n})}function EU({className:e,orientation:t=`horizontal`,...n}){return(0,L.jsx)(gae,{"data-slot":`tabs`,"data-orientation":t,className:I(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var DU=aT(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function OU({className:e,variant:t=`default`,...n}){return(0,L.jsx)(vae,{"data-slot":`tabs-list`,"data-variant":t,className:I(DU({variant:t}),e),...n})}function kU({className:e,...t}){return(0,L.jsx)(bae,{"data-slot":`tabs-trigger`,className:I(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function AU({className:e,...t}){return(0,L.jsx)(Sae,{"data-slot":`tabs-content`,className:I(`flex-1 text-sm outline-none`,e),...t})}var jU=`opacity-0 group-hover/closable-tab:opacity-100 group-focus-within/closable-tab:opacity-100 group-has-data-active/closable-tab:opacity-100 pointer-coarse:opacity-100`;function MU({value:e,title:t,onClose:n,ended:r,className:i,...a}){return(0,L.jsxs)(`div`,{"data-slot":`closable-tab`,"data-ended":r||void 0,className:I(`group/closable-tab relative flex h-full items-center`,i),onAuxClick:e=>{e.button===1&&n&&(e.preventDefault(),n())},...a,children:[(0,L.jsxs)(kU,{value:e,"data-ended":r||void 0,onKeyDown:e=>{e.key===`Delete`&&n&&(e.preventDefault(),n())},className:I(`px-2.5`,n&&`pr-7`,r&&`text-muted-foreground`),children:[r?(0,L.jsx)(TU,{status:`error`,"aria-label":`Ended`,className:`size-1.5`}):null,t]}),n?(0,L.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Close ${t}`,onClick:n,className:I(`absolute right-1.5 inline-flex size-5 items-center justify-center rounded-sm text-muted-foreground transition-opacity outline-none hover:bg-foreground/10 hover:text-foreground focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50 [&_svg]:size-3.5`,jU),children:(0,L.jsx)(fR,{})}):null]})}function NU({tabs:e,focusedId:t,onFocus:n,onClose:r,onAdd:i,addLabel:a=`New pane`,children:o,className:s,style:c}){return(0,L.jsxs)(`div`,{"data-slot":`pane-strip`,style:c,className:I(`flex min-h-0 min-w-0 flex-col bg-background`,s),children:[(0,L.jsx)(EU,{value:t??``,onValueChange:t=>{let r=e.find(e=>e.id===t);r&&n(r)},className:`shrink-0 gap-0 border-b px-2 py-2`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-1 overflow-x-auto`,children:[(0,L.jsx)(OU,{"aria-label":`Panes`,className:`w-auto flex-none`,children:e.map(e=>(0,L.jsx)(MU,{value:e.id,title:e.title,ended:e.ended,onClose:e.closable===!1?void 0:()=>r(e)},e.id))}),i?(0,L.jsx)(Z,{variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-muted-foreground`,"aria-label":a,onClick:i,children:(0,L.jsx)(PL,{})}):null]})}),o?(0,L.jsx)(`div`,{className:`min-h-0 flex-1`,children:o}):null]})}var PU=`tau:pane-split`,FU=e=>Number.isFinite(e)?Math.min(80,Math.max(20,e)):50;function IU(){try{let e=window.localStorage.getItem(PU);return e===null?50:FU(Number(e))}catch{return 50}}function LU(e){try{window.localStorage.setItem(PU,String(FU(e)))}catch{}}var RU=aT(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function zU({className:e,variant:t,...n}){return(0,L.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:I(RU({variant:t}),e),...n})}function BU({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-title`,className:I(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function VU({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-description`,className:I(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}var HU=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`],UU=`"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`;function WU(e,t){let n=document.createElement(`span`);n.style.color=`var(${t})`,e.appendChild(n);let r=getComputedStyle(n).color;return n.remove(),r}function GU(e){let t=t=>WU(e,`--terminal-${t}`),[n,r,i,a,o,s,c,l]=HU.map(t),[u,d,f,p,m,h,g,_]=HU.map(e=>t(`bright-${e}`));return{background:t(`bg`),foreground:t(`fg`),cursor:t(`cursor`),cursorAccent:t(`cursor-accent`),selectionBackground:t(`selection`),black:n,red:r,green:i,yellow:a,blue:o,magenta:s,cyan:c,white:l,brightBlack:u,brightRed:d,brightGreen:f,brightYellow:p,brightBlue:m,brightMagenta:h,brightCyan:g,brightWhite:_}}var KU=80,qU=600,JU=new TextEncoder,YU=e=>Uint8Array.from(e,e=>e.charCodeAt(0)&255);function XU(e){let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()}var ZU=e=>e.ctrlKey&&e.shiftKey&&e.key===`ArrowUp`;async function QU(){try{await Promise.all([document.fonts.load(`400 13px "JetBrains Mono"`),document.fonts.load(`700 13px "JetBrains Mono"`)])}catch{}}async function $U(e){let[{Terminal:t},{FitAddon:n}]=await Promise.all([gn(()=>import(`./xterm-CerOhKYV.js`),[]),gn(()=>import(`./addon-fit-DIOBYJe3.js`),[]),gn(()=>Promise.resolve({}),__vite__mapDeps([0])),gn(()=>Promise.resolve({}),__vite__mapDeps([1]))]);await QU();let r=new n,i=new t({screenReaderMode:!0,fontFamily:UU,fontSize:13,lineHeight:1,cursorBlink:!0,scrollback:5e3,theme:GU(e)});return i.loadAddon(r),i.open(e),{terminal:i,fit:r}}function eW(e,t,n){e.onData(e=>{e.startsWith(`\x1B`)&&n()||t(JU.encode(e))}),e.onBinary(e=>t(YU(e))),e.attachCustomKeyEventHandler(e=>!ZU(e))}function tW({onInput:e,onResize:t,onHandle:n,onLeave:r,autoFocus:i,className:a}){let o=(0,M.useRef)(null),s=(0,M.useRef)({onInput:e,onResize:t,onHandle:n,onLeave:r});return s.current={onInput:e,onResize:t,onHandle:n,onLeave:r},(0,M.useEffect)(()=>{let e=o.current;if(!e)return;let t=!1,n=()=>{};return $U(e).then(({terminal:r,fit:a})=>{if(t)return r.dispose();let o=0;eW(r,e=>s.current.onInput(e),()=>performance.now()<o);let c,l=()=>{let e=a.proposeDimensions();e&&Number.isFinite(e.cols)&&(a.fit(),s.current.onResize(r.cols,r.rows))},u=new ResizeObserver(()=>{clearTimeout(c),c=setTimeout(l,KU)});u.observe(e);let d=XU(()=>{r.options.theme=GU(e)});e.dataset.loaded=`true`,l(),i&&r.focus(),s.current.onHandle({write:e=>r.write(e),reset:()=>{o=performance.now()+qU,r.reset()},focus:()=>r.focus()}),n=()=>{clearTimeout(c),u.disconnect(),d(),s.current.onHandle(null),r.dispose()}}),()=>{t=!0,n()}},[i]),(0,L.jsx)(`section`,{"aria-label":`Terminal`,onKeyDown:e=>{ZU(e)&&s.current.onLeave?.(),e.stopPropagation()},className:I(`size-full min-h-0 overflow-hidden bg-[var(--terminal-bg)] p-3`,a),children:(0,L.jsx)(`div`,{ref:o,className:`size-full`})})}var nW=500,rW=15e3;function iW(e){return Math.min(rW,nW*2**e)}var aW=(e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)};function oW(e){try{let t=JSON.parse(e);return sC(Xte,t)?t:void 0}catch{return}}function sW(e){let t=e.setTimer??aW,n,r,i=0,a=!1,o=!1,s=!1,c=()=>{},l=(t,n=null)=>e.onState({status:t,exitCode:n}),u=()=>o&&r&&n?.send(JSON.stringify({type:`resize`,...r}));function d(t){let n=oW(t);n&&(n.type===`ready`?(i=0,o=!0,e.sink.reset(),a=n.status===`exited`,l(a?`exited`:`ready`,n.exitCode),a||u()):(a=!0,l(`exited`,n.exitCode)))}function f(e){if(n=void 0,o=!1,!(s||a)){if(e===1008)return l(`closed`);l(`connecting`),c=t(p,iW(i++))}}function p(){n=e.open({onOpen:()=>{},onMessage:t=>typeof t==`string`?d(t):e.sink.write(t),onClose:f})}return p(),{sendInput:e=>o&&n?.send(e),sendResize(e,t){r={cols:e,rows:t},a||u()},close(){s=!0,c(),n?.close()}}}function cW(){let e=null,t=[],n=(e,t)=>`reset`in e?t.reset():t.write(e.data),r=r=>e?n(r,e):t.push(r);return{sink:{write:e=>r({data:e}),reset:()=>r({reset:!0})},bind(r){if(e=r,r){for(let e of t)n(e,r);t=[]}}}}function lW(e){let t=J(),[n,r]=(0,M.useState)({status:`connecting`,exitCode:null}),i=(0,M.useRef)(cW()),a=(0,M.useRef)(void 0),o=(0,M.useRef)(void 0);(0,M.useEffect)(()=>{r({status:`connecting`,exitCode:null});let n=sW({open:n=>t.terminals.openStream(e,n),sink:i.current.sink,onState:r});return a.current=n,o.current&&n.sendResize(o.current.cols,o.current.rows),()=>{n.close(),a.current=void 0}},[t,e]);let s=(0,M.useCallback)(e=>a.current?.sendInput(e),[]),c=(0,M.useCallback)((e,t)=>{o.current={cols:e,rows:t},a.current?.sendResize(e,t)},[]);return{state:n,bind:(0,M.useCallback)(e=>i.current.bind(e),[]),sendInput:s,sendResize:c}}var uW=`This terminal ended`;function dW({exitCode:e}){return(0,L.jsx)(zU,{role:`status`,className:`rounded-none border-x-0 border-t-0`,children:(0,L.jsxs)(VU,{children:[uW,e===null?`.`:` (exit code ${e}).`]})})}function fW({terminalId:e,onLeave:t}){let n=lW(e),r=(n.state.status===`exited`||n.state.status===`closed`)&&n.state.exitCode!==0;return(0,L.jsxs)(`div`,{className:`flex size-full min-h-0 flex-col bg-background`,children:[r?(0,L.jsx)(dW,{exitCode:n.state.exitCode}):null,(0,L.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,L.jsx)(tW,{autoFocus:!0,onHandle:n.bind,onInput:n.sendInput,onResize:n.sendResize,onLeave:t})})]})}function pW(){let[e,t]=(0,M.useState)(()=>window.innerWidth<760);return(0,M.useEffect)(()=>{let e=window.matchMedia(`(max-width: 759px)`),n=()=>t(window.innerWidth<760);return e.addEventListener(`change`,n),window.addEventListener(`resize`,n),n(),()=>{e.removeEventListener(`change`,n),window.removeEventListener(`resize`,n)}},[]),e}function mW(){let e=g3(),t=yC();(0,M.useEffect)(()=>e.onChanged(e=>{e.resource===`terminals`&&t.invalidateQueries({queryKey:fU.list(e.conversationId)})}),[e,t])}var hW={kind:`chat`,id:`chat`,title:`Chat`,closable:!1};function gW(e,t){let n=e.map((e,n)=>({kind:`terminal`,id:e.id,title:t?`Terminal ${n+1}`:e.title,ended:e.status===`exited`}));return t?[hW,...n]:n}function _W(e){e?.querySelector(`textarea[aria-label="Message"]`)?.focus()}function vW({projectId:e,conversationId:t,terminalId:n,children:r}){let i=Sw();mW();let a=bt(),o=pW(),s=(0,M.useRef)(null),[c,l]=(0,M.useState)(IU),u=mU().data===!0,d=hU(t,u),f=_U(t),p=vU(e,t),m=d.data??[],h=u&&(m.length>0||n!==void 0),g=n??(o?void 0:m[0]?.id),_=o&&g===void 0?hW.id:g,v=(0,M.useCallback)(e=>{l(e),LU(e)},[]),y=(0,M.useCallback)(()=>v(50),[v]),b=n=>a(n.kind===`chat`?iU(e,t,i):oU(e,t,n.id,i)),x=n=>{if(f.mutate(n.id),n.id!==g)return;let r=m.find(e=>e.id!==n.id);a(r?oU(e,t,r.id,i):iU(e,t,i))},S=n!==void 0&&d.isSuccess&&!m.some(e=>e.id===n),C=m[0]?.id;(0,M.useEffect)(()=>{S&&a(C?oU(e,t,C,i):iU(e,t,i),{replace:!0})},[S,C,a,e,t,i]);let w=g&&!S?(0,L.jsx)(fW,{terminalId:g,onLeave:()=>_W(s.current)},g):null,T=!(o&&h&&_!==hW.id),E=h?(0,L.jsx)(NU,{tabs:gW(m,o),focusedId:_,onFocus:b,onClose:x,onAdd:p.run,addLabel:`New terminal`,className:o?void 0:`h-full`,style:o?void 0:{width:`${100-c}%`},children:o?void 0:w},`strip`):null;return(0,L.jsxs)(`div`,{ref:s,"data-slot":`thread-panes`,className:o?`relative flex h-full min-h-0 min-w-0 flex-col`:`relative flex h-full min-h-0 min-w-0 flex-row`,children:[o?E:null,(0,L.jsx)(`div`,{hidden:!T,className:`h-full min-h-0 min-w-0 flex-1`,style:o||!h?void 0:{flex:`0 0 ${c}%`},children:r},`chat`),h&&!o?(0,L.jsx)(SU,{value:c,min:20,max:80,containerRef:s,onChange:v,onReset:y},`split`):null,o?T?null:(0,L.jsx)(`div`,{className:`min-h-0 flex-1`,children:w},`body`):E]})}function yW({message:e,className:t}){return e?(0,L.jsx)(`p`,{role:`alert`,className:I(`text-sm text-destructive`,t),children:e}):null}function bW(){let[e,t]=(0,M.useState)(null),[n,r]=(0,M.useState)(!1);return{run:async e=>{r(!0),t(null);try{return await e(),!0}catch(e){return t(_C(e)),!1}finally{r(!1)}},error:e,pending:n,clearError:()=>t(null)}}function xW({title:e,label:t,initialValue:n,onSubmit:r,onClose:i}){let a=(0,M.useId)(),[o,s]=(0,M.useState)(n),{run:c,error:l,pending:u}=bW();return(0,L.jsx)(yB,{open:!0,onOpenChange:e=>!e&&i(),children:(0,L.jsx)(SB,{children:(0,L.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),await c(()=>r(o.trim()))&&i()},className:`flex flex-col gap-4`,children:[(0,L.jsxs)(CB,{children:[(0,L.jsx)(TB,{children:e}),(0,L.jsx)(EB,{className:`sr-only`,children:t})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`label`,{htmlFor:a,className:`text-sm font-medium`,children:t}),(0,L.jsx)(iI,{id:a,value:o,onChange:e=>s(e.target.value),autoFocus:!0}),(0,L.jsx)(yW,{message:l})]}),(0,L.jsxs)(wB,{children:[(0,L.jsx)(Z,{type:`button`,variant:`outline`,onClick:i,children:`Cancel`}),(0,L.jsx)(Z,{type:`submit`,disabled:u||o.trim()===``,children:`Save`})]})]})})})}var SW=aT(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function CW({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?hT:`span`;return(0,L.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:I(SW({variant:t}),e),...r})}var wW={running:`secondary`,done:`outline`,failed:`destructive`,stopped:`outline`};function TW({status:e}){return e?(0,L.jsx)(CW,{variant:wW[e],"data-agent-status":e,children:e}):null}var EW=e=>e??`general-purpose`,DW=e=>e?.status===`running`||e?.agentStatus===`running`,OW=(e,t)=>e&&t?`${e} · ${t}`:e,kW={running:`running`,done:`done`,failed:`error`,stopped:`interrupted`},AW=(e,t)=>e?.agentStatus?kW[e.agentStatus]:t;function jW({childId:e}){let t=J(),n=yC();return(0,L.jsx)(Z,{variant:`outline`,size:`sm`,onClick:async()=>{await t.conversations.stopAgent(e),await n.invalidateQueries({queryKey:Y.allConversations})},children:`Stop`})}var MW=e=>`${e.provider}/${e.modelId}`;function NW(){let e=Ew().data,t=t=>e?.find(e=>MW(e)===t)?.name;return{ofRef:e=>e?t(MW(e))??e.modelId:void 0,ofKey:e=>t(e)??e}}function PW({parentId:e,childId:t}){let n=Sw(),r=Mw().data,i=NW(),a=r?.find(t=>t.id===e),o=t?r?.find(e=>e.id===t):void 0;if(!a)return null;let s=OW(i.ofRef(o?.agentModel),o?.agentThinking);return(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-1.5 text-xs text-muted-foreground`,children:[(0,L.jsxs)(`p`,{className:`min-w-0 flex-1 truncate`,children:[`Subagent of`,` `,(0,L.jsx)(Ln,{className:`underline`,to:iU(a.projectId,a.id,n),children:a.title.trim()||`New thread`}),o?` · ${EW(o.agentType)}`:null,s?` · ${s}`:null]}),(0,L.jsx)(TW,{status:o?.agentStatus}),t&&DW(o)?(0,L.jsx)(jW,{childId:t}):null]})}function FW({...e}){return(0,L.jsx)(sie,{"data-slot":`dropdown-menu`,...e})}function IW({...e}){return(0,L.jsx)(lie,{"data-slot":`dropdown-menu-trigger`,...e})}function LW({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,L.jsx)(uie,{children:(0,L.jsx)(fie,{"data-slot":`dropdown-menu-content`,sideOffset:n,align:t,className:I(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function RW({className:e,inset:t,variant:n=`default`,...r}){return(0,L.jsx)(pie,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:I(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function zW({className:e,...t}){return(0,L.jsx)(mie,{"data-slot":`dropdown-menu-separator`,className:I(`-mx-1 my-1 h-px bg-border`,e),...t})}var BW=`Please commit all your changes in this worktree with a clear commit message, so I can merge it.`,VW=e=>`Please rebase this branch onto ${e}, fix any conflicts, and continue the rebase until it finishes.`;function HW(e){if(!e)return[];let t=e.unmergedCommits>0?[`${e.unmergedCommits} unmerged commit(s)`]:[];return[...e.dirtyFiles,...t]}function UW({branch:e,status:t,pending:n,onConfirm:r,onClose:i}){let a=HW(t);return(0,L.jsx)(yB,{open:!0,onOpenChange:e=>!e&&i(),children:(0,L.jsxs)(SB,{children:[(0,L.jsxs)(CB,{children:[(0,L.jsxs)(TB,{children:[`Remove worktree `,e,`?`]}),(0,L.jsxs)(EB,{children:[`The thread keeps working in the main checkout.`,a.length>0&&` Removing the worktree loses this unmerged work:`]})]}),a.length>0&&(0,L.jsx)(`ul`,{"aria-label":`Unmerged work`,className:`max-h-40 overflow-auto text-sm text-muted-foreground`,children:a.map(e=>(0,L.jsx)(`li`,{children:e},e))}),(0,L.jsxs)(wB,{children:[(0,L.jsx)(Z,{variant:`outline`,onClick:i,children:`Cancel`}),(0,L.jsx)(Z,{variant:`destructive`,disabled:n,onClick:()=>r(a.length>0),children:`Remove worktree`})]})]})})}function WW(){return globalThis.crypto?.randomUUID?.()??`req-${Date.now()}-${Math.random().toString(36).slice(2)}`}function GW(e){let t=J();return{send:(0,M.useCallback)(({text:n,images:r,whenBusy:i})=>t.conversations.send(e,{text:n,...r.length>0&&{images:r},...i&&{whenBusy:i},requestId:WW()}),[t,e]),stop:(0,M.useCallback)(()=>t.conversations.abort(e),[t,e]),retry:(0,M.useCallback)(n=>t.conversations.retry(e,{requestId:n}),[t,e])}}function KW(e){let t=J(),n=yC(),[r,i]=(0,M.useState)(null),[a,o]=(0,M.useState)(!1),s=async()=>{await n.invalidateQueries({queryKey:Y.workspace(e)}),await n.invalidateQueries({queryKey:[`conversations`]})},c=async e=>{o(!0),i(null);try{return await e(),await s(),!0}catch(e){return i({code:hv(e)?e.code:null,message:_C(e)}),!1}finally{o(!1)}};return{failure:r,pending:a,dismiss:()=>i(null),merge:()=>c(()=>t.workspaces.merge(e)),createPullRequest:()=>c(()=>t.workspaces.createPullRequest(e)),remove:n=>c(()=>t.workspaces.remove(e,n)),sendMessage:n=>c(()=>t.conversations.send(e,{text:n,requestId:WW()}))}}function qW(e,t){return e===`worktree_dirty`?{label:`Ask agent to commit`,text:BW}:e===`merge_conflict`?{label:`Ask agent to resolve`,text:VW(t)}:null}function JW({failure:e,base:t,disabled:n,onSend:r,onDismiss:i}){let a=qW(e.code,t);return(0,L.jsxs)(zU,{variant:`destructive`,className:`flex w-auto items-center gap-2 py-1`,children:[(0,L.jsx)(VU,{className:`text-destructive`,children:e.message}),a&&(0,L.jsx)(Z,{size:`xs`,disabled:n,onClick:()=>r(a.text),children:a.label}),(0,L.jsx)(Z,{size:`xs`,variant:`ghost`,onClick:i,children:`Dismiss`})]})}var YW=e=>navigator.clipboard?.writeText(e).catch(()=>void 0);function XW({thread:e,status:t,disabled:n,onMerge:r,onAskToCommit:i,onCreatePullRequest:a,onRemove:o}){let{base:s,path:c,pullRequestUrl:l}=e.workspace,u=t!==void 0&&t.unmergedCommits===0,d=(t?.dirtyFiles.length??0)>0;return(0,L.jsxs)(LW,{align:`start`,children:[(0,L.jsxs)(RW,{disabled:n||u,onSelect:r,children:[`Merge into `,s]}),d&&(0,L.jsx)(RW,{disabled:n,onSelect:i,children:`Ask agent to commit`}),l?(0,L.jsx)(RW,{asChild:!0,children:(0,L.jsx)(`a`,{href:l,target:`_blank`,rel:`noreferrer`,children:`Open pull request`})}):(0,L.jsx)(RW,{disabled:n,onSelect:a,children:`Create PR`}),(0,L.jsx)(RW,{onSelect:()=>YW(c),children:`Copy path`}),(0,L.jsx)(zW,{}),(0,L.jsx)(RW,{variant:`destructive`,disabled:n,onSelect:o,children:`Remove worktree`})]})}var ZW=e=>e?.workspace?.mode===`worktree`&&e.workspace.state!==`removed`;function QW({status:e,storedMerged:t}){if(!e)return null;let n=e.dirtyFiles.length;return t&&e.ahead===0&&n===0?(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`merged`}):(0,L.jsxs)(`span`,{className:`flex gap-1 text-muted-foreground`,children:[e.ahead>0&&(0,L.jsxs)(`span`,{role:`img`,"aria-label":`${e.ahead} ahead`,children:[`↑`,e.ahead]}),e.behind>0&&(0,L.jsxs)(`span`,{role:`img`,"aria-label":`${e.behind} behind`,children:[`↓`,e.behind]}),n>0&&(0,L.jsxs)(`span`,{children:[n,` uncommitted`]})]})}function $W({conversationId:e}){let t=Mw().data?.find(t=>t.id===e),n=Pw(e,ZW(t)).data,r=KW(e),[i,a]=(0,M.useState)(!1);if(!ZW(t))return null;let{branch:o,base:s,state:c}=t.workspace;return(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(FW,{children:[(0,L.jsx)(IW,{asChild:!0,children:(0,L.jsxs)(Z,{variant:`outline`,size:`xs`,"aria-label":`Workspace`,children:[(0,L.jsx)(JI,{}),(0,L.jsx)(`span`,{className:`max-w-40 truncate`,children:o}),(0,L.jsx)(QW,{status:n,storedMerged:c===`merged`})]})}),(0,L.jsx)(XW,{thread:t,status:n,disabled:r.pending,onMerge:r.merge,onAskToCommit:()=>r.sendMessage(BW),onCreatePullRequest:r.createPullRequest,onRemove:()=>a(!0)})]}),r.failure&&(0,L.jsx)(JW,{failure:r.failure,base:s??`the base branch`,disabled:r.pending,onSend:r.sendMessage,onDismiss:r.dismiss}),i&&(0,L.jsx)(UW,{branch:o??`worktree`,status:n,pending:r.pending,onClose:()=>a(!1),onConfirm:async e=>{await r.remove(e)&&a(!1)}})]})}var eG=e=>e.invalidateQueries({queryKey:[`goal`]});async function tG(e,t){let n=await e.goals.get(t);if(!n)return void eH.info(`No goal set. Use /goal followed by a condition.`);eH.info(`Goal`,{description:QH(n,Date.now())})}async function nG(e,t,n,r){let i=WH(n);try{if(i.kind===`status`)return await tG(e,t);if(i.kind===`clear`)await e.goals.clear(t);else if(GH(i.condition)){eH.error(`A goal condition has at most ${k_.toLocaleString(`en-US`)} characters.`);return}else await e.goals.set(t,i.condition);await eG(r),await r.invalidateQueries({queryKey:[`conversations`]})}catch(e){eH.error(_C(e))}}var rG=`Usage: /loop [5m] <prompt>, or /loop stop. Intervals: 5m, 2h, 1d (at least 1m).`,iG=/^\d+[mhd]$/;function aG(e){let t=e.trim();if(t===``)return{action:`usage`};if(t.toLowerCase()===`stop`)return{action:`stop`};let[n=``,...r]=t.split(/\s+/);if(!iG.test(n))return{action:`start`,input:{prompt:t}};let i=r.join(` `).trim();return i===``?{action:`usage`}:{action:`start`,input:{every:n,prompt:i}}}function oG(e){return hv(e)&&e.code===`nothing_to_compact`?`Nothing to compact yet`:_C(e)}function sG({conversationId:e,projectId:t,pickers:n}){let r=J(),i=Sw(),a=bt(),o=yC(),[s,c]=(0,M.useState)(!1);return{commands:(0,M.useMemo)(()=>{let s=()=>o.invalidateQueries({queryKey:[`conversations`]});return{compact:t=>r.conversations.compact(e,t?{instructions:t}:{}).catch(e=>void eH.error(oG(e))),new:()=>void a(aU(t,i)),model:()=>n.current?.openModel(),thinking:()=>n.current?.openThinking(),rename:()=>c(!0),goal:t=>nG(r,e,t,o),loop:async t=>{let n=aG(t);if(n.action===`usage`)throw Error(rG);n.action===`stop`?await r.timers.stopLoop(e):await r.timers.loop(e,n.input),await s()},archive:async()=>{await r.conversations.archive(e,!0),await s(),a(`/`)}}},[r,i,e,t,n,a,o]),renaming:s,closeRename:()=>c(!1),rename:async t=>{await r.conversations.rename(e,t),await o.invalidateQueries({queryKey:[`conversations`]})}}}function cG(e){let t=e.docs[`pi.agent`];return{provider:t?.model?.provider,modelId:t?.model?.modelId,thinkingLevel:t?.thinkingLevel??`off`}}function lG(e,t){return t?.find(t=>t.provider===e.provider&&t.modelId===e.modelId)}function uG(e,t){return e?lG(cG(e),t)?.images??!0:!0}var dG=e=>e===`steer`?`Steering`:`Queued`,fG=e=>e===`queue`?`followUp`:`steer`,pG=e=>e===`followUp`?`⏎ queue · ⌘⏎ steer`:`⏎ steer · ⌘⏎ queue`;function mG({busy:e}){let t=ww().data?.messageMode;return!e||!t?null:(0,L.jsx)(`span`,{className:`mr-1 shrink-0 self-center text-[11px] leading-none whitespace-nowrap text-muted-foreground/60`,children:pG(fG(t))})}async function hG(e,t,n,r){let i=[...r];await e.conversations.abort(t),i.length>0&&_V($R(t,n),i)}function gG({className:e,...t}){return(0,L.jsx)(uL,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:I(`size-4 animate-spin`,e),...t})}var _G=aT(`size-1.5 shrink-0 rounded-full`,{variants:{tone:{neutral:`bg-muted-foreground`,busy:`bg-warning`,success:`bg-green-500`,error:`bg-destructive`}}});function vG({tone:e,loading:t,className:n,children:r,...i}){return(0,L.jsxs)(CW,{"data-slot":`status-chip`,"data-tone":e,variant:`outline`,className:I(n),...i,children:[t?(0,L.jsx)(gG,{className:`size-3`}):(0,L.jsx)(`span`,{"aria-hidden":!0,className:_G({tone:e})}),r]})}var yG=aT(`inline-block size-2 shrink-0 rounded-full`,{variants:{status:{online:`bg-green-500`,reconnecting:`animate-pulse bg-warning`,offline:`bg-muted-foreground/50`,"update-required":`bg-warning`}}}),bG={online:`Online`,reconnecting:`Reconnecting`,offline:`Offline`,"update-required":`Update required`};function xG({status:e,className:t,...n}){return(0,L.jsx)(`span`,{"data-slot":`machine-dot`,"data-status":e,role:`img`,"aria-label":bG[e],className:I(yG({status:e}),t),...n})}function SG({className:e,...t}){return(0,L.jsx)(`ul`,{"data-slot":`machine-list`,className:I(`divide-y overflow-hidden rounded-lg border`,e),...t})}function CG({className:e,...t}){return(0,L.jsx)(`li`,{"data-slot":`machine-row`,className:I(`flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2.5`,e),...t})}function wG({className:e,...t}){return(0,L.jsx)(`div`,{className:I(`flex min-w-48 flex-1 flex-col gap-0.5`,e),...t})}function TG({className:e,...t}){return(0,L.jsx)(`div`,{className:I(`flex shrink-0 flex-wrap items-center justify-end gap-1 max-sm:w-full max-sm:justify-start`,e),...t})}function EG({version:e,state:t,latest:n,className:r,...i}){return(0,L.jsxs)(`span`,{"data-slot":`machine-row-version`,className:I(`flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,r),...i,children:[e?(0,L.jsx)(`span`,{className:`font-mono`,children:e}):null,t===`behind`?(0,L.jsxs)(vG,{tone:`busy`,children:[`Behind, latest `,n]}):t===`current`?(0,L.jsx)(vG,{tone:`success`,children:`Up to date`}):(0,L.jsx)(vG,{tone:`neutral`,children:`Version unknown`})]})}var DG={mac:`macOS`,linux:`Linux`,windows:`Windows`,unknown:`Unknown OS`};function OG(e){let t=(e??``).trim().toLowerCase().split(/\s+/)[0]??``;return t===`darwin`||t===`macos`?`mac`:t===`linux`?`linux`:t===`win32`||t===`windows`?`windows`:`unknown`}var kG=e=>DG[OG(e)],AG={mac:{viewBox:`0 0 814 1000`,path:`M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z`},linux:{viewBox:`0 0 24 24`,path:`M12.504 0c-.155 0-.315.008-.48.021-4.226.333-3.105 4.807-3.17 6.298-.076 1.092-.3 1.953-1.05 3.02-.885 1.051-2.127 2.75-2.716 4.521-.278.832-.41 1.684-.287 2.489a.424.424 0 00-.11.135c-.26.268-.45.6-.663.839-.199.199-.485.267-.797.4-.313.136-.658.269-.864.68-.09.189-.136.394-.132.602 0 .199.027.4.055.536.058.399.116.728.04.97-.249.68-.28 1.145-.106 1.484.174.334.535.47.94.601.81.2 1.91.135 2.774.6.926.466 1.866.67 2.616.47.526-.116.97-.464 1.208-.946.587-.003 1.23-.269 2.26-.334.699-.058 1.574.267 2.577.2.025.134.063.198.114.333l.003.003c.391.778 1.113 1.132 1.884 1.071.771-.06 1.592-.536 2.257-1.306.631-.765 1.683-1.084 2.378-1.503.348-.199.629-.469.649-.853.023-.4-.2-.811-.714-1.376v-.097l-.003-.003c-.17-.2-.25-.535-.338-.926-.085-.401-.182-.786-.492-1.046h-.003c-.059-.054-.123-.067-.188-.135a.357.357 0 00-.19-.064c.431-1.278.264-2.55-.173-3.694-.533-1.41-1.465-2.638-2.175-3.483-.796-1.005-1.576-1.957-1.56-3.368.026-2.152.236-6.133-3.544-6.139zm.529 3.405h.013c.213 0 .396.062.584.198.19.135.33.332.438.533.105.259.158.459.166.724 0-.02.006-.04.006-.06v.105a.086.086 0 01-.004-.021l-.004-.024a1.807 1.807 0 01-.15.706.953.953 0 01-.213.335.71.71 0 00-.088-.042c-.104-.045-.198-.064-.284-.133a1.312 1.312 0 00-.22-.066c.05-.06.146-.133.183-.198.053-.128.082-.264.088-.402v-.02a1.21 1.21 0 00-.061-.4c-.045-.134-.101-.2-.183-.333-.084-.066-.167-.132-.267-.132h-.016c-.093 0-.176.03-.262.132a.8.8 0 00-.205.334 1.18 1.18 0 00-.09.4v.019c.002.089.008.179.02.267-.193-.067-.438-.135-.607-.202a1.635 1.635 0 01-.018-.2v-.02a1.772 1.772 0 01.15-.768c.082-.22.232-.406.43-.533a.985.985 0 01.594-.2zm-2.962.059h.036c.142 0 .27.048.399.135.146.129.264.288.344.465.09.199.14.4.153.667v.004c.007.134.006.2-.002.266v.08c-.03.007-.056.018-.083.024-.152.055-.274.135-.393.2.012-.09.013-.18.003-.267v-.015c-.012-.133-.04-.2-.082-.333a.613.613 0 00-.166-.267.248.248 0 00-.183-.064h-.021c-.071.006-.13.04-.186.132a.552.552 0 00-.12.27.944.944 0 00-.023.33v.015c.012.135.037.2.08.334.046.134.098.2.166.268.01.009.02.018.034.024-.07.057-.117.07-.176.136a.304.304 0 01-.131.068 2.62 2.62 0 01-.275-.402 1.772 1.772 0 01-.155-.667 1.759 1.759 0 01.08-.668 1.43 1.43 0 01.283-.535c.128-.133.26-.2.418-.2zm1.37 1.706c.332 0 .733.065 1.216.399.293.2.523.269 1.052.468h.003c.255.136.405.266.478.399v-.131a.571.571 0 01.016.47c-.123.31-.516.643-1.063.842v.002c-.268.135-.501.333-.775.465-.276.135-.588.292-1.012.267a1.139 1.139 0 01-.448-.067 3.566 3.566 0 01-.322-.198c-.195-.135-.363-.332-.612-.465v-.005h-.005c-.4-.246-.616-.512-.686-.71-.07-.268-.005-.47.193-.6.224-.135.38-.271.483-.336.104-.074.143-.102.176-.131h.002v-.003c.169-.202.436-.47.839-.601.139-.036.294-.065.466-.065zm2.8 2.142c.358 1.417 1.196 3.475 1.735 4.473.286.534.855 1.659 1.102 3.024.156-.005.33.018.513.064.646-1.671-.546-3.467-1.089-3.966-.22-.2-.232-.335-.123-.335.59.534 1.365 1.572 1.646 2.757.13.535.16 1.104.021 1.67.067.028.135.06.205.067 1.032.534 1.413.938 1.23 1.537v-.043c-.06-.003-.12 0-.18 0h-.016c.151-.467-.182-.825-1.065-1.224-.915-.4-1.646-.336-1.77.465-.008.043-.013.066-.018.135-.068.023-.139.053-.209.064-.43.268-.662.669-.793 1.187-.13.533-.17 1.156-.205 1.869v.003c-.02.334-.17.838-.319 1.35-1.5 1.072-3.58 1.538-5.348.334a2.645 2.645 0 00-.402-.533 1.45 1.45 0 00-.275-.333c.182 0 .338-.03.465-.067a.615.615 0 00.314-.334c.108-.267 0-.697-.345-1.163-.345-.467-.931-.995-1.788-1.521-.63-.4-.986-.87-1.15-1.396-.165-.534-.143-1.085-.015-1.645.245-1.07.873-2.11 1.274-2.763.107-.065.037.135-.408.974-.396.751-1.14 2.497-.122 3.854a8.123 8.123 0 01.647-2.876c.564-1.278 1.743-3.504 1.836-5.268.048.036.217.135.289.202.218.133.38.333.59.465.21.201.477.335.876.335.039.003.075.006.11.006.412 0 .73-.134.997-.268.29-.134.52-.334.74-.4h.005c.467-.135.835-.402 1.044-.7zm2.185 8.958c.037.6.343 1.245.882 1.377.588.134 1.434-.333 1.791-.765l.211-.01c.315-.007.577.01.847.268l.003.003c.208.199.305.53.391.876.085.4.154.78.409 1.066.486.527.645.906.636 1.14l.003-.007v.018l-.003-.012c-.015.262-.185.396-.498.595-.63.401-1.746.712-2.457 1.57-.618.737-1.37 1.14-2.036 1.191-.664.053-1.237-.2-1.574-.898l-.005-.003c-.21-.4-.12-1.025.056-1.69.176-.668.428-1.344.463-1.897.037-.714.076-1.335.195-1.814.12-.465.308-.797.641-.984l.045-.022zm-10.814.049h.01c.053 0 .105.005.157.014.376.055.706.333 1.023.752l.91 1.664.003.003c.243.533.754 1.064 1.189 1.637.434.598.77 1.131.729 1.57v.006c-.057.744-.48 1.148-1.125 1.294-.645.135-1.52.002-2.395-.464-.968-.536-2.118-.469-2.857-.602-.369-.066-.61-.2-.723-.4-.11-.2-.113-.602.123-1.23v-.004l.002-.003c.117-.334.03-.752-.027-1.118-.055-.401-.083-.71.043-.94.16-.334.396-.4.69-.533.294-.135.64-.202.915-.47h.002v-.002c.256-.268.445-.601.668-.838.19-.201.38-.336.663-.336zm7.159-9.074c-.435.201-.945.535-1.488.535-.542 0-.97-.267-1.28-.466-.154-.134-.28-.268-.373-.335-.164-.134-.144-.333-.074-.333.109.016.129.134.199.2.096.066.215.2.36.333.292.2.68.467 1.167.467.485 0 1.053-.267 1.398-.466.195-.135.445-.334.648-.467.156-.136.149-.267.279-.267.128.016.034.134-.147.332a8.097 8.097 0 01-.69.468zm-1.082-1.583V5.64c-.006-.02.013-.042.029-.05.074-.043.18-.027.26.004.063 0 .16.067.15.135-.006.049-.085.066-.135.066-.055 0-.092-.043-.141-.068-.052-.018-.146-.008-.163-.065zm-.551 0c-.02.058-.113.049-.166.066-.047.025-.086.068-.14.068-.05 0-.13-.02-.136-.068-.01-.066.088-.133.15-.133.08-.031.184-.047.259-.005.019.009.036.03.03.05v.02h.003z`},windows:{viewBox:`0 0 88 88`,path:`m0 12.402 35.687-4.86.016 34.423-35.67.203zm35.67 33.529.028 34.453L.028 75.48.026 45.7zm4.326-39.025L87.314 0v41.527l-47.318.376zm47.329 39.349-.011 41.34-47.318-6.678-.066-34.739z`}};function jG({os:e,className:t,...n}){let r=OG(e);return(0,L.jsx)(`svg`,{"data-slot":`os-icon`,"data-os":r,viewBox:r===`unknown`?`0 0 24 24`:AG[r].viewBox,"aria-hidden":!0,className:I(`size-4 shrink-0`,t),...r===`unknown`?{fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`}:{fill:`currentColor`},...n,children:r===`unknown`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`rect`,{width:`18`,height:`12`,x:`3`,y:`4`,rx:`2`}),(0,L.jsx)(`path`,{d:`M8 20h8M12 16v4`})]}):(0,L.jsx)(`path`,{d:AG[r].path})})}var MG={online:`online`,reconnecting:`reconnecting`,offline:`offline`,"update-required":`update required`};function NG({os:e,status:t,className:n,...r}){return(0,L.jsxs)(`span`,{"data-slot":`machine-avatar`,"data-status":t,role:`img`,"aria-label":`${kG(e)}, ${MG[t]}`,className:I(`relative inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground`,n),...r,children:[(0,L.jsx)(jG,{os:e,className:`size-full`}),(0,L.jsx)(xG,{status:t,"aria-hidden":!0,role:`presentation`,className:`absolute -right-1 -bottom-1 size-1.5 ring-2 ring-background`})]})}function PG(){let e=hz(),{data:t=[],isLoading:n}=gw({queryKey:Y.machines,queryFn:()=>gC.machines.list()},e);return{machines:t,isLoading:n}}function FG(){let e=hz(),{data:t}=gw({queryKey:Y.hubLink,queryFn:()=>yw().machines.hubLink()},e);return t?.os}function IG(e){let{machines:t}=PG(),n=FG();if(e===void 0)return{os:n,status:`online`};let r=t.find(t=>t.id===e);return{os:r?.os,status:r?.status??`offline`}}var LG=6e4,RG=60*LG,zG=24*RG;function BG(e,t){let n=Math.max(0,t-e);return n<LG?`just now`:n<RG?`${Math.floor(n/LG)} min ago`:n<zG?`${Math.floor(n/RG)} h ago`:`${Math.floor(n/zG)} d ago`}var VG=e=>e.status===`online`||e.status===`reconnecting`;function HG(e,t){return e.status===`online`?`Online`:e.status===`reconnecting`?`Reconnecting…`:e.status===`update-required`?`Update tau on ${e.name}`:`Offline, last seen ${BG(e.lastSeenAt,t)}`}var UG=`npm i -g @pablopunk/tau@latest`,WG=`The hub gets full power on the machine you connect: its terminals, its agents and its Claude login. Everything on that machine, threads and files in them, shows up in this tau. Connect only machines you own.`,GG=e=>({darwin:`macOS`,linux:`Linux`,win32:`Windows`})[e]??e,KG=`This machine`;function qG(e){let{machines:t}=PG();if(t.filter(VG).length!==0)return e===void 0?KG:t.find(t=>t.id===e)?.name}function JG({id:e,extras:t}){let n=Mw().data?.find(t=>t.id===e)?.title||`Conversation`,r=Sw(),i=qG(r),a=IG(r);return(0,L.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 border-b px-4 py-2`,children:[(0,L.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:n}),i?(0,L.jsxs)(CW,{variant:`outline`,children:[(0,L.jsx)(NG,{os:a.os,status:a.status}),i]}):null,t]})}var YG=`\0`,XG=(e,t)=>[t.filter(Boolean).join(`
|
|
58
|
+
`),e].join(YG),ZG=e=>e.split(YG)[0]??``,QG=e=>(e.split(`
|
|
59
|
+
`)[0]??``).toLowerCase(),$G=e=>e.slice(e.lastIndexOf(`/`)+1);function eK(e,t){let n=t.trim().toLowerCase();if(n===``)return 1;let r=ZG(e),i=QG(r);return $G(i)===n?1:$G(i).startsWith(n)?.95:i.includes(n)?.9:r.toLowerCase().includes(n)?.6:0}function tK(e){let t=new Map;for(let n of e)t.set(n.group,[...t.get(n.group)??[],n]);return[...t.entries()]}function nK({options:e,value:t,onChange:n,placeholder:r=`Select…`,searchPlaceholder:i=`Search…`,emptyText:a=`Nothing found.`,id:o,disabled:s,className:c,contentClassName:l,open:u,onOpenChange:d,groupActions:f,groupIcons:p,searchable:m=!0,footer:h,variant:g=`outline`,size:_=`default`,triggerIcon:v,"aria-label":y}){let[b,x]=M.useState(!1),S=u??b,C=e=>{x(e),d?.(e)},w=M.useRef(null),T=e.find(e=>e.value===t);return(0,L.jsxs)(vz,{open:S,onOpenChange:C,children:[(0,L.jsx)(yz,{asChild:!0,children:(0,L.jsxs)(Z,{id:o,"data-slot":`combobox-trigger`,type:`button`,variant:g,size:_,role:`combobox`,"aria-label":y,"aria-expanded":S,disabled:s,className:I(`w-full justify-between font-normal`,c),children:[v,(0,L.jsx)(`span`,{className:I(`truncate`,!T&&`text-muted-foreground`),children:T?.triggerLabel??T?.label??r}),(0,L.jsx)(doe,{className:`opacity-50`})]})}),(0,L.jsx)(bz,{"data-slot":`combobox-content`,className:I(`max-h-(--radix-popover-content-available-height) w-(--radix-popover-trigger-width) min-w-52 max-w-[calc(100vw-2rem)] p-0 [&_[data-slot=command-list]]:max-h-[max(9rem,min(18rem,calc(var(--radix-popover-content-available-height)-6rem)))]`,l),align:`start`,collisionPadding:12,children:(0,L.jsxs)(PB,{filter:eK,children:[m?(0,L.jsx)(IB,{placeholder:i,onValueChange:()=>w.current&&(w.current.scrollTop=0)}):null,(0,L.jsxs)(LB,{ref:w,children:[(0,L.jsx)(RB,{children:a}),tK(e).map(([e,r])=>(0,L.jsxs)(zB,{heading:e!==void 0&&p?.[e]?(0,L.jsxs)(`span`,{"data-slot":`combobox-group-heading`,className:`flex items-center gap-2`,children:[p[e],e]}):e,className:`relative`,children:[e!==void 0&&f?.[e]?(0,L.jsx)(`div`,{"data-slot":`combobox-group-action`,className:`absolute top-1 right-1 z-10`,children:f[e]}):null,r.map(e=>(0,L.jsxs)(BB,{value:XG(e.value,[e.label,e.description,...e.keywords??[]]),disabled:e.disabled,onSelect:()=>{n(e.value),C(!1)},children:[e.icon,(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:e.label}),e.description?(0,L.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.description}):null]}),e.hint?(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.hint}):null,(0,L.jsx)(yI,{className:I(`ml-auto`,e.value===t?`opacity-100`:`opacity-0`)})]},e.value))]},e??`options`))]}),h?(0,L.jsx)(`div`,{"data-slot":`combobox-footer`,className:`border-t p-1`,children:h(()=>C(!1))}):null]})})]})}var rK=e=>`${e.provider}/${e.modelId}`,iK=`claude-cli`,aK=e=>` (${e.modelId})`,oK=e=>e.name.endsWith(aK(e))?e.name.slice(0,-aK(e).length):e.name,sK=e=>`${oK(e)}${aK(e)}`,cK=e=>`${e.providerName} · ${oK(e)}`,lK=e=>e.provider===iK?sK(e):e.name,uK=e=>e.provider===iK?cK(e):void 0,dK=e=>({value:rK(e),label:lK(e),triggerLabel:uK(e),description:rK(e),group:e.providerName,keywords:[e.modelId]}),fK=e=>[...e.filter(e=>e.provider===iK),...e.filter(e=>e.provider!==iK)],pK=`__clear__`;function mK({models:e,value:t,onChange:n,id:r,disabled:i,className:a,variant:o,size:s,ariaLabel:c,open:l,onOpenChange:u,clearLabel:d,onClear:f}){let p=fK(e).map(dK);return(0,L.jsx)(nK,{id:r,disabled:i,className:a,contentClassName:`w-[min(32rem,calc(100vw-2rem))]`,variant:o,size:s,"aria-label":c,open:l,onOpenChange:u,options:[...d?[{value:pK,label:d}]:[],...p],value:t?rK(t):d?pK:null,placeholder:`Select a model…`,searchPlaceholder:`Search models…`,emptyText:`No model found.`,onChange:t=>{if(t===pK)return f?.();let r=e.find(e=>rK(e)===t);r&&n({provider:r.provider,modelId:r.modelId})}})}function hK(e){let t=e.levels.some(e=>e!==`off`),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(!1);return(0,M.useImperativeHandle)(e.ref,()=>({openModel:()=>r(!0),openThinking:()=>a(!0)})),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(mK,{models:e.models,value:e.model,onChange:e.onModel,disabled:e.disabled,variant:`ghost`,size:`sm`,className:`w-auto min-w-0 max-w-full`,ariaLabel:`Model`,open:n,onOpenChange:r}),t&&(0,L.jsx)(nK,{"aria-label":`Thinking level`,triggerIcon:(0,L.jsx)(_I,{className:`opacity-60`}),variant:`ghost`,size:`sm`,className:`w-auto`,searchable:!1,open:i,onOpenChange:a,disabled:e.disabled,options:e.levels.map(e=>({value:e,label:e})),value:e.level,onChange:t=>e.onLevel(t)})]})}var gK=16,_K=2,vK=7,yK=5,bK=2*Math.PI*vK;function xK(e,t){return Math.min(100,Math.max(0,e/t*100))}function SK(e){return e>=95?`text-destructive`:e>=80?`text-warning`:`text-primary`}function CK({used:e,total:t,label:n,className:r}){if(t<=0||e<=0)return null;let i=xK(e,t),a=n??`${Math.round(i)}%`;return(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsxs)(`span`,{role:`meter`,"aria-label":a,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":Math.min(Math.max(e,0),t),tabIndex:0,"data-slot":`context-meter`,className:I(`inline-flex shrink-0 items-center gap-1 rounded-full text-xs tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-ring`,SK(i),r),children:[(0,L.jsxs)(`svg`,{viewBox:`0 0 ${gK} ${gK}`,className:`size-4 shrink-0 -rotate-90`,"aria-hidden":`true`,children:[(0,L.jsx)(`circle`,{cx:gK/2,cy:gK/2,r:vK,fill:`none`,strokeWidth:_K,className:`stroke-muted-foreground/30`}),(0,L.jsx)(`circle`,{cx:gK/2,cy:gK/2,r:vK,fill:`none`,strokeWidth:_K,strokeLinecap:i<yK?`butt`:`round`,stroke:`currentColor`,strokeDasharray:bK,strokeDashoffset:bK*(1-i/100)})]}),(0,L.jsxs)(`span`,{children:[Math.round(i),`%`]})]})}),(0,L.jsx)(CR,{children:a})]})}var wK=1500,TK=(e,t)=>{let n=J();return gw({queryKey:Y.processLogs(e,200),queryFn:()=>n.processes.logs(e,200),refetchInterval:t?wK:!1})};function EK({processId:e,live:t}){let n=TK(e,t),r=(0,M.useRef)(null),i=n.data??``;return(0,M.useEffect)(()=>{let e=r.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,L.jsx)(`figure`,{"aria-label":`Process logs`,children:(0,L.jsx)(`pre`,{ref:r,className:`max-h-64 overflow-auto rounded-md border bg-background px-3 py-2 font-mono text-xs leading-5 whitespace-pre-wrap break-words`,children:i||`No output yet.`})})}var DK=e=>e.filter(e=>e.state===`running`).length,OK=e=>e.state===`running`?`Running`:e.state===`killed`?`Stopped`:e.exitCode===0||e.exitCode===null?`Exited`:`Exited ${e.exitCode}`;function kK(e){let t=J(),n=yC();return()=>t.processes.stop(e.id).then(()=>n.invalidateQueries({queryKey:Y.processes(e.conversationId)})).catch(e=>void eH.error(_C(e)))}function AK({process:e}){let t=kK(e),n=e.state===`running`;return(0,L.jsxs)(`li`,{className:`space-y-2 px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.name}),e.kind===`monitor`?(0,L.jsx)(CW,{variant:`outline`,children:`monitor`}):null,(0,L.jsx)(CW,{variant:n?`default`:`secondary`,children:OK(e)}),n?(0,L.jsx)(Z,{size:`sm`,variant:`outline`,onClick:()=>void t(),children:`Stop`}):null]}),(0,L.jsx)(`code`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.command}),e.urls.map(e=>(0,L.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`block truncate text-xs underline`,children:e},e)),(0,L.jsx)(EK,{processId:e.id,live:n})]})}function jK({processes:e,open:t,onOpenChange:n}){return(0,L.jsx)(pR,{open:t,onOpenChange:n,children:(0,L.jsxs)(gR,{className:`overflow-y-auto sm:max-w-md`,children:[(0,L.jsxs)(_R,{children:[(0,L.jsx)(vR,{children:`Background processes`}),(0,L.jsx)(yR,{children:`Started by the agent in this thread.`})]}),(0,L.jsx)(`ul`,{className:`divide-y`,children:e.map(e=>(0,L.jsx)(AK,{process:e},e.id))})]})})}function MK({conversationId:e}){let[t,n]=(0,M.useState)(!1),r=rre(e).data??[],i=DK(r);return i===0&&!t?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Z,{variant:`outline`,size:`sm`,"aria-label":`${i} running processes`,onClick:()=>n(!0),children:[(0,L.jsx)(HL,{}),i]}),(0,L.jsx)(jK,{processes:r,open:t,onOpenChange:n})]})}var NK=6e4,PK=60*NK,FK=24*PK;function IK(e,t){let n=e-t;return n<=0?`now`:n<NK?`in less than a minute`:n<PK?`in ${Math.round(n/NK)} min`:n<FK?`in ${Math.round(n/PK)} h`:`in ${Math.round(n/FK)} d`}var LK=e=>e.kind===`repeat`&&e.every!==null?`every ${e.every}`:`once`,RK=e=>e===0?`not fired yet`:`fired ${e}×`,zK=(e,t)=>e===null?`Has a timer`:`Next wake-up ${IK(Date.parse(e),t)}`;function BK({timer:e,now:t,onDelete:n}){return(0,L.jsxs)(`li`,{"data-testid":`timer-row`,className:`flex items-start gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,L.jsx)(`p`,{className:`line-clamp-2 break-words text-sm`,title:e.prompt,children:e.prompt}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:LK(e)}),(0,L.jsxs)(`span`,{children:[`· next `,IK(e.nextAt,t)]}),(0,L.jsxs)(`span`,{children:[`· `,RK(e.firedCount)]}),e.source===`loop`?(0,L.jsx)(CW,{variant:`secondary`,className:`h-4`,children:`/loop`}):null]})]}),(0,L.jsx)(Z,{variant:`ghost`,size:`icon-xs`,"aria-label":`Delete timer: ${e.prompt}`,onClick:()=>n(e),children:(0,L.jsx)(oR,{})})]})}function VK(e,t=15e3){let[n,r]=(0,M.useState)(()=>Date.now());return(0,M.useEffect)(()=>{if(!e)return;r(Date.now());let n=setInterval(()=>r(Date.now()),t);return()=>clearInterval(n)},[e,t]),n}function HK({conversationId:e,open:t}){let n=J(),r=yC(),i=ire(e,t),a=VK(t),o=async t=>{try{await n.timers.delete(t.id),await r.invalidateQueries({queryKey:Y.timers(e)}),await r.invalidateQueries({queryKey:[`conversations`]})}catch(e){eH.error(_C(e))}};return i.isPending?(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,L.jsx)(gG,{}),` Loading timers…`]}):i.isError?(0,L.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,L.jsxs)(`p`,{role:`alert`,className:`text-destructive`,children:[`Could not load the timers. `,_C(i.error)]}),(0,L.jsx)(Z,{variant:`outline`,size:`sm`,onClick:()=>void i.refetch(),children:`Retry`})]}):i.data.length===0?(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`No timers.`}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-3`,children:i.data.map(e=>(0,L.jsx)(BK,{timer:e,now:a,onDelete:e=>void o(e)},e.id))})}function UK({conversationId:e}){let[t,n]=(0,M.useState)(!1),r=Mw().data?.find(t=>t.id===e)?.timers??0;return r===0?null:(0,L.jsxs)(vz,{open:t,onOpenChange:n,children:[(0,L.jsx)(yz,{asChild:!0,children:(0,L.jsxs)(Z,{variant:`outline`,size:`sm`,"aria-label":`${r} timers`,children:[(0,L.jsx)(iR,{}),r]})}),(0,L.jsxs)(bz,{align:`end`,className:`w-80`,children:[(0,L.jsx)(Sz,{children:(0,L.jsx)(Cz,{children:`Timers`})}),(0,L.jsx)(HK,{conversationId:e,open:t})]})]})}var WK=4;function GK(e){if(e.kind===`pi.assistant`)return e.model?.[0]?.usage}function KK(e){return(e.totalTokens??0)>0?e.totalTokens??0:(e.input??0)+(e.cacheRead??0)+(e.cacheWrite??0)+(e.output??0)}function qK(e){return(e.model??[]).reduce((e,t)=>e+JSON.stringify(t.content??``).length,0)}function JK(e){let t=e.findLastIndex(e=>e.kind===`pi.compaction`);if(t<0)return e;let n=String(e[t].head),r=e.findIndex((e,r)=>r>t&&String(e.id)===n);return e.slice(r>=0?r:t+1)}function YK(e){return e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function XK(e,t){let n=Math.round(e/t*100);return`${YK(e)} of ${YK(t)} tokens · ${n}%`}function ZK(e,t){if(t<=0)return null;let n=JK(e),r=n.findLastIndex(e=>GK(e)!==void 0);if(r<0)return null;let i=GK(n[r]),a=n.slice(r+1).reduce((e,t)=>e+qK(t),0),o=KK(i)+Math.ceil(a/WK);return{used:o,total:t,label:XK(o,t)}}function QK({id:e,view:t,pickers:n}){let r=J(),i=Ew().data,a=(e,t)=>r.conversations.configure(e,t).catch(e=>void eH.error(_C(e))),o=cG(t);if(!i)return null;let s=lG(o,i),c=s?{provider:s.provider,modelId:s.modelId}:null,l=s?ZK(t.entries,s.contextWindow):null;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(hK,{ref:n,models:i,model:c,onModel:t=>void a(e,{model:t}),levels:s?.thinkingLevels??[`off`],level:o.thinkingLevel,onLevel:t=>void a(e,{thinkingLevel:t})}),(0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[l?(0,L.jsx)(CK,{used:l.used,total:l.total,label:l.label}):null,(0,L.jsx)(nU,{conversationId:e}),(0,L.jsx)(MK,{conversationId:e}),(0,L.jsx)(UK,{conversationId:e})]})]})}function $K({...e}){return(0,L.jsx)(WE,{"data-slot":`collapsible`,...e})}function eq({...e}){return(0,L.jsx)(KE,{"data-slot":`collapsible-trigger`,...e})}function tq({...e}){return(0,L.jsx)(JE,{"data-slot":`collapsible-content`,...e})}var nq=/^(---|\+\+\+) /;function rq(e){return e.startsWith(`@@`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`}function iq(e){return e.split(`
|
|
60
|
+
`).filter((e,t,n)=>!nq.test(e)&&(t!==n.length-1||e!==``)).map(e=>({kind:rq(e),text:e}))}function aq(e){return{added:e.filter(e=>e.kind===`add`).length,removed:e.filter(e=>e.kind===`remove`).length}}var oq={add:`bg-success/15 text-foreground`,remove:`bg-destructive/15 text-foreground`,hunk:`text-muted-foreground`,context:`text-muted-foreground`},sq={add:`Added`,remove:`Removed`,hunk:`Section`,context:``};function cq({line:e}){return(0,L.jsxs)(`div`,{className:I(`whitespace-pre px-3`,oq[e.kind]),children:[(0,L.jsxs)(`span`,{className:`sr-only`,children:[sq[e.kind],` `]}),e.text||` `]})}function lq({diff:e}){let t=iq(e);return(0,L.jsx)(`figure`,{"aria-label":`Diff`,className:`max-h-96 overflow-auto rounded-md border bg-background py-1 font-mono text-xs leading-5`,children:t.map((e,t)=>(0,L.jsx)(cq,{line:e},t))})}var uq=e=>`${e} ${e===1?`file`:`files`} changed`;function dq({conversationId:e,checkpointId:t,path:n}){let r=J(),i=gw({queryKey:[`checkpoint-diff`,e,t,n],queryFn:()=>r.conversations.checkpointDiff(e,t,n)});return i.isPending?(0,L.jsx)(gG,{"aria-label":`Loading diff`}):i.isError?(0,L.jsx)(`p`,{className:`text-sm text-destructive`,children:_C(i.error)}):i.data?(0,L.jsx)(lq,{diff:i.data}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changes.`})}function fq({file:e,conversationId:t,checkpointId:n}){return(0,L.jsxs)($K,{className:`group/file`,children:[(0,L.jsxs)(eq,{className:`flex w-full items-center gap-2 rounded px-1 py-1 text-left font-mono text-xs outline-none hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,L.jsx)(SI,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/file:rotate-90`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.path}),(0,L.jsxs)(`span`,{className:`shrink-0 text-success`,children:[`+`,e.added]}),(0,L.jsxs)(`span`,{className:`shrink-0 text-destructive`,children:[`-`,e.removed]})]}),(0,L.jsx)(tq,{className:`pt-1`,children:(0,L.jsx)(dq,{conversationId:t,checkpointId:n,path:e.path})})]})}function pq({conversationId:e,entryId:t}){let n=nre(e).data?.find(e=>e.kind===`after`&&e.entryId===t);return!n||n.files.length===0?null:(0,L.jsxs)($K,{className:`group/turn overflow-hidden rounded-lg border bg-card text-card-foreground`,children:[(0,L.jsxs)(eq,{className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,L.jsx)(SI,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/turn:rotate-90`}),(0,L.jsx)(`span`,{className:`font-medium`,children:uq(n.files.length)})]}),(0,L.jsx)(tq,{className:`space-y-1 border-t p-2`,children:n.files.map(t=>(0,L.jsx)(fq,{file:t,conversationId:e,checkpointId:n.id},t.path))})]})}var mq=1500;function hq({text:e,label:t=`Copy`,variant:n=`ghost`,size:r=`icon-xs`,...i}){let[a,o]=M.useState(!1),s=M.useRef(void 0);return M.useEffect(()=>()=>clearTimeout(s.current),[]),(0,L.jsx)(Z,{"data-slot":`copy-button`,type:`button`,variant:n,size:r,"aria-label":a?`Copied`:t,title:a?`Copied`:t,onClick:async()=>{try{await navigator.clipboard.writeText(typeof e==`function`?e():e)}catch{return}o(!0),clearTimeout(s.current),s.current=setTimeout(()=>o(!1),mq)},...i,children:a?(0,L.jsx)(yI,{}):(0,L.jsx)(goe,{})})}function gq(e,t,n){return e?e.message.isError?`error`:`done`:t?t.status===`done`?`done`:t.status:n?`pending`:`interrupted`}function _q(e,t){let n=t.results.get(e.id),r=t.slots.find(t=>t.callId===e.id);return{call:e,status:gq(n,r,t.busy),result:n,slot:r}}function vq(e){return e===`pending`||e===`running`}function yq(e,t){let n=e.call.arguments?.[t];return typeof n==`string`?n:void 0}function bq(e){return e?e.message.content.flatMap(e=>e.type===`text`&&!e.text.startsWith(`<harness>`)?[e.text]:[]).join(``):``}function xq(e){return(e?.message.content??[]).filter(e=>e.type===`image`)}function Sq(e){let t=e.result?.message.details??e.slot?.details;return t&&typeof t==`object`?t:{}}function Cq(e){let t=(e?.diagnostics.find(e=>e.code===`exit_code`))?.message.match(/(\d+)/);return t?Number(t[1]):void 0}function wq(e){return e?.diagnostics.some(e=>e.code===`aborted`)??!1}var Tq={pending:`Starting`,running:`Running`,done:`Done`,error:`Failed`,interrupted:`Interrupted`};function Eq({status:e}){let t={className:`size-3.5`,"aria-hidden":!0};return vq(e)?(0,L.jsx)(uL,{...t,className:`size-3.5 animate-spin text-muted-foreground`}):e===`done`?(0,L.jsx)(yI,{...t,className:`size-3.5 text-success`}):e===`error`?(0,L.jsx)(fR,{...t,className:`size-3.5 text-destructive`}):(0,L.jsx)(foe,{...t,className:`size-3.5 text-muted-foreground`})}function Dq({icon:e,title:t,subtitle:n,status:r,badge:i,children:a,openWhileActive:o=!0}){let[s,c]=(0,M.useState)(void 0),[l,u]=(0,M.useState)(!1),d=o&&vq(r),f=(0,M.useRef)(0);return(0,M.useEffect)(()=>{if(!d)return;let e=setTimeout(()=>{f.current=Date.now(),u(!0)},400);return()=>clearTimeout(e)},[d]),(0,M.useEffect)(()=>{if(d||!l)return;let e=Date.now()-f.current;if(e>=800){u(!1);return}let t=setTimeout(()=>u(!1),800-e);return()=>clearTimeout(t)},[d,l]),(0,L.jsxs)($K,{open:s??l,onOpenChange:c,"data-tool-status":r,className:`group/tool overflow-hidden rounded-lg border bg-card text-card-foreground`,children:[(0,L.jsxs)(eq,{className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,L.jsx)(SI,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/tool:rotate-90`}),(0,L.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-muted-foreground [&_svg]:size-4`,children:e}),(0,L.jsx)(`span`,{className:`shrink-0 font-medium`,children:t}),n?(0,L.jsx)(`span`,{className:I(`min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground`),children:n}):(0,L.jsx)(`span`,{className:`flex-1`}),i,(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center`,role:`status`,children:[(0,L.jsx)(Eq,{status:r}),(0,L.jsx)(`span`,{className:`sr-only`,children:Tq[r]})]})]}),a?(0,L.jsx)(tq,{className:`space-y-2 border-t p-3`,children:a}):null]})}var Oq=[`running`,`done`,`failed`,`stopped`],kq=e=>typeof e==`string`?e:``;function Aq(e){let t=e&&typeof e==`object`?e:{},n=kq(t.status);return{id:kq(t.id),description:kq(t.description),type:kq(t.type),model:kq(t.model),status:Oq.includes(n)?n:void 0}}function jq(e){let t=Sq(e).agents;return Array.isArray(t)?t.map(Aq):[]}function Mq({state:e}){let t=jq(e),n=NW();return(0,L.jsx)(Dq,{icon:(0,L.jsx)(cL,{}),title:`Subagents`,subtitle:`${t.length} total`,status:e.status,children:t.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No subagents.`}):(0,L.jsxs)(`table`,{className:`w-full text-left text-xs`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`text-muted-foreground`,children:[(0,L.jsx)(`th`,{className:`py-1 pr-2 font-medium`,children:`Description`}),(0,L.jsx)(`th`,{className:`py-1 pr-2 font-medium`,children:`Type`}),(0,L.jsx)(`th`,{className:`py-1 pr-2 font-medium`,children:`Model`}),(0,L.jsx)(`th`,{className:`py-1 font-medium`,children:`Status`})]})}),(0,L.jsx)(`tbody`,{children:t.map(e=>(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`td`,{className:`py-1 pr-2`,children:e.description||e.id}),(0,L.jsx)(`td`,{className:`py-1 pr-2`,children:e.type}),(0,L.jsx)(`td`,{className:`py-1 pr-2`,children:n.ofKey(e.model)}),(0,L.jsx)(`td`,{className:`py-1`,children:(0,L.jsx)(TW,{status:e.status})})]},e.id))})]})})}function Nq(e){let t=Sq(e),n=t.conversationId??t.childId??t.id;return typeof n==`string`?n:void 0}function Pq(e){let t=Mw().data;return e?t?.find(t=>t.id===e):void 0}function Fq({state:e}){let t=yq(e,`id`),n=Pq(t),r=bq(e.result),i=e.status===`error`;return(0,L.jsx)(Dq,{icon:(0,L.jsx)(QI,{}),title:`Merge ${n?.title.trim()||t||`subagent`}`,status:e.status,children:r?(0,L.jsx)(zU,{variant:i?`destructive`:`default`,"data-merge-result":i?`conflict`:`merged`,children:(0,L.jsx)(VU,{className:`whitespace-pre-wrap`,children:r})}):null})}function Iq({state:e}){let t=yq(e,`to`),n=Pq(t),r=yq(e,`message`);return(0,L.jsx)(Dq,{icon:(0,L.jsx)(gL,{}),title:`Message to ${n?.title.trim()||t||`subagent`}`,subtitle:r,status:e.status,badge:(0,L.jsx)(CW,{variant:`outline`,children:yq(e,`mode`)??`followUp`}),children:r?(0,L.jsx)(`p`,{className:`whitespace-pre-wrap text-sm`,children:r}):null})}function Lq({state:e}){let t=yq(e,`id`),n=Pq(t);return(0,L.jsx)(Dq,{icon:(0,L.jsx)(XL,{}),title:`Stop ${n?.title.trim()||t||`subagent`}`,status:e.status})}var Rq=`Needs approval`;function zq({conversationId:e,enabled:t=!0}){return Fw(e,t).data?.length?(0,L.jsx)(CW,{variant:`destructive`,children:Rq}):null}function Bq({child:e}){let t=Sw();return(0,L.jsx)(Z,{asChild:!0,variant:`outline`,size:`sm`,children:(0,L.jsx)(Ln,{to:iU(e.projectId,e.id,t),children:`Open`})})}var Vq=40;function Hq(e,t){return t===`end`?e.slice(-40):e.slice(0,Vq)}function Uq({text:e,label:t,keep:n=`start`,className:r}){let[i,a]=(0,M.useState)(!1),o=e.replace(/\n$/,``).split(`
|
|
61
|
+
`),s=o.length-Vq,c=i||s<=0?o:Hq(o,n);return(0,L.jsxs)(`figure`,{"aria-label":t,className:`space-y-1.5`,children:[(0,L.jsx)(`pre`,{className:I(`max-h-96 overflow-auto rounded-md border bg-background px-3 py-2 font-mono text-xs leading-5 whitespace-pre-wrap break-words`,r),children:c.join(`
|
|
62
|
+
`)}),s>0?(0,L.jsx)(Z,{variant:`ghost`,size:`xs`,onClick:()=>a(e=>!e),children:i?`Show less`:`Show all ${o.length} lines`}):null]})}function Wq({state:e}){let t=Nq(e),n=Pq(t),r=NW(),i=n?.agentType??yq(e,`subagent_type`),a=OW(r.ofRef(n?.agentModel)??yq(e,`model`),n?.agentThinking??yq(e,`thinking`)),o=bq(e.result);return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(hI,{}),openWhileActive:!1,title:n?.title.trim()||`Subagent`,subtitle:yq(e,`description`),status:AW(n,e.status),badge:(0,L.jsx)(CW,{variant:`secondary`,children:EW(i)}),children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a?(0,L.jsx)(CW,{variant:`outline`,children:a}):null,(0,L.jsx)(TW,{status:n?.agentStatus}),t?(0,L.jsx)(zq,{conversationId:t,enabled:DW(n)}):null,n?(0,L.jsx)(Bq,{child:n}):null,t&&DW(n)?(0,L.jsx)(jW,{childId:t}):null]}),o?(0,L.jsx)(Uq,{text:o,label:e.status===`error`?`Error`:`Answer`}):null]})}function Gq(e){return e.result?bq(e.result):e.slot?.output??``}function Kq(e){let t=Sq(e),n=t.truncation;return t.truncated===!0||n?.truncated===!0||(e.slot?.droppedLines??0)>0||(e.slot?.droppedBytes??0)>0}function qq({state:e}){if(wq(e.result))return(0,L.jsx)(CW,{variant:`secondary`,children:`Stopped`});let t=Cq(e.result);return t===void 0?null:(0,L.jsxs)(CW,{variant:`destructive`,children:[`Exit `,t]})}function Jq({state:e}){let t=Gq(e);return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(nR,{}),title:`Bash`,subtitle:yq(e,`command`),status:e.status,badge:(0,L.jsx)(qq,{state:e}),children:[t?(0,L.jsx)(Uq,{text:t,label:`Command output`,keep:`end`}):null,Kq(e)?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Output was truncated.`}):null,!t&&!vq(e.status)?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No output.`}):null]})}function Yq({src:e,alt:t}){let[n,r]=(0,M.useState)(!1);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{type:`button`,"aria-label":`Open ${t}`,onClick:()=>r(!0),className:`block cursor-zoom-in rounded-lg outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,L.jsx)(`img`,{src:e,alt:t,draggable:!1,className:`max-h-60 max-w-full rounded-lg border bg-muted object-contain`})}),(0,L.jsx)(yB,{open:n,onOpenChange:r,children:(0,L.jsxs)(SB,{className:`sm:max-w-3xl`,children:[(0,L.jsx)(TB,{children:t}),(0,L.jsx)(EB,{className:`sr-only`,children:`Full size image`}),(0,L.jsx)(`img`,{src:e,alt:`${t}, full size`,className:`max-h-[75vh] w-full object-contain`})]})})]})}function Xq(e){let t=xq(e.result);return t.length===0?null:(0,L.jsx)(`ul`,{"aria-label":`Result images`,className:`flex flex-wrap gap-2`,children:t.map((e,t)=>(0,L.jsx)(`li`,{children:(0,L.jsx)(Yq,{src:`data:${e.mimeType};base64,${e.data}`,alt:`Result image ${t+1}`})},t))})}var Zq=`Tool claude_connector is not available`,Qq=`Claude connectors need a Claude CLI model`,$q=(e,t)=>`${(e??`?`).replace(/^claude\.ai /,``)} · ${t??`?`}`,eJ=e=>e.startsWith(Zq)?Qq:e;function tJ(e){let t=e.call.arguments?.arguments;return t&&typeof t==`object`&&Object.keys(t).length?JSON.stringify(t,null,2):``}function nJ({state:e}){let t=tJ(e),n=eJ(bq(e.result)||(e.slot?.output??``));return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(ML,{}),title:$q(yq(e,`server`),yq(e,`tool`)),status:e.status,badge:e.status===`error`?(0,L.jsx)(CW,{variant:`destructive`,children:`Error`}):null,children:[t?(0,L.jsx)(Uq,{text:t,label:`Arguments`}):null,n?(0,L.jsx)(Uq,{text:n,label:`Result`}):null,Xq(e)]})}function rJ(e){return(e.call.arguments?.edits??[]).flatMap(e=>[...(e.oldText??``).split(`
|
|
63
|
+
`).map(e=>`-${e}`),...(e.newText??``).split(`
|
|
64
|
+
`).map(e=>`+${e}`)]).join(`
|
|
65
|
+
`)}function iJ(e){let t=Sq(e);return typeof t.patch==`string`&&t.patch?t.patch:typeof t.diff==`string`&&t.diff?t.diff:rJ(e)}function aJ({diff:e}){let{added:t,removed:n}=aq(iq(e));return!t&&!n?null:(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[(0,L.jsxs)(`span`,{className:`text-success`,children:[`+`,t]}),` `,(0,L.jsxs)(`span`,{className:`text-destructive`,children:[`-`,n]})]})}function oJ({state:e}){let t=iJ(e),n=e.status===`error`?bq(e.result):``;return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(II,{}),title:`Edit`,subtitle:yq(e,`path`),status:e.status,badge:(0,L.jsx)(aJ,{diff:t}),children:[n?(0,L.jsx)(`p`,{className:`text-sm text-destructive`,children:n}):null,t?(0,L.jsx)(lq,{diff:t}):null]})}function sJ(e){let t=e.call.arguments??{};return Object.keys(t).length?JSON.stringify(t,null,2):``}function cJ({state:e}){let t=sJ(e),n=bq(e.result)||(e.slot?.output??``);return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(uR,{}),title:e.call.name,status:e.status,children:[t?(0,L.jsx)(Uq,{text:t,label:`Arguments`}):null,n?(0,L.jsx)(Uq,{text:n,label:`Result`}):null,Xq(e)]})}var lJ=e=>e.result?bq(e.result):e.slot?.output??``;function uJ(e){let t=e.call.arguments?.arguments;return t&&typeof t==`object`&&Object.keys(t).length?JSON.stringify(t,null,2):``}function dJ({state:e}){let t=uJ(e),n=lJ(e);return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(ML,{}),title:`MCP`,subtitle:`${yq(e,`server`)??`?`}/${yq(e,`tool`)??`?`}`,status:e.status,badge:e.status===`error`?(0,L.jsx)(CW,{variant:`destructive`,children:`Error`}):null,children:[t?(0,L.jsx)(Uq,{text:t,label:`Arguments`}):null,n?(0,L.jsx)(Uq,{text:n,label:`Result`}):null,Xq(e)]})}function fJ({state:e}){let t=lJ(e);return(0,L.jsx)(Dq,{icon:(0,L.jsx)(ML,{}),title:`MCP tools`,subtitle:yq(e,`query`),status:e.status,children:t?(0,L.jsx)(Uq,{text:t,label:`Matching tools`}):null})}function pJ({state:e}){return e.call.name===`mcp_call`?(0,L.jsx)(dJ,{state:e}):e.call.name===`mcp_search`?(0,L.jsx)(fJ,{state:e}):(0,L.jsx)(cJ,{state:e})}function mJ(e){try{let t=JSON.parse(e);return typeof t.id==`string`&&typeof t.state==`string`?t:void 0}catch{return}}function hJ(e){return e.replace(/\n$/,``).split(`
|
|
66
|
+
`).slice(-8).join(`
|
|
67
|
+
`)}function gJ({state:e}){let t=bq(e.result),n=mJ(t),r=n?.name??yq(e,`name`)??yq(e,`command`)??yq(e,`id`),i=n||!t?``:hJ(t);return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(HL,{}),title:e.call.name.replace(`_`,` `),subtitle:r,status:e.status,badge:n?(0,L.jsx)(CW,{variant:`secondary`,children:OK(n)}):null,children:[n?.urls.map(e=>(0,L.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`block text-xs underline`,children:e},e)),i?(0,L.jsx)(Uq,{text:i,label:`Process output`,keep:`end`}):null]})}function _J(e){let{offset:t,limit:n}=e.call.arguments??{};if(typeof t!=`number`&&typeof n!=`number`)return;let r=typeof t==`number`?t:1;return typeof n==`number`?`lines ${r}-${r+n-1}`:`from line ${r}`}function vJ({state:e}){let t=bq(e.result),n=_J(e);return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(BI,{}),title:`Read`,subtitle:[yq(e,`path`),n].filter(Boolean).join(` `),status:e.status,children:[t?(0,L.jsx)(Uq,{text:t,label:`File content`}):null,Xq(e)]})}function yJ(e){let t=Sq(e).conversationId;return typeof t==`string`?t:void 0}function bJ(e){let t=Mw().data;return e?t?.find(t=>t.id===e):void 0}function xJ(e,t){return e?t?`Continued ${t}`:`Continued subagent`:`New subagent`}function SJ({child:e}){let t=Sw();return(0,L.jsx)(Z,{asChild:!0,variant:`outline`,size:`sm`,children:(0,L.jsx)(Ln,{to:iU(e.projectId,e.id,t),children:`Open`})})}function CJ({state:e}){let t=bJ(yJ(e)),n=yq(e,`subagent`)!==void 0,r=bq(e.result);return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(hI,{}),title:xJ(n,t?.title),subtitle:yq(e,`description`),status:e.status,children:[t?(0,L.jsx)(SJ,{child:t}):null,r?(0,L.jsx)(Uq,{text:r,label:`Answer`}):null]})}var wJ=(0,M.createContext)(void 0),TJ=wJ.Provider,EJ=e=>{let t=(0,M.useContext)(wJ);return t!==void 0&&t!==e},DJ=[`pending`,`in_progress`,`completed`];function OJ(e){let t=e;return typeof t?.content==`string`&&DJ.includes(t.status)}function kJ(e){return Array.isArray(e)?e.filter(OJ):[]}var AJ=e=>e.filter(e=>e.status===`completed`).length;function jJ(e){if(e.length===0)return;let t=`${AJ(e)}/${e.length} done`,n=e.find(e=>e.status===`in_progress`)?.content;return n?`${t} \u2192 ${n}`:t}var MJ=e=>e.length===0||AJ(e)===e.length,NJ=e=>{let t=e.model?.[0]?.content;return e.kind!==`pi.assistant`||!Array.isArray(t)?[]:t.filter(e=>e.type===`toolCall`&&e.name===`todo_write`)};function PJ(e){for(let t=e.entries.length-1;t>=0;t--){let n=e.entries[t],r=n?NJ(n).at(-1):void 0;if(r)return kJ(r.arguments?.todos)}return[]}function FJ(e){for(let t=e.entries.length-1;t>=0;t--){let n=e.entries[t],r=n?NJ(n).at(-1):void 0;if(r)return r.id}}function IJ({state:e}){let t=kJ(e.call.arguments?.todos),n=EJ(e.call.id);return(0,L.jsx)(Dq,{icon:(0,L.jsx)(oL,{}),title:n?`Updated todos`:`Todos`,subtitle:jJ(t),status:e.status})}function LJ(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var RJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BJ={};function VJ(e,t){return((t||BJ).jsx?zJ:RJ).test(e)}var HJ=/[ \t\n\f\r]/g;function UJ(e){return typeof e==`object`?e.type===`text`&&WJ(e.value):WJ(e)}function WJ(e){return e.replace(HJ,``)===``}var GJ=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};GJ.prototype.normal={},GJ.prototype.property={},GJ.prototype.space=void 0;function KJ(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new GJ(n,r,t)}function qJ(e){return e.toLowerCase()}var JJ=class{constructor(e,t){this.attribute=t,this.property=e}};JJ.prototype.attribute=``,JJ.prototype.booleanish=!1,JJ.prototype.boolean=!1,JJ.prototype.commaOrSpaceSeparated=!1,JJ.prototype.commaSeparated=!1,JJ.prototype.defined=!1,JJ.prototype.mustUseProperty=!1,JJ.prototype.number=!1,JJ.prototype.overloadedBoolean=!1,JJ.prototype.property=``,JJ.prototype.spaceSeparated=!1,JJ.prototype.space=void 0;var YJ=s({boolean:()=>ZJ,booleanish:()=>QJ,commaOrSpaceSeparated:()=>nY,commaSeparated:()=>tY,number:()=>$,overloadedBoolean:()=>$J,spaceSeparated:()=>eY}),XJ=0,ZJ=rY(),QJ=rY(),$J=rY(),$=rY(),eY=rY(),tY=rY(),nY=rY();function rY(){return 2**++XJ}var iY=Object.keys(YJ),aY=class extends JJ{constructor(e,t,n,r){let i=-1;if(super(e,t),oY(this,`space`,r),typeof n==`number`)for(;++i<iY.length;){let e=iY[i];oY(this,iY[i],(n&YJ[e])===YJ[e])}}};aY.prototype.defined=!0;function oY(e,t,n){n&&(e[t]=n)}function sY(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new aY(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[qJ(r)]=r,n[qJ(a.attribute)]=r}return new GJ(t,n,e.space)}var cY=sY({properties:{ariaActiveDescendant:null,ariaAtomic:QJ,ariaAutoComplete:null,ariaBusy:QJ,ariaChecked:QJ,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:eY,ariaCurrent:null,ariaDescribedBy:eY,ariaDetails:null,ariaDisabled:QJ,ariaDropEffect:eY,ariaErrorMessage:null,ariaExpanded:QJ,ariaFlowTo:eY,ariaGrabbed:QJ,ariaHasPopup:null,ariaHidden:QJ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:eY,ariaLevel:$,ariaLive:null,ariaModal:QJ,ariaMultiLine:QJ,ariaMultiSelectable:QJ,ariaOrientation:null,ariaOwns:eY,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:QJ,ariaReadOnly:QJ,ariaRelevant:null,ariaRequired:QJ,ariaRoleDescription:eY,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:QJ,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function lY(e,t){return t in e?e[t]:t}function uY(e,t){return lY(e,t.toLowerCase())}var dY=sY({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:tY,acceptCharset:eY,accessKey:eY,action:null,allow:null,allowFullScreen:ZJ,allowPaymentRequest:ZJ,allowUserMedia:ZJ,alpha:ZJ,alt:null,as:null,async:ZJ,autoCapitalize:null,autoComplete:eY,autoFocus:ZJ,autoPlay:ZJ,blocking:eY,capture:null,charSet:null,checked:ZJ,cite:null,className:eY,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:QJ,controls:ZJ,controlsList:eY,coords:$|tY,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ZJ,defer:ZJ,dir:null,dirName:null,disabled:ZJ,download:$J,draggable:QJ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ZJ,formTarget:null,headers:eY,height:$,hidden:$J,high:$,href:null,hrefLang:null,htmlFor:eY,httpEquiv:eY,id:null,imageSizes:null,imageSrcSet:null,inert:ZJ,inputMode:null,integrity:null,is:null,isMap:ZJ,itemId:null,itemProp:eY,itemRef:eY,itemScope:ZJ,itemType:eY,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ZJ,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:ZJ,muted:ZJ,name:null,nonce:null,noModule:ZJ,noValidate:ZJ,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:ZJ,optimum:$,pattern:null,ping:eY,placeholder:null,playsInline:ZJ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ZJ,referrerPolicy:null,rel:eY,required:ZJ,reversed:ZJ,rows:$,rowSpan:$,sandbox:eY,scope:null,scoped:ZJ,seamless:ZJ,selected:ZJ,shadowRootClonable:ZJ,shadowRootCustomElementRegistry:ZJ,shadowRootDelegatesFocus:ZJ,shadowRootMode:null,shadowRootSerializable:ZJ,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:QJ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:ZJ,useMap:null,value:QJ,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:eY,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ZJ,declare:ZJ,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:ZJ,noHref:ZJ,noShade:ZJ,noWrap:ZJ,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:QJ,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ZJ,disablePictureInPicture:ZJ,disableRemotePlayback:ZJ,exportParts:tY,part:eY,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:uY}),fY=sY({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:nY,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:eY,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:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:ZJ,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,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:tY,g2:tY,glyphName:tY,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:nY,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,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:$,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:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:eY,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nY,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nY,rev:nY,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nY,requiredFeatures:nY,requiredFonts:nY,requiredFormats:nY,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:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:nY,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nY,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nY,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:lY}),pY=sY({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()}}),mY=sY({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:uY}),hY=sY({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),gY={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`},_Y=/[A-Z]/g,vY=/-[a-z]/g,yY=/^data[-\w.:]+$/i;function bY(e,t){let n=qJ(t),r=t,i=JJ;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&yY.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(vY,SY);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!vY.test(e)){let n=e.replace(_Y,xY);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=aY}return new i(r,t)}function xY(e){return`-`+e.toLowerCase()}function SY(e){return e.charAt(1).toUpperCase()}var CY=KJ([cY,dY,pY,mY,hY],`html`),wY=KJ([cY,fY,pY,mY,hY],`svg`);function TY(e){return e.join(` `).trim()}var EY=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(`
|
|
68
|
+
`);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})),DY=o(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(EY());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),OY=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))}})),kY=o(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(DY()),i=OY();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),AY=MY(`end`),jY=MY(`start`);function MY(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 NY(e){let t=jY(e),n=AY(e);if(t&&n)return{start:t,end:n}}function PY(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?IY(e.position):`start`in e||`end`in e?IY(e):`line`in e||`column`in e?FY(e):``}function FY(e){return LY(e&&e.line)+`:`+LY(e&&e.column)}function IY(e){return FY(e&&e.start)+`-`+FY(e&&e.end)}function LY(e){return e&&typeof e==`number`?e:1}var RY=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=PY(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}};RY.prototype.file=``,RY.prototype.name=``,RY.prototype.reason=``,RY.prototype.message=``,RY.prototype.stack=``,RY.prototype.column=void 0,RY.prototype.line=void 0,RY.prototype.ancestors=void 0,RY.prototype.cause=void 0,RY.prototype.fatal=void 0,RY.prototype.place=void 0,RY.prototype.ruleId=void 0,RY.prototype.source=void 0;var zY=l(kY(),1),BY={}.hasOwnProperty,VY=new Map,HY=/[A-Z]/g,UY=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),WY=new Set([`td`,`th`]),GY=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function KY(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=rX(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=nX(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`?wY:CY,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=qY(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function qY(e,t,n){if(t.type===`element`)return JY(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return YY(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return ZY(e,t,n);if(t.type===`mdxjsEsm`)return XY(e,t);if(t.type===`root`)return QY(e,t,n);if(t.type===`text`)return $Y(e,t)}function JY(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=wY,e.schema=i),e.ancestors.push(t);let a=lX(e,t.tagName,!1),o=iX(e,t),s=oX(e,t);return UY.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!UJ(e)})),eX(e,o,a,t),tX(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function YY(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)}uX(e,t.position)}function XY(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);uX(e,t.position)}function ZY(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=wY,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:lX(e,t.name,!0),o=aX(e,t),s=oX(e,t);return eX(e,o,a,t),tX(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function QY(e,t,n){let r={};return tX(r,oX(e,t)),e.create(t,e.Fragment,r,n)}function $Y(e,t){return t.value}function eX(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tX(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function nX(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 rX(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=jY(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 iX(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&BY.call(t.properties,i)){let a=sX(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&WY.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 aX(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 uX(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 uX(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function oX(e,t){let n=[],r=-1,i=e.passKeys?new Map:VY;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=qY(e,a,o);s!==void 0&&n.push(s)}return n}function sX(e,t,n){let r=bY(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?LJ(n):TY(n)),r.property===`style`){let t=typeof n==`object`?n:cX(e,String(n));return e.stylePropertyNameCase===`css`&&(t=dX(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?gY[r.property]||r.property:r.attribute,n]}}function cX(e,t){try{return(0,zY.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new RY("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=GY+`#cannot-parse-style-attribute`,r}}function lX(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=VJ(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=VJ(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return BY.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);uX(e)}function uX(e,t){let n=new RY("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=GY+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function dX(e){let t={},n;for(n in e)BY.call(e,n)&&(t[fX(n)]=e[n]);return t}function fX(e){let t=e.replace(HY,pX);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function pX(e){return`-`+e.toLowerCase()}var mX={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`]},hX={};function gX(e,t){let n=t||hX;return _X(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function _X(e,t,n){if(yX(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 vX(e.children,t,n)}return Array.isArray(e)?vX(e,t,n):``}function vX(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=_X(e[i],t,n);return r.join(``)}function yX(e){return!!(e&&typeof e==`object`)}var bX=document.createElement(`i`);function xX(e){let t=`&`+e+`;`;bX.innerHTML=t;let n=bX.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function SX(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 CX(e,t){return e.length>0?(SX(e,e.length,0,t),e):t}var wX={}.hasOwnProperty;function TX(e){let t={},n=-1;for(;++n<e.length;)EX(t,e[n]);return t}function EX(e,t){let n;for(n in t){let r=(wX.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){wX.call(r,a)||(r[a]=[]);let e=i[a];DX(r[a],Array.isArray(e)?e:e?[e]:[])}}}function DX(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);SX(e,0,0,r)}function OX(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)}function kX(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var AX=HX(/[A-Za-z]/),jX=HX(/[\dA-Za-z]/),MX=HX(/[#-'*+\--9=?A-Z^-~]/);function NX(e){return e!==null&&(e<32||e===127)}var PX=HX(/\d/),FX=HX(/[\dA-Fa-f]/),IX=HX(/[!-/:-@[-`{-~]/);function LX(e){return e!==null&&e<-2}function RX(e){return e!==null&&(e<0||e===32)}function zX(e){return e===-2||e===-1||e===32}var BX=HX(/\p{P}|\p{S}/u),VX=HX(/\s/);function HX(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function UX(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&jX(e.charCodeAt(n+1))&&jX(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 WX(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return zX(r)?(e.enter(n),s(r)):t(r)}function s(r){return zX(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function GX(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&zX(t)?(e.enter(r),c(t)):l(t)}function c(t){return zX(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var KX={tokenize:qX};function qX(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),WX(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);else return LX(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var JX=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){YX(this,e,t,n,!1)}addBefore(e,t,n){YX(this,e,t,n,!0)}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 YX(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var XX={tokenize:QX},ZX={tokenize:$X};function QX(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++;let c=new JX;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),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(ZX,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(ZX,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);else 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);else return LX(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++;let l=new JX;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}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 $X(e,t,n){return WX(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function eZ(e){if(e===null||RX(e)||VX(e))return 1;if(BX(e))return 2}function tZ(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 nZ={name:`attention`,resolveAll:rZ,tokenize:iZ};function rZ(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};aZ(o,-a),aZ(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=CX(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=CX(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=CX(r,tZ(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=CX(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=CX(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),SX(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function iZ(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=eZ(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=eZ(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function aZ(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var oZ={name:`autolink`,tokenize:sZ};function sZ(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 AX(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||jX(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||jX(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||NX(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):MX(t)?(e.consume(t),l):n(t)}function u(e){return jX(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||jX(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var cZ={partial:!0,tokenize:lZ};function lZ(e,t,n){return r;function r(t){return zX(t)?WX(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||LX(e)?t(e):n(e)}}var uZ={continuation:{tokenize:fZ},exit:pZ,name:`blockQuote`,tokenize:dZ};function dZ(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 zX(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function fZ(e,t,n){let r=this;return i;function i(t){return zX(t)?WX(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(uZ,t,n)(r)}}function pZ(e){e.exit(`blockQuote`)}var mZ={name:`characterEscape`,tokenize:hZ};function hZ(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 IX(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var gZ={name:`characterReference`,tokenize:_Z};function _Z(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=jX,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=FX,u):(e.enter(`characterReferenceValue`),a=7,o=PX,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===jX&&!xX(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 vZ={partial:!0,tokenize:yZ};function yZ(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 bZ={concrete:!0,name:`codeFenced`,tokenize:xZ};function xZ(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`),zX(t)?WX(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||LX(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(vZ,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||LX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):zX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),WX(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||LX(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||LX(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&&zX(t)?WX(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||LX(t)?e.check(vZ,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||LX(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`),zX(t)?WX(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`),zX(t)?WX(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||LX(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var SZ={name:`codeIndented`,tokenize:wZ},CZ={partial:!0,tokenize:TZ};function wZ(e,t,n){return r;function r(t){return e.enter(`codeIndented`),GX(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):LX(t)?e.attempt(CZ,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||LX(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function TZ(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):LX(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):GX(e,t,a,`linePrefix`,4,4)(o)}function a(e){return LX(e)?i(e):n(e)}}var EZ={name:`codeText`,previous:OZ,resolve:DZ,tokenize:kZ};function DZ(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 OZ(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function kZ(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)):LX(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||LX(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 AZ=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&&jZ(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),jZ(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),jZ(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);jZ(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);jZ(this.left,t.reverse())}}}};function jZ(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 MZ(e){let t={},n=-1,r,i,a,o,s,c,l,u=new AZ(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,NZ(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 SX(e,0,1/0,u.slice(0)),!l}function NZ(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 PZ={resolve:IZ,tokenize:LZ},FZ={partial:!0,tokenize:RZ};function IZ(e){return MZ(e),e}function LZ(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):LX(t)?e.check(FZ,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 RZ(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),WX(e,a,`linePrefix`)}function a(i){if(i===null||LX(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 zZ(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||NX(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||LX(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||RX(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||NX(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 BZ(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):LX(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||LX(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!zX(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function VZ(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):LX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),WX(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||LX(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 HZ(e,t){let n;return r;function r(i){return LX(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):zX(i)?WX(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var UZ={name:`definition`,tokenize:GZ},WZ={partial:!0,tokenize:KZ};function GZ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return BZ.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=kX(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 RX(t)?HZ(e,l)(t):l(t)}function l(t){return zZ(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(WZ,d,d)(t)}function d(t){return zX(t)?WX(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||LX(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function KZ(e,t,n){return r;function r(t){return RX(t)?HZ(e,i)(t):n(t)}function i(t){return VZ(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return zX(t)?WX(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||LX(e)?t(e):n(e)}}var qZ={name:`hardBreakEscape`,tokenize:JZ};function JZ(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return LX(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var YZ={name:`headingAtx`,resolve:XZ,tokenize:ZZ};function XZ(e,t){let n=e.length-2,r=3;if(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){let 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`};SX(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function ZZ(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||RX(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||LX(n)?(e.exit(`atxHeading`),t(n)):zX(n)?WX(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||RX(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var QZ=`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(`.`),$Z=[`pre`,`script`,`style`,`textarea`],eQ={concrete:!0,name:`htmlFlow`,resolveTo:nQ,tokenize:rQ},tQ={partial:!0,tokenize:iQ};function nQ(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 rQ(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:N):AX(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):AX(a)?(e.consume(a),i=4,r.interrupt?t:N):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:N):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 AX(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||RX(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&$Z.includes(l)?(i=1,r.interrupt?t(s):O(s)):QZ.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||jX(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 zX(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||AX(t)?(e.consume(t),b):zX(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||jX(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):zX(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):zX(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||LX(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||RX(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||zX(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||LX(t)?O(t):zX(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ee):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),N):t===93&&i===5?(e.consume(t),ne):LX(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(tQ,ie,k)(t)):t===null||LX(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(vZ,A,ie)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||LX(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function ee(t){return t===45?(e.consume(t),N):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return $Z.includes(n)?(e.consume(t),re):O(t)}return AX(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function ne(t){return t===93?(e.consume(t),N):O(t)}function N(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),N):O(t)}function re(t){return t===null||LX(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function iQ(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(cZ,t,n)}}var aQ={name:`htmlText`,tokenize:oQ};function oQ(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):AX(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):AX(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):LX(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ee(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):LX(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ee(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ee(t):LX(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):LX(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?ee(e):y(e)}function x(t){return AX(t)?(e.consume(t),S):n(t)}function S(t){return t===45||jX(t)?(e.consume(t),S):C(t)}function C(t){return LX(t)?(o=C,M(t)):zX(t)?(e.consume(t),C):ee(t)}function w(t){return t===45||jX(t)?(e.consume(t),w):t===47||t===62||RX(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ee):t===58||t===95||AX(t)?(e.consume(t),E):LX(t)?(o=T,M(t)):zX(t)?(e.consume(t),T):ee(t)}function E(t){return t===45||t===46||t===58||t===95||jX(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):LX(t)?(o=D,M(t)):zX(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):LX(t)?(o=O,M(t)):zX(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):LX(t)?(o=k,M(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||RX(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||RX(e)?T(e):n(e)}function ee(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return zX(t)?WX(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var sQ={name:`labelEnd`,resolveAll:dQ,resolveTo:fQ,tokenize:pQ},cQ={tokenize:mQ},lQ={tokenize:hQ},uQ={tokenize:gQ};function dQ(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&&SX(e,0,e.length,n),e}function fQ(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=CX(o,e.slice(i+1,i+r+3)),o=CX(o,[[`enter`,l,t]]),o=CX(o,tZ(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=CX(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=CX(o,e.slice(a+1)),o=CX(o,[[`exit`,s,t]]),SX(e,i,e.length,o),e}function pQ(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(kX(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(cQ,u,o?u:d)(t):t===91?e.attempt(lQ,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(uQ,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function mQ(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 RX(t)?HZ(e,a)(t):a(t)}function a(t){return t===41?u(t):zZ(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return RX(t)?HZ(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?VZ(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return RX(t)?HZ(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 hQ(e,t,n){let r=this;return i;function i(t){return BZ.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(kX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function gQ(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 _Q={name:`labelStartImage`,resolveAll:sQ.resolveAll,tokenize:vQ};function vQ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var yQ={name:`labelStartLink`,resolveAll:sQ.resolveAll,tokenize:bQ};function bQ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var xQ={name:`lineEnding`,tokenize:SQ};function SQ(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),WX(e,t,`linePrefix`)}}var CQ={name:`thematicBreak`,tokenize:wQ};function wQ(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||LX(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),zX(t)?WX(e,s,`whitespace`)(t):s(t))}}var TQ={continuation:{tokenize:kQ},exit:jQ,name:`list`,tokenize:OQ},EQ={partial:!0,tokenize:MQ},DQ={partial:!0,tokenize:AQ};function OQ(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:PX(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(CQ,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 PX(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(cZ,r.interrupt?n:u,e.attempt(EQ,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return zX(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 kQ(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(cZ,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,WX(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!zX(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(DQ,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,WX(e,e.attempt(TQ,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function AQ(e,t,n){let r=this;return WX(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 jQ(e){e.exit(this.containerState.type)}function MQ(e,t,n){let r=this;return WX(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!zX(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var NQ={name:`setextUnderline`,resolveTo:PQ,tokenize:FQ};function PQ(e,t){let n=new JX,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function FQ(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`),zX(t)?WX(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||LX(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var IQ={tokenize:LQ};function LQ(e){let t=this,n=e.attempt(cZ,r,e.attempt(this.parser.constructs.flowInitial,i,WX(e,e.attempt(this.parser.constructs.flow,i,e.attempt(PZ,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var RQ={resolveAll:HQ()},zQ=VQ(`string`),BQ=VQ(`text`);function VQ(e){return{resolveAll:HQ(e===`text`?UQ: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);else 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 HQ(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 UQ(e,t){let n=new JX,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var WQ=s({attentionMarkers:()=>QQ,contentInitial:()=>KQ,disable:()=>$Q,document:()=>GQ,flow:()=>JQ,flowInitial:()=>qQ,insideSpan:()=>ZQ,string:()=>YQ,text:()=>XQ}),GQ={42:TQ,43:TQ,45:TQ,48:TQ,49:TQ,50:TQ,51:TQ,52:TQ,53:TQ,54:TQ,55:TQ,56:TQ,57:TQ,62:uZ},KQ={91:UZ},qQ={[-2]:SZ,[-1]:SZ,32:SZ},JQ={35:YZ,42:CQ,45:[NQ,CQ],60:eQ,61:NQ,95:CQ,96:bZ,126:bZ},YQ={38:gZ,92:mZ},XQ={[-5]:xQ,[-4]:xQ,[-3]:xQ,33:_Q,38:gZ,42:nZ,60:[oZ,aQ],91:yQ,92:[qZ,mZ],93:sQ,95:nZ,96:EZ},ZQ={null:[nZ,RQ]},QQ={null:[42,95]},$Q={null:[]};function e$(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=CX(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=tZ(a,l.events,l),l.events):[]}function f(e,t){return n$(p(e),t)}function p(e){return t$(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(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){LX(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&&SX(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 t$(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 n$(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=`
|
|
69
|
+
`;break;case-3:o=`\r
|
|
70
|
+
`;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 r$(e){let t={constructs:TX([WQ,...(e||{}).extensions||[]]),content:n(KX),defined:[],document:n(XX),flow:n(IQ),lazy:{},string:n(zQ),text:n(BQ)};return t;function n(e){return n;function n(n){return e$(t,e,n)}}}function i$(e){for(;!MZ(e););return e}var a$=/[\0\t\n\r]/g;function o$(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){a$.lastIndex=c;let n=a$.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var s$=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function c$(e){return e.replace(s$,l$)}function l$(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return OX(n.slice(t?2:1),t?16:10)}return xX(n)||e}var u$={}.hasOwnProperty;function d$(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),f$(n)(i$(r$(n).document().write(o$()(e,t,!0))))}function f$(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(Se),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(ve),blockQuote:o(pe),characterEscape:E,characterReference:E,codeFenced:o(me),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(me,s),codeText:o(he,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(ge),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(_e),hardBreakEscape:o(ye),hardBreakTrailing:o(ye),htmlFlow:o(be,s),htmlFlowData:E,htmlText:o(be,s),htmlTextData:E,image:o(xe),label:s,link:o(Se),listItem:o(we),listItemValue:p,listOrdered:o(Ce,f),listUnordered:o(Ce),paragraph:o(Te),reference:oe,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ve),strong:o(Ee),thematicBreak:o(Oe)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(ee),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(te),label:N,labelText:ne,lineEnding:O,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:se,resourceDestinationString:re,resourceTitleString:ie,resource:ae,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};m$(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),u$.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||g$).call(o,void 0,e[0])}for(r.position={start:p$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:p$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];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 n=r;for(s=void 0;n--;){let t=e[n];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=n}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),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(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:p$(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+PY({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||g$).call(this,e,r[0])),n.position.end=p$(e.end)}function d(){return gX(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(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 m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){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 v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=kX(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=De(),n.position={start:p$(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=p$(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=p$(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}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 ee(){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 te(){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 ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=c$(t),n.identifier=kX(t).toLowerCase()}function N(){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 re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ae(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=kX(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=OX(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=xX(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=p$(e.end)}function de(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function fe(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function pe(){return{type:`blockquote`,children:[],position:void 0}}function me(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function he(){return{type:`inlineCode`,value:``,position:void 0}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function _e(){return{type:`emphasis`,children:[],position:void 0}}function ve(){return{type:`heading`,depth:0,children:[],position:void 0}}function ye(){return{type:`break`,position:void 0}}function be(){return{type:`html`,value:``,position:void 0}}function xe(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function Se(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Te(){return{type:`paragraph`,children:[],position:void 0}}function Ee(){return{type:`strong`,children:[],position:void 0}}function De(){return{type:`text`,value:``,position:void 0}}function Oe(){return{type:`thematicBreak`,position:void 0}}}function p$(e){return{line:e.line,column:e.column,offset:e.offset}}function m$(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?m$(e,r):h$(e,r)}}function h$(e,t){let n;for(n in t)if(u$.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`afterExit`:case`beforeEnter`:{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 g$(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+PY({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+PY({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+PY({start:t.start,end:t.end})+`) is still open`)}function _$(e){let t=this;t.parser=n;function n(n){return d$(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function v$(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 y$(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
71
|
+
`}]}function b$(e,t){let n=t.value?t.value+`
|
|
72
|
+
`:``,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 x$(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S$(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function C$(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=UX(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 w$(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 T$(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function E$(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 D$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return E$(e,t);let i={src:UX(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 O$(e,t){let n={src:UX(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 k$(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 A$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return E$(e,t);let i={href:UX(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 j$(e,t){let n={href:UX(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 M$(e,t,n){let r=e.all(t),i=n?N$(n):P$(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:`
|
|
73
|
+
`}),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:`
|
|
74
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function N$(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=P$(n[r])}return t}function P$(e){return e.spread??e.children.length>1}function F$(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 I$(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function L$(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function R$(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function z$(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=jY(t.children[1]),o=AY(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 B$(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 V$(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var H$=9,U$=32;function W$(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(G$(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(G$(t.slice(i),i>0,!1)),a.join(``)}function G$(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===H$||t===U$;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===H$||t===U$;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function K$(e,t){let n={type:`text`,value:W$(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function q$(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var J$={blockquote:v$,break:y$,code:b$,delete:x$,emphasis:S$,footnoteReference:C$,heading:w$,html:T$,imageReference:D$,image:O$,inlineCode:k$,linkReference:A$,link:j$,listItem:M$,list:F$,paragraph:I$,root:L$,strong:R$,table:z$,tableCell:V$,tableRow:B$,text:K$,thematicBreak:q$,toml:Y$,yaml:Y$,definition:Y$,footnoteDefinition:Y$};function Y$(){}var{defineProperty:X$}=Object,Z$=typeof self==`object`?self:globalThis,Q$=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Z$[e](t)},$$=(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__`?X$(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 Z$[e]==`function`?Q$(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(Q$(a,o),i)};return r},e1=e=>$$(new Map,e)(0),t1=``,{toString:n1}={},{keys:r1,is:i1}=Object,a1=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=n1.call(e).slice(8,-1);switch(n){case`Array`:return[1,t1];case`Object`:return[2,t1];case`Date`:return[3,t1];case`RegExp`:return[4,t1];case`Map`:return[5,t1];case`Set`:return[6,t1];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},o1=([e,t])=>e===0&&(t===`function`||t===`symbol`),s1=(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]=a1(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&i1(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 r1(o))(e||!o1(a1(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?t1: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||!(o1(a1(n))||o1(a1(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!o1(a1(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},c1=(e,{json:t,lossy:n}={})=>{let r=[];return s1(!(t||n),!!t,new Map,r)(e),r},l1=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?e1(c1(e,t)):structuredClone(e):(e,t)=>e1(c1(e,t));function u1(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 d1(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function f1(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||u1,r=e.options.footnoteBackLabel||d1,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=UX(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:{...l1(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
75
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
76
|
+
`}]}}var p1=(function(e){if(e==null)return v1;if(typeof e==`function`)return _1(e);if(typeof e==`object`)return Array.isArray(e)?m1(e):h1(e);if(typeof e==`string`)return g1(e);throw Error(`Expected function, string, or object as test`)});function m1(e){let t=[],n=-1;for(;++n<e.length;)t[n]=p1(e[n]);return _1(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function h1(e){let t=e;return _1(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function g1(e){return _1(t);function t(t){return t&&t.type===e}}function _1(e){return t;function t(t,n,r){return!!(y1(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function v1(){return!0}function y1(e){return typeof e==`object`&&!!e&&`type`in e}function b1(e){return e}var x1=[];function S1(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=p1(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 (`+b1(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=x1,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=C1(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 C1(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?x1:[e]}function w1(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),S1(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 T1={}.hasOwnProperty,E1={};function D1(e,t){let n=t||E1,r=new Map,i=new Map,a={all:s,applyData:k1,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...J$,...n.handlers},one:o,options:n,patch:O1,wrap:j1};return w1(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(T1.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=l1(n);return r.children=a.all(e),r}return l1(e)}return(a.options.unknownHandler||A1)(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=M1(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=M1(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function O1(e,t){e.position&&(t.position=NY(e))}function k1(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,l1(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function A1(e,t){let n=t.data||{},r=`value`in t&&!(T1.call(n,`hProperties`)||T1.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 j1(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
77
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
78
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
79
|
+
`}),n}function M1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function N1(e,t){let n=D1(e,t),r=n.one(e,void 0),i=f1(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
80
|
+
`},i)),a}function P1(e,t){return e&&`run`in e?async function(n,r){let i=N1(n,{file:r,...t});await e.run(i,r)}:function(n,r){return N1(n,{file:r,...e||t})}}function F1(e){if(e)throw e}var I1=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 L1(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 R1(){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);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?z1(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 z1(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 B1={basename:V1,dirname:H1,extname:U1,join:W1,sep:`/`};function V1(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);q1(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 H1(e){if(q1(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 U1(e){q1(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}}else 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 W1(...e){let t=-1,n;for(;++t<e.length;)q1(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:G1(n)}function G1(e){q1(e);let t=e.codePointAt(0)===47,n=K1(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function K1(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 q1(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var J1={cwd:Y1};function Y1(){return`/`}function X1(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Z1(e){if(typeof e==`string`)e=new URL(e);else if(!X1(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 Q1(e)}function Q1(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 $1=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],e0=class{constructor(e){let t;t=e?X1(e)?{path:e}:typeof e==`string`||i0(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:J1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<$1.length;){let e=$1[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)$1.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?B1.basename(this.path):void 0}set basename(e){n0(e,`basename`),t0(e,`basename`),this.path=B1.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?B1.dirname(this.path):void 0}set dirname(e){r0(this.basename,`dirname`),this.path=B1.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?B1.extname(this.path):void 0}set extname(e){if(t0(e,`extname`),r0(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=B1.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){X1(e)&&(e=Z1(e)),n0(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?B1.basename(this.path,this.extname):void 0}set stem(e){n0(e,`stem`),t0(e,`stem`),this.path=B1.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 RY(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 t0(e,t){if(e&&e.includes(B1.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+B1.sep+"`")}function n0(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function r0(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function i0(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var a0=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),o0=l(I1(),1),s0={}.hasOwnProperty,c0=new class e extends a0{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=R1()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,o0.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(d0(`data`,this.frozen),this.namespace[e]=t,this):s0.call(this.namespace,e)&&this.namespace[e]||void 0:e?(d0(`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=m0(e),n=this.parser||this.Parser;return l0(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),l0(`process`,this.parser||this.Parser),u0(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=m0(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);g0(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(),l0(`processSync`,this.parser||this.Parser),u0(`processSync`,this.compiler||this.Compiler),this.process(e,r),p0(`processSync`,`process`,t),n;function r(e,r){t=!0,F1(e),n=r}}run(e,t,n){f0(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=m0(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),p0(`runSync`,`run`,n),r;function i(e,t){F1(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=m0(t),r=this.compiler||this.Compiler;return u0(`stringify`,r),f0(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(d0(`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,o0.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];L1(o)&&L1(r)&&(r=(0,o0.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function l0(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function u0(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function d0(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 f0(e){if(!L1(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function p0(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function m0(e){return h0(e)?e:new e0(e)}function h0(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function g0(e){return typeof e==`string`||_0(e)}function _0(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var v0=[],y0={allowDangerousHtml:!0},b0=/^(https?|ircs?|mailto|xmpp)$/i,x0=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function S0(e){let t=C0(e),n=w0(e);return T0(t.runSync(t.parse(n),n),e)}function C0(e){let t=e.rehypePlugins||v0,n=e.remarkPlugins||v0,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...y0}:y0;return c0().use(_$).use(n).use(P1,r).use(t)}function w0(e){let t=e.children||``,n=new e0;return typeof t==`string`?n.value=t:``+t,n}function T0(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||E0;for(let e of x0)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return w1(e,l),KY(e,{Fragment:L.Fragment,components:i,ignoreInvalidStyle:!0,jsx:L.jsx,jsxs:L.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in mX)if(Object.hasOwn(mX,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=mX[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function E0(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||b0.test(e.slice(0,t))?e:``}function D0(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}function O0(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function k0(e,t,n){let r=p1((n||{}).ignore||[]),i=A0(t),a=-1;for(;++a<i.length;)S1(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;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function A0(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([j0(e[0]),M0(e[1])])}return t}function j0(e){return typeof e==`string`?new RegExp(O0(e),`g`):e}function M0(e){return typeof e==`function`?e:function(){return e}}var N0=`phrasing`,P0=[`autolink`,`link`,`image`,`label`];function F0(){return{transforms:[U0],enter:{literalAutolink:L0,literalAutolinkEmail:R0,literalAutolinkHttp:R0,literalAutolinkWww:R0},exit:{literalAutolink:H0,literalAutolinkEmail:V0,literalAutolinkHttp:z0,literalAutolinkWww:B0}}}function I0(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:N0,notInConstruct:P0},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:N0,notInConstruct:P0},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:N0,notInConstruct:P0}]}}function L0(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function R0(e){this.config.enter.autolinkProtocol.call(this,e)}function z0(e){this.config.exit.autolinkProtocol.call(this,e)}function B0(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 V0(e){this.config.exit.autolinkEmail.call(this,e)}function H0(e){this.exit(e)}function U0(e){k0(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,W0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,G0]],{ignore:[`link`,`linkReference`]})}function W0(e,t,n,r,i){let a=``;if(!J0(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!K0(n)))return!1;let o=q0(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 G0(e,t,n,r){return!J0(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function K0(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 q0(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=D0(e,`(`),a=D0(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 J0(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||VX(n)||BX(n))&&(!t||n!==47)}i2.peek=r2;function Y0(){this.buffer()}function X0(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Z0(){this.buffer()}function Q0(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function $0(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=kX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function e2(e){this.exit(e)}function t2(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=kX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function n2(e){this.exit(e)}function r2(){return`[`}function i2(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 a2(){return{enter:{gfmFootnoteCallString:Y0,gfmFootnoteCall:X0,gfmFootnoteDefinitionLabelString:Z0,gfmFootnoteDefinition:Q0},exit:{gfmFootnoteCallString:$0,gfmFootnoteCall:e2,gfmFootnoteDefinitionLabelString:t2,gfmFootnoteDefinition:n2}}}function o2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:i2},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?`
|
|
81
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?c2:s2))),s(),o}}function s2(e,t,n){return t===0?e:c2(e,t,n)}function c2(e,t,n){return(n?``:` `)+e}var l2=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];m2.attention=h2,m2.peek=g2;function u2(){return{canContainEols:[`delete`],enter:{strikethrough:f2},exit:{strikethrough:p2}}}function d2(){return{handlers:{delete:m2},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:l2}]}}function f2(e){this.enter({type:`delete`,children:[],position:void 0},e)}function p2(e){this.exit(e)}function m2(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function h2(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function g2(){return`~`}function _2(e){return e.length}function v2(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||_2,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=y2(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]=b2(r[d]);else{let e=b2(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(`
|
|
82
|
+
`)}function y2(e){return e==null?``:String(e)}function b2(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}var x2=p1([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function S2(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()),C2);return i(),o}function C2(e,t,n){return`>`+(n?``:` `)+e}function w2(e,t){return T2(e,t.inConstruct,!0)&&!T2(e,t.notInConstruct,!1)}function T2(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 E2(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
83
|
+
`&&!e.before&&!e.after&&w2(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
84
|
+
`}function D2(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 O2(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function k2(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function A2(e,t,n,r){let i=k2(n),a=e.value||``;if(O2(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,j2);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(D2(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
|
|
85
|
+
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
86
|
+
`),a&&(u+=o.move(a+`
|
|
87
|
+
`)),u+=o.move(s),c(),u}function j2(e,t,n){return(n?``:` `)+e}function M2(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function N2(e,t,n,r){let i=M2(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?` `:`
|
|
88
|
+
`,...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 P2(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}F2.attention=I2,F2.peek=L2;function F2(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function I2(e,t){return{construct:`emphasis`,markers:P2(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function L2(e,t,n){return n.options.emphasis||`*`}function R2(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function z2(e,t){let n=!1;return w1(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)&&gX(e)&&(t.options.setext||n))}function B2(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(z2(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
89
|
+
`,after:`
|
|
90
|
+
`});return r(),t(),o+`
|
|
91
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
92
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
93
|
+
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=R2(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}V2.peek=H2;function V2(e){return e.value||``}function H2(){return`<`}U2.peek=W2;function U2(e,t,n,r){let i=M2(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 W2(){return`!`}G2.peek=K2;function G2(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=u.filter(function(e){return e!==`phrasing`}),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 K2(){return`!`}q2.peek=J2;function q2(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;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 J2(){return"`"}function Y2(e,t){let n=gX(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))}X2.peek=Z2;function X2(e,t,n,r){let i=M2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(Y2(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),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 Z2(e,t,n){return Y2(e,n)?`<`:`[`}Q2.peek=$2;function Q2(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=u.filter(function(e){return e!==`phrasing`}),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 $2(){return`[`}function e4(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 t4(e){let t=e4(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 n4(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function r4(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 i4(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?n4(n):e4(n),s=e.ordered?o===`.`?`)`:`.`:t4(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),r4(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 a4(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 o4(e,t,n,r){let i=a4(n),a=n.bulletCurrent||e4(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 s4(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function c4(e,t,n,r){if(!e.children.some(function(e){return x2(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function l4(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}u4.attention=d4,u4.peek=f4;function u4(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function d4(e,t){return{construct:`strong`,markers:l4(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function f4(e,t,n){return n.options.strong||`*`}function p4(e,t,n,r){let i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function m4(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 h4(e,t,n){let r=(r4(n)+(n.options.ruleSpaces?` `:``)).repeat(m4(n));return n.options.ruleSpaces?r.slice(0,-1):r}var g4={blockquote:S2,break:E2,code:A2,definition:N2,emphasis:F2,hardBreak:E2,heading:B2,html:V2,image:U2,imageReference:G2,inlineCode:q2,link:X2,linkReference:Q2,list:i4,listItem:o4,paragraph:s4,root:c4,strong:u4,text:p4,thematicBreak:h4};function _4(){return{enter:{table:v4,tableData:S4,tableHeader:S4,tableRow:b4},exit:{codeText:C4,table:y4,tableData:x4,tableHeader:x4,tableRow:x4}}}function v4(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 y4(e){this.exit(e),this.data.inTable=void 0}function b4(e){this.enter({type:`tableRow`,children:[]},e)}function x4(e){this.exit(e)}function S4(e){this.enter({type:`tableCell`,children:[]},e)}function C4(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,w4));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function w4(e,t){return t===`|`?t:e}function T4(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
94
|
+
`,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(`
|
|
95
|
+
`))}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 v2(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=g4.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function E4(){return{exit:{taskListCheckValueChecked:O4,taskListCheckValueUnchecked:O4,paragraph:k4}}}function D4(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:A4}}}function O4(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function k4(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 A4(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=g4.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 j4(){return[F0(),a2(),u2(),_4(),E4()]}function M4(e){return{extensions:[I0(),o2(e),d2(),T4(e),D4()]}}var N4={tokenize:xoe,partial:!0},P4={tokenize:Soe,partial:!0},F4={tokenize:Coe,partial:!0},I4={tokenize:woe,partial:!0},L4={tokenize:Toe,partial:!0},R4={name:`wwwAutolink`,tokenize:yoe,previous:U4},z4={name:`protocolAutolink`,tokenize:boe,previous:W4},B4={name:`emailAutolink`,tokenize:voe,previous:G4},V4={};function _oe(){return{text:V4}}for(var H4=48;H4<123;)V4[H4]=B4,H4++,H4===58?H4=65:H4===91&&(H4=97);V4[43]=B4,V4[45]=B4,V4[46]=B4,V4[95]=B4,V4[72]=[B4,z4],V4[104]=[B4,z4],V4[87]=[B4,R4],V4[119]=[B4,R4];function voe(e,t,n){let r=this,i,a;return o;function o(t){return!K4(t)||!G4.call(r,r.previous)||q4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return K4(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(L4,u,l)(t):t===45||t===95||jX(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&&AX(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function yoe(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!U4.call(r,r.previous)||q4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(N4,e.attempt(P4,e.attempt(F4,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function boe(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&W4.call(r,r.previous)&&!q4(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(AX(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||NX(t)||RX(t)||VX(t)||BX(t)?n(t):e.attempt(P4,e.attempt(F4,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function xoe(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 Soe(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(I4,c,s)(t):t===null||RX(t)||VX(t)||t!==45&&BX(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 Coe(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(I4,t,a)(o):o===null||RX(o)||VX(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function woe(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||RX(o)||VX(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||RX(e)||VX(e)?t(e):r(e)}function a(e){return AX(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):AX(t)?(e.consume(t),o):n(t)}}function Toe(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return jX(e)?n(e):t(e)}}function U4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||RX(e)}function W4(e){return!AX(e)}function G4(e){return!(e===47||K4(e))}function K4(e){return e===43||e===45||e===46||e===95||jX(e)}function q4(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}var Eoe={tokenize:Poe,partial:!0};function Doe(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:joe,continuation:{tokenize:Moe},exit:Noe}},text:{91:{name:`gfmFootnoteCall`,tokenize:Aoe},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Ooe,resolveTo:koe}}}}function Ooe(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=kX(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 koe(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 Aoe(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||RX(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(kX(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return RX(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 joe(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||RX(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=kX(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return RX(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),WX(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Moe(e,t,n){return e.check(cZ,t,e.attempt(Eoe,t,n))}function Noe(e){e.exit(`gfmFootnoteDefinition`)}function Poe(e,t,n){let r=this;return WX(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 Foe(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&&SX(o,o.length,0,tZ(s,e.slice(r+1,n),t)),SX(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),SX(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=eZ(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=eZ(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Ioe=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Loe(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 Loe(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 Roe(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 zoe(){return{flow:{null:{name:`table`,tokenize:Boe,resolveAll:Voe}}}}function Boe(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||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):LX(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):zX(t)?WX(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||RX(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,zX(t)?WX(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 zX(t)?WX(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||LX(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 zX(t)?WX(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||LX(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||LX(n)?(e.exit(`tableRow`),t(n)):zX(n)?WX(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||RX(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 Voe(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 Ioe;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Y4(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=J4(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=J4(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=J4(f,t,o,i,n,d)):(o[0]=o[1],d=J4(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Y4(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=Roe(t.events,n))}return e}function J4(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},X4(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=X4(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=X4(t.events,n[2]),a=X4(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({},X4(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Y4(e,t,n,r,i){let a=[],o=X4(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 X4(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Hoe={name:`tasklistCheck`,tokenize:Woe};function Uoe(){return{text:{91:Hoe}}}function Woe(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 RX(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 LX(r)?t(r):zX(r)?e.check({tokenize:Goe},t,n)(r):n(r)}}function Goe(e,t,n){return WX(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Koe(e){return TX([_oe(),Doe(),Foe(e),zoe(),Uoe()])}var qoe={};function Joe(e){let t=this,n=e||qoe,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Koe(n)),a.push(j4()),o.push(M4(n))}function Z4(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(Z4).join(``):(0,M.isValidElement)(e)?Z4(e.props.children):``}function Yoe({children:e,...t}){return(0,L.jsxs)(`div`,{className:`group relative my-2`,children:[(0,L.jsx)(`pre`,{className:`overflow-x-auto rounded-md border bg-muted px-3 py-2 font-mono text-xs leading-5 [&_code]:bg-transparent [&_code]:p-0`,...t,children:e}),(0,L.jsx)(hq,{text:()=>Z4(e),label:`Copy code`,className:`absolute top-1.5 right-1.5`})]})}var Xoe={p:e=>(0,L.jsx)(`p`,{className:`my-2 leading-relaxed first:mt-0 last:mb-0`,...Q4(e)}),h1:e=>(0,L.jsx)(`h3`,{className:`mt-4 mb-2 text-lg font-semibold first:mt-0`,...Q4(e)}),h2:e=>(0,L.jsx)(`h4`,{className:`mt-4 mb-2 text-base font-semibold first:mt-0`,...Q4(e)}),h3:e=>(0,L.jsx)(`h5`,{className:`mt-3 mb-1.5 text-sm font-semibold first:mt-0`,...Q4(e)}),h4:e=>(0,L.jsx)(`h6`,{className:`mt-3 mb-1.5 text-sm font-semibold first:mt-0`,...Q4(e)}),ul:e=>(0,L.jsx)(`ul`,{className:`my-2 list-disc space-y-1 pl-5`,...Q4(e)}),ol:e=>(0,L.jsx)(`ol`,{className:`my-2 list-decimal space-y-1 pl-5`,...Q4(e)}),blockquote:e=>(0,L.jsx)(`blockquote`,{className:`my-2 border-l-2 pl-3 text-muted-foreground`,...Q4(e)}),hr:()=>(0,L.jsx)(`hr`,{className:`my-4`}),a:e=>(0,L.jsx)(`a`,{className:`text-primary underline underline-offset-4`,target:`_blank`,rel:`noopener noreferrer`,...Q4(e)}),pre:e=>(0,L.jsx)(Yoe,{...Q4(e)}),code:e=>(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em]`,...Q4(e)}),table:e=>(0,L.jsx)(`div`,{className:`my-2 overflow-x-auto`,children:(0,L.jsx)(`table`,{className:`w-full border-collapse text-sm`,...Q4(e)})}),th:e=>(0,L.jsx)(`th`,{className:`border px-2 py-1 text-left font-medium`,...Q4(e)}),td:e=>(0,L.jsx)(`td`,{className:`border px-2 py-1`,...Q4(e)})};function Q4({node:e,...t}){return t}function $4({children:e,className:t}){return(0,L.jsx)(`div`,{className:I(`min-w-0 break-words`,t),children:(0,L.jsx)(S0,{remarkPlugins:[Joe],components:Xoe,children:e})})}var Zoe=/^\s*\d+\.\s+(.+)\n\s+(https?:\/\/\S+)/gm;function Qoe(e){return[...e.matchAll(Zoe)].map(e=>({title:e[1]??``,url:e[2]??``}))}function $oe(e){try{return new URL(e).hostname}catch{return e}}function ese(e){return e<1e3?`${e} chars`:`${(e/1e3).toFixed(+(e<1e4))}k chars`}function tse(e){let t=e?.queries;return Array.isArray(t)?t.filter(e=>typeof e==`string`).join(`, `):typeof e?.query==`string`?e.query:``}function nse(e){let t=e?.urls;return Array.isArray(t)?t.filter(e=>typeof e==`string`).join(`, `):typeof e?.url==`string`?e.url:``}var rse=/\n*---\n+\*\*Sources:\*\*[\s\S]*$/,ise=/\n---\n[\s\S]*$/;function ase(e){return e.replace(rse,``).replace(ise,``).trim()}var e3=e=>e.result?bq(e.result):e.slot?.output??``;function ose({results:e}){return(0,L.jsx)(`ul`,{"aria-label":`Search results`,className:`space-y-1.5`,children:e.map(e=>(0,L.jsxs)(`li`,{className:`min-w-0 text-sm`,children:[(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`block truncate font-medium text-primary underline-offset-4 hover:underline`,children:e.title}),(0,L.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:$oe(e.url)})]},e.url))})}function sse({state:e}){let t=e3(e),n=Qoe(t),r=ase(t);return(0,L.jsxs)(Dq,{icon:(0,L.jsx)(BL,{}),title:`Web search`,subtitle:tse(e.call.arguments),status:e.status,badge:n.length?(0,L.jsxs)(CW,{variant:`secondary`,children:[n.length,` results`]}):null,children:[n.length?(0,L.jsx)(ose,{results:n}):null,r?(0,L.jsx)($4,{className:`text-sm`,children:r}):null]})}function cse({state:e}){let t=e3(e);return(0,L.jsx)(Dq,{icon:(0,L.jsx)(PI,{}),title:`Fetch`,subtitle:nse(e.call.arguments),status:e.status,badge:t?(0,L.jsx)(CW,{variant:`secondary`,children:ese(t.length)}):null,children:t?(0,L.jsx)(Uq,{text:t,label:`Page content`}):null})}function t3({state:e}){return e.call.name===`web_search`?(0,L.jsx)(sse,{state:e}):e.call.name===`fetch_content`?(0,L.jsx)(cse,{state:e}):(0,L.jsx)(cJ,{state:e})}function lse({state:e}){let t=yq(e,`content`);return(0,L.jsx)(Dq,{icon:(0,L.jsx)(RI,{}),title:`Write`,subtitle:yq(e,`path`),status:e.status,children:t?(0,L.jsx)(Uq,{text:t,label:`Written content`}):null})}var use={read:vJ,write:lse,edit:oJ,bash:Jq,task:CJ,agent:Wq,send_message:Iq,stop_agent:Lq,list_agents:Mq,merge_agent:Fq,todo_write:IJ,web_search:t3,fetch_content:t3,code_search:t3,get_search_content:t3,mcp_search:pJ,mcp_call:pJ,claude_connector:nJ,process_start:gJ,process_logs:gJ,process_stop:gJ,process_list:gJ};function dse({state:e}){let t=use[e.call.name]??cJ;return(0,L.jsx)(t,{state:e})}function n3(){let e=bt(),t=Sw(),n=yC();return async(r,i)=>{i&&sV($R(r.id,t),i),await n.invalidateQueries({queryKey:[`conversations`]}),e(iU(r.projectId,r.id,t))}}var fse={write:`Restore`,delete:`Delete`};function pse({entry:e}){let t=J(),n=gw({queryKey:[`rewind-preview`,e.conversationId,e.entryId],queryFn:()=>t.conversations.rewindPreview(e.conversationId,e.entryId),gcTime:0});return n.isPending?(0,L.jsx)(gG,{"aria-label":`Loading changes`}):n.isError?(0,L.jsx)(zU,{variant:`destructive`,children:(0,L.jsx)(VU,{children:_C(n.error)})}):n.data.changes.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No files change. Only the conversation rewinds.`}):(0,L.jsx)(`ul`,{"aria-label":`Files that change`,className:`max-h-60 space-y-1 overflow-auto font-mono text-xs`,children:n.data.changes.map(e=>(0,L.jsxs)(`li`,{className:`flex gap-2`,children:[(0,L.jsx)(`span`,{className:`w-14 shrink-0 text-muted-foreground`,children:fse[e.action]}),(0,L.jsx)(`span`,{className:`min-w-0 break-all`,children:e.path})]},e.path))})}function mse({entry:e,open:t,onOpenChange:n}){let r=J(),i=n3(),a=_w({mutationFn:()=>r.conversations.rewind(e.conversationId,e.entryId),onSuccess:async({conversation:e,draft:t})=>{n(!1),await i(e,t)}});return(0,L.jsx)(yB,{open:t,onOpenChange:n,children:(0,L.jsxs)(SB,{children:[(0,L.jsxs)(CB,{children:[(0,L.jsx)(TB,{children:e.startsConversation?`Rewind to start?`:`Rewind to here?`}),(0,L.jsx)(EB,{children:`Files go back to how they were before this message. A new thread opens with the conversation up to this point, and the message waits in its composer.`})]}),t?(0,L.jsx)(pse,{entry:e}):null,(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Ignored files (such as node_modules) and anything outside this folder are not undone.`}),a.isError?(0,L.jsx)(zU,{variant:`destructive`,children:(0,L.jsx)(VU,{children:_C(a.error)})}):null,(0,L.jsxs)(wB,{children:[(0,L.jsx)(Z,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,L.jsx)(Z,{variant:`destructive`,disabled:a.isPending,onClick:()=>a.mutate(),children:`Rewind`})]})]})})}function hse(e){let t=J(),[n,r]=(0,M.useState)(!1),i=n3(),a=e.role===`user`,o=[{id:`fork`,label:`Fork from here`,onSelect:()=>t.conversations.fork(e.conversationId,e.entryId).then(e=>i(e)).catch(e=>eH.error(_C(e)))}];return a&&o.push({id:`rewind`,label:e.startsConversation?`Rewind to start`:`Rewind to here`,destructive:!0,onSelect:()=>r(!0)}),{actions:o,overlays:a?(0,L.jsx)(mse,{entry:e,open:n,onOpenChange:r},`rewind`):null}}function gse(e){let t=[hse(e)];return{actions:t.flatMap(e=>e.actions),overlays:t.map(e=>e.overlays)}}function r3({entry:e}){let{actions:t,overlays:n}=gse(e);return t.length===0?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(FW,{children:[(0,L.jsx)(IW,{asChild:!0,children:(0,L.jsx)(Z,{variant:`ghost`,size:`icon-xs`,"aria-label":`Message actions`,children:(0,L.jsx)(MI,{})})}),(0,L.jsx)(LW,{align:`end`,children:t.map(e=>(0,L.jsx)(RW,{variant:e.destructive?`destructive`:`default`,onSelect:e.onSelect,children:e.label},e.id))})]}),n]})}function _se({message:e}){let t=Ew().data?.find(t=>t.provider===e.provider&&t.modelId===e.model);return(0,L.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,"data-testid":`model-label`,children:t?.name??e.model})}function vse({message:e}){return(0,L.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[(0,L.jsx)(cR,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`p`,{className:`font-medium`,children:`The model returned an error`}),e?(0,L.jsx)(`p`,{className:`break-words text-destructive/90`,children:e}):null]})]})}function yse(e,t){return Math.max(0,Math.ceil((e-t)/1e3))}function bse({retry:e}){let t=HH(1e3),n=yse(e.at,t);return(0,L.jsxs)(`div`,{role:`status`,className:`flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2 text-sm`,children:[(0,L.jsx)(RL,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`p`,{className:`font-medium`,children:[n>0?`Retrying in ${n}s`:`Retrying now`,` (attempt `,e.attempt+1,`)`]}),(0,L.jsx)(`p`,{className:`break-words text-muted-foreground`,children:e.error})]})]})}function xse(){return(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,L.jsx)(aI,{className:`flex-1`}),(0,L.jsx)(`span`,{children:`Context compacted`}),(0,L.jsx)(aI,{className:`flex-1`})]})}function Sse(){return(0,L.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(uL,{"aria-hidden":!0,className:`size-3.5 animate-spin`}),`Compacting context…`]})}function Cse(){return(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,L.jsx)(aI,{className:`flex-1`}),(0,L.jsx)(`span`,{children:`Retried`}),(0,L.jsx)(aI,{className:`flex-1`})]})}function wse({text:e,streaming:t}){return(0,L.jsxs)($K,{className:`group/thinking`,children:[(0,L.jsxs)(eq,{className:`flex items-center gap-1.5 rounded-md py-0.5 text-sm text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,L.jsx)(SI,{"aria-hidden":!0,className:`size-3.5 transition-transform group-data-[state=open]/thinking:rotate-90`}),(0,L.jsx)(_I,{"aria-hidden":!0,className:`size-3.5`}),(0,L.jsx)(`span`,{children:t?`Thinking…`:`Thought`})]}),(0,L.jsx)(tq,{children:(0,L.jsx)($4,{className:`mt-1 border-l-2 pl-3 text-sm text-muted-foreground`,children:e})})]})}function Tse({block:e,props:t}){let n=t.streaming??!1;return e.type===`text`?e.text?(0,L.jsx)($4,{children:e.text}):null:e.type===`thinking`?e.thinking?(0,L.jsx)(wse,{text:e.thinking,streaming:n}):null:e.type===`toolCall`&&!n?(0,L.jsx)(dse,{state:t.resolveTool(e)}):null}function Ese(e,t){return e.type===`toolCall`?e.id:`${e.type}:${t}`}function i3(e){return e.content.flatMap(e=>e.type===`text`&&e.text?[e.text]:[]).join(`
|
|
96
|
+
|
|
97
|
+
`)}function a3(e){let{message:t}=e,n=i3(t);return(0,L.jsxs)(`div`,{className:`group space-y-2`,"data-testid":`assistant-message`,children:[t.content.map((t,n)=>(0,L.jsx)(Tse,{block:t,props:e},Ese(t,n))),t.stopReason===`error`?(0,L.jsx)(vse,{message:t.errorMessage}):null,n&&!e.streaming?(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(hq,{text:n,label:`Copy answer`}),(0,L.jsx)(_se,{message:t}),e.entry?(0,L.jsx)(r3,{entry:e.entry}):null]}):null,t.stopReason===`aborted`?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Stopped.`}):null]})}var Dse=e=>e===Gee;function Ose(e){return sC(Kee,e)?e:void 0}var kse=P_,o3=e=>e===`done`?`finished`:e,Ase={[f_]:e=>sC(v_,e)?{kind:`monitor-event`,data:e}:void 0,[p_]:e=>sC(y_,e)?{kind:`process-exit`,data:e}:void 0,[m_]:e=>sC(S_,e)?{kind:`timer-fired`,data:e}:void 0,[h_]:e=>sC(C_,e)?{kind:`notice`,data:e}:void 0,[g_]:e=>sC(E_,e)?{kind:`goal-verdict`,data:e}:void 0};function jse(e,t){let n=Ase[e];return n?.(t)}var Mse=/^\s*<([a-z-]+)([^>]*)>([\s\S]*?)(?:<\/\1>\s*)?$/,s3=(e,t)=>RegExp(`${t}="([^"]*)"`).exec(e)?.[1];function Nse({text:e}){let t=Mw().data,n=Mse.exec(e),r=n?.[1]??`notification`,i=n?.[2]??``,a=(n?.[3]??e).trim(),o=t?.find(e=>e.id===s3(i,`id`))?.title,s=s3(i,`status`),c=r===`subagent-notification`?[`Subagent`,o,o3(s??`done`)].filter(Boolean).join(` `):r.replace(/-/g,` `);return(0,L.jsxs)($K,{"data-testid":`queued-notification`,className:`rounded-lg border bg-card text-sm opacity-70`,children:[(0,L.jsxs)(eq,{className:`group flex w-full min-w-0 items-center gap-2 px-3 py-2 text-left`,children:[(0,L.jsx)(SI,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,L.jsx)(`span`,{className:`truncate`,children:c})]}),(0,L.jsx)(tq,{className:`whitespace-pre-wrap border-t px-3 py-2 text-xs`,children:a})]})}var Pse=`Too late to cancel: the agent already received that message.`;function Fse({mimeType:e,data:t}){return{mimeType:e,data:t}}async function Ise(e,t,n,r){try{let{cancelled:i}=await e.conversations.cancelQueued(n,String(r.id));if(!i)return void eH.info(Pse);gV($R(n,t),{text:r.text,images:r.images.map(Fse)})}catch(e){eH.error(_C(e))}}function Lse({conversationId:e,item:t}){let n=J(),r=Sw();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CW,{variant:`secondary`,children:dG(t.mode)}),(0,L.jsx)(Z,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void Ise(n,r,e,t),children:`Cancel`})]})}function c3(e){return`data:${e.mimeType};base64,${e.data}`}function Rse({images:e}){let[t,n]=(0,M.useState)();if(e.length===0)return null;let r=t===void 0?void 0:e[t];return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ul`,{"aria-label":`Images`,className:`flex flex-wrap justify-end gap-2`,children:e.map((e,t)=>(0,L.jsx)(`li`,{children:(0,L.jsx)(GB,{src:c3(e),alt:`Attachment ${t+1}`,onOpen:()=>n(t)})},t))}),(0,L.jsx)(yB,{open:r!==void 0,onOpenChange:e=>!e&&n(void 0),children:(0,L.jsxs)(SB,{className:`sm:max-w-3xl`,children:[(0,L.jsxs)(TB,{children:[`Attachment `,(t??0)+1]}),(0,L.jsx)(EB,{className:`sr-only`,children:`Full size image`}),r?(0,L.jsx)(`img`,{src:c3(r),alt:`Attachment ${(t??0)+1}, full size`,className:`max-h-[75vh] w-full object-contain`}):null]})})]})}function l3({text:e,images:t=[],pending:n=!1,entry:r}){return(0,L.jsxs)(`div`,{className:`group flex flex-col items-end gap-1.5`,children:[(0,L.jsx)(Rse,{images:t}),e?(0,L.jsxs)(`div`,{className:`flex max-w-[85%] items-start gap-1`,children:[n?null:(0,L.jsx)(hq,{text:e,label:`Copy message`,className:`mt-1`}),r?(0,L.jsx)(r3,{entry:r}):null,(0,L.jsx)(`div`,{className:I(`rounded-2xl rounded-br-md bg-secondary px-3.5 py-2 text-sm leading-relaxed whitespace-pre-wrap break-words text-secondary-foreground`,n&&`border border-dashed bg-transparent text-muted-foreground`),children:e})]}):null]})}var zse={steer:`Will steer the agent`,followUp:`Will send when the agent is done`};function Bse({items:e,conversationId:t}){return e.length===0?null:(0,L.jsx)(`ul`,{"aria-label":`Queued messages`,className:`space-y-2`,children:e.map(e=>(0,L.jsxs)(`li`,{className:`space-y-1`,children:[P_(e.text)?(0,L.jsx)(Nse,{text:e.text}):(0,L.jsx)(l3,{text:e.text,images:e.images,pending:!0}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:zse[e.mode]}),t?(0,L.jsx)(Lse,{conversationId:t,item:e}):null]})]},e.id))})}function Vse(e){return e.type===`image`}function Hse(e){return e.type===`text`}function u3(e){return typeof e.content==`string`?e.content:e.content.filter(Hse).map(e=>e.text).join(`
|
|
98
|
+
`)}function Use(e){return typeof e.content==`string`?[]:e.content.filter(Vse)}function Wse(e){return e.data?.diagnostics??[]}function d3(e){return`${e.kind}:${e.id}`}function Gse(e){let t=jse(e.kind,e.data);if(t)return{...t,key:d3(e)};if(!Dse(e.kind))return;let n=Ose(e.data);return n?{kind:`subagent-notification`,key:d3(e),data:n}:void 0}function Kse(e){let t=e.model?.[0],n=Gse(e);if(n)return n;if(e.kind===`pi.user`&&t?.role===`user`)return kse(u3(t))?void 0:{kind:`user`,key:d3(e),entryId:String(e.id),text:u3(t),images:Use(t)};if(e.kind===`pi.compaction`)return{kind:`compaction`,key:d3(e)};if(e.kind===`app.retry`)return{kind:`retry`,key:d3(e)};if(e.kind===`pi.assistant`&&t?.role===`assistant`)return{kind:`assistant`,key:d3(e),entryId:String(e.id),message:t}}function qse(e){let t=e.model?.[0];if(e.kind===`pi.tool-result`&&t?.role===`toolResult`)return[t.toolCallId,{message:t,diagnostics:Wse(e)}]}function Jse(e){let t=[],n=new Map;for(let r of e.entries){let e=Kse(r);e&&t.push(e);let i=qse(r);i&&n.set(i[0],i[1])}return{items:t,results:n}}var Yse={not_met:`not met`,met:`met`,impossible:`impossible`};function Xse({data:e}){return(0,L.jsxs)($K,{"data-testid":`goal-verdict`,className:`rounded-lg border bg-card text-sm`,children:[(0,L.jsxs)(eq,{className:`group flex w-full min-w-0 items-center gap-2 px-3 py-2 text-left`,children:[(0,L.jsx)(SI,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,L.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Goal check: `,(0,L.jsx)(`span`,{className:`font-medium`,children:Yse[e.verdict]}),` — `,e.reason]})]}),(0,L.jsx)(tq,{className:`border-t px-3 py-2 whitespace-pre-wrap`,children:e.reason})]})}var f3=({lines:e})=>(0,L.jsx)(`pre`,{className:`overflow-x-auto font-mono text-xs whitespace-pre-wrap`,children:e.join(`
|
|
99
|
+
`)});function p3({lines:e,summary:t}){return e.length<=5?(0,L.jsxs)(`div`,{className:`space-y-1 px-3 py-2`,children:[(0,L.jsx)(`div`,{children:t}),e.length>0?(0,L.jsx)(f3,{lines:e}):null]}):(0,L.jsxs)($K,{children:[(0,L.jsxs)(eq,{className:`group flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,L.jsx)(SI,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),t,(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.length,` lines`]})]}),(0,L.jsx)(tq,{className:`border-t px-3 py-2`,children:(0,L.jsx)(f3,{lines:e})})]})}function Zse(e){return e===`timeout`?`ended: timeout`:`ended: exit ${e.exitCode??`none`}`}var Qse=e=>e>0?` (+${e} dropped)`:``;function $se({data:e}){let t=(0,L.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Monitor `,(0,L.jsx)(`span`,{className:`font-medium`,children:e.description}),e.lines.length===0&&e.dropped===0&&!e.ended?`: no output`:null,Qse(e.dropped),e.ended?`, ${Zse(e.ended)}`:null]});return(0,L.jsx)(`div`,{"data-testid":`monitor-event`,className:`rounded-lg border bg-card text-sm`,children:(0,L.jsx)(p3,{lines:e.lines,summary:t})})}function ece({data:e}){return(0,L.jsx)(`div`,{"data-testid":`notice`,className:`rounded-lg border bg-card px-3 py-2 text-sm text-muted-foreground`,children:e.text})}var tce=e=>e===null?`no exit code`:`exit ${e}`;function nce({data:e}){let t=(0,L.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Process `,(0,L.jsx)(`span`,{className:`font-medium`,children:e.name}),` exited (`,tce(e.exitCode),`)`]}),n=e.logTail===``?[]:e.logTail.split(`
|
|
100
|
+
`);return(0,L.jsx)(`div`,{"data-testid":`process-exit`,className:`rounded-lg border bg-card text-sm`,children:(0,L.jsx)(p3,{lines:n,summary:t})})}var rce=e=>e.kind===`repeat`?`Repeat fired (${e.firedCount+1})`:`Wake-up fired`;function ice({data:e}){return(0,L.jsxs)(`div`,{"data-testid":`timer-fired`,className:`flex items-start gap-2 rounded-lg border bg-card px-3 py-2 text-sm`,children:[(0,L.jsx)(iR,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[rce(e),e.source===`loop`?` · /loop`:``,e.reason?` · ${e.reason}`:``]}),(0,L.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:e.prompt})]})]})}function ace({item:e}){return e.kind===`monitor-event`?(0,L.jsx)($se,{data:e.data}):e.kind===`process-exit`?(0,L.jsx)(nce,{data:e.data}):e.kind===`timer-fired`?(0,L.jsx)(ice,{data:e.data}):e.kind===`goal-verdict`?(0,L.jsx)(Xse,{data:e.data}):(0,L.jsx)(ece,{data:e.data})}var oce=[`monitor-event`,`process-exit`,`timer-fired`,`notice`,`goal-verdict`],sce=e=>oce.includes(e.kind);function cce({data:e}){let t=Sw(),n=Mw().data?.find(t=>t.id===e.childId);return(0,L.jsxs)($K,{"data-testid":`subagent-notification`,className:`rounded-lg border bg-card text-sm`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,L.jsxs)(eq,{className:`group flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,L.jsx)(SI,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,L.jsxs)(`span`,{className:`truncate`,children:[`Subagent `,(0,L.jsx)(`span`,{className:`font-medium`,children:e.title}),` `,o3(e.status)]})]}),n?(0,L.jsx)(Ln,{className:`text-xs underline`,to:iU(n.projectId,n.id,t),children:`Open`}):null]}),(0,L.jsx)(tq,{className:`border-t px-3 py-2`,children:(0,L.jsx)($4,{children:e.report})})]})}function lce({onRetry:e}){let t=(0,M.useRef)(void 0),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)();return(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsxs)(Z,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>{t.current??=WW(),r(!0),a(void 0),e(t.current).then(()=>{t.current=void 0}).catch(e=>a(e instanceof Error?e.message:`Could not retry.`)).finally(()=>r(!1))},children:[(0,L.jsx)(RL,{}),` Retry`]}),i?(0,L.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i}):null]})}function uce({approval:e}){let t=are(e.conversationId),n=n=>t.mutate({toolUseId:e.toolUseId,decision:n});return(0,L.jsxs)(`section`,{"aria-label":`Tool approval`,className:`flex flex-col gap-2 rounded-lg border bg-card p-3 text-sm`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:$q(e.server,e.tool)}),(0,L.jsxs)($K,{children:[(0,L.jsx)(eq,{className:`text-xs text-muted-foreground`,children:`Arguments`}),(0,L.jsx)(tq,{children:(0,L.jsx)(`pre`,{className:`overflow-x-auto font-mono text-xs`,children:JSON.stringify(e.arguments,null,2)})})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(Z,{size:`sm`,disabled:t.isPending,onClick:()=>n(`allow`),children:`Allow once`}),(0,L.jsx)(Z,{size:`sm`,variant:`outline`,disabled:t.isPending,onClick:()=>n(`allow_always`),children:`Always allow this tool`}),(0,L.jsx)(Z,{size:`sm`,variant:`outline`,disabled:t.isPending,onClick:()=>n(`deny`),children:`Deny`})]})]})}function dce({conversationId:e}){let t=Fw(e);return t.data?.length?(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.data.map(e=>(0,L.jsx)(uce,{approval:e},e.toolUseId))}):null}function m3(e){return e?.content.some(e=>e.type===`text`?e.text:e.type===`thinking`)??!1}function fce(e){let t=e[0];return t?.kind===`user`?t.entryId:void 0}function pce(e,t){if(e[t+1]?.kind!==`assistant`)for(let n=t;n>=0;n--){let t=e[n];if(t?.kind===`user`)return t.entryId}}function mce(){return(0,L.jsx)(`p`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`Send a message to start.`})}function hce(){return(0,L.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(uL,{"aria-hidden":!0,className:`size-3.5 animate-spin`}),`Working…`]})}function gce(e){return e.busy&&!m3(e.streaming)&&!e.retry&&!e.slots.some(e=>vq(e.status))}function _ce({view:e,onRetry:t,conversationId:n}){let{items:r,results:i}=Jse(e),a=fce(r),o=(e,t,r)=>n?{conversationId:n,entryId:e,role:t,text:r,startsConversation:e===a}:void 0,s=dC(e),c=e=>_q(e,{results:i,slots:s.slots,busy:s.busy});return r.length===0&&!s.busy&&!s.compacting&&s.queued.length===0?(0,L.jsx)(mce,{}):(0,L.jsx)(TJ,{value:FJ(e),children:(0,L.jsxs)(`div`,{className:`space-y-5`,children:[r.map((e,t)=>{if(e.kind===`compaction`)return(0,L.jsx)(xse,{},e.key);if(e.kind===`subagent-notification`)return(0,L.jsx)(cce,{data:e.data},e.key);if(sce(e))return(0,L.jsx)(ace,{item:e},e.key);if(e.kind===`retry`)return(0,L.jsx)(Cse,{},e.key);if(e.kind===`user`)return(0,L.jsx)(l3,{text:e.text,images:e.images,entry:o(e.entryId,`user`,e.text)},e.key);let i=pce(r,t);return(0,L.jsxs)(M.Fragment,{children:[(0,L.jsx)(a3,{message:e.message,resolveTool:c,entry:o(e.entryId,`assistant`,i3(e.message))}),n&&i?(0,L.jsx)(pq,{conversationId:n,entryId:i}):null]},e.key)}),m3(s.streaming)?(0,L.jsx)(a3,{message:s.streaming,resolveTool:c,streaming:!0}):null,s.compacting?(0,L.jsx)(Sse,{}):null,s.retry?(0,L.jsx)(bse,{retry:s.retry}):null,gce(s)?(0,L.jsx)(hce,{}):null,t&&nne(e)?(0,L.jsx)(lce,{onRetry:t}):null,n?(0,L.jsx)(dce,{conversationId:n}):null,(0,L.jsx)(Bse,{items:s.queued,conversationId:n})]})})}var vce={pending:`Pending`,in_progress:`In progress`,completed:`Completed`};function yce({status:e}){let t=`mt-0.5 size-3.5 shrink-0`;return e===`completed`?(0,L.jsx)(yI,{"aria-hidden":!0,className:I(t,`text-success`)}):e===`in_progress`?(0,L.jsx)(uL,{"aria-hidden":!0,className:I(t,`animate-spin text-muted-foreground`)}):(0,L.jsx)(moe,{"aria-hidden":!0,className:I(t,`text-muted-foreground`)})}function bce({todos:e}){return(0,L.jsx)(`ul`,{className:`space-y-1 text-sm`,children:e.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex items-start gap-2`,"data-status":e.status,children:[(0,L.jsx)(yce,{status:e.status}),(0,L.jsx)(`span`,{className:I(e.status===`completed`&&`text-muted-foreground line-through`),children:e.content}),(0,L.jsx)(`span`,{className:`sr-only`,children:vce[e.status]})]},t))})}function xce({view:e}){let t=PJ(e);return MJ(t)?null:(0,L.jsxs)($K,{defaultOpen:!0,"data-testid":`todo-panel`,className:`group/todos rounded-lg border bg-card text-card-foreground`,children:[(0,L.jsxs)(eq,{className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-muted-foreground outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,L.jsx)(SI,{"aria-hidden":!0,className:`size-3.5 transition-transform group-data-[state=open]/todos:rotate-90`}),(0,L.jsx)(oL,{"aria-hidden":!0,className:`size-3.5`}),(0,L.jsx)(`span`,{className:`font-medium`,children:`Todos`}),(0,L.jsxs)(`span`,{children:[AJ(t),`/`,t.length]})]}),(0,L.jsx)(tq,{className:`border-t px-3 py-2`,children:(0,L.jsx)(bce,{todos:t})})]})}var h3=(0,M.createContext)(void 0);function Sce({client:e,children:t}){return(0,L.jsx)(h3.Provider,{value:e,children:t})}function g3(){let e=(0,M.useContext)(h3);if(!e)throw Error(`useLiveClient needs a <LiveClientProvider>`);return e}var _3={status:`loading`};function v3(e){let t=g3(),[n,r]=(0,M.useState)({id:e,value:_3});return(0,M.useEffect)(()=>(r({id:e,value:_3}),t.subscribe(e,t=>{r({id:e,value:t?{status:`ready`,view:t}:{status:`gone`}})})),[t,e]),n.id===e?n.value:_3}var Cce=48;function wce(e){return e.scrollHeight-e.scrollTop-e.clientHeight}function Tce(){let e=(0,M.useRef)(null),t=(0,M.useRef)(null),n=(0,M.useRef)(!0),r=(0,M.useRef)(0),[i,a]=(0,M.useState)(!0),o=(0,M.useCallback)(()=>{let t=e.current;t&&(n.current=!0,a(!0),t.scrollTop=t.scrollHeight,r.current=t.scrollTop)},[]),s=(0,M.useCallback)(()=>{let t=e.current;if(!t)return;let i=t.scrollTop<r.current;r.current=t.scrollTop,wce(t)<=Cce?n.current=!0:i&&(n.current=!1),a(n.current)},[]);return(0,M.useEffect)(()=>{let i=t.current,a=e.current;if(!i||!a)return;let o=()=>{n.current&&(a.scrollTop=a.scrollHeight,r.current=a.scrollTop)};o();let s=new ResizeObserver(o);return s.observe(i),s.observe(a),()=>s.disconnect()},[]),{scrollRef:e,contentRef:t,atBottom:i,onScroll:s,scrollToBottom:o}}function Ece(){return(0,L.jsxs)(`div`,{"aria-busy":!0,className:`space-y-4`,role:`status`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`Loading conversation`}),(0,L.jsx)(Si,{className:`ml-auto h-9 w-1/2`}),(0,L.jsx)(Si,{className:`h-16 w-3/4`})]})}function Dce(){return(0,L.jsxs)(`div`,{className:`space-y-3 py-16 text-center`,children:[(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This thread was deleted`}),(0,L.jsx)(Z,{asChild:!0,variant:`outline`,size:`sm`,children:(0,L.jsx)(Ln,{to:`/`,children:`Back to new thread`})})]})}function Oce({id:e,state:t,onRetry:n}){return t.status===`loading`?(0,L.jsx)(Ece,{}):t.status===`gone`?(0,L.jsx)(Dce,{}):(0,L.jsx)(_ce,{view:t.view,onRetry:n,conversationId:e})}function kce({id:e}){let t=v3(e),n=GW(e),r=J(),i=Sw(),{scrollRef:a,contentRef:o,atBottom:s,onScroll:c,scrollToBottom:l}=Tce(),u=Ew().data,d=Mw().data?.find(t=>t.id===e),f=(0,M.useRef)(null),p=sG({conversationId:e,projectId:d?.projectId,pickers:f}),m=t.status===`ready`?t.view:void 0,h=t.status===`ready`&&dC(t.view).busy,g=m?dC(m).queued:[],_=(0,M.useCallback)(()=>hG(r,e,i,g),[r,e,i,g]),v=ww().data?.messageMode,y=v?fG(v):void 0,b=d?.parentId??null;return(0,L.jsxs)(`div`,{"data-testid":`conversation`,className:`relative flex h-full min-h-0 flex-col bg-background`,children:[m?(0,L.jsx)(JG,{id:e,extras:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(nU,{conversationId:e}),(0,L.jsx)($W,{conversationId:e}),(0,L.jsx)(bU,{})]})}):null,b?(0,L.jsx)(PW,{parentId:b,childId:e}):null,(0,L.jsx)(`div`,{ref:a,onScroll:c,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,L.jsx)(`div`,{ref:o,className:`relative mx-auto w-full max-w-3xl px-4 py-6`,children:(0,L.jsx)(`section`,{"aria-label":`Conversation`,"aria-live":`polite`,"aria-relevant":`additions`,children:(0,L.jsx)(Oce,{id:e,state:t,onRetry:b?void 0:n.retry})})})}),s?null:(0,L.jsxs)(Z,{variant:`outline`,size:`sm`,className:`absolute bottom-24 left-1/2 -translate-x-1/2 rounded-full bg-background shadow-md`,onClick:l,children:[(0,L.jsx)(loe,{}),` Jump to latest`]}),t.status===`gone`||b?null:(0,L.jsx)(`div`,{className:`mx-auto w-full max-w-3xl px-3 pt-1 pb-3 sm:px-4 sm:pb-4`,children:(0,L.jsx)(VH,{target:e,imagesAllowed:uG(m,u),busy:h,whenBusy:y,hint:(0,L.jsx)(mG,{busy:h}),abovePanel:m?(0,L.jsx)(xce,{conversationId:e,view:m}):void 0,toolbar:m?(0,L.jsx)(QK,{id:e,view:m,pickers:f}):void 0,commands:p.commands,projectId:d?.projectId,onSend:n.send,onStop:_,onSent:l})}),p.renaming?(0,L.jsx)(xW,{title:`Rename thread`,label:`Thread name`,initialValue:d?.title??``,onSubmit:p.rename,onClose:p.closeRename}):null]})}function Ace({id:e}){return(0,L.jsx)(kce,{id:e},e)}function y3(e,t){return e.add(t),()=>e.delete(t)}function b3(e,t){for(let n of[...e])try{n(t)}catch(e){console.error(`live listener failed`,e)}}function jce(e){let t=new Map,n=new Set,r=new Set,i=`closed`,a,o=0,s,c=!1,l=e=>{e!==i&&(i=e,b3(r,e))},u=e=>{i===`open`&&a?.send(e)},d=e=>{u({type:`unsubscribe`,conversationId:e}),u({type:`subscribe`,conversationId:e})},f=(e,n)=>{let r=t.get(e);if(r)try{let e=c_(r.view,n);if(e===r.view)return;r.view=e,e!==void 0&&b3(r.listeners,e)}catch(t){console.error(`bad ops for conversation, resubscribing`,t),d(e)}},p=e=>{e.type===`ops`?f(e.conversationId,e.ops):b3(n,e)},m=()=>{l(`reconnecting`),s=setTimeout(g,iW(o)),o+=1},h={onOpen(){o=0,l(`open`);for(let e of t.keys())a?.send({type:`subscribe`,conversationId:e})},onFrame:p,onClose(){a=void 0,c||m()}};function g(){s=void 0,!c&&(i!==`reconnecting`&&l(`connecting`),a=e.open(h))}let _=()=>{c||a||s||g()};return{subscribe(e,n){let r=t.get(e);return r||(r={view:void 0,listeners:new Set},t.set(e,r),u({type:`subscribe`,conversationId:e})),r.listeners.add(n),r.view!==void 0&&n(r.view),_(),()=>{let r=t.get(e);!r?.listeners.delete(n)||r.listeners.size>0||(t.delete(e),u({type:`unsubscribe`,conversationId:e}))}},onChanged(e){let t=y3(n,e);return _(),t},get status(){return i},onStatus:e=>y3(r,e),close(){c=!0,clearTimeout(s),s=void 0,a?.close(),a=void 0,t.clear(),n.clear(),l(`closed`),r.clear()}}}function x3(e){e.invalidateQueries({queryKey:Y.projects}),e.invalidateQueries({queryKey:[`conversations`]})}function Mce(e,t){t.resource===`projects`?(x3(e),e.invalidateQueries({queryKey:Y.githubRepos})):t.resource===`providers`?Dw(e):t.resource===`processes`?(e.invalidateQueries({queryKey:Y.processes(t.conversationId)}),e.invalidateQueries({queryKey:[`process-logs`]})):t.resource===`timers`?e.invalidateQueries({queryKey:Y.timers(t.conversationId)}):t.resource===`approvals`?e.invalidateQueries({queryKey:Y.approvals(t.conversationId)}):t.resource===`remote`?(e.invalidateQueries({queryKey:Y.remoteStatus}),e.invalidateQueries({queryKey:Y.settings})):t.resource===`devices`?e.invalidateQueries({queryKey:Y.devices}):t.resource===`machines`?e.invalidateQueries({queryKey:Y.machines}):t.resource===`mcp`?e.invalidateQueries({queryKey:Y.allMcpServers}):t.resource===`conversations`&&(e.invalidateQueries({queryKey:Y.conversations(t.projectId)}),e.invalidateQueries({queryKey:Y.allConversations}),e.invalidateQueries({queryKey:[`workspace`]}),e.invalidateQueries({queryKey:[`checkpoints`]}),e.invalidateQueries({queryKey:[`goal`]}))}var Nce=e=>e===`reconnecting`||e===`closed`;function Pce(e){let t=!1;return n=>{Nce(n)?t=!0:n===`open`&&t&&(t=!1,x3(e))}}function Fce(){let e=g3(),t=yC();(0,M.useEffect)(()=>e.onChanged(e=>Mce(t,e)),[e,t]),(0,M.useEffect)(()=>e.onStatus(Pce(t)),[e,t])}function Ice(){return Fce(),null}var S3=new Map;function C3(e){return{queryClient:new Hne({defaultOptions:{queries:{retry:!1}}}),liveClient:jce(e.live)}}function Lce(e,t){if(e===void 0)return C3(t);let n=S3.get(e);return n||(n=C3(t),S3.set(e,n)),n}function w3({machineId:e,children:t}){let[n]=(0,M.useState)(()=>yw(e)),[{queryClient:r,liveClient:i}]=(0,M.useState)(()=>Lce(e,n));return(0,L.jsx)(Jne,{machineId:e,api:n,children:(0,L.jsx)(yne,{client:r,children:(0,L.jsx)(mz,{isHub:e===void 0,client:r,children:(0,L.jsxs)(Sce,{client:i,children:[(0,L.jsx)(Ice,{}),t]})})})})}var T3=15e3;function E3(){let{machines:e}=PG(),t=hz(),n=FG(),r=yw(),i=e.filter(VG),a=Gne({queries:[{queryKey:Y.projects,queryFn:()=>r.projects.list()},{queryKey:Y.allConversations,queryFn:async()=>(await r.conversations.listAll()).sort(jw)},...i.flatMap(e=>[{queryKey:[...Y.machineData(e.id),`projects`],queryFn:()=>yw(e.id).projects.list(),refetchInterval:T3},{queryKey:[...Y.machineData(e.id),`conversations`],queryFn:async()=>(await yw(e.id).conversations.listAll()).sort(jw),refetchInterval:T3}])]},t),o=a.map(e=>e.dataUpdatedAt).join(`,`),s=i.map(e=>`${e.id}:${e.name}`).join(`,`);return(0,M.useMemo)(()=>[{machineId:void 0,name:KG,os:n,status:`online`,projects:a[0]?.data??[],conversations:a[1]?.data??[]},...i.map((e,t)=>({machineId:e.id,name:e.name,os:e.os,status:e.status,projects:a[2+t*2]?.data??[],conversations:a[3+t*2]?.data??[]}))],[o,s,n])}function D3({machineId:e,children:t}){return e===void 0?t:(0,L.jsx)(w3,{machineId:e,children:t},e)}function O3({className:e,...t}){return(0,L.jsx)(gie,{"data-slot":`label`,className:I(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Rce({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`field-group`,className:I(`flex w-full flex-col gap-5`,e),...t})}function k3({className:e,...t}){return(0,L.jsx)(`div`,{role:`group`,"data-slot":`field`,className:I(`flex w-full flex-col gap-2`,e),...t})}function A3({className:e,...t}){return(0,L.jsx)(O3,{"data-slot":`field-label`,className:I(`w-fit`,e),...t})}function j3({className:e,...t}){return(0,L.jsx)(`p`,{"data-slot":`field-description`,className:I(`text-sm text-muted-foreground`,e),...t})}function zce({className:e,children:t,...n}){return(0,L.jsxs)(Lie,{"data-slot":`scroll-area`,className:I(`relative`,e),...n,children:[(0,L.jsx)(Rie,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,L.jsx)(Bce,{}),(0,L.jsx)(Yie,{})]})}function Bce({className:e,orientation:t=`vertical`,...n}){return(0,L.jsx)(Vie,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:I(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:(0,L.jsx)(qie,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}function M3({id:e,asChild:t,className:n,...r}){let i=t?hT:`div`;return(0,L.jsx)(i,{"data-slot":`setting-row`,"data-setting-id":e,className:I(!t&&`-mx-2 -my-1.5 px-2 py-1.5`,`scroll-mt-4 rounded-lg transition-colors duration-700 data-[highlighted]:bg-accent data-[highlighted]:ring-2 data-[highlighted]:ring-ring/40 motion-reduce:transition-none`,n),...r})}function N3({className:e,...t}){return(0,L.jsx)(SB,{showCloseButton:!1,className:I(`h-[min(640px,85vh)] max-w-3xl gap-0 overflow-hidden p-0 sm:max-w-3xl`,e),...t})}function P3({sections:e,active:t,onPick:n}){return(0,L.jsx)(`nav`,{"aria-label":`Settings sections`,children:(0,L.jsx)(GR,{children:e.map(e=>(0,L.jsx)(KR,{children:(0,L.jsxs)(JR,{isActive:e.id===t,"aria-current":e.id===t?`page`:void 0,onClick:()=>n(e.id),children:[e.icon,(0,L.jsx)(`span`,{children:e.label})]})},e.id))})})}function F3({children:e}){return(0,L.jsx)(zce,{className:`min-h-0 flex-1`,children:(0,L.jsx)(`div`,{className:`flex flex-col gap-6 p-4 md:p-6`,children:e})})}function Vce({sections:e,active:t,onActiveChange:n,title:r,search:i,results:a,children:o}){return(0,L.jsxs)(NR,{className:`h-full min-h-0 w-full`,children:[(0,L.jsx)(PR,{collapsible:`none`,className:`w-48 shrink-0 p-2`,children:(0,L.jsxs)(BR,{children:[i,(0,L.jsx)(VR,{className:`p-0`,children:(0,L.jsx)(P3,{sections:e,active:t,onPick:n})})]})}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,L.jsx)(TB,{className:`px-6 pt-5 text-base font-medium`,children:r}),(0,L.jsx)(F3,{children:a??o})]})]})}function Hce({sections:e,active:t,onActiveChange:n,title:r,search:i,results:a,sectionRequest:o,children:s}){let[c,l]=M.useState(!1);M.useEffect(()=>{o&&l(!0)},[o]);let u=e.find(e=>e.id===t)?.label??r;return(0,L.jsxs)(NR,{className:`h-full min-h-0 w-full flex-col`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pt-4 pb-2`,children:[c&&(0,L.jsx)(Z,{variant:`ghost`,size:`icon-sm`,"aria-label":`Back to settings`,onClick:()=>l(!1),children:(0,L.jsx)(uoe,{})}),(0,L.jsx)(TB,{className:`text-base font-medium`,children:c?u:r})]}),c?(0,L.jsx)(F3,{children:s}):(0,L.jsxs)(L.Fragment,{children:[i,a?(0,L.jsx)(F3,{children:a}):(0,L.jsx)(`div`,{className:`p-2`,children:(0,L.jsx)(P3,{sections:e,active:t,onPick:e=>{n(e),l(!0)}})})]})]})}function I3({mobile:e,...t}){let n=nI();return e??n?(0,L.jsx)(Hce,{...t}):(0,L.jsx)(Vce,{...t})}function L3({className:e,size:t=`default`,...n}){return(0,L.jsx)(sae,{"data-slot":`switch`,"data-size":t,className:I(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,L.jsx)(lae,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}var R3=()=>typeof Notification<`u`,z3=()=>R3()&&Notification.permission===`granted`,Uce=`Notifications are blocked in your browser settings.`;function Wce(){let[e,t]=(0,M.useState)(()=>fz.getNotificationsEnabled()&&z3()),[n,r]=(0,M.useState)(!1);return(0,L.jsx)(M3,{id:`notifications`,children:(0,L.jsxs)(k3,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(A3,{htmlFor:`notifications-switch`,children:`Notifications`}),(0,L.jsx)(L3,{id:`notifications-switch`,checked:e,disabled:!R3(),onCheckedChange:async e=>{let n=e&&await Notification.requestPermission()===`granted`;fz.setNotificationsEnabled(n),t(n),r(e&&!n)}})]}),(0,L.jsx)(j3,{children:n?Uce:`Notify me when a run ends and this page is hidden.`})]})})}function Gce(e,t){if(!e)return[];let n=new Map(e.map(e=>[e.id,e.lastRunEndedAt]));return t.filter(({id:e,lastRunEndedAt:t})=>t===null||!n.has(e)?!1:t>(n.get(e)??0))}var Kce=()=>document.visibilityState===`visible`,B3=e=>e.machineId??`local`;function qce(){let e=E3(),t=(0,M.useRef)(new Map),{conversationId:n,machineId:r}=uU(),i=bt();return(0,M.useEffect)(()=>{for(let a of e){let o=Gce(t.current.get(B3(a)),a.conversations);if(t.current.set(B3(a),[...a.conversations]),fz.getNotificationsEnabled()&&z3())for(let t of o){if(t.id===n&&a.machineId===r&&Kce())continue;let o=t.title.trim()||`New thread`,s=new Notification(e.length>1?`${o} · ${a.name}`:o,{body:t.status===`error`?`The run failed.`:`The run finished.`,tag:a.machineId===void 0?t.id:`${a.machineId}:${t.id}`});s.onclick=()=>{window.focus(),i(iU(t.projectId,t.id,a.machineId))}}}},[e]),null}var Jce=aT(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),V3=M.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function H3({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,L.jsx)(kae,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:I(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,L.jsx)(V3.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function U3({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=M.useContext(V3);return(0,L.jsx)(Pae,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:I(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,Jce({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}var Yce=()=>/Mac|iPhone|iPad/.test(globalThis.navigator?.platform??``);function Xce(e){let t=e.toLowerCase().split(`+`);return{mod:t.includes(`mod`),shift:t.includes(`shift`),alt:t.includes(`alt`),key:t.at(-1)??``}}function Zce(e,t){let n=Yce()?e.metaKey:e.ctrlKey;return e.key.toLowerCase()===t.key&&n===t.mod&&e.shiftKey===t.shift&&e.altKey===t.alt}function Qce(e){let t=e;return!!t&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))}function W3(e,t){let n=(0,M.useRef)(t);n.current=t,(0,M.useEffect)(()=>{let t=Xce(e),r=e=>{Zce(e,t)&&(t.mod||!Qce(e.target))&&(e.preventDefault(),n.current(e))};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e])}var G3=[{id:`general`,label:`General`},{id:`providers`,label:`Providers`},{id:`models`,label:`Models`},{id:`projects`,label:`Projects`},{id:`github`,label:`GitHub`},{id:`agent`,label:`Agent`},{id:`tools`,label:`Tools`},{id:`remote`,label:`Remote access`},{id:`machines`,label:`Machines`}];function $ce(e,t){let[n,r]=(0,M.useState)(e);return(0,M.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var ele=120,K3=e=>e.startsWith(`/`)||e.startsWith(`~`),tle=e=>`${e.display}/`,nle=(e,t)=>e.trim()===t.display,q3=e=>e.preventDefault();function rle({suggestion:e,active:t,onAccept:n}){let r=(0,M.useRef)(null);(0,M.useEffect)(()=>{t&&r.current?.scrollIntoView?.({block:`nearest`})},[t]);let i=e.isGitRepo?HI:WI;return(0,L.jsxs)(BB,{ref:r,value:e.path,onMouseDown:q3,onSelect:()=>n(e),children:[(0,L.jsx)(i,{"aria-label":e.isGitRepo?`Git repository`:void 0}),(0,L.jsx)(`span`,{className:`truncate`,children:e.display})]})}function J3({value:e,onValueChange:t,onKeyDown:n,onFocus:r,onBlur:i,...a}){let o=(0,M.useId)(),[s,c]=(0,M.useState)(!1),[l,u]=(0,M.useState)(!1),[d,f]=(0,M.useState)(0),p=$ce(e,ele),{data:m}=ere(p,K3(p)),h=K3(e)?m??[]:[],g=h[Math.min(d,h.length-1)],_=s&&!l&&g!==void 0,v=e=>{t(e),f(0),u(!1)},y=e=>v(tle(e)),b=e=>f(t=>(t+e+h.length)%h.length),x=t=>{n?.(t),!(t.defaultPrevented||t.nativeEvent.isComposing)&&(!_||!g?t.key===`ArrowDown`&&h.length>0&&(t.preventDefault(),u(!1)):t.key===`ArrowDown`||t.key===`ArrowUp`?(t.preventDefault(),b(t.key===`ArrowDown`?1:-1)):t.key===`Escape`?(t.preventDefault(),u(!0)):(t.key===`Tab`&&!t.shiftKey||t.key===`Enter`&&!nle(e,g))&&(t.preventDefault(),y(g)))};return(0,L.jsxs)(vz,{open:_,onOpenChange:e=>!e&&u(!0),children:[(0,L.jsx)(xz,{asChild:!0,children:(0,L.jsx)(`div`,{className:`w-full`,children:(0,L.jsx)(iI,{autoComplete:`off`,autoCapitalize:`off`,spellCheck:!1,...a,role:`combobox`,"aria-expanded":_,"aria-controls":o,"aria-autocomplete":`list`,value:e,onChange:e=>v(e.target.value),onKeyDown:x,onFocus:e=>{c(!0),r?.(e)},onBlur:e=>{c(!1),i?.(e)}})})}),(0,L.jsx)(bz,{align:`start`,className:`w-(--radix-popover-trigger-width) gap-0 p-0`,onOpenAutoFocus:q3,onCloseAutoFocus:q3,onInteractOutside:q3,children:(0,L.jsx)(PB,{shouldFilter:!1,value:g?.path,onValueChange:e=>f(Math.max(0,h.findIndex(t=>t.path===e))),children:(0,L.jsx)(LB,{id:o,"aria-label":`Folder suggestions`,children:h.map(e=>(0,L.jsx)(rle,{suggestion:e,active:e.path===g?.path,onAccept:y},e.path))})})})]})}function Y3(){let e=Sw(),{machines:t}=PG();if(e===void 0)return``;let n=t.find(t=>t.id===e)?.name;return n?` on ${n}`:` on that machine`}function X3({onClose:e,onAdded:t}){let n=J(),r=Y3(),i=(0,M.useId)(),a=(0,M.useId)(),o=(0,M.useId)(),[s,c]=(0,M.useState)(`folder`),[l,u]=(0,M.useState)(``),[d,f]=(0,M.useState)(``),[p,m]=(0,M.useState)(``),h=yC(),g=ww().data?.projectsFolder,{run:_,error:v,pending:y,clearError:b}=bW(),x=s===`folder`?l:d;return(0,L.jsx)(yB,{open:!0,onOpenChange:t=>!t&&e(),children:(0,L.jsx)(SB,{children:(0,L.jsxs)(`form`,{onSubmit:async r=>{r.preventDefault();let i;await _(async()=>{let e=p.trim(),t=e?{name:e}:{};i=s===`folder`?await n.projects.add({path:l.trim(),...t}):await n.projects.clone({url:d.trim(),...t}),await h.invalidateQueries({queryKey:Y.projects})})&&(e(),i&&t?.(i))},className:`flex flex-col gap-4`,children:[(0,L.jsxs)(CB,{children:[(0,L.jsx)(TB,{children:`Add project`}),(0,L.jsxs)(EB,{children:[`Use a folder on `,r?r.slice(4):`this computer`,` or clone a Git repository.`]})]}),(0,L.jsxs)(EU,{value:s,onValueChange:e=>{c(e),b()},children:[(0,L.jsxs)(OU,{children:[(0,L.jsx)(kU,{value:`folder`,children:`Folder`}),(0,L.jsx)(kU,{value:`git`,children:`Git URL`})]}),(0,L.jsxs)(AU,{value:`folder`,className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`label`,{htmlFor:i,className:`text-sm font-medium`,children:[`Folder path`,r]}),(0,L.jsx)(J3,{id:i,value:l,onValueChange:u,placeholder:`~/src/my-app`,autoFocus:!0,"aria-invalid":v?!0:void 0})]}),(0,L.jsxs)(AU,{value:`git`,className:`flex flex-col gap-2`,children:[(0,L.jsx)(`label`,{htmlFor:a,className:`text-sm font-medium`,children:`Repository URL`}),(0,L.jsx)(iI,{id:a,value:d,onChange:e=>f(e.target.value),placeholder:`https://github.com/you/my-app.git`,spellCheck:!1,autoFocus:!0,"aria-invalid":v?!0:void 0}),g&&(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Clones into `,g]})]})]}),(0,L.jsx)(yW,{message:v}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`label`,{htmlFor:o,className:`text-sm font-medium`,children:[`Name `,(0,L.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional)`})]}),(0,L.jsx)(iI,{id:o,value:p,onChange:e=>m(e.target.value)})]}),(0,L.jsxs)(wB,{children:[(0,L.jsx)(Z,{type:`button`,variant:`outline`,onClick:e,children:`Cancel`}),(0,L.jsx)(Z,{type:`submit`,disabled:y||x.trim()===``,children:s===`folder`?`Add project`:`Clone project`})]})]})})})}function Z3({machines:e,onChoose:t,onClose:n}){return(0,L.jsx)(yB,{open:!0,onOpenChange:e=>!e&&n(),children:(0,L.jsxs)(SB,{className:`sm:max-w-sm`,children:[(0,L.jsxs)(CB,{children:[(0,L.jsx)(TB,{children:`Which machine?`}),(0,L.jsx)(EB,{children:`The project folder lives on one machine. Pick it.`})]}),(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,L.jsxs)(Z,{variant:`outline`,className:`justify-start`,onClick:()=>t(e.machineId),children:[(0,L.jsx)(NG,{os:e.os,status:e.status}),e.name]},e.machineId??`local`))})]})})}function ile({state:e,machines:t,onChange:n}){let r=bt(),i=hz();if(e===null)return null;if(e.step===`choose`)return(0,L.jsx)(Z3,{machines:t,onClose:()=>n(null),onChoose:e=>n({step:`add`,machineId:e})});let{machineId:a}=e,o=(0,L.jsx)(X3,{onClose:()=>n(null),onAdded:e=>{i.invalidateQueries({queryKey:Y.projects}),i.invalidateQueries({queryKey:[`machine-data`]}),r(aU(e.id,a))}});return a===void 0?o:(0,L.jsx)(w3,{machineId:a,children:o},a)}function ale(e){return e.flatMap(e=>e.conversations.filter(e=>e.archivedAt===null).map(t=>({ref:{machineId:e.machineId,projectId:t.projectId,id:t.id},at:t.lastActivityAt}))).sort((e,t)=>t.at-e.at).map(({ref:e})=>e)}function ole(e,t,n){if(e.length===0)return;let r=e.findIndex(e=>e.id===t?.id&&e.machineId===t?.machineId);return r===-1?n===1?e[0]:e.at(-1):e[(r+n+e.length)%e.length]}function Q3(){let e=bt(),t=uU(),n=ale(E3()),r=t.conversationId?{machineId:t.machineId,projectId:t.projectId??``,id:t.conversationId}:void 0;return{go:t=>{let i=ole(n,r,t);i&&e(iU(i.projectId,i.id,i.machineId))},available:n.length>1}}var $3=e=>()=>void e().catch(e=>eH.error(_C(e)));function e6(e){let t=v3(e),n=Ew().data;if(t.status!==`ready`)return{model:void 0,level:void 0};let r=cG(t.view);return{model:lG(r,n),level:r.thinkingLevel}}var sle=e=>[...new Set(e.map(e=>e.providerName))].map(t=>({name:t,models:e.filter(e=>e.providerName===t)}));function cle({conversationId:e,run:t}){let n=J(),r=e6(e).model,i=fK(Ew().data??[]),a=r=>t($3(()=>n.conversations.configure(e,{model:{provider:r.provider,modelId:r.modelId}})));return(0,L.jsx)(L.Fragment,{children:sle(i).map(e=>(0,L.jsx)(zB,{heading:e.name,children:e.models.map(e=>(0,L.jsx)(BB,{value:`${e.provider}/${e.modelId} ${e.name}`,"data-checked":e.provider===r?.provider&&e.modelId===r?.modelId,onSelect:a(e),children:lK(e)},`${e.provider}/${e.modelId}`))},e.name))})}function t6({text:e,ranges:t,className:n,...r}){let i=[],a=0;return t.forEach(([t,n],r)=>{t>a&&i.push(e.slice(a,t)),i.push((0,L.jsx)(`mark`,{className:`rounded-xs bg-primary/15 text-foreground`,children:e.slice(t,n)},r)),a=n}),i.push(e.slice(a)),(0,L.jsx)(`span`,{"data-slot":`highlighted-text`,className:I(n),...r,children:i})}var n6={labelPrefix:10,labelSubstring:7,keywordPhrase:8,keywordPrefix:6,labelTypo:4,keywordTypo:3,descriptionPrefix:3,descriptionSubstring:2,section:2},r6=e=>e.toLowerCase().split(/[^a-z0-9.]+/).filter(Boolean),lle=e=>e<4?0:e<8?1:2;function i6(e,t){let n=t.length+1,r=Array((e.length+1)*n).fill(0),i=(e,t)=>r[e*n+t]??0;for(let t=0;t<=e.length;t++)r[t*n]=t;for(let e=0;e<=t.length;e++)r[e]=e;for(let a=1;a<=e.length;a++)for(let o=1;o<=t.length;o++){let s=e[a-1]===t[o-1]?0:1,c=Math.min(i(a-1,o)+1,i(a,o-1)+1,i(a-1,o-1)+s);a>1&&o>1&&e[a-1]===t[o-2]&&e[a-2]===t[o-1]&&(c=Math.min(c,i(a-2,o-2)+1)),r[a*n+o]=c}return i(e.length,t.length)}var ule=(e,t)=>{let n=lle(e.length);return n===0||e[0]!==t[0]?!1:i6(e,t.slice(0,e.length))<=n||i6(e,t)<=n},a6=(e,t)=>e.some(e=>e.startsWith(t)),o6=(e,t)=>e.some(e=>ule(t,e));function dle(e,t){let n=r6(t.label),r=t.keywords.flatMap(r6),i=r6(t.description),a=[a6(n,e)?n6.labelPrefix:0,t.label.toLowerCase().includes(e)?n6.labelSubstring:0,a6(r,e)?n6.keywordPrefix:0,o6(n,e)?n6.labelTypo:0,o6(r,e)?n6.keywordTypo:0,a6(i,e)?n6.descriptionPrefix:0,t.description.toLowerCase().includes(e)?n6.descriptionSubstring:0,a6(r6(t.sectionLabel),e)?n6.section:0];return Math.max(...a)}var fle=(e,t)=>t.keywords.some(t=>t.toLowerCase().includes(e));function ple(e,t){let n=r6(e);if(n.length===0)return 0;let r=n.map(e=>dle(e,t));return r.some(e=>e===0)?0:r.reduce((e,t)=>e+t,0)+(n.length>1&&fle(e.trim().toLowerCase(),t)?n6.keywordPhrase:0)}function mle(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=[];for(let e of t){let t=n.at(-1);t&&e[0]<=t[1]?t[1]=Math.max(t[1],e[1]):n.push([e[0],e[1]])}return n}function s6(e,t){let n=e.toLowerCase(),r=[];for(let e of r6(t)){let t=n.indexOf(e);t>=0&&r.push([t,t+e.length])}return mle(r)}var hle=[{id:`appearance`,section:`general`,label:`Appearance`,description:`Light, dark, or follow your device.`,keywords:[`theme`,`dark mode`,`light mode`,`dark`,`light`,`system`,`color scheme`,`colors`]},{id:`notifications`,section:`general`,label:`Notifications`,description:`Notify me when a run ends and this page is hidden.`,keywords:[`alerts`,`notify`,`desktop`,`browser notification`,`permission`,`run finished`]},{id:`default-model`,section:`models`,label:`Default model`,description:`Used for new threads, with its thinking level.`,keywords:[`model`,`llm`,`thinking`,`thinking levels`,`effort`,`reasoning`,`reasoning effort`]},{id:`fast-model`,section:`models`,label:`Fast model`,description:`Names new threads.`,keywords:[`model`,`title`,`naming`,`cheap`,`small model`,`thinking`,`effort`,`reasoning`]},{id:`projects-folder`,section:`projects`,label:`Projects folder`,description:`Where cloned repositories live.`,keywords:[`directory`,`path`,`code folder`,`clone`,`repos`,`repositories`,`workspace`,`project`]},{id:`github-status`,section:`github`,label:`GitHub`,description:`Connection status, login and token source.`,keywords:[`gh`,`git`,`login`,`token`,`auth`,`sign in`,`pull request`,`repo`,`clone`]},{id:`message-mode`,section:`agent`,label:`While the agent works, new messages`,description:`Steer lands at the next tool step. Queue waits for the final answer.`,keywords:[`steer`,`queue`,`interrupt`,`message mode`,`follow-up`,`send while running`]},{id:`workspace-default`,section:`agent`,label:`New threads use`,description:`A worktree, the main checkout, or remember per project.`,keywords:[`worktree`,`branch`,`checkout`,`git worktree`,`workspace`,`isolation`]},{id:`web-search`,section:`tools`,label:`Web search`,description:`Works out of the box. No keys needed.`,keywords:[`fetch`,`browse`,`internet`,`web`,`search the web`,`pages`]},{id:`mcp-servers`,section:`tools`,label:`MCP servers`,description:`Add tools the agent can call.`,keywords:[`mcp`,`server`,`connector`,`integration`,`plugin`,`extension`,`add server`,`stdio`]},{id:`claude-connectors`,section:`tools`,label:`Claude connectors`,description:`Let Claude CLI threads use the connectors of your Claude login.`,keywords:[`claude`,`connectors`,`claude.ai`,`linear`,`slack`,`mcp`]},{id:`claude-ask-before-writes`,section:`tools`,label:`Ask before writes`,description:`When on, tools that change things ask you first.`,keywords:[`claude`,`connectors`,`approve`,`approval`,`permission`,`prompt`,`write`,`confirm`]},{id:`remote-access`,section:`remote`,label:`Remote access`,description:`Open tau from your phone or any browser with a link.`,keywords:[`tunnel`,`url`,`public`,`internet`,`opentunnel`,`phone`,`anywhere`,`remote`,`online`]},{id:`link-device`,section:`remote`,label:`Link a device`,description:`A one-time code, as a QR, a link and a short code.`,keywords:[`pair`,`qr`,`code`,`phone`,`browser`,`colleague`,`laptop`,`add device`]},{id:`devices`,section:`remote`,label:`Devices`,description:`Linked devices: rename, revoke, sign out all.`,keywords:[`sessions`,`revoke`,`sign out`,`logout`,`this device`,`linked`,`last seen`]},{id:`machines`,section:`machines`,label:`Machines`,description:`This machine and the machines linked to it: rename, disconnect, open their settings.`,keywords:[`computers`,`servers`,`homelab`,`linked`,`online`,`offline`,`runtimes`,`hub`,`federation`]},{id:`connect-machine`,section:`machines`,label:`Connect a machine`,description:`Link another tau with one command: a code, a link and a QR.`,keywords:[`link`,`add machine`,`tau connect`,`pair`,`code`,`qr`,`second computer`,`server`]},{id:`hub-link`,section:`machines`,label:`Linked to a hub`,description:`When this machine is linked to another tau: the hub's name, its state, and Disconnect.`,keywords:[`hub`,`disconnect`,`unlink`,`tau disconnect`,`unreachable`,`update tau`]}],gle=[`api key`,`key`,`token`,`login`,`sign in`,`chatgpt`,`connect`,`disconnect`,`provider`],_le=e=>({id:`provider:${e.id}`,section:`providers`,label:e.name,description:e.connection?`Connected. Change or remove its key.`:`Add an API key or sign in.`,keywords:[...gle,e.id,...e.id===`anthropic`?[`claude cli`]:[]]}),vle=e=>t=>t.id!==`claude-cli`||!e.some(e=>e.id===`anthropic`),yle=e=>({id:`project:${e.id}`,section:`projects`,target:`projects-folder`,label:e.name,description:`Project`,keywords:[`project`,`repository`]}),ble=e=>({id:`mcp:${e.name}`,section:`tools`,label:e.name,description:`MCP server`,keywords:[`mcp`,`server`,`connector`,e.transport===`stdio`?`command`:`url`]}),xle=e=>({id:`model:${e.provider}/${e.modelId}`,section:`models`,target:`default-model`,label:e.name,description:`${e.providerName} model ${e.modelId}`,keywords:[`model`,e.modelId,e.provider]});function Sle(e){return[...e.providers.filter(vle(e.providers)).map(_le),...e.projects.map(yle),...e.mcpServers.map(ble),...e.models.map(xle)]}var Cle=e=>G3.find(t=>t.id===e)?.label??e,c6=e=>e.target??e.id;function l6(e,t){return t.map((t,n)=>{let r={...t,sectionLabel:Cle(t.section)};return{result:r,order:n,score:ple(e,r)}}).filter(({score:e})=>e>0).sort((e,t)=>t.score-e.score||e.order-t.order).map(({result:e})=>e)}var u6=`Search settings`;function wle({inputRef:e,query:t,onQueryChange:n}){let r=()=>e.current?.focus();return W3(`mod+f`,r),W3(`/`,r),(0,L.jsx)(`div`,{className:`pb-2`,children:(0,L.jsx)(IB,{ref:e,value:t,onValueChange:n,placeholder:u6,"aria-label":u6})})}function Tle(e){let t=new Map;for(let n of e)t.set(n.sectionLabel,[...t.get(n.sectionLabel)??[],n]);return[...t]}function Ele({result:e,query:t,onOpen:n}){return(0,L.jsx)(BB,{value:e.id,onSelect:n,className:`items-start gap-3 py-2`,children:(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,L.jsx)(t6,{className:`truncate text-sm font-medium`,text:e.label,ranges:s6(e.label,t)}),(0,L.jsx)(t6,{className:`line-clamp-2 text-xs font-normal text-muted-foreground`,text:e.description,ranges:s6(e.description,t)})]})})}function Dle({query:e}){return(0,L.jsxs)(`div`,{role:`status`,className:`flex flex-col items-center gap-1 px-4 py-10 text-center`,children:[(0,L.jsxs)(`p`,{className:`text-sm font-medium`,children:[`No settings match “`,e.trim(),`”`]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Try a shorter word, or something like “theme”, “api key” or “mcp”.`})]})}function Ole({query:e,entries:t,onOpen:n}){let r=(0,M.useMemo)(()=>l6(e,t),[e,t]);return r.length===0?(0,L.jsx)(Dle,{query:e}):(0,L.jsx)(LB,{className:`max-h-none overflow-visible`,children:Tle(r).map(([t,r])=>(0,L.jsx)(zB,{heading:t,className:`p-0 pb-2`,children:r.map(t=>(0,L.jsx)(Ele,{result:t,query:e,onOpen:()=>n(t)},t.id))},t))})}var d6=e=>e.archivedAt!==null,f6=e=>e.filter(e=>!d6(e)),p6=e=>e.filter(d6);function m6(e){let t=new Set(e.map(e=>e.id)),n=e=>e.parentId!==null&&t.has(e.parentId);return e.filter(e=>!n(e)).map(t=>({conversation:t,children:e.filter(e=>e.parentId===t.id)}))}var h6=e=>e.active[0]?.lastActivityAt??0,g6=e=>e.project.status===`ready`&&e.active.length>0;function kle(e,t){let n=e.map(e=>{let n=t.filter(t=>t.projectId===e.id);return{project:e,active:f6(n),archived:p6(n)}});return[...n.filter(g6).sort((e,t)=>h6(t)-h6(e)),...n.filter(e=>!g6(e))]}var _6=e=>e.replace(/^(\/Users|\/home)\/[^/]+/,`~`),Ale=(e,t)=>{let n=(t===void 0?/^\/p\/([^/]+)/.exec(e):RegExp(`^/m/${encodeURIComponent(t)}/p/([^/]+)`).exec(e))?.[1];return n===void 0?void 0:decodeURIComponent(n)};function v6(e,t,n){if(e.project.id===n)return!0;let r=e.project.status!==`ready`;return t[e.project.id]??(r||e.active.length>0)}function y6(){let e=J(),t=yC(),n=$ne(),r=ww(),{run:i,error:a,pending:o}=bW(),s=n.data?.path;if(!s||r.data?.projectsFolder===s)return null;let c=()=>i(async()=>{await e.settings.setProjectsFolder(s),await t.invalidateQueries({queryKey:Y.settings})});return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(Z,{type:`button`,variant:`outline`,disabled:o,onClick:()=>void c(),children:[`Use `,_6(s),` as your code folder`]}),(0,L.jsx)(yW,{message:a})]})}var b6=6e4,x6=60*b6,S6=24*x6,C6=7*S6,jle=3e4;function Mle(e,t){let n=Math.max(0,t-e);return n<b6?`now`:n<x6?`${Math.floor(n/b6)}m`:n<S6?`${Math.floor(n/x6)}h`:n<C6?`${Math.floor(n/S6)}d`:n<52*C6?`${Math.floor(n/C6)}w`:`${Math.floor(n/(52*C6))}y`}function w6({at:e,now:t,...n}){let[r,i]=(0,M.useState)(()=>Date.now());return(0,M.useEffect)(()=>{if(t!==void 0)return;let e=setInterval(()=>i(Date.now()),jle);return()=>clearInterval(e)},[t]),(0,L.jsx)(`time`,{"data-slot":`relative-time`,dateTime:new Date(e).toISOString(),...n,children:Mle(e,t??r)})}var T6=`On GitHub`,E6=`github:`,D6=`${E6}hint`,Nle=e=>`${E6}${e}`,Ple=e=>e.startsWith(E6)&&e!==D6?e.slice(7):null,Fle=(e,t)=>(0,L.jsxs)(L.Fragment,{children:[e.localPath?`local · `:null,(0,L.jsx)(w6,{at:e.pushedAt,now:t})]}),Ile=(e,t=Date.now())=>({value:Nle(e.nameWithOwner),label:e.nameWithOwner,group:T6,hint:Fle(e,t),...e.description&&{description:e.description},...e.private&&{icon:(0,L.jsx)(fL,{"aria-label":`Private`,className:`size-3.5`})}});function O6(e){return e.state===`connected`?null:e.state===`not_installed`?`Install the GitHub CLI (gh) to list your repos.`:e.state===`not_logged_in`?e.hint:e.message}var k6=e=>({value:D6,label:e,group:T6,disabled:!0});function Lle({status:e,repos:t,reposFailed:n}){if(!e)return[];let r=O6(e);return r?[k6(r)]:n?[k6(`Could not load your GitHub repos.`)]:(t??[]).map(e=>Ile(e))}var Rle={connected:`Connected`,not_installed:`Not installed`,not_logged_in:`Not logged in`,error:`Error`},zle=e=>e.state===`connected`?`Connected as ${e.login}. Token from ${e.tokenSource}, git over ${e.gitProtocol}.`:O6(e)??``;function Ble(){let e=Nw();return e.isError?(0,L.jsx)(yW,{message:_C(e.error)}):e.data?(0,L.jsxs)(M3,{id:`github-status`,className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`p`,{className:`text-sm font-medium`,children:[`GitHub: `,Rle[e.data.state]]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:zle(e.data)})]}):(0,L.jsx)(Si,{className:`h-9 w-full`})}function A6({value:e,onChange:t,options:n,className:r,...i}){return(0,L.jsx)(H3,{type:`single`,variant:`outline`,size:`sm`,spacing:0,value:e,onValueChange:e=>e&&t(e),"aria-label":i[`aria-label`],className:r,children:n.map(e=>(0,L.jsx)(U3,{value:e.value,"aria-label":e.label,title:e.label,children:e.icon},e.value))})}var j6=(e,t)=>({value:e,label:t,icon:(0,L.jsx)(`span`,{className:`px-1`,children:t})}),Vle=[j6(`steer`,`Steer`),j6(`queue`,`Queue`)],Hle=[j6(`per-project`,`Remember per project`),j6(`worktree`,`Worktree`),j6(`checkout`,`Main checkout`)],M6=`While the agent works, new messages`,N6=`New threads use`;function Ule(){let e=J(),t=yC(),n=ww(),{run:r,error:i}=bW();if(!n.data)return(0,L.jsx)(Si,{className:`h-9 w-full`});let a=e=>void r(async()=>{await e(),await t.invalidateQueries({queryKey:Y.settings})});return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsx)(M3,{id:`message-mode`,children:(0,L.jsxs)(k3,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(A3,{children:M6}),(0,L.jsx)(A6,{"aria-label":M6,value:n.data.messageMode,options:Vle,onChange:t=>a(()=>e.settings.setMessageMode(t))})]}),(0,L.jsx)(j3,{children:`Steer lands at the next tool step. Queue waits for the final answer.`})]})}),(0,L.jsx)(M3,{id:`workspace-default`,children:(0,L.jsx)(k3,{children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(A3,{children:N6}),(0,L.jsx)(A6,{"aria-label":N6,value:n.data.workspaceDefault,options:Hle,onChange:t=>a(()=>e.settings.setWorkspaceDefault(t))})]})})}),(0,L.jsx)(yW,{message:i})]})}var Wle=[{value:`system`,label:`System`,icon:(0,L.jsx)(vL,{})},{value:`light`,label:`Light`,icon:(0,L.jsx)(QL,{})},{value:`dark`,label:`Dark`,icon:(0,L.jsx)(bL,{})}],Gle=`System follows your device and switches with it.`,Kle=()=>(0,M.useSyncExternalStore)(fz.subscribeTheme,fz.getTheme);function qle(){let e=Kle();return(0,L.jsx)(M3,{id:`appearance`,children:(0,L.jsxs)(k3,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(A3,{children:`Appearance`}),(0,L.jsx)(A6,{"aria-label":`Theme`,value:e,onChange:fz.setTheme,options:Wle})]}),e===`system`&&(0,L.jsx)(j3,{children:Gle})]})})}function Jle(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(qle,{}),(0,L.jsx)(Wce,{})]})}var P6=4;function Yle(e){let t=[];for(let n=0;n<e.length;n+=P6)t.push(e.slice(n,n+P6));return t.join(` `)}function F6({code:e,className:t,...n}){return(0,L.jsx)(`p`,{"data-slot":`code-display`,"aria-label":`Code ${e.split(``).join(` `)}`,className:I(`font-mono text-3xl font-semibold tracking-widest select-all`,t),...n,children:(0,L.jsx)(`span`,{"aria-hidden":!0,children:Yle(e)})})}var Xle=o(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),I6=o((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),L6=o((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),Zle=o(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Qle=o(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),$le=o((e=>{var t=I6().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),eue=o((e=>{var t=I6().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),tue=o((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),R6=o((e=>{var t=L6(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),nue=o((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),rue=o((e=>{var t=nue();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),iue=o(((e,t)=>{var n=rue();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),z6=o((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),B6=o((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
|
|
101
|
+
]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^[0-9]+$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),V6=o((e=>{var t=z6(),n=B6();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),aue=o((e=>{var t=I6(),n=R6(),r=L6(),i=V6(),a=z6(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),oue=o((e=>{var t=I6(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),sue=o(((e,t)=>{var n=V6();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),cue=o(((e,t)=>{var n=V6(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),lue=o(((e,t)=>{var n=V6();function r(e){this.mode=n.BYTE,this.data=typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),uue=o(((e,t)=>{var n=V6(),r=I6();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
|
|
102
|
+
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),due=o(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),fue=o((e=>{var t=V6(),n=sue(),r=cue(),i=lue(),a=uue(),o=B6(),s=I6(),c=due();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
|
|
103
|
+
Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),pue=o((e=>{var t=I6(),n=L6(),r=Zle(),i=Qle(),a=$le(),o=eue(),s=tue(),c=R6(),l=iue(),u=aue(),d=oue(),f=V6(),p=fue();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
|
|
104
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
105
|
+
Minimum version required to store current data is: `+c+`.
|
|
106
|
+
`);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),H6=o((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||(e.color={});let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),mue=o((e=>{var t=H6();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),hue=o((e=>{var t=H6();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
|
|
107
|
+
`;return typeof a==`function`&&a(null,p),p}})),gue=l(o((e=>{var t=Xle(),n=pue(),r=mue(),i=hue();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))(),1),U6=2;function _ue(e){let{modules:t}=gue.create(e,{errorCorrectionLevel:`M`}),n=[];for(let e=0;e<t.size;e++)for(let r=0;r<t.size;r++)t.get(r,e)&&n.push(`M${r+U6} ${e+U6}h1v1h-1z`);return{size:t.size+4,path:n.join(``)}}function W6({value:e,label:t=`QR code`,className:n,...r}){let{size:i,path:a}=M.useMemo(()=>_ue(e),[e]);return(0,L.jsx)(`svg`,{"data-slot":`qr-code`,role:`img`,"aria-label":t,viewBox:`0 0 ${i} ${i}`,shapeRendering:`crispEdges`,className:I(`size-48 rounded-lg bg-white text-black`,n),...r,children:(0,L.jsx)(`path`,{d:a,fill:`currentColor`})})}var vue=`Remote access works only while this Mac is awake. If it sleeps, devices cannot connect until it wakes.`,G6=`A linked device has full power: it can use every terminal and agent on this computer. Link only devices you own.`,yue=`The URL is kept, but linked devices cannot connect while remote access is off. Turning it on again is fast and uses the same URL.`,bue=`This deletes the current URL. Every device must pair again, and the new URL takes a few minutes to be ready.`,xue={off:{label:`Off`,tone:`neutral`},starting:{label:`Setting up`,tone:`busy`},online:{label:`Online`,tone:`success`},reconnecting:{label:`Reconnecting`,tone:`busy`},error:{label:`Error`,tone:`error`}},Sue=e=>xue[e];function Cue(e){return e.state===`starting`?wue(e,Date.now()):e.state===`reconnecting`?e.message??`Connection lost. Trying again.`:e.state===`error`?e.message??`Remote access could not start.`:null}function wue(e,t){let n=e.since===null?0:Math.max(0,Math.floor((t-e.since)/6e4));return`Setting up remote access, ${n<1?`just started`:`${n} min so far`} (usually 3-6 minutes). You can close this window.`}function Tue(e,t){if(e.state!==`online`||e.since===null)return null;let n=Math.max(0,Math.floor((t-e.since)/6e4)),r=n<1?`Online for less than a minute`:`Online for ${Eue(n)}`;return e.message?`${r}. ${e.message}`:r}function Eue(e){if(e<60)return`${e} min`;let t=Math.floor(e/60);return t<24?`${t} h`:`${Math.floor(t/24)} d`}function K6(e){let t=Math.max(0,Math.ceil(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}var Due=1e3;function Oue(e,t){return e.find(e=>!t.has(e.id))??null}function kue(e){return e?.link?new URL(e.link).origin:window.location.origin}function Aue(e){let t=Hw(),{machines:n,isLoading:r}=PG(),[i,a]=(0,M.useState)(null),[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(()=>Date.now()),u=(0,M.useRef)(new Set),d=(0,M.useRef)(n);d.current=n;let{mutateAsync:f}=t,p=(0,M.useCallback)(async()=>{s(null),a(null),u.current=new Set(d.current.map(e=>e.id));try{a(await f({kind:`machine`}))}catch(e){s(_C(e))}},[f]),m=!r;(0,M.useEffect)(()=>{e?m&&p():a(null)},[e,m,p]),(0,M.useEffect)(()=>{if(!e)return;let t=setInterval(()=>l(Date.now()),Due);return()=>clearInterval(t)},[e]);let h=i?Oue(n,u.current):null,g=i?Math.max(0,i.expiresAt-c):0;return{pairing:i,error:o,linked:h,msLeft:g,minted:i?i.expiresAt-Bg:0,expired:i!==null&&!h&&g===0,create:p}}function q6({command:e,label:t}){return(0,L.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-1`,children:[(0,L.jsx)(`code`,{className:`min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1 text-xs`,title:e,children:e}),(0,L.jsx)(hq,{text:e,label:t})]})}function jue({state:e}){let{pairing:t,expired:n,msLeft:r}=e;if(!t)return(0,L.jsx)(gG,{className:`mx-auto my-12`});let i=t.link;return(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,"data-expired":n||void 0,children:[i?(0,L.jsx)(W6,{value:i,label:`QR code of the link`,className:n?`opacity-30`:void 0}):null,(0,L.jsx)(F6,{code:t.shortCode}),(0,L.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2 text-sm`,children:[(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`On the other machine, run:`}),i?(0,L.jsx)(q6,{command:`npx @pablopunk/tau connect ${i}`,label:`Copy command with link`}):null,(0,L.jsx)(q6,{command:`tau connect ${t.shortCode} --hub ${kue(t)}`,label:`Copy command with short code`})]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n?`This code expired.`:`Waiting for the machine… Expires in ${K6(r)}`})]})}function Mue({open:e,onOpenChange:t}){let n=Aue(e);return(0,L.jsx)(yB,{open:e,onOpenChange:t,children:(0,L.jsxs)(SB,{className:`max-h-[90vh] grid-cols-[minmax(0,1fr)] overflow-y-auto sm:max-w-md`,children:[(0,L.jsxs)(CB,{children:[(0,L.jsx)(TB,{children:`Connect a machine`}),(0,L.jsx)(EB,{children:`Run one command on the other computer. It links itself to this tau and shows up in the sidebar.`})]}),n.linked?(0,L.jsxs)(`p`,{role:`status`,className:`py-6 text-center text-sm font-medium`,children:[`Connected: `,n.linked.name]}):(0,L.jsx)(jue,{state:n}),(0,L.jsx)(yW,{message:n.error}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:WG}),(0,L.jsxs)(wB,{children:[n.linked?null:(0,L.jsx)(Z,{variant:`outline`,onClick:()=>void n.create(),children:`New code`}),(0,L.jsx)(Z,{onClick:()=>t(!1),children:n.linked?`Done`:`Close`})]})]})})}function Nue(){let[e,t]=(0,M.useState)(!1);return(0,L.jsxs)(M3,{id:`connect-machine`,children:[(0,L.jsxs)(k3,{className:`gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(A3,{children:`Connect a machine`}),(0,L.jsx)(Z,{variant:`outline`,size:`sm`,onClick:()=>t(!0),children:`Connect a machine`})]}),(0,L.jsx)(j3,{children:WG})]}),(0,L.jsx)(Mue,{open:e,onOpenChange:t})]})}function J6(e){return(0,L.jsx)(Kk,{"data-slot":`alert-dialog`,...e})}function Y6({className:e,...t}){return(0,L.jsxs)(qk,{children:[(0,L.jsx)(Jk,{"data-slot":`alert-dialog-overlay`,className:`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`}),(0,L.jsx)(Zk,{"data-slot":`alert-dialog-content`,className:I(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})]})}function X6({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:I(`flex flex-col gap-2`,e),...t})}function Z6({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:I(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...t})}function Q6({className:e,...t}){return(0,L.jsx)(Qk,{"data-slot":`alert-dialog-title`,className:I(`font-heading text-base leading-none font-medium`,e),...t})}function $6({className:e,...t}){return(0,L.jsx)($k,{"data-slot":`alert-dialog-description`,className:I(`text-sm text-muted-foreground`,e),...t})}function e8({className:e,variant:t=`default`,...n}){return(0,L.jsx)(eA,{"data-slot":`alert-dialog-action`,className:I(rI({variant:t}),e),...n})}function t8({className:e,...t}){return(0,L.jsx)(nA,{"data-slot":`alert-dialog-cancel`,className:I(rI({variant:`outline`}),e),...t})}function n8({open:e,onOpenChange:t,title:n,description:r,confirmLabel:i,onConfirm:a,destructive:o=!0}){return(0,L.jsx)(J6,{open:e,onOpenChange:t,children:(0,L.jsxs)(Y6,{children:[(0,L.jsxs)(X6,{children:[(0,L.jsx)(Q6,{children:n}),(0,L.jsx)($6,{children:r})]}),(0,L.jsxs)(Z6,{children:[(0,L.jsx)(t8,{children:`Cancel`}),(0,L.jsx)(e8,{variant:o?`destructive`:`default`,onClick:a,children:i})]})]})})}var Pue={none:``,connecting:`Connecting…`,linked:`Linked`,reconnecting:`Reconnecting…`,unreachable:`Hub unreachable`,"update-required":`Update tau on the hub`,refused:`The hub refused this machine`},r8=e=>e.hubName??e.hubUrl??`a hub`;function Fue(e){return e.state===`none`?`This machine is not linked to a hub.`:e.message??Pue[e.state]}function Iue(){let e=Jw().data,t=Qw(),{run:n,error:r}=bW(),[i,a]=(0,M.useState)(!1),o=e!==void 0&&e.state!==`none`;return(0,L.jsxs)(M3,{id:`hub-link`,children:[(0,L.jsxs)(k3,{className:`gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(A3,{children:o?`Linked to ${r8(e)}`:`Linked to a hub`}),o?(0,L.jsx)(Z,{variant:`outline`,size:`sm`,onClick:()=>a(!0),children:`Disconnect`}):null]}),(0,L.jsx)(j3,{children:e?Fue(e):`Checking…`}),(0,L.jsx)(yW,{message:r})]}),(0,L.jsx)(n8,{open:i,onOpenChange:a,title:`Disconnect from ${e?r8(e):`the hub`}?`,description:`The hub can no longer see or use this machine. Connect again with a new code to come back.`,confirmLabel:`Disconnect`,onConfirm:()=>{a(!1),n(async()=>void await t.mutateAsync())}})]})}var Lue={needs_auth:`Needs sign-in`,failed:`Failed`,disabled:`Disabled`,pending:`Connecting`},Rue=`Connectors from your Claude account, for Claude CLI models.`,zue=`Connectors show up here once a Claude CLI login is ready.`,i8=`Ask before writes`,Bue=`When on, tools that change things ask you first.`,a8=e=>e.replace(/^claude\.ai /,``),o8=e=>e.status===`needs_auth`||e.status===`failed`,Vue=e=>`Needs sign-in (${e})`,s8=(e,t)=>a8(e.name).localeCompare(a8(t.name)),Hue=e=>e.filter(e=>!o8(e)).sort(s8),c8=e=>e.filter(o8).sort(s8),Uue=(e,t)=>({...e,askBeforeWrites:t}),Wue=`Connect it on claude.ai`,Gue=e=>Lue[e.status]??null,Kue=e=>`${e.toolCount} tools · ${e.readOnlyCount} read-only`,que=o8;function Jue(e,t,n){let r=e.enabled.filter(e=>e!==t);return{...e,enabled:n?[...r,t]:r}}function Yue({connector:e,enabled:t,disabled:n,onToggle:r}){let i=Gue(e),a=que(e);return(0,L.jsxs)(`li`,{className:`flex items-center justify-between gap-3 rounded-lg border px-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate text-sm font-medium`,children:a8(e.name)}),i?(0,L.jsx)(CW,{variant:`secondary`,children:i}):null]}),(0,L.jsx)(j3,{children:a?Wue:Kue(e)})]}),a?null:(0,L.jsx)(L3,{"aria-label":a8(e.name),checked:t,disabled:n,onCheckedChange:r})]})}function Xue({checked:e,disabled:t,onToggle:n}){return(0,L.jsxs)(M3,{id:`claude-ask-before-writes`,className:`flex items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium`,children:i8}),(0,L.jsx)(j3,{children:Bue})]}),(0,L.jsx)(L3,{"aria-label":i8,checked:e,disabled:t,onCheckedChange:n})]})}function l8({connectors:e,current:t,disabled:n,onSave:r,label:i}){return(0,L.jsx)(`ul`,{"aria-label":i,className:`flex flex-col gap-2`,children:e.map(e=>(0,L.jsx)(Yue,{connector:e,enabled:t.enabled.includes(e.name),disabled:n,onToggle:n=>r(Jue(t,e.name,n))},e.name))})}function Zue(e){return(0,L.jsxs)($K,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(eq,{className:`group flex items-center gap-1 text-sm font-medium`,children:[(0,L.jsx)(SI,{className:`size-4 transition-transform group-data-[state=open]:rotate-90`}),Vue(e.connectors.length)]}),(0,L.jsx)(tq,{children:(0,L.jsx)(l8,{...e})})]})}function u8(){let e=Cw(),t=ww(),n=ore(),r=e.data?.find(e=>e.id===`claude-cli`)?.cli,i=r?.state===`ready`?r.connectors:null,a=t.data?.claudeConnectors,o=i!==null&&i.length>0&&a!==void 0;return(0,L.jsxs)(M3,{id:`claude-connectors`,className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium`,children:`Claude connectors`}),a?(0,L.jsx)(Xue,{checked:a.askBeforeWrites,disabled:n.isPending,onToggle:e=>n.mutate(Uue(a,e))}):null,(0,L.jsx)(j3,{children:o?Rue:zue}),o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(l8,{label:`Claude connectors`,connectors:Hue(i),current:a,disabled:n.isPending,onSave:e=>n.mutate(e)}),c8(i).length>0?(0,L.jsx)(Zue,{label:`Needs sign-in`,connectors:c8(i),current:a,disabled:n.isPending,onSave:e=>n.mutate(e)}):null]}):null]})}function d8(){let e=J(),t=Y3(),n=(0,M.useId)(),r=yC(),i=ww(),{run:a,error:o,pending:s}=bW(),c=i.data?.projectsFolder??``,[l,u]=(0,M.useState)(c);(0,M.useEffect)(()=>u(c),[c]);let d=()=>a(async()=>{await e.settings.setProjectsFolder(l.trim()),await r.invalidateQueries({queryKey:Y.settings})});return(0,L.jsx)(M3,{id:`projects-folder`,asChild:!0,children:(0,L.jsxs)(`form`,{className:`flex flex-col gap-2`,onSubmit:e=>{e.preventDefault(),d()},children:[(0,L.jsxs)(`label`,{htmlFor:n,className:`text-sm font-medium`,children:[`Projects folder`,t]}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(J3,{id:n,value:l,onValueChange:u,placeholder:`~/projects`}),(0,L.jsx)(Z,{type:`submit`,variant:`outline`,disabled:s||!l.trim()||l.trim()===c,children:`Save`})]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Cloned repositories live here. If this folder is inside the tau data home, deleting the data home deletes them too.`}),(0,L.jsx)(yW,{message:o})]})})}var f8=`@min-[40rem]:grid-cols-[minmax(0,9rem)_minmax(0,1fr)_12.5rem]`;function Que({className:e,children:t,...n}){return(0,L.jsxs)(`div`,{className:`@container overflow-hidden rounded-lg border`,children:[(0,L.jsxs)(`div`,{"aria-hidden":!0,className:I(`hidden gap-3 border-b bg-muted/40 px-3 py-2 text-xs font-medium text-muted-foreground @min-[40rem]:grid`,f8),children:[(0,L.jsx)(`span`,{children:`Provider`}),(0,L.jsx)(`span`,{children:`Status`}),(0,L.jsx)(`span`,{className:`text-right`,children:`Actions`})]}),(0,L.jsx)(`ul`,{"data-slot":`provider-list`,className:I(`divide-y`,e),...n,children:t})]})}function p8({className:e,...t}){return(0,L.jsx)(`li`,{"data-slot":`provider-list-row`,className:I(`grid grid-cols-1 items-center gap-x-4 gap-y-2 px-4 py-4 @min-[28rem]:grid-cols-[minmax(0,1fr)_auto]`,f8,e),...t})}function m8({name:e,connected:t=!1}){return(0,L.jsxs)(`div`,{"data-slot":`provider-list-name`,className:`flex min-w-0 items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e}),t?(0,L.jsx)(TI,{role:`img`,"aria-label":`Connected`,className:`size-4 shrink-0 text-green-500`}):null]})}function h8({label:e,note:t,children:n}){return(0,L.jsxs)(`div`,{"data-slot":`provider-list-status`,className:`col-span-full row-start-2 flex min-w-0 flex-col items-start gap-1 @min-[40rem]:col-span-1 @min-[40rem]:col-start-2 @min-[40rem]:row-start-1`,children:[n?(0,L.jsx)(bR,{children:(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsx)(`span`,{className:`inline-flex min-w-0 max-w-full`,children:n})}),(0,L.jsx)(CR,{children:e})]})}):null,t&&n?(0,L.jsx)(`span`,{className:`text-xs/relaxed text-muted-foreground`,children:t}):null,t&&!n?(0,L.jsx)(bR,{children:(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsx)(`span`,{className:`text-xs/relaxed text-muted-foreground`,children:t})}),(0,L.jsx)(CR,{children:e})]})}):null]})}function g8({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`provider-list-actions`,className:I(`flex min-w-0 flex-wrap items-center gap-1.5 @min-[28rem]:col-start-2 @min-[28rem]:row-start-1 @min-[28rem]:justify-end @min-[40rem]:col-start-3`,e),...t})}function _8({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`provider-list-detail`,className:I(`col-span-full`,e),...t})}var $ue=`Runs the Claude Agent SDK under your own Claude login, for your own use.`,ede=/claude code/gi,v8=e=>e.replace(ede,`claude CLI`),y8=e=>e.filter(Boolean).join(` · `),tde=e=>e.charAt(0).toUpperCase()+e.slice(1),b8=e=>[e.plan&&tde(e.plan),e.org],nde={missing:`claude CLI not found`,logged_out:`Not logged in`,not_plan:`API key login`,blocked:`Blocked by your organization`,error:`Check failed`,sdk_missing:`Claude Agent SDK not installed`};function x8(e){let t=e.state===`blocked`;return e.state===`ready`?{label:y8([`Connected via claude CLI`,...b8(e)]),destructive:t}:e.state===`needs_notice`?{label:y8([`Detected`,...b8(e)]),destructive:t}:{label:nde[e.state]??`Check failed`,destructive:t}}var rde=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1}),S8=e=>e.resetsAt===null?null:`resets ${rde(e.resetsAt)}`;function C8(e){return e.status===`rejected`?y8([`Plan limit reached`,S8(e)]):e.fiveHour===null?null:y8([`5-hour ${Math.round(e.fiveHour)}%`,S8(e)])}var w8=e=>e.usage?.status===`allowed_warning`,ide=e=>e.cliVersion&&e.sdkCliVersion&&e.cliVersion!==e.sdkCliVersion?`tau uses ${e.sdkCliVersion}`:null,ade=e=>e.processCount>6?`${e.processCount} Claude processes running`:null,ode={needs_notice:`Claude Agent SDK, under your own login.`,missing:`Install the claude CLI and log in.`,sdk_missing:`tau installs the Claude Agent SDK on first use.`,logged_out:"Run `claude`, then `/login`, on this machine.",not_plan:`The CLI uses an API key. Use the Anthropic provider.`};function sde(e){return y8([e.usage?C8(e.usage):null,e.cliVersion?`CLI ${e.cliVersion}`:null,ide(e),ade(e),e.message&&v8(e.message)])||null}function cde(e){let t=e.usage?C8(e.usage):null;return y8([`Claude CLI login`,...b8(e),t])}function T8(e){return e.state===`ready`?sde(e):ode[e.state]||(e.message?v8(e.message):null)}var lde={needs_notice:`acknowledge`,sdk_missing:`install`},E8=e=>lde[e.state]??`refresh`,ude={acknowledge:`I understand`,refresh:`Check again`,install:`Install Claude Agent SDK`},D8=e=>ude[e],O8=e=>e===`install`?`Installing Claude Agent SDK…`:null;function k8(){return(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:$ue})}function A8({name:e,actions:t}){let[n,...r]=t,i=t=>`${t.label} for ${e}`;return(0,L.jsxs)(g8,{children:[n?(0,L.jsx)(Z,{variant:`outline`,size:`sm`,disabled:n.disabled,"aria-label":i(n),onClick:n.onSelect,children:n.label}):null,r.length>0?(0,L.jsxs)(FW,{children:[(0,L.jsx)(IW,{asChild:!0,children:(0,L.jsx)(Z,{variant:`ghost`,size:`icon-sm`,"aria-label":`More actions for ${e}`,children:(0,L.jsx)(MI,{})})}),(0,L.jsx)(LW,{align:`end`,className:`w-auto`,children:r.map(e=>(0,L.jsx)(RW,{variant:e.destructive?`destructive`:`default`,disabled:e.disabled,"aria-label":i(e),onSelect:e.onSelect,children:e.label},e.id))})]}):(0,L.jsx)(`span`,{"aria-hidden":!0,className:`hidden size-7 sm:block`})]})}function j8({provider:e,onSaved:t}){let[n,r]=(0,M.useState)(``),i=Xne(),{run:a,error:o,pending:s}=bW();return(0,L.jsxs)(`form`,{onSubmit:async r=>{r.preventDefault(),await a(async()=>{await i.mutateAsync({id:e.id,key:n.trim()})})&&t()},className:`flex flex-col gap-2`,children:[(0,L.jsxs)(OB,{children:[(0,L.jsx)(NB,{type:`password`,autoComplete:`off`,spellCheck:!1,"aria-label":`${e.name} API key`,"aria-invalid":o?!0:void 0,placeholder:`Paste your API key`,value:n,onChange:e=>r(e.target.value)}),(0,L.jsx)(AB,{align:`inline-end`,children:(0,L.jsx)(MB,{type:`submit`,variant:`secondary`,disabled:s||n.trim()===``,children:s?`Checking…`:`Save`})})]}),(0,L.jsx)(yW,{message:o}),(0,L.jsx)(Z,{variant:`link`,size:`sm`,className:`self-start px-0`,asChild:!0,children:(0,L.jsx)(`a`,{href:e.keyUrl,target:`_blank`,rel:`noreferrer`,children:`Get a key`})})]})}var M8=`http://127.0.0.1:1455/auth/callback`,dde=`On another device? After signing in, the page fails to load. Copy its address and paste it here.`,fde=`Paste the full address. It starts with ${M8}`,pde=e=>e.trim().startsWith(M8);function mde({sessionId:e,serverError:t,onSession:n}){let r=J(),[i,a]=(0,M.useState)(``),[o,s]=(0,M.useState)(null),{run:c,error:l,pending:u}=bW();return(0,L.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),!pde(i))return s(fde);s(null),await c(async()=>n(await r.logins.submitUrl(e,i.trim())))},className:`flex flex-col gap-2`,children:[(0,L.jsx)(j3,{children:dde}),(0,L.jsxs)(OB,{children:[(0,L.jsx)(NB,{"aria-label":`Sign-in address`,autoComplete:`off`,spellCheck:!1,placeholder:`${M8}?code=…`,value:i,onChange:e=>a(e.target.value)}),(0,L.jsx)(AB,{align:`inline-end`,children:(0,L.jsx)(MB,{type:`submit`,variant:`secondary`,disabled:u||i.trim()===``,children:`Submit`})})]}),(0,L.jsx)(yW,{message:o??l??t})]})}function N8({connection:e}){return e?e.source===`env`?`From environment`:e.valid===!1?`Invalid key`:e.valid===null?`Key not checked`:e.method===`chatgpt`?`Connected · ChatGPT`:`Connected · key`:`Not connected`}var P8=({connection:e})=>e!==null&&e.valid!==!1&&(e.valid!==null||e.source===`env`),F8=({connection:e})=>e?.source===`env`,I8=({connection:e})=>e?.source===`file`,L8=({methods:e})=>e.includes(`chatgpt`),hde=({methods:e})=>e.includes(`api_key`),R8=e=>e.connection?.method===`api_key`&&I8(e)?`Replace key`:`Add key`,z8=`A stored key overrides the environment key.`,B8=`Uses your ChatGPT plan. Personal use.`,V8=`Uses an API key.`;function gde(e){return F8(e)?z8:L8(e)?B8:V8}function H8(e){return F8(e)?`From environment`:e.connection?.method===`chatgpt`?`ChatGPT plan`:V8}var _de=e=>F8(e)?`From environment. ${z8}`:N8(e);function vde(e){let t=e.connection?.method===`chatgpt`,n=[];return L8(e)&&!t&&n.push(`sign-in`),hde(e)&&n.push(`key`),L8(e)&&t&&n.push(`sign-in`),I8(e)&&n.push(`disconnect`),n}function yde(e,t){return e===`sign-in`?`Sign in with ChatGPT`:e===`key`?R8(t):`Disconnect`}var bde=1e3,xde=e=>e.state===`starting`||e.state===`waiting`;function Sde(e,t){let n=J(),[r,i]=(0,M.useState)(null);return(0,M.useEffect)(()=>{let e=!0,r;return n.logins.start().then(t=>{r=t.id,e?i(t):n.logins.cancel(t.id).catch(()=>{})}).catch(n=>e&&t(_C(n))),()=>{e=!1,r&&n.logins.cancel(r).catch(()=>{})}},[e]),[r,i]}function Cde(e,t){let n=J(),r=e&&xde(e)?e.id:null;(0,M.useEffect)(()=>{if(!r)return;let e=setInterval(()=>{n.logins.get(r).then(t).catch(()=>{})},bde);return()=>clearInterval(e)},[n,r,t])}function wde(){let[e,t]=(0,M.useState)(0),[n,r]=(0,M.useState)(null),[i,a]=Sde(e,r);return Cde(i,a),{session:i,startError:n,update:a,retry:()=>{a(null),r(null),t(e=>e+1)}}}function Tde({onDone:e}){let t=yC(),{session:n,startError:r,update:i,retry:a}=wde(),o=n?.state;return(0,M.useEffect)(()=>{o===`done`&&(Dw(t),e())},[o,t,e]),r?(0,L.jsx)(yW,{message:r}):n?o===`failed`||o===`cancelled`?(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(yW,{message:n.error??`Sign-in ended.`}),(0,L.jsx)(Z,{onClick:a,children:`Try again`})]}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsx)(Z,{disabled:!n.authUrl,asChild:!!n.authUrl,children:n.authUrl?(0,L.jsx)(`a`,{href:n.authUrl,target:`_blank`,rel:`noreferrer`,children:`Open sign-in page`}):`Open sign-in page`}),(0,L.jsx)(mde,{sessionId:n.id,serverError:n.error,onSession:i})]}):(0,L.jsx)(Si,{className:`h-9 w-full`})}function Ede({onClose:e}){return(0,L.jsx)(yB,{open:!0,onOpenChange:t=>!t&&e(),children:(0,L.jsxs)(SB,{children:[(0,L.jsxs)(CB,{children:[(0,L.jsx)(TB,{children:`Sign in with ChatGPT`}),(0,L.jsx)(EB,{children:B8})]}),(0,L.jsx)(Tde,{onDone:e})]})})}function Dde({cli:e}){let t=w8(e)?`text-amber-600 dark:text-amber-400`:void 0;return(0,L.jsx)(`span`,{className:t,children:T8(e)})}function Ode({provider:e}){let t=Ow(),n=kw(),r=Aw(),{run:i,error:a,pending:o}=bW(),s=e.cli;if(!s)return null;let c=x8(s),l=E8(s),u={acknowledge:t,refresh:n,install:r},d=()=>i(async()=>void await u[l].mutateAsync()),f=o?O8(l):null;return(0,L.jsx)(M3,{id:`provider:${e.id}`,asChild:!0,children:(0,L.jsxs)(p8,{"aria-label":e.name,className:`rounded-none!`,children:[(0,L.jsx)(m8,{name:e.name}),(0,L.jsx)(h8,{label:c.label,note:(0,L.jsx)(Dde,{cli:s}),children:(0,L.jsx)(CW,{variant:c.destructive?`destructive`:`secondary`,className:`min-w-0 justify-start`,children:(0,L.jsx)(`span`,{className:`truncate`,children:c.label})})}),(0,L.jsx)(g8,{children:(0,L.jsx)(Z,{variant:`outline`,size:`sm`,disabled:o,"aria-label":`${D8(l)} for ${e.name}`,onClick:d,children:f??D8(l)})}),s.state===`needs_notice`?(0,L.jsx)(_8,{children:(0,L.jsx)(k8,{})}):null,a?(0,L.jsx)(_8,{children:(0,L.jsx)(yW,{message:a})}):null]})})}function U8({provider:e,onCancel:t}){let n=Zne(),{run:r,error:i,pending:a}=bW();return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md bg-muted/50 p-2`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsxs)(`span`,{className:`text-sm`,children:[`Disconnect `,e.name,`?`]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Z,{variant:`destructive`,size:`sm`,disabled:a,onClick:()=>r(async()=>void await n.mutateAsync(e.id)),children:`Confirm disconnect`}),(0,L.jsx)(Z,{variant:`ghost`,size:`sm`,onClick:t,children:`Cancel`})]})]}),(0,L.jsx)(yW,{message:i})]})}function kde({provider:e}){if(P8(e))return(0,L.jsx)(h8,{label:_de(e),note:H8(e)});let t=N8(e),n=e.connection?.valid===!1?`destructive`:`secondary`;return(0,L.jsx)(h8,{label:t,note:gde(e),children:(0,L.jsx)(CW,{variant:n,className:`min-w-0 justify-start`,children:(0,L.jsx)(`span`,{className:`truncate`,children:t})})})}function Ade({provider:e,onAction:t}){let n=vde(e).map(n=>({id:n,label:yde(n,e),destructive:n===`disconnect`,onSelect:()=>t(n)}));return(0,L.jsx)(A8,{name:e.name,actions:n})}function jde({provider:e}){let[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)(!1),[a,o]=(0,M.useState)(!1);return(0,L.jsx)(M3,{id:`provider:${e.id}`,asChild:!0,children:(0,L.jsxs)(p8,{"aria-label":e.name,className:`rounded-none!`,children:[(0,L.jsx)(m8,{name:e.name,connected:P8(e)}),(0,L.jsx)(kde,{provider:e}),(0,L.jsx)(Ade,{provider:e,onAction:e=>{e===`sign-in`&&i(!0),e===`key`&&n(e=>!e),e===`disconnect`&&o(!0)}}),t?(0,L.jsx)(_8,{children:(0,L.jsx)(j8,{provider:e,onSaved:()=>n(!1)})}):null,a?(0,L.jsx)(_8,{children:(0,L.jsx)(U8,{provider:e,onCancel:()=>o(!1)})}):null,r?(0,L.jsx)(Ede,{onClose:()=>i(!1)}):null]})})}function Mde({provider:e}){return e.cli?(0,L.jsx)(Ode,{provider:e}):(0,L.jsx)(jde,{provider:e})}var Nde=[`missing`,`logged_out`,`not_plan`],W8=e=>e.state===`ready`,G8=e=>e.state===`needs_notice`||e.state===`sdk_missing`,Pde=e=>e.filter(Boolean).join(` · `),Fde=e=>P8(e)?e.connection?.source===`env`?H8(e):`API key`:null,Ide=(e,t)=>Pde([W8(t)?cde(t):null,Fde(e)]),K8=(e,t,n)=>({label:e,badge:{text:e,destructive:t},note:n});function Lde(e,t){if(P8(e)||W8(t)){let n=Ide(e,t);return{label:n,badge:null,note:n}}if(e.connection)return K8(N8(e),e.connection.valid===!1,`Uses an API key.`);if(Nde.includes(t.state))return K8(`Not connected`,!1,T8(t));let n=x8(t);return K8(n.label,n.destructive,T8(t))}function Rde({api:e,cli:t}){let{label:n,badge:r,note:i}=Lde(e,t),a=w8(t)?`text-amber-600 dark:text-amber-400`:void 0;return(0,L.jsx)(h8,{label:n,note:i?(0,L.jsx)(`span`,{className:a,children:i}):null,children:r?(0,L.jsx)(CW,{variant:r.destructive?`destructive`:`secondary`,className:`min-w-0 justify-start`,children:(0,L.jsx)(`span`,{className:`truncate`,children:r.text})}):null})}function zde({api:e,cliProvider:t}){let n=t.cli,r=Ow(),i=kw(),a=Aw(),{run:o,error:s,pending:c}=bW(),[l,u]=(0,M.useState)(!1),[d,f]=(0,M.useState)(!1);if(!n)return null;let p={acknowledge:r,refresh:i,install:a},m=e=>o(async()=>void await p[e].mutateAsync()),h=E8(n),g=c?O8(h):null,_=G8(n)?[{id:h,label:g??D8(h),disabled:c,onSelect:()=>m(h)}]:[],v=[{id:`key`,label:R8(e),onSelect:()=>u(e=>!e)}];I8(e)&&v.push({id:`disconnect`,label:`Disconnect key`,destructive:!0,onSelect:()=>f(!0)});let y=G8(n)?[]:[{id:`refresh`,label:`Check again`,disabled:c,onSelect:()=>m(`refresh`)}];return(0,L.jsx)(M3,{id:`provider:${e.id}`,asChild:!0,children:(0,L.jsxs)(p8,{"aria-label":e.name,className:`rounded-none!`,children:[(0,L.jsx)(m8,{name:e.name,connected:P8(e)||W8(n)}),(0,L.jsx)(Rde,{api:e,cli:n}),(0,L.jsx)(A8,{name:e.name,actions:[..._,...v,...y]}),n.state===`needs_notice`?(0,L.jsx)(_8,{children:(0,L.jsx)(k8,{})}):null,l?(0,L.jsx)(_8,{children:(0,L.jsx)(j8,{provider:e,onSaved:()=>u(!1)})}):null,d?(0,L.jsx)(_8,{children:(0,L.jsx)(U8,{provider:e,onCancel:()=>f(!1)})}):null,s?(0,L.jsx)(_8,{children:(0,L.jsx)(yW,{message:s})}):null]})})}var q8=(e,t)=>e.find(e=>e.id===t);function Bde({providers:e}){let t=q8(e,`claude-cli`),n=q8(e,`anthropic`)&&t?.cli;return e.map(e=>n&&e.id===`claude-cli`?null:n&&e.id===`anthropic`&&t?(0,L.jsx)(zde,{api:e,cliProvider:t},e.id):(0,L.jsx)(Mde,{provider:e},e.id))}function J8(){let e=Cw();return e.isError?(0,L.jsx)(yW,{message:_C(e.error)}):e.isPending?(0,L.jsx)(Si,{className:`h-9 w-full`}):(0,L.jsx)(Que,{"aria-label":`Providers`,children:(0,L.jsx)(Bde,{providers:e.data})})}var Vde=[{id:`providers`,label:`Providers`},{id:`projects`,label:`Projects`},{id:`connectors`,label:`Connectors`}],Hde={providers:()=>(0,L.jsx)(J8,{}),projects:()=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(d8,{}),(0,L.jsx)(y6,{})]}),connectors:()=>(0,L.jsx)(u8,{})};function Ude({machine:e,onClose:t}){let[n,r]=(0,M.useState)(`providers`);return(0,L.jsx)(yB,{open:!0,onOpenChange:e=>!e&&t(),children:(0,L.jsxs)(N3,{"aria-describedby":void 0,children:[(0,L.jsxs)(EB,{className:`sr-only`,children:[`Settings of the machine `,e.name]}),(0,L.jsx)(w3,{machineId:e.id,children:(0,L.jsx)(I3,{title:`Settings for ${e.name}`,sections:Vde,active:n,onActiveChange:e=>r(e),children:Hde[n]()})})]})})}var Y8=`tau update`;function X8(e,t){if(!t)return`unknown`;let n=ane(e,t);return n===void 0?`unknown`:n?`behind`:`current`}function Wde(e,t,n){return+(X8(t,n)===`behind`)+e.filter(e=>X8(e.tauVersion,n)===`behind`).length}function Z8(){return(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-xs`,children:[(0,L.jsx)(`code`,{className:`rounded-md bg-muted px-2 py-1`,children:Y8}),(0,L.jsx)(hq,{text:Y8,label:`Copy update command`}),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`or`}),(0,L.jsx)(`code`,{className:`rounded-md bg-muted px-2 py-1`,children:UG})]})}function Gde({latest:e,checkedAt:t}){let n=nT();return(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsxs)(`span`,{children:[e?`Latest known: ${e}`:`Latest unknown`,t?`, checked ${BG(t,Date.now())}`:``]}),(0,L.jsx)(Z,{variant:`outline`,size:`xs`,disabled:n.isPending,onClick:()=>n.mutate(),children:`Check again`})]})}function Kde({machines:e}){let t=tT().data;if(!t)return null;let n=Wde(e,t.current,t.latest),r=(0,L.jsx)(Gde,{latest:t.latest,checkedAt:t.checkedAt});return n===0?r:(0,L.jsxs)(zU,{children:[(0,L.jsx)(BU,{children:n===1?`1 machine is behind`:`${n} machines are behind`}),(0,L.jsxs)(VU,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`span`,{children:`Run this on each one, they must run the same tau as this hub.`}),(0,L.jsx)(Z8,{}),r]})]})}function qde({machine:e,onDone:t}){let n=Xw(),{run:r,error:i,pending:a}=bW(),[o,s]=(0,M.useState)(e.name),c=async()=>{let i=o.trim();if(!i||i===e.name)return t();await r(async()=>void await n.mutateAsync({id:e.id,name:i}))&&t()};return(0,L.jsxs)(`form`,{className:`flex flex-col gap-1`,onSubmit:e=>{e.preventDefault(),c()},children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(iI,{"aria-label":`Machine name`,autoFocus:!0,value:o,disabled:a,onChange:e=>s(e.target.value)}),(0,L.jsx)(Z,{type:`submit`,size:`sm`,disabled:a,children:`Save`}),(0,L.jsx)(Z,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Cancel`})]}),(0,L.jsx)(yW,{message:i})]})}var Q8=e=>e.slice(0,8);function Jde({machine:e}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 pt-1 text-xs text-muted-foreground`,children:[(0,L.jsxs)(`p`,{children:[`Update tau on `,e.name,`: it runs tau `,e.tauVersion,` (protocol`,` `,Q8(e.protocolVersion),`), this one speaks protocol `,Q8(Zte),`.`]}),(0,L.jsx)(Z8,{})]})}function Yde(){return tT().data?.latest??null}function Xde({machine:e,now:t,onDisconnect:n,onSettings:r}){let[i,a]=(0,M.useState)(!1),o=Yde();return(0,L.jsx)(CG,{"data-machine-id":e.id,children:i?(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(qde,{machine:e,onDone:()=>a(!1)})}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(wG,{children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,L.jsx)(NG,{os:e.os,status:e.status}),(0,L.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[GG(e.os),` · `,e.threadCount,` `,e.threadCount===1?`thread`:`threads`,` `,`· `,HG(e,t)]}),e.status===`update-required`?(0,L.jsx)(Jde,{machine:e}):null]}),(0,L.jsx)(EG,{version:e.tauVersion,state:X8(e.tauVersion,o),latest:o}),(0,L.jsxs)(TG,{children:[(0,L.jsx)(Z,{variant:`ghost`,size:`xs`,"aria-label":`Open settings of ${e.name}`,disabled:e.status!==`online`,onClick:()=>r(e),children:`Open settings`}),(0,L.jsx)(Z,{variant:`ghost`,size:`xs`,"aria-label":`Rename ${e.name}`,onClick:()=>a(!0),children:`Rename`}),(0,L.jsx)(Z,{variant:`ghost`,size:`xs`,"aria-label":`Disconnect ${e.name}`,onClick:()=>n(e),children:`Disconnect`})]})]})})}function Zde(){let e=Mw().data?.length??0,t=Jw().data,n=tT().data,r=t&&t.state!==`none`?t.hubName??t.hubUrl??`a hub`:null;return(0,L.jsxs)(CG,{"data-machine-id":`local`,children:[(0,L.jsxs)(wG,{children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,L.jsx)(NG,{os:t?.os,status:`online`}),(0,L.jsx)(`span`,{className:`truncate`,children:`This machine`}),r?null:(0,L.jsx)(CW,{variant:`secondary`,children:`Hub`})]}),(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e,` `,e===1?`thread`:`threads`,` · the tau you are looking at`,r?`, linked to ${r}`:``]})]}),n?(0,L.jsx)(EG,{version:n.current,state:X8(n.current,n.latest),latest:n.latest}):null]})}function Qde(){let{machines:e}=PG(),t=Zw(),{run:n,error:r}=bW(),[i,a]=(0,M.useState)(null),[o,s]=(0,M.useState)(null),c=Date.now();return(0,L.jsxs)(M3,{id:`machines`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(A3,{children:`Machines`}),(0,L.jsx)(Kde,{machines:e}),(0,L.jsxs)(SG,{"aria-label":`Machines`,children:[(0,L.jsx)(Zde,{}),e.map(e=>(0,L.jsx)(Xde,{machine:e,now:c,onDisconnect:a,onSettings:s},e.id))]}),e.length===0?(0,L.jsx)(j3,{children:`No other machine is linked yet.`}):null,(0,L.jsx)(yW,{message:r})]}),(0,L.jsx)(n8,{open:i!==null,onOpenChange:e=>!e&&a(null),title:`Disconnect ${i?.name??`machine`}?`,description:`It disappears from this tau and must connect again with a new code. Its threads stay on that machine.`,confirmLabel:`Disconnect`,onConfirm:()=>{let e=i?.id;a(null),e&&n(async()=>void await t.mutateAsync(e))}}),o?(0,L.jsx)(Ude,{machine:o,onClose:()=>s(null)}):null]})}function $de(){let e=Jw().data,t=e!==void 0&&e.state!==`none`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Qde,{}),(0,L.jsx)(aI,{}),t?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Nue,{}),(0,L.jsx)(aI,{})]}),(0,L.jsx)(Iue,{})]})}var efe={browser:eL,phone:KL,cli:nR,machine:HL};function tfe({className:e,...t}){return(0,L.jsx)(`ul`,{"data-slot":`device-list`,className:I(`divide-y overflow-hidden rounded-lg border`,e),...t})}function nfe({className:e,...t}){return(0,L.jsx)(`li`,{"data-slot":`device-row`,className:I(`flex items-center gap-3 px-3 py-2.5`,e),...t})}function rfe({kind:e}){let t=efe[e];return(0,L.jsx)(t,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`})}function ife({className:e,...t}){return(0,L.jsx)(`div`,{className:I(`flex min-w-0 flex-1 flex-col gap-0.5`,e),...t})}function afe({className:e,...t}){return(0,L.jsx)(`div`,{className:I(`flex shrink-0 items-center gap-1`,e),...t})}function ofe({device:e,onDone:t}){let n=Ww(),{run:r,error:i,pending:a}=bW(),[o,s]=(0,M.useState)(e.name),c=async()=>{let i=o.trim();if(!i||i===e.name)return t();await r(async()=>void await n.mutateAsync({id:e.id,name:i}))&&t()};return(0,L.jsxs)(`form`,{className:`flex flex-col gap-1`,onSubmit:e=>{e.preventDefault(),c()},children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(iI,{"aria-label":`Device name`,autoFocus:!0,value:o,disabled:a,onChange:e=>s(e.target.value)}),(0,L.jsx)(Z,{type:`submit`,size:`sm`,disabled:a,children:`Save`}),(0,L.jsx)(Z,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Cancel`})]}),(0,L.jsx)(yW,{message:i})]})}function sfe({device:e,onRevoke:t}){let[n,r]=(0,M.useState)(!1);return(0,L.jsxs)(nfe,{children:[(0,L.jsx)(rfe,{kind:e.kind}),n?(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(ofe,{device:e,onDone:()=>r(!1)})}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(ife,{children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:e.name}),e.current?(0,L.jsx)(CW,{variant:`secondary`,children:`This device`}):null]}),(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Last seen `,(0,L.jsx)(w6,{at:e.lastSeenAt})]})]}),(0,L.jsxs)(afe,{children:[(0,L.jsx)(Z,{variant:`ghost`,size:`xs`,"aria-label":`Rename ${e.name}`,onClick:()=>r(!0),children:`Rename`}),(0,L.jsx)(Z,{variant:`ghost`,size:`xs`,"aria-label":`Revoke ${e.name}`,onClick:()=>t(e),children:`Revoke`})]})]})]})}function cfe(){let e=Rw().data??[],t=Gw(),n=Kw(),{run:r,error:i}=bW(),[a,o]=(0,M.useState)(null),[s,c]=(0,M.useState)(!1),l=e.some(e=>e.kind!==`machine`);return(0,L.jsxs)(M3,{id:`devices`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(A3,{children:`Devices`}),l?(0,L.jsx)(Z,{variant:`outline`,size:`sm`,onClick:()=>c(!0),children:`Sign out all`}):null]}),e.length===0?(0,L.jsx)(j3,{children:`No devices are linked yet.`}):(0,L.jsx)(tfe,{"aria-label":`Devices`,children:e.map(e=>(0,L.jsx)(sfe,{device:e,onRevoke:o},e.id))}),(0,L.jsx)(yW,{message:i})]}),(0,L.jsx)(n8,{open:a!==null,onOpenChange:e=>!e&&o(null),title:`Revoke ${a?.name??`device`}?`,description:`This device is signed out at once and must pair again to come back.`,confirmLabel:`Revoke`,onConfirm:()=>{let e=a?.id;o(null),e&&r(async()=>void await t.mutateAsync(e))}}),(0,L.jsx)(n8,{open:s,onOpenChange:c,title:`Sign out all devices?`,description:`Every linked device, including this one if it came through the URL, must pair again. Linked machines stay connected.`,confirmLabel:`Sign out all`,onConfirm:()=>{c(!1),r(async()=>void await n.mutateAsync())}})]})}var lfe=1e3;function ufe(e,t){if(!t||!e)return null;let n=t.expiresAt-Bg;return e.find(e=>e.kind!==`machine`&&e.createdAt>=n)??null}function dfe(e){let t=Hw(),n=Rw().data,[r,i]=(0,M.useState)(null),[a,o]=(0,M.useState)(null),[s,c]=(0,M.useState)(()=>Date.now()),{mutateAsync:l}=t,u=(0,M.useCallback)(async()=>{o(null),i(null);try{i(await l({kind:`device`}))}catch(e){o(_C(e))}},[l]);(0,M.useEffect)(()=>{e?u():i(null)},[e,u]),(0,M.useEffect)(()=>{if(!e)return;let t=setInterval(()=>c(Date.now()),lfe);return()=>clearInterval(t)},[e]);let d=ufe(n,r),f=r?Math.max(0,r.expiresAt-s):0;return{pairing:r,error:a,linked:d,msLeft:f,expired:r!==null&&!d&&f===0,create:u}}function ffe({name:e}){return(0,L.jsxs)(`p`,{role:`status`,className:`py-6 text-center text-sm font-medium`,children:[`Linked: `,e]})}function pfe({state:e}){let{pairing:t,expired:n,msLeft:r}=e;return t?(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,"data-expired":n||void 0,children:[t.link?(0,L.jsx)(W6,{value:t.link,label:`QR code of the link`,className:n?`opacity-30`:void 0}):null,(0,L.jsx)(F6,{code:t.shortCode}),t.link?(0,L.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-1`,children:[(0,L.jsx)(`code`,{className:`min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1 text-xs`,children:t.link}),(0,L.jsx)(hq,{text:t.link,label:`Copy link`})]}):null,(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n?`This code expired.`:`Waiting for the device… Expires in ${K6(r)}`})]}):(0,L.jsx)(gG,{className:`mx-auto my-12`})}function mfe({open:e,onOpenChange:t}){let n=dfe(e);return(0,L.jsx)(yB,{open:e,onOpenChange:t,children:(0,L.jsxs)(SB,{className:`max-h-[90vh] grid-cols-[minmax(0,1fr)] overflow-y-auto sm:max-w-sm`,children:[(0,L.jsxs)(CB,{children:[(0,L.jsx)(TB,{children:`Link a device`}),(0,L.jsx)(EB,{children:`Scan the code with the phone camera, open the link, or type the code on the pair page.`})]}),n.linked?(0,L.jsx)(ffe,{name:n.linked.name}):(0,L.jsx)(pfe,{state:n}),(0,L.jsx)(yW,{message:n.error}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:G6}),(0,L.jsxs)(wB,{children:[n.linked?null:(0,L.jsx)(Z,{variant:`outline`,onClick:()=>void n.create(),children:`New code`}),(0,L.jsx)(Z,{onClick:()=>t(!1),children:n.linked?`Done`:`Close`})]})]})})}function hfe(){let[e,t]=(0,M.useState)(!1),n=Lw().data?.state===`online`;return(0,L.jsxs)(M3,{id:`link-device`,children:[(0,L.jsxs)(k3,{className:`gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(A3,{children:`Link a device`}),(0,L.jsx)(Z,{variant:`outline`,size:`sm`,disabled:!n,onClick:()=>t(!0),children:`Link a device`})]}),(0,L.jsx)(j3,{children:n?G6:`Turn on remote access, and wait until it is online, to link a device.`})]}),(0,L.jsx)(mfe,{open:e,onOpenChange:t})]})}function gfe(e){let[,t]=(0,M.useState)(0);(0,M.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e])}function _fe({url:e}){return(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,L.jsx)(`code`,{className:`min-w-0 truncate rounded-md bg-muted px-2 py-1 text-xs`,children:e}),(0,L.jsx)(hq,{text:e,label:`Copy URL`})]})}function vfe(){let e=Lw().data;gfe(e?.state===`starting`);let t=cre(),n=Bw(),r=Vw(),{run:i,error:a,pending:o}=bW(),[s,c]=(0,M.useState)(null);if(!e)return(0,L.jsx)(M3,{id:`remote-access`,children:`Remote access`});let l=e.state!==`off`,u=Sue(e.state),d=Cue(e),f=Tue(e,Date.now()),p=e=>e?i(async()=>void await t.mutateAsync()):c(`off`),m=()=>{let e=s===`off`?n:r;c(null),i(async()=>void await e.mutateAsync())};return(0,L.jsxs)(M3,{id:`remote-access`,children:[(0,L.jsxs)(k3,{className:`gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(A3,{htmlFor:`remote-switch`,children:`Remote access`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(vG,{tone:u.tone,loading:e.state===`starting`,children:u.label}),(0,L.jsx)(L3,{id:`remote-switch`,checked:l,disabled:o,onCheckedChange:p})]})]}),(0,L.jsx)(j3,{children:`Open tau from your phone or another computer through a private URL.`}),e.url?(0,L.jsx)(_fe,{url:e.url}):null,d?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:d}):null,f?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}):null,l?(0,L.jsx)(j3,{children:vue}):null,e.pendingRemoval?(0,L.jsx)(j3,{children:`An old URL is still being removed. It finishes when the network allows.`}):null,e.canRecreate?(0,L.jsx)(`div`,{children:(0,L.jsx)(Z,{variant:`outline`,size:`sm`,disabled:o,onClick:()=>c(`recreate`),children:`Make a new URL`})}):null,(0,L.jsx)(yW,{message:a})]}),(0,L.jsx)(n8,{open:s===`off`,onOpenChange:e=>!e&&c(null),title:`Turn off remote access?`,description:yue,confirmLabel:`Turn off`,onConfirm:m}),(0,L.jsx)(n8,{open:s===`recreate`,onOpenChange:e=>!e&&c(null),title:`Make a new URL?`,description:bue,confirmLabel:`Make a new URL`,onConfirm:m})]})}function yfe(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(vfe,{}),(0,L.jsx)(aI,{}),(0,L.jsx)(hfe,{}),(0,L.jsx)(aI,{}),(0,L.jsx)(cfe,{})]})}var $8=`__model_default__`,bfe=e=>e.some(e=>e!==`off`);function xfe({levels:e,value:t,onChange:n,id:r,disabled:i,className:a}){return bfe(e)?(0,L.jsx)(nK,{id:r,"aria-label":`Thinking level`,triggerIcon:(0,L.jsx)(_I,{className:`opacity-60`}),className:a,searchable:!1,disabled:i,options:[{value:$8,label:`Model default`},...e.map(e=>({value:e,label:e}))],value:t??$8,onChange:e=>n(e===$8?null:e)}):null}var e5=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],Sfe=(e,t)=>e.provider===t.provider&&e.modelId===t.modelId,t5=(e,t)=>t?e.find(e=>Sfe(e,t)):void 0;function Cfe(e,t,n){return t5(e,t)??t5(e,n)??e[0]}function wfe(e,t){return t.includes(e)?e:e5.slice(0,e5.indexOf(e)).reverse().find(e=>t.includes(e))??t[0]??`off`}function Tfe(e,t){return wfe(t??`medium`,e?.thinkingLevels??[`off`])}function Efe(e,t){return e.find(e=>e.id===t&&e.status!==`failed`)?.id??e.find(e=>e.kind===`home`)?.id??`home`}var n5=e=>[...e.filter(e=>e.kind===`home`),...e.filter(e=>e.kind!==`home`)];function r5(e){let t=(0,M.useId)(),n=t5(e.models,e.model)?.thinkingLevels??[`off`];return(0,L.jsxs)(M3,{id:e.settingId,className:`flex flex-col gap-2`,children:[(0,L.jsx)(`label`,{htmlFor:t,className:`text-sm font-medium`,children:e.label}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,L.jsx)(mK,{id:t,models:e.models,value:e.model,onChange:e.onModel,clearLabel:e.clearLabel,onClear:e.onClear,className:`sm:flex-1`}),(0,L.jsx)(xfe,{levels:n,value:e.level,onChange:e.onLevel,className:`sm:w-40`})]})]})}function Dfe(){let e=J(),t=yC(),n=Ew(),r=ww(),{run:i,error:a}=bW();if(n.isError)return(0,L.jsx)(yW,{message:_C(n.error)});if(n.isPending||r.isPending)return(0,L.jsx)(Si,{className:`h-9 w-full`});let o=e=>void i(async()=>{await e(),await t.invalidateQueries({queryKey:Y.settings})});return(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(r5,{settingId:`default-model`,label:`Default model`,models:n.data,model:r.data?.defaultModel??null,level:r.data?.defaultThinkingLevel??null,onModel:t=>o(()=>e.settings.setDefaultModel(t)),onLevel:t=>o(()=>e.settings.setDefaultThinkingLevel(t))}),(0,L.jsx)(r5,{settingId:`fast-model`,label:`Fast model`,models:n.data,model:r.data?.fastModel??null,level:r.data?.fastThinkingLevel??null,onModel:t=>o(()=>e.settings.setFastModel(t)),onLevel:t=>o(()=>e.settings.setFastThinkingLevel(t)),clearLabel:`Same as thread`,onClear:()=>o(()=>e.settings.setFastModel(null))}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The fast model names new threads. The default model and its thinking level are used for new threads; change a thread's model from its composer.`}),(0,L.jsx)(yW,{message:a})]})}var Ofe={name:``,transport:`stdio`,command:``,args:``,env:``,url:``,headers:``},i5=e=>e.split(`
|
|
108
|
+
`).map(e=>e.trim()).filter(Boolean),kfe=e=>i5(e);function a5(e,t){let n={};for(let r of i5(e)){let e=r.indexOf(t);if(e<=0)throw Error(`"${r}" must look like NAME${t}value.`);n[r.slice(0,e).trim()]=r.slice(e+1).trim()}return n}function o5(e,t){let n=e.trim();if(n===``)throw Error(t);return n}function Afe(e){let t=o5(e,`Enter the server URL.`);if(!/^https?:\/\//.test(t))throw Error(`The URL must start with http:// or https://.`);return t}function jfe(e){let t=o5(e.name,`Enter a name.`);return e.transport===`stdio`?{name:t,command:o5(e.command,`Enter the command to run.`),args:kfe(e.args),env:a5(e.env,`=`)}:{name:t,url:Afe(e.url),headers:a5(e.headers,`:`)}}function s5(){let e=yC();return()=>e.invalidateQueries({queryKey:Y.allMcpServers})}function Mfe(){let e=J();return _w({mutationFn:t=>e.mcp.save(t),onSuccess:s5()})}function Nfe(){let e=J();return _w({mutationFn:t=>e.mcp.remove(t),onSuccess:s5()})}var Pfe=[{value:`stdio`,label:`Run a command`,icon:(0,L.jsx)(nR,{})},{value:`http`,label:`Connect to a URL`,icon:(0,L.jsx)(eL,{})}],c5=`Values are saved but never shown again.`;function Ffe({values:e,set:t}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(k3,{children:[(0,L.jsx)(A3,{htmlFor:`mcp-command`,children:`Command`}),(0,L.jsx)(iI,{id:`mcp-command`,value:e.command,placeholder:`npx`,autoComplete:`off`,spellCheck:!1,onChange:e=>t({command:e.target.value})})]}),(0,L.jsxs)(k3,{children:[(0,L.jsx)(A3,{htmlFor:`mcp-args`,children:`Arguments`}),(0,L.jsx)(DB,{id:`mcp-args`,value:e.args,placeholder:`-y
|
|
109
|
+
@modelcontextprotocol/server-filesystem`,spellCheck:!1,onChange:e=>t({args:e.target.value})}),(0,L.jsx)(j3,{children:`One argument per line.`})]}),(0,L.jsxs)(k3,{children:[(0,L.jsx)(A3,{htmlFor:`mcp-env`,children:`Environment`}),(0,L.jsx)(DB,{id:`mcp-env`,value:e.env,placeholder:`API_TOKEN=...`,autoComplete:`off`,spellCheck:!1,onChange:e=>t({env:e.target.value})}),(0,L.jsxs)(j3,{children:[`NAME=value, one per line. `,c5]})]})]})}function Ife({values:e,set:t}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(k3,{children:[(0,L.jsx)(A3,{htmlFor:`mcp-url`,children:`URL`}),(0,L.jsx)(iI,{id:`mcp-url`,value:e.url,placeholder:`https://example.com/mcp`,autoComplete:`off`,spellCheck:!1,onChange:e=>t({url:e.target.value})})]}),(0,L.jsxs)(k3,{children:[(0,L.jsx)(A3,{htmlFor:`mcp-headers`,children:`Headers`}),(0,L.jsx)(DB,{id:`mcp-headers`,value:e.headers,placeholder:`Authorization: Bearer ...`,autoComplete:`off`,spellCheck:!1,onChange:e=>t({headers:e.target.value})}),(0,L.jsxs)(j3,{children:[`Name: value, one per line. `,c5]})]})]})}function Lfe({editing:e,onClose:t}){let[n,r]=(0,M.useState)({...Ofe,name:e??``}),i=Mfe(),{run:a,error:o,pending:s,clearError:c}=bW(),l=e=>r(t=>({...t,...e}));return(0,L.jsx)(yB,{open:!0,onOpenChange:e=>!e&&t(),children:(0,L.jsxs)(SB,{children:[(0,L.jsxs)(CB,{children:[(0,L.jsx)(TB,{children:e?`Edit ${e}`:`Add MCP server`}),(0,L.jsx)(EB,{children:e?`Saving replaces this server's whole configuration.`:`Servers are started on demand and shared by every thread.`})]}),(0,L.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),await a(async()=>void await i.mutateAsync(jfe(n)))&&t()},className:`flex flex-col gap-4`,children:[(0,L.jsxs)(Rce,{children:[(0,L.jsxs)(k3,{children:[(0,L.jsx)(A3,{htmlFor:`mcp-name`,children:`Name`}),(0,L.jsx)(iI,{id:`mcp-name`,value:n.name,readOnly:e!==null,autoComplete:`off`,spellCheck:!1,onChange:e=>l({name:e.target.value})})]}),(0,L.jsx)(A6,{"aria-label":`Connection type`,value:n.transport,options:Pfe,onChange:e=>{c(),l({transport:e})}}),n.transport===`stdio`?(0,L.jsx)(Ffe,{values:n,set:l}):(0,L.jsx)(Ife,{values:n,set:l})]}),(0,L.jsx)(yW,{message:o}),(0,L.jsxs)(wB,{children:[(0,L.jsx)(Z,{type:`button`,variant:`ghost`,onClick:t,children:`Cancel`}),(0,L.jsx)(Z,{type:`submit`,disabled:s,children:s?`Saving…`:`Save`})]})]})]})})}function Rfe(e){return e.state===`error`?`Error`:e.state===`connected`?e.toolCount===null?`Connected`:`${e.toolCount} ${e.toolCount===1?`tool`:`tools`}`:`Not started`}function zfe({name:e}){let[t,n]=(0,M.useState)(!1),r=Nfe(),{run:i,error:a,pending:o}=bW();return t?(0,L.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Z,{variant:`destructive`,size:`sm`,disabled:o,onClick:()=>i(async()=>void await r.mutateAsync(e)),children:`Confirm remove`}),(0,L.jsx)(Z,{variant:`ghost`,size:`sm`,onClick:()=>n(!1),children:`Cancel`})]}),(0,L.jsx)(yW,{message:a})]}):(0,L.jsx)(Z,{variant:`outline`,size:`sm`,"aria-label":`Remove ${e}`,onClick:()=>n(!0),children:`Remove`})}function Bfe({server:e,onEdit:t}){return(0,L.jsx)(M3,{id:`mcp:${e.name}`,asChild:!0,children:(0,L.jsxs)(`li`,{"aria-label":e.name,className:`flex flex-col gap-1 rounded-lg border p-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium`,children:e.name}),(0,L.jsx)(CW,{variant:e.state===`error`?`destructive`:`secondary`,children:Rfe(e)}),(0,L.jsx)(CW,{variant:`outline`,children:e.transport===`stdio`?`command`:`url`})]}),t?(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Z,{variant:`outline`,size:`sm`,"aria-label":`Edit ${e.name}`,onClick:()=>t(e.name),children:`Edit`}),(0,L.jsx)(zfe,{name:e.name})]}):null]}),e.error?(0,L.jsx)(j3,{className:`text-destructive`,children:e.error}):null]})})}var Vfe=`Web search and page fetching work out of the box. No keys needed.`,Hfe=`MCP servers add tools the agent can call. They start when first used.`;function l5({title:e,servers:t,onEdit:n}){return t.length===0?null:(0,L.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium`,children:e}),(0,L.jsx)(`ul`,{"aria-label":e,className:`flex flex-col gap-2`,children:t.map(e=>(0,L.jsx)(Bfe,{server:e,...n&&{onEdit:n}},`${e.source}:${e.name}`))})]})}function Ufe(){let{projectId:e}=uU(),t=Iw(e??null),[n,r]=(0,M.useState)(null);if(t.isError)return(0,L.jsx)(yW,{message:_C(t.error)});if(t.isPending)return(0,L.jsx)(Si,{className:`h-9 w-full`});let i=t.data.filter(e=>e.source===`settings`),a=t.data.filter(e=>e.source===`project`);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(M3,{id:`web-search`,asChild:!0,children:(0,L.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium`,children:`Web search`}),(0,L.jsx)(j3,{children:Vfe})]})}),(0,L.jsxs)(M3,{id:`mcp-servers`,className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium`,children:`MCP servers`}),(0,L.jsx)(Z,{variant:`outline`,size:`sm`,onClick:()=>r({editing:null}),children:`Add server`})]}),(0,L.jsx)(j3,{children:Hfe}),i.length===0?(0,L.jsx)(j3,{children:`No servers added yet.`}):null]}),(0,L.jsx)(l5,{title:`Your servers`,servers:i,onEdit:e=>r({editing:e})}),(0,L.jsx)(l5,{title:`From this project's .mcp.json`,servers:a}),(0,L.jsx)(u8,{}),n?(0,L.jsx)(Lfe,{editing:n.editing,onClose:()=>r(null)}):null]})}var Wfe={general:()=>(0,L.jsx)(Jle,{}),providers:()=>(0,L.jsx)(J8,{}),models:()=>(0,L.jsx)(Dfe,{}),projects:()=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(d8,{}),(0,L.jsx)(y6,{})]}),github:()=>(0,L.jsx)(Ble,{}),agent:()=>(0,L.jsx)(Ule,{}),tools:()=>(0,L.jsx)(Ufe,{}),remote:()=>(0,L.jsx)(yfe,{}),machines:()=>(0,L.jsx)($de,{})},u5=`(prefers-reduced-motion: reduce)`,Gfe=e=>{let t=window.matchMedia(u5);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},d5=()=>window.matchMedia(u5).matches,f5=()=>(0,M.useSyncExternalStore)(Gfe,d5,()=>!1),Kfe=1600,qfe=4e3,Jfe=`input, button, textarea, [role=switch], [role=radio], [role=combobox], a[href]`,Yfe=e=>document.querySelector(`[data-setting-id="${CSS.escape(e)}"]`);function Xfe(e,t){e.scrollIntoView?.({block:`center`,behavior:t?`smooth`:`auto`}),e.querySelector(Jfe)?.focus({preventScroll:!0}),e.setAttribute(`data-highlighted`,``),window.setTimeout(()=>e.removeAttribute(`data-highlighted`),Kfe)}function Zfe(e,t,n){let r=f5();(0,M.useEffect)(()=>{if(!e)return;let t=!1,n=()=>{let n=Yfe(e);n&&!t&&(t=!0,i.disconnect(),Xfe(n,!r))},i=new MutationObserver(n);i.observe(document.body,{childList:!0,subtree:!0});let a=window.setTimeout(()=>i.disconnect(),qfe);return n(),()=>{i.disconnect(),window.clearTimeout(a)}},[e,t,n,r])}function p5({withModels:e=!0}={}){let{projectId:t}=uU(),n=Cw().data,r=Tw().data,i=Ew().data,a=Iw(t??null).data;return(0,M.useMemo)(()=>[...hle,...Sle({providers:n??[],projects:r??[],models:e?i??[]:[],mcpServers:a??[]})],[n,r,i,a,e])}function Qfe({section:e,onSectionChange:t,setting:n=null,onSettingOpen:r,query:i,onQueryChange:a}){let[o,s]=(0,M.useState)(0),c=(0,M.useRef)(null),l=p5(),u=i.trim()!==``;return Zfe(u?null:n,o,e),(0,L.jsx)(PB,{shouldFilter:!1,loop:!0,className:`rounded-none! bg-transparent p-0`,children:(0,L.jsx)(I3,{title:`Settings`,sections:G3,active:e,onActiveChange:e=>{a(``),t(e)},sectionRequest:o,search:(0,L.jsx)(wle,{inputRef:c,query:i,onQueryChange:a}),results:u?(0,L.jsx)(Ole,{query:i,entries:l,onOpen:e=>{r?.(e.section,c6(e)),a(``),s(e=>e+1)}}):null,children:Wfe[e]()})})}function $fe(e){let[t,n]=(0,M.useState)(``);return(0,L.jsx)(yB,{open:e.open,onOpenChange:t=>{t||n(``),e.onOpenChange(t)},children:(0,L.jsx)(N3,{"aria-describedby":void 0,onEscapeKeyDown:e=>{t!==``&&(e.preventDefault(),n(``))},children:(0,L.jsx)(Qfe,{...e,query:t,onQueryChange:n})})})}var m5=`settings`,h5=`setting`,g5=(0,M.createContext)(()=>{}),_5=e=>{let t=(0,M.useContext)(g5);return(0,M.useCallback)(()=>t(e),[t,e])},epe=()=>{let e=(0,M.useContext)(g5);return(0,M.useCallback)((t,n)=>e(t,n),[e])},tpe=e=>G3.find(t=>t.id===e)?.id??null;function npe({children:e}){let[t,n]=Vn(),r=tpe(t.get(m5)),i=t.get(h5),a=(0,M.useCallback)((e,t)=>n(n=>{let r=new URLSearchParams(n);return r.delete(m5),r.delete(h5),e&&r.set(m5,e),e&&t&&r.set(h5,t),r},{replace:!0}),[n]),o=(0,M.useMemo)(()=>(e=`general`,t)=>a(e,t),[a]);return(0,L.jsxs)(g5.Provider,{value:o,children:[e,(0,L.jsx)($fe,{open:r!==null,onOpenChange:e=>!e&&a(null),section:r??`general`,onSectionChange:e=>a(e),setting:i,onSettingOpen:a})]})}function rpe({section:e,run:t}){let n=_5(e.id);return(0,L.jsxs)(BB,{onSelect:t(n),children:[`Settings: `,e.label]})}var ipe=8;function ape(e){let t=p5({withModels:!1});return(0,M.useMemo)(()=>e.trim()===``?[]:l6(e,t).slice(0,ipe),[e,t])}function ope({search:e,results:t,run:n}){let r=epe();return t.length===0?null:(0,L.jsx)(zB,{forceMount:!0,heading:`Settings`,children:t.map(t=>(0,L.jsxs)(BB,{forceMount:!0,value:`setting ${t.id}`,onSelect:n(()=>r(t.section,c6(t))),children:[(0,L.jsx)(t6,{className:`min-w-0 flex-1 truncate`,text:t.label,ranges:s6(t.label,e)}),(0,L.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:t.sectionLabel})]},t.id))})}function spe({conversationId:e,run:t}){let n=J(),{model:r,level:i}=e6(e);return(0,L.jsx)(zB,{heading:`Thinking level`,children:(r?.thinkingLevels??[]).map(r=>(0,L.jsx)(BB,{value:`thinking ${r}`,"data-checked":r===i,onSelect:t($3(()=>n.conversations.configure(e,{thinkingLevel:r}))),children:r},r))})}function cpe({projectId:e,conversationId:t,archived:n,onChangeModel:r,onChangeThinking:i,run:a}){let o=J(),s=Sw(),c=bt(),l=yC(),u=mU().data===!0,d=hU(t,u).data??[],f=e6(t).model?.thinkingLevels.some(e=>e!==`off`),p=vU(e,t),m=v3(t),h=m.status===`ready`?dC(m.view).queued:[];return(0,L.jsxs)(zB,{heading:`This thread`,children:[u?(0,L.jsx)(BB,{onSelect:a(p.run),children:`New terminal`}):null,d.map((n,r)=>(0,L.jsxs)(BB,{value:`terminal ${r+1} ${n.title} ${n.id}`,onSelect:a(()=>c(oU(e,t,n.id,s))),children:[`Go to terminal: `,n.title]},n.id)),d.length>0?(0,L.jsx)(BB,{onSelect:a(()=>c(iU(e,t,s))),children:`Go to chat`}):null,(0,L.jsx)(BB,{onSelect:r,children:`Change model…`}),f?(0,L.jsx)(BB,{onSelect:i,children:`Change thinking level…`}):null,(0,L.jsx)(BB,{onSelect:a($3(()=>hG(o,t,s,h))),children:`Stop agent`}),(0,L.jsx)(BB,{onSelect:a($3(async()=>{await o.conversations.archive(t,!n),await Promise.all([l.invalidateQueries({queryKey:Y.conversations(e)}),l.invalidateQueries({queryKey:Y.allConversations})])})),children:n?`Unarchive thread`:`Archive thread`})]})}var v5=`all`,y5=e=>e??`local`;function lpe({machines:e,value:t,onChange:n}){return(0,L.jsxs)(H3,{type:`single`,variant:`outline`,size:`sm`,"aria-label":`Machine`,className:`flex-wrap justify-start px-3 py-2`,value:t,onValueChange:e=>n(e||v5),children:[(0,L.jsx)(U3,{value:v5,children:`All machines`}),e.map(e=>(0,L.jsxs)(U3,{value:y5(e.machineId),children:[(0,L.jsx)(NG,{os:e.os,status:e.status}),e.name]},y5(e.machineId)))]})}function upe({search:e,allMachines:t,machines:n,several:r,run:i,startAddProject:a,openModelPage:o,openThinkingPage:s}){let c=bt(),l=Q3(),{toggleSidebar:u}=MR(),{projectId:d,conversationId:f,machineId:p}=uU(),m=t.find(e=>e.machineId===p)?.conversations.find(e=>e.id===f),h=ape(e);return(0,L.jsxs)(L.Fragment,{children:[h.length===0&&(0,L.jsx)(RB,{children:`No results.`}),d&&f?(0,L.jsx)(D3,{machineId:p,children:(0,L.jsx)(cpe,{projectId:d,conversationId:f,archived:m?.archivedAt!=null,onChangeModel:o,onChangeThinking:s,run:i})}):null,(0,L.jsxs)(zB,{heading:`Actions`,children:[(0,L.jsx)(BB,{onSelect:i(()=>c(aU(d,p))),children:`New thread`}),(0,L.jsx)(BB,{onSelect:i(a),children:`Add project`}),l.available?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(BB,{onSelect:i(()=>l.go(1)),children:[`Next thread`,(0,L.jsx)(VB,{children:`⌘⌥↓`})]}),(0,L.jsxs)(BB,{onSelect:i(()=>l.go(-1)),children:[`Previous thread`,(0,L.jsx)(VB,{children:`⌘⌥↑`})]})]}):null,(0,L.jsxs)(BB,{onSelect:i(u),children:[`Toggle sidebar`,(0,L.jsx)(VB,{children:`⌘B`})]}),G3.map(e=>(0,L.jsx)(rpe,{section:e,run:i},e.id))]}),(0,L.jsx)(ope,{search:e,results:h,run:i}),(0,L.jsx)(zB,{heading:`Projects`,children:n.flatMap(e=>e.projects.map(t=>(0,L.jsxs)(BB,{value:`project ${t.name} ${t.id} ${e.name}`,onSelect:i(()=>c(aU(t.id,e.machineId))),children:[t.name,r?(0,L.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:e.name}):null]},`${y5(e.machineId)}:${t.id}`)))}),(0,L.jsx)(zB,{heading:`Threads`,children:n.flatMap(e=>e.conversations.map(t=>{let n=e.projects.find(e=>e.id===t.projectId)?.name??``;return(0,L.jsxs)(BB,{value:`thread ${t.title} ${n} ${t.id} ${e.name}`,onSelect:i(()=>c(iU(t.projectId,t.id,e.machineId))),children:[t.title.trim()||`New thread`,(0,L.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:r?`${e.name} · ${n}`:n})]},`${y5(e.machineId)}:${t.id}`)}))})]})}var dpe={main:`Search threads, projects, actions, settings`,model:`Search models`,thinking:`Search thinking levels`};function fpe(){let[e,t]=(0,M.useState)(!1),[n,r]=(0,M.useState)(``),[i,a]=(0,M.useState)(null),[o,s]=(0,M.useState)(v5),[c,l]=(0,M.useState)(null),{conversationId:u,machineId:d}=uU(),f=E3(),p=f.filter(e=>o===v5||y5(e.machineId)===o);W3(`mod+k`,()=>t(e=>!e));let m=()=>l(f.length>1?{step:`choose`}:{step:`add`,machineId:void 0}),h=e=>{t(e),e||a(null)},g=e=>()=>{h(!1),r(``),e()},_=e=>()=>{r(``),a(e)};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(ile,{state:c,machines:f,onChange:l}),(0,L.jsx)(FB,{open:e,onOpenChange:h,title:`Command palette`,children:(0,L.jsxs)(PB,{onKeyDown:e=>{i!==null&&n===``&&e.key===`Backspace`&&a(null)},children:[(0,L.jsx)(IB,{value:n,onValueChange:r,placeholder:dpe[i??`main`]}),i===null&&f.length>1?(0,L.jsx)(lpe,{machines:f,value:o,onChange:s}):null,(0,L.jsx)(LB,{children:i!==null&&u?(0,L.jsxs)(D3,{machineId:d,children:[(0,L.jsx)(RB,{children:`No results.`}),i===`model`?(0,L.jsx)(cle,{conversationId:u,run:g}):(0,L.jsx)(spe,{conversationId:u,run:g})]}):(0,L.jsx)(upe,{search:n,allMachines:f,machines:p,several:f.length>1,run:g,startAddProject:m,openModelPage:_(`model`),openThinkingPage:_(`thinking`)})})]})})]})}function ppe(){let e=bt(),{projectId:t,machineId:n}=uU(),{go:r}=Q3();return W3(`mod+alt+arrowdown`,()=>r(1)),W3(`mod+alt+arrowup`,()=>r(-1)),W3(`mod+shift+o`,()=>e(aU(t,n))),null}function mpe({className:e,...t}){return(0,L.jsx)(`img`,{"data-slot":`tau-logo`,src:`/favicon.svg`,alt:`tau`,draggable:!1,className:I(`size-7 shrink-0 select-none rounded-md`,e),...t})}function hpe(){let[e,t]=(0,M.useState)(()=>fz.getSidebarMode());return[e,e=>{fz.setSidebarMode(e),t(e)}]}function gpe(){let e=Sw(),[t,n]=(0,M.useState)(()=>fz.getProjectOpenOverrides(e));return{overrides:t,setOpen:(r,i)=>{let a={...t,[r]:i};fz.setProjectOpenOverrides(a,e),n(a)}}}function _pe(){let e=Sw(),[t,n]=(0,M.useState)(()=>fz.getCollapsedThreads(e));return{isExpanded:e=>!t.includes(e),toggle:r=>{let i=t.includes(r)?t.filter(e=>e!==r):[...t,r];fz.setCollapsedThreads(i,e),n(i)}}}function vpe(){let[e,t]=(0,M.useState)(()=>fz.getCollapsedMachines());return{isOpen:t=>!e.includes(t),setOpen:(n,r)=>{let i=r?e.filter(e=>e!==n):[...e,n];fz.setCollapsedMachines(i),t(i)}}}function b5({machine:e,name:t,children:n}){let{isOpen:r,setOpen:i}=vpe(),a=e?.id??`local`,o=FG(),s=e?e.os:o,c=e?.status??`online`,l=r(a);return(0,L.jsx)(VR,{role:`group`,"aria-label":t,"data-machine":a,"data-status":c,children:(0,L.jsxs)($K,{open:l,onOpenChange:e=>i(a,e),children:[(0,L.jsx)(HR,{asChild:!0,children:(0,L.jsxs)(eq,{className:`w-full gap-1.5`,children:[(0,L.jsx)(SI,{className:l?`rotate-90 transition-transform`:`transition-transform`}),c===`update-required`?(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsx)(NG,{os:s,status:c})}),(0,L.jsxs)(CR,{side:`right`,children:[`Update tau on `,t]})]}):(0,L.jsx)(NG,{os:s,status:c}),(0,L.jsx)(`span`,{className:`truncate`,children:t})]})}),(0,L.jsx)(tq,{children:n})]})})}var x5=`tau:machine-summary`,ype=e=>typeof e==`object`&&!!e&&Array.isArray(e.projects)&&Array.isArray(e.threads);function bpe(e){try{let t=window.localStorage.getItem(QR(x5,e)),n=t?JSON.parse(t):void 0;return ype(n)?n:void 0}catch{return}}function xpe(e,t){try{window.localStorage.setItem(QR(x5,e),JSON.stringify(t))}catch{}}var S5=e=>[...e.querySelectorAll(`[data-flip-id]`)],Spe=e=>new Map(e.map(e=>[e.dataset.flipId??``,e.getBoundingClientRect().top])),Cpe=(e,t)=>e.size===t.size&&[...e.keys()].every(e=>t.has(e));function wpe(e,t){e.animate([{transform:`translateY(${t}px)`},{transform:`translateY(0)`}],{duration:160,easing:`ease-out`})}function C5(e,t){let n=(0,M.useRef)({tops:new Map,resetKey:t});(0,M.useLayoutEffect)(()=>{let r=e.current;if(!r)return;let i=Spe(S5(r)),{tops:a,resetKey:o}=n.current;if(n.current={tops:i,resetKey:t},!d5()&&(o!==t||Cpe(a,i)))for(let e of S5(r)){let t=e.dataset.flipId??``,n=a.get(t),r=i.get(t);n!==void 0&&r!==void 0&&n!==r&&wpe(e,n-r)}})}function Tpe({className:e,size:t=`default`,...n}){return(0,L.jsx)(dA,{"data-slot":`avatar`,"data-size":t,className:I(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function Epe({className:e,...t}){return(0,L.jsx)(pA,{"data-slot":`avatar-image`,className:I(`aspect-square size-full rounded-full object-cover`,e),...t})}function Dpe({className:e,...t}){return(0,L.jsx)(hA,{"data-slot":`avatar-fallback`,className:I(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}var Ope=360;function kpe(e){let t=0;for(let n of e)t=(t*31+n.charCodeAt(0))%Ope;return t}function w5({id:e,name:t,iconUrl:n,home:r=!1,tile:i=17,className:a,...o}){let s=kpe(e);return(0,L.jsxs)(Tpe,{"data-slot":`project-icon`,"aria-hidden":!0,className:I(`rounded-sm after:rounded-sm`,a),style:{width:i,height:i},...o,children:[n&&!r?(0,L.jsx)(Epe,{src:n,alt:``,className:`rounded-sm animate-in fade-in`}):null,(0,L.jsx)(Dpe,{className:`rounded-sm text-[0.6rem] font-medium`,style:{backgroundColor:`color-mix(in oklab, oklch(0.7 0.14 ${s}) 25%, var(--background))`,color:`oklch(0.55 0.14 ${s})`},children:r?(0,L.jsx)(nL,{className:`size-3`}):t.trim().charAt(0).toUpperCase()||`?`})]})}var Ape=e=>new Promise((t,n)=>{let r=URL.createObjectURL(e),i=new Image;i.onload=()=>{URL.revokeObjectURL(r),t(i)},i.onerror=()=>{URL.revokeObjectURL(r),n(Error(`This file is not an image the browser can read.`))},i.src=r}),jpe=(e,t)=>{let n=Math.min(128/e,128/t),r=e*n,i=t*n;return{x:(128-r)/2,y:(128-i)/2,w:r,h:i}},Mpe=e=>new Promise((t,n)=>e.toBlob(e=>e?t(e):n(Error(`Could not encode the icon.`)),`image/png`));async function Npe(e){let t=await Ape(e),n=document.createElement(`canvas`);n.width=128,n.height=128;let{x:r,y:i,w:a,h:o}=jpe(t.naturalWidth||128,t.naturalHeight||128);return n.getContext(`2d`)?.drawImage(t,r,i,a,o),new Uint8Array(await(await Mpe(n)).arrayBuffer())}var Ppe=12,Fpe=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Could not load that image.`);return t.blob()};function Ipe({project:e,onClose:t}){let n=J(),r=Sw(),i=(0,M.useId)(),a=yC(),{run:o,error:s,pending:c}=bW(),l=tre(e.id),u=async e=>{await o(async()=>{await e(),await a.invalidateQueries({queryKey:Y.projects})})&&t()},d=t=>u(async()=>n.projects.setIcon(e.id,await Npe(await t()))),f=e=>{let t=e.find(e=>e.type.startsWith(`image/`));t&&d(async()=>t)};return(0,L.jsx)(yB,{open:!0,onOpenChange:e=>!e&&t(),children:(0,L.jsxs)(SB,{children:[(0,L.jsxs)(CB,{children:[(0,L.jsxs)(TB,{children:[`Change icon for `,e.name]}),(0,L.jsx)(EB,{children:`Pick an image from the project or upload your own.`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(w5,{id:e.id,name:e.name,iconUrl:e.iconUrl?lU(e.iconUrl,r):null,tile:48}),(0,L.jsxs)(_z,{onFiles:f,disabled:c,label:`Drop an image`,className:`flex-1`,children:[(0,L.jsx)(`label`,{htmlFor:i,className:`sr-only`,children:`Upload an image`}),(0,L.jsx)(iI,{id:i,type:`file`,accept:`image/*`,disabled:c,onChange:e=>{f(Array.from(e.target.files??[])),e.target.value=``}})]})]}),l.data&&l.data.length>0&&(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:l.data.slice(0,Ppe).map(e=>(0,L.jsx)(GB,{src:lU(e.url,r),alt:e.name,onOpen:()=>void d(()=>Fpe(lU(e.url,r)))},e.name))}),(0,L.jsx)(yW,{message:s}),(0,L.jsxs)(wB,{children:[(0,L.jsx)(Z,{type:`button`,variant:`outline`,disabled:c,onClick:()=>void u(()=>n.projects.resetIcon(e.id)),children:`Reset to default`}),(0,L.jsx)(Z,{type:`button`,variant:`outline`,onClick:t,children:`Cancel`})]})]})})}var Lpe=3,Rpe=`Delete interrupted — deletions may still be running. Reload; kept threads reappear under Archived.`,T5=null,E5=new Set,D5=e=>{T5=e;for(let e of E5)e()},zpe=e=>(E5.add(e),()=>void E5.delete(e)),Bpe=()=>T5!==null,Vpe=e=>`${e} archived thread${e===1?``:`s`}`;function Hpe(e,t){if(e.kept.length===0){eH.success(`Deleted ${Vpe(e.deleted.length)}`);return}let n=e.kept.slice(0,Lpe).map(e=>`${t.get(e.id)??e.id} — ${e.reason}`),r=e.kept.length-n.length;r>0&&n.push(`…and ${r} more`),n.push(`Kept threads stay under Archived with warnings.`),eH.info(`Deleted ${e.deleted.length}, kept ${e.kept.length}`,{description:n.join(`
|
|
110
|
+
`)})}function O5(){let e=J(),t=yC();return{inFlight:(0,M.useSyncExternalStore)(zpe,Bpe),startDeleteArchived:(0,M.useCallback)((n,r=[])=>{if(T5)return eH.info(`Already deleting…`),!1;let i=new Map(r.map(e=>[e.id,e.title]));return D5(e.conversations.deleteArchived({force:n}).then(e=>Hpe(e,i)).catch(e=>{eH.error(Upe(e)?Rpe:_C(e))}).then(()=>t.invalidateQueries({queryKey:[`conversations`]})).then(()=>D5(null),()=>D5(null))),!0},[e,t])}}var Upe=e=>!(typeof e==`object`&&e&&`code`in e);function Wpe({className:e,...t}){return(0,L.jsx)(MA,{"data-slot":`checkbox`,className:I(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,e),...t,children:(0,L.jsx)(PA,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current`,children:(0,L.jsx)(yI,{className:`size-3.5`})})})}var Gpe=e=>`${e} archived thread${e===1?``:`s`}`;function Kpe({archived:e,onClose:t}){let{startDeleteArchived:n}=O5(),[r,i]=(0,M.useState)(!1),a=e.filter(e=>e.unmergedWarning!==null),o=r?e.length:e.length-a.length,s=()=>{n(r,e),t()};return(0,L.jsx)(J6,{open:!0,onOpenChange:e=>!e&&t(),children:(0,L.jsxs)(Y6,{children:[(0,L.jsxs)(X6,{children:[(0,L.jsx)(Q6,{children:`Delete all archived?`}),(0,L.jsxs)($6,{children:[Gpe(o),` will be deleted with their worktrees and branches.`]})]}),a.length>0&&!r&&(0,L.jsxs)(`div`,{className:`text-sm`,children:[(0,L.jsxs)(`p`,{children:[`Kept because of unmerged work (`,a.length,`):`]}),(0,L.jsx)(`ul`,{className:`list-disc pl-5 text-muted-foreground`,children:a.map(e=>(0,L.jsxs)(`li`,{children:[e.title,`: `,e.unmergedWarning]},e.id))})]}),a.length>0&&(0,L.jsxs)(O3,{children:[(0,L.jsx)(Wpe,{checked:r,onCheckedChange:e=>i(e===!0)}),`Also delete threads with unmerged work`]}),(0,L.jsxs)(Z6,{children:[(0,L.jsx)(t8,{children:`Cancel`}),(0,L.jsxs)(e8,{variant:`destructive`,onClick:e=>{e.preventDefault(),s()},children:[`Delete `,o]})]})]})})}var k5={clover:{label:`Clover`,color:`#35B8FF`,face:`eyes`,faceX:50,faceY:50,faceScale:1},flower:{label:`Flower`,color:`#2FCB7A`,face:`eyes`,faceX:50,faceY:51,faceScale:.95},triangle:{label:`Triangle`,color:`#DC48FF`,face:`eyes`,faceX:50,faceY:61,faceScale:.9},square:{label:`Square`,color:`#35B8FF`,face:`eyes`,faceX:50,faceY:50,faceScale:1},blob:{label:`Blob`,color:`#2FCB7A`,face:`eyes`,faceX:49.5,faceY:50,faceScale:1},ghost:{label:`Ghost`,color:`#F4F2FA`,face:`eyes`,faceX:50,faceY:48,faceScale:.95},circle:{label:`Circle`,color:`#9A62FF`,face:`eyes`,faceX:50,faceY:50,faceScale:1},drop:{label:`Drop`,color:`#1ED3C6`,face:`eyes`,faceX:50,faceY:62,faceScale:.9},star:{label:`Star`,color:`#FFD32B`,face:`eyes`,faceX:50,faceY:52,faceScale:.82},droid:{label:`Droid`,color:`#D5DBEA`,face:`eyes`,faceX:50,faceY:60,faceScale:.95},mech:{label:`Mech`,color:`#95A6C4`,face:`eyes`,faceX:50,faceY:59,faceScale:1},alien:{label:`Alien`,color:`#9BE85A`,face:`eyes`,faceX:50,faceY:45,faceScale:1.05},hexagon:{label:`Hexagon`,color:`#FF2A2A`,face:`eyes`,faceX:50,faceY:50,faceScale:.95},cat:{label:`Cat`,color:`#FF8C42`,face:`eyes`,faceX:50,faceY:58,faceScale:1},cloud:{label:`Cloud`,color:`#CFE6FF`,face:`eyes`,faceX:50,faceY:58,faceScale:.95},pill:{label:`Pill`,color:`#7B77F0`,face:`eyes`,faceX:50,faceY:50,faceScale:.9},pebble:{label:`Pebble`,color:`#2FCB7A`,face:`eyes`,faceX:50,faceY:50,faceScale:.95},puddle:{label:`Puddle`,color:`#FF2A2A`,face:`eyes`,faceX:50,faceY:50,faceScale:.95}},A5=Object.keys(k5);Object.fromEntries(A5.map(e=>[e,k5[e].color]));var j5={default:`idle`,working:`working`,sleeping:`sleeping`},M5={clover:`M26.53 22.38A25 25 0 0 1 73.47 22.38A7 7 0 0 0 77.62 26.53A25 25 0 0 1 77.62 73.47A7 7 0 0 0 73.47 77.62A25 25 0 0 1 26.53 77.62A7 7 0 0 0 22.38 73.47A25 25 0 0 1 22.38 26.53A7 7 0 0 0 26.53 22.38Z`,flower:`M31.2 19.82A20.5 20.5 0 0 1 68.8 19.82A5 5 0 0 0 72.9 22.8A20.5 20.5 0 0 1 84.51 58.55A5 5 0 0 0 82.95 63.37A20.5 20.5 0 0 1 52.54 85.47A5 5 0 0 0 47.46 85.47A20.5 20.5 0 0 1 17.05 63.37A5 5 0 0 0 15.49 58.55A20.5 20.5 0 0 1 27.1 22.8A5 5 0 0 0 31.2 19.82Z`,triangle:`M38.75 27.43A13 13 0 0 1 61.25 27.43L82.7 64.49A13 13 0 0 1 71.45 84L28.55 84A13 13 0 0 1 17.3 64.49L38.75 27.43Z`,square:`M93 50C93 53.66 92.96 58.23 92.88 60.97C92.8 63.71 92.67 64.81 92.51 66.44C92.35 68.08 92.15 69.44 91.9 70.77C91.66 72.1 91.37 73.3 91.04 74.44C90.72 75.58 90.35 76.63 89.94 77.63C89.53 78.63 89.07 79.55 88.58 80.43C88.08 81.31 87.54 82.13 86.96 82.9C86.37 83.67 85.75 84.39 85.07 85.07C84.39 85.75 83.67 86.37 82.9 86.96C82.13 87.54 81.31 88.08 80.43 88.58C79.55 89.07 78.63 89.53 77.63 89.94C76.63 90.35 75.58 90.72 74.44 91.04C73.3 91.37 72.1 91.66 70.77 91.9C69.44 92.15 68.08 92.35 66.44 92.51C64.81 92.67 63.71 92.8 60.97 92.88C58.23 92.96 53.66 93 50 93C46.34 93 41.77 92.96 39.03 92.88C36.29 92.8 35.19 92.67 33.56 92.51C31.92 92.35 30.56 92.15 29.23 91.9C27.9 91.66 26.7 91.37 25.56 91.04C24.42 90.72 23.37 90.35 22.37 89.94C21.37 89.53 20.45 89.07 19.57 88.58C18.69 88.08 17.87 87.54 17.1 86.96C16.33 86.37 15.61 85.75 14.93 85.07C14.25 84.39 13.63 83.67 13.04 82.9C12.46 82.13 11.92 81.31 11.42 80.43C10.93 79.55 10.47 78.63 10.06 77.63C9.65 76.63 9.28 75.58 8.96 74.44C8.63 73.3 8.34 72.1 8.1 70.77C7.85 69.44 7.65 68.08 7.49 66.44C7.33 64.81 7.2 63.71 7.12 60.97C7.04 58.23 7 53.66 7 50C7 46.34 7.04 41.77 7.12 39.03C7.2 36.29 7.33 35.19 7.49 33.56C7.65 31.92 7.85 30.56 8.1 29.23C8.34 27.9 8.63 26.7 8.96 25.56C9.28 24.42 9.65 23.37 10.06 22.37C10.47 21.37 10.93 20.45 11.42 19.57C11.92 18.69 12.46 17.87 13.04 17.1C13.63 16.33 14.25 15.61 14.93 14.93C15.61 14.25 16.33 13.63 17.1 13.04C17.87 12.46 18.69 11.92 19.57 11.42C20.45 10.93 21.37 10.47 22.37 10.06C23.37 9.65 24.42 9.28 25.56 8.96C26.7 8.63 27.9 8.34 29.23 8.1C30.56 7.85 31.92 7.65 33.56 7.49C35.19 7.33 36.29 7.2 39.03 7.12C41.77 7.04 46.34 7 50 7C53.66 7 58.23 7.04 60.97 7.12C63.71 7.2 64.81 7.33 66.44 7.49C68.08 7.65 69.44 7.85 70.77 8.1C72.1 8.34 73.3 8.63 74.44 8.96C75.58 9.28 76.63 9.65 77.63 10.06C78.63 10.47 79.55 10.93 80.43 11.42C81.31 11.92 82.13 12.46 82.9 13.04C83.67 13.63 84.39 14.25 85.07 14.93C85.75 15.61 86.37 16.33 86.96 17.1C87.54 17.87 88.08 18.69 88.58 19.57C89.07 20.45 89.53 21.37 89.94 22.37C90.35 23.37 90.72 24.42 91.04 25.56C91.37 26.7 91.66 27.9 91.9 29.23C92.15 30.56 92.35 31.92 92.51 33.56C92.67 35.19 92.8 36.29 92.88 39.03C92.96 41.77 93 46.34 93 50Z`,blob:`M93.92 50C94.18 51.9 94.24 53.9 93.99 55.79C93.73 57.68 93.18 59.61 92.39 61.36C91.6 63.1 90.48 64.78 89.27 66.27C88.07 67.76 86.58 69.08 85.14 70.29C83.7 71.49 82.1 72.5 80.62 73.5C79.14 74.49 77.64 75.34 76.24 76.24C74.84 77.15 73.51 78 72.2 78.93C70.88 79.86 69.66 80.83 68.36 81.8C67.06 82.76 65.78 83.82 64.39 84.74C63 85.67 61.55 86.63 60.01 87.35C58.47 88.08 56.82 88.73 55.15 89.1C53.48 89.47 51.71 89.64 50 89.57C48.29 89.5 46.55 89.16 44.91 88.68C43.27 88.21 41.67 87.47 40.16 86.72C38.65 85.96 37.24 85.02 35.86 84.13C34.48 83.24 33.19 82.29 31.89 81.37C30.58 80.46 29.32 79.56 28.03 78.63C26.74 77.71 25.44 76.82 24.16 75.84C22.88 74.86 21.57 73.87 20.36 72.74C19.15 71.62 17.95 70.42 16.91 69.1C15.88 67.79 14.92 66.35 14.15 64.85C13.38 63.35 12.76 61.73 12.29 60.1C11.81 58.48 11.52 56.78 11.29 55.1C11.06 53.41 10.98 51.71 10.91 50C10.83 48.29 10.83 46.59 10.83 44.84C10.84 43.1 10.85 41.34 10.93 39.53C11.02 37.72 11.09 35.86 11.34 33.99C11.59 32.12 11.88 30.16 12.43 28.31C12.99 26.46 13.69 24.56 14.66 22.88C15.64 21.21 16.86 19.58 18.27 18.27C19.69 16.96 21.4 15.84 23.17 15.03C24.93 14.22 26.95 13.71 28.89 13.43C30.83 13.15 32.9 13.21 34.82 13.36C36.74 13.5 38.66 13.92 40.43 14.28C42.2 14.65 43.87 15.16 45.46 15.54C47.06 15.93 48.52 16.31 50 16.58C51.48 16.85 52.87 17.02 54.32 17.17C55.77 17.32 57.22 17.36 58.71 17.49C60.2 17.62 61.74 17.7 63.28 17.95C64.81 18.19 66.39 18.5 67.91 18.98C69.43 19.46 70.95 20.08 72.38 20.83C73.81 21.58 75.19 22.5 76.5 23.5C77.81 24.5 79.03 25.63 80.22 26.81C81.41 27.99 82.54 29.25 83.65 30.57C84.76 31.89 85.85 33.26 86.89 34.72C87.93 36.18 88.98 37.69 89.9 39.31C90.82 40.92 91.73 42.64 92.4 44.42C93.07 46.2 93.66 48.1 93.92 50Z`,ghost:`M17 50C17 31.78 31.78 17 50 17C68.22 17 83 31.78 83 50V81.5Q72 93.5 61 81.5Q50 93.5 39 81.5Q28 93.5 17 81.5Z`,circle:`M50 8A42 42 0 1 1 50 92A42 42 0 1 1 50 8Z`,drop:`M50 8.5C52.2 8.5 53.4 10.3 56.4 15.2C62.9 25.5 84 44.6 84 61.5C84 80.3 68.8 92 50 92C31.2 92 16 80.3 16 61.5C16 44.6 37.1 25.5 43.6 15.2C46.6 10.3 47.8 8.5 50 8.5Z`,star:`M45.77 9.7A5 5 0 0 1 54.23 9.7L65.02 26.81A4 4 0 0 0 67.42 28.55L87.02 33.53A5 5 0 0 1 89.63 41.57L76.7 57.12A4 4 0 0 0 75.78 59.94L77.11 80.12A5 5 0 0 1 70.26 85.09L51.48 77.59A4 4 0 0 0 48.52 77.59L29.74 85.09A5 5 0 0 1 22.89 80.12L24.22 59.94A4 4 0 0 0 23.3 57.12L10.37 41.57A5 5 0 0 1 12.98 33.53L32.58 28.55A4 4 0 0 0 34.98 26.81L45.77 9.7Z`,droid:`M16 50C16 38.95 24.95 30 36 30H64C75.05 30 84 38.95 84 50V70C84 81.05 75.05 90 64 90H36C24.95 90 16 81.05 16 70ZM4 62A7 7 0 1 1 18 62A7 7 0 1 1 4 62ZM82 62A7 7 0 1 1 96 62A7 7 0 1 1 82 62Z`,mech:`M10 48C10 38.06 18.06 30 28 30H72C81.94 30 90 38.06 90 48V70C90 79.94 81.94 88 72 88H28C18.06 88 10 79.94 10 70ZM3 54C3 51.79 4.79 50 7 50H11V72H7C4.79 72 3 70.21 3 68ZM89 50H93C95.21 50 97 51.79 97 54V68C97 70.21 95.21 72 93 72H89Z`,alien:`M50 10C70 10 83 27 83 46C83 65 64 92 50 92C36 92 17 65 17 46C17 27 30 10 50 10Z`,hexagon:`M91.4 45.5A9 9 0 0 1 91.4 54.5L74.6 83.61A9 9 0 0 1 66.8 88.11L33.2 88.11A9 9 0 0 1 25.4 83.61L8.6 54.5A9 9 0 0 1 8.6 45.5L25.4 16.39A9 9 0 0 1 33.2 11.89L66.8 11.89A9 9 0 0 1 74.6 16.39L91.4 45.5Z`,cat:`M50 20A36 36 0 1 1 50 92A36 36 0 1 1 50 20ZM24.72 44.64A4.5 4.5 0 0 1 17.35 40.67L20.21 16.66A4.5 4.5 0 0 1 26.86 13.26L42.3 21.83A4.5 4.5 0 0 1 43.02 29.21L24.72 44.64ZM82.65 40.67A4.5 4.5 0 0 1 75.28 44.64L56.98 29.21A4.5 4.5 0 0 1 57.7 21.83L73.14 13.26A4.5 4.5 0 0 1 79.79 16.66L82.65 40.67Z`,cloud:`M19 44A25 25 0 1 1 69 44A25 25 0 1 1 19 44ZM47 50A21 21 0 1 1 89 50A21 21 0 1 1 47 50ZM7 68A17 17 0 1 1 41 68A17 17 0 1 1 7 68ZM32 73A18 18 0 1 1 68 73A18 18 0 1 1 32 73ZM60 70A16 16 0 1 1 92 70A16 16 0 1 1 60 70Z`,pill:`M28 28H72C84.15 28 94 37.85 94 50C94 62.15 84.15 72 72 72H28C15.85 72 6 62.15 6 50C6 37.85 15.85 28 28 28Z`,pebble:`M94.6 50C94.71 51.92 94.56 53.93 94.17 55.82C93.79 57.7 93.13 59.6 92.28 61.33C91.44 63.06 90.32 64.72 89.1 66.19C87.87 67.67 86.41 69.01 84.92 70.16C83.42 71.31 81.75 72.29 80.11 73.1C78.47 73.92 76.73 74.55 75.06 75.06C73.39 75.58 71.7 75.91 70.1 76.2C68.5 76.48 66.93 76.62 65.45 76.76C63.96 76.9 62.55 76.94 61.2 77.03C59.84 77.11 58.57 77.16 57.31 77.26C56.05 77.36 54.86 77.48 53.64 77.63C52.42 77.79 51.24 77.98 50 78.18C48.76 78.39 47.52 78.64 46.2 78.85C44.89 79.06 43.53 79.3 42.11 79.46C40.69 79.61 39.2 79.75 37.67 79.77C36.14 79.78 34.54 79.74 32.95 79.54C31.35 79.33 29.7 79.03 28.1 78.55C26.49 78.07 24.86 77.45 23.33 76.67C21.8 75.88 20.29 74.94 18.92 73.85C17.54 72.77 16.23 71.51 15.08 70.16C13.94 68.8 12.9 67.29 12.04 65.72C11.17 64.16 10.45 62.46 9.91 60.74C9.36 59.03 8.98 57.22 8.76 55.43C8.55 53.64 8.5 51.8 8.6 50C8.71 48.2 8.98 46.39 9.38 44.65C9.79 42.91 10.35 41.19 11.02 39.56C11.7 37.92 12.52 36.34 13.43 34.85C14.34 33.37 15.39 31.96 16.5 30.66C17.61 29.36 18.84 28.15 20.11 27.07C21.39 25.98 22.76 25 24.15 24.15C25.54 23.3 27.01 22.56 28.48 21.95C29.94 21.33 31.46 20.85 32.95 20.46C34.44 20.08 35.95 19.83 37.43 19.66C38.91 19.48 40.38 19.43 41.81 19.43C43.24 19.43 44.64 19.53 46.01 19.66C47.37 19.78 48.7 19.98 50 20.18C51.3 20.39 52.57 20.63 53.83 20.87C55.1 21.11 56.34 21.37 57.6 21.62C58.87 21.87 60.13 22.12 61.43 22.39C62.74 22.66 64.07 22.93 65.45 23.24C66.83 23.56 68.25 23.88 69.72 24.3C71.19 24.72 72.71 25.17 74.25 25.75C75.78 26.34 77.37 27 78.91 27.81C80.46 28.63 82.04 29.56 83.5 30.66C84.97 31.75 86.43 33 87.7 34.38C88.98 35.77 90.19 37.32 91.17 38.97C92.14 40.62 92.98 42.43 93.56 44.27C94.13 46.1 94.5 48.08 94.6 50Z`,puddle:`M85.34 50C85.65 51.54 85.9 53.13 86.01 54.74C86.11 56.35 86.11 58 85.95 59.63C85.8 61.26 85.51 62.93 85.07 64.52C84.62 66.12 84.03 67.72 83.3 69.23C82.58 70.74 81.7 72.21 80.72 73.57C79.74 74.94 78.62 76.23 77.43 77.43C76.24 78.62 74.93 79.72 73.58 80.73C72.23 81.74 70.79 82.65 69.33 83.48C67.86 84.31 66.34 85.04 64.79 85.71C63.24 86.37 61.65 86.95 60.04 87.46C58.42 87.96 56.77 88.4 55.1 88.75C53.43 89.09 51.72 89.37 50 89.54C48.28 89.71 46.52 89.81 44.76 89.76C43.01 89.72 41.22 89.58 39.47 89.29C37.72 89 35.95 88.58 34.26 88C32.57 87.42 30.89 86.69 29.33 85.8C27.77 84.92 26.26 83.87 24.91 82.7C23.56 81.53 22.3 80.19 21.23 78.77C20.16 77.35 19.22 75.79 18.47 74.2C17.71 72.61 17.13 70.91 16.7 69.23C16.26 67.55 16.02 65.81 15.88 64.13C15.75 62.45 15.78 60.76 15.88 59.14C15.97 57.52 16.21 55.94 16.45 54.42C16.7 52.89 17.03 51.43 17.34 50C17.65 48.57 18 47.2 18.32 45.83C18.63 44.46 18.94 43.13 19.24 41.76C19.53 40.39 19.79 39.03 20.08 37.61C20.36 36.18 20.62 34.74 20.95 33.23C21.28 31.72 21.61 30.16 22.07 28.57C22.52 26.98 23.02 25.32 23.69 23.69C24.35 22.06 25.11 20.38 26.05 18.79C26.99 17.21 28.08 15.62 29.33 14.2C30.58 12.78 32 11.41 33.54 10.26C35.08 9.12 36.8 8.11 38.57 7.35C40.34 6.6 42.27 6.04 44.17 5.73C46.08 5.43 48.08 5.37 50 5.54C51.92 5.71 53.87 6.15 55.69 6.75C57.52 7.36 59.3 8.22 60.94 9.19C62.57 10.15 64.11 11.33 65.51 12.56C66.91 13.78 68.17 15.15 69.33 16.52C70.48 17.89 71.5 19.34 72.44 20.76C73.38 22.18 74.19 23.62 74.97 25.03C75.75 26.43 76.44 27.83 77.12 29.19C77.8 30.56 78.42 31.89 79.05 33.23C79.67 34.57 80.28 35.87 80.87 37.21C81.46 38.55 82.05 39.88 82.6 41.27C83.14 42.65 83.68 44.05 84.14 45.51C84.6 46.96 85.03 48.46 85.34 50Z`},N5={droid:`M47.5 14H52.5V32H47.5ZM43 11A7 7 0 1 1 57 11A7 7 0 1 1 43 11Z`,mech:`M19.5 32L24.5 32L17 13L12 13ZM75.5 32L80.5 32L88 13L83 13ZM10 11.5A4.5 4.5 0 1 1 19 11.5A4.5 4.5 0 1 1 10 11.5ZM81 11.5A4.5 4.5 0 1 1 90 11.5A4.5 4.5 0 1 1 81 11.5Z`};function P5(e){let t=e.trim(),n=t.match(/^hsla?\(\s*([\d.]+)(?:deg)?[,\s]+([\d.]+)%[,\s]+([\d.]+)%/i);if(n)return Qpe([Number(n[1])/360,Number(n[2])/100,Number(n[3])/100]);let r=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(r){let e=r[1];e.length===3&&(e=e.split(``).map(e=>e+e).join(``));let t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}let i=t.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i);return i?[Number(i[1]),Number(i[2]),Number(i[3])]:null}function qpe(e){let t=P5(e);if(!t)return .5;let n=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*n(t[0])+.7152*n(t[1])+.0722*n(t[2])}var Jpe=`#1E1A33`,Ype=`#F7F5F2`;function Xpe(e){return qpe(e)<.13?Ype:Jpe}function Zpe([e,t,n]){e/=255,t/=255,n/=255;let r=Math.max(e,t,n),i=Math.min(e,t,n),a=(r+i)/2;if(r===i)return[0,0,a];let o=r-i,s=a>.5?o/(2-r-i):o/(r+i),c=0;return c=r===e?(t-n)/o+(t<n?6:0):r===t?(n-e)/o+2:(e-t)/o+4,[c/6,s,a]}function Qpe([e,t,n]){if(t===0)return[n*255,n*255,n*255];let r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=e=>(e=(e%1+1)%1,e<1/6?i+(r-i)*6*e:e<1/2?r:e<2/3?i+(r-i)*(2/3-e)*6:i);return[a(e+1/3)*255,a(e)*255,a(e-1/3)*255]}function $pe([e,t,n]){return`hsl(${(e*360).toFixed(1)} ${(t*100).toFixed(1)}% ${(n*100).toFixed(1)}%)`}var F5=e=>Math.min(1,Math.max(0,e));function I5(e,t,n=0){let r=P5(e);if(!r)return e;let[i,a,o]=Zpe(r);return $pe([i,F5(a+n+(t<0?-t*.25:0)),F5(o+t)])}var L5=[`default`,`working`,`sleeping`],R5=.68,z5=26,eme=.2,B5={height:z5,time:R5,stretch:1,squash:1.15,squashTime:.37,squashEase:`pulse`,groundTime:.11,groundEase:`pulse`,riseTime:.33,riseEase:`pulse`,clickSquashTime:.24,spin:1,lean:6,every:8,land:0},V5=(e,t)=>t?e.clickSquashTime:eme*e.time,H5=(e,t)=>V5(e,t)+e.time+U5[e.squashEase]*(t?e.clickSquashTime:e.squashTime)+Math.max(0,e.groundTime)+e.riseTime+Math.max(0,e.land)+.05,U5={sharp:0,pulse:2/7,soft:.5,bouncy:.144},W5=(e,t)=>{if(e<=0)return 1;if(e>=1)return 0;switch(t){case`sharp`:return(1-e)*(1-e);case`soft`:return .5+.5*Math.cos(Math.PI*e);case`bouncy`:return Math.exp(-3.2*e)*Math.cos(5.4*e)-e*e*e*.026;default:{let t=4.2*e;return(1+t)*Math.exp(-t)-e*e*e*.078}}},G5=(e,t)=>1+.25*K5(e,t),K5=(e,t)=>{if(e<=0||e>=1)return 0;let n;switch(t){case`sharp`:n=(1-e)*(1-e);break;case`soft`:n=Math.sin(Math.PI*e)**2;break;case`bouncy`:n=Math.exp(-3.15*e)*Math.sin(8.43*e)/.596;break;default:{let t=7*e;n=t*t*Math.exp(2-t)/4}}let r=e>.85?1-(e-.85)/.15:1;return n*r*r*(3-2*r)},q5=e=>Math.exp(-((Math.min(Math.abs(e),Math.abs(e-1))/.11)**2)),J5=Math.PI/180,Y5=Math.PI*2,tme={default:1.2,working:.7,sleeping:1.4},nme=1;function rme(e){let t=e*2654435761>>>0||1;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function X5(e,t,n,r){return e+(t-e)*(1-Math.exp(-n*r))}var Z5=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,ime=e=>.5-.5*Math.cos(Math.PI*e),Q5=class{constructor(e,t,n,r,i,a=!1){this.rand=e,this.amp=t,this.holdMin=n,this.holdMax=r,this.rate=i,this.spring=a,this.value=0,this.vel=0,this.target=0,this.next=0}update(e,t){if(e>=this.next&&(this.target=(this.rand()*2-1)*this.amp,this.next=e+this.holdMin+this.rand()*(this.holdMax-this.holdMin)),this.spring){let e=this.rate*1.6;this.vel+=(e*e*(this.target-this.value)-1.8*e*this.vel)*t,this.value+=this.vel*t}else this.value=X5(this.value,this.target,this.rate,t)}aim(e){this.target=e,this.next=1/0}set(e,t,n,r){this.amp=e,this.holdMin=t,this.holdMax=n,this.rate=r,this.next=0}},$5=class{constructor(e){this.duration=e,this.p=-1}fire(){this.p=0}get active(){return this.p>=0}update(e){this.p<0||(this.p+=e/this.duration,this.p>=1&&(this.p=-1))}},e7=35*J5,t7=14*J5,n7=3.2*J5,ame=2.6,r7={default:{pitch:0,roll:0,y:0,lookX:0,lookY:0},working:{pitch:5*J5,roll:0,y:0,lookX:0,lookY:0},sleeping:{pitch:-16*J5,roll:6*J5,y:3,lookX:0,lookY:1}},ome=class{constructor(e,t=`default`){this.pose={yaw:0,pitch:0,roll:0,x:0,y:0,sx:1,sy:1,eyeOpen:1,blinkL:0,blinkR:0,lookX:0,lookY:0,breath:0,laugh:0,whirl:0,whirlAngle:0,w:[1,0,0]},this.state=`default`,this.t=0,this.wFrom=[1,0,0],this.tr=1,this.trDuration=1.2,this.blink=new $5(.17),this.blinkAgain=!1,this.dart=new $5(.12),this.dartX=0,this.dartY=0,this.flip=new $5(H5(B5,!1)),this.flipPoked=!1,this.jump={...B5},this.flipSide=1,this.nod=new $5(1.7),this.hopPhase=0,this.hopCount=0,this.hopGain=0,this.laughEv=new $5(.8),this.prevYaw=0,this.jelly=0,this.jellyV=0,this.gazeLead=0,this.gazeDir=[0,0],this.gazeAt=0,this.turnK=1,this.breathPhase=0,this.ptrX=0,this.ptrY=0,this.ptrS=0,this.ptrTargetX=0,this.ptrTargetY=0,this.ptrTargetS=0,this.baseYaw=0,this.rand=rme(Math.floor(e*1e6)+1);let n=this.rand;this.yawW=new Q5(n,36*J5,1.1,2.6,3,!0),this.pitchW=new Q5(n,10*J5,1.1,2.6,2.6,!0),this.rollW=new Q5(n,5*J5,1.6,3.2,2,!0),this.lookXW=new Q5(n,3.6,.5,2,14),this.lookYW=new Q5(n,2.4,.5,2,14),this.t=n()*10,this.hopPhase=n(),this.breathPhase=n(),this.blinkAt=this.t+1+n()*3,this.flipAt=this.nextFlip(this.t,1),this.nodAt=this.t+3+n()*4,this.dartAt=this.t+1+n()*2,this.laughAt=this.t+.6+n()*1.5,this.setState(t,!0)}setState(e,t=!1){if(e===this.state&&!t)return;let n=this.state;this.state=e;let r=this.pose.w;if(t){for(let t=0;t<3;t++)r[t]=+(L5[t]===e);this.tr=1}else this.wFrom=[r[0],r[1],r[2]],this.tr=0,this.trDuration=n===`sleeping`?nme:tme[e];switch(e){case`default`:this.yawW.set(e7,2.6,5.4,2),this.pitchW.set(t7,2.8,5.8,1.8),this.rollW.set(n7,3.4,6.6,1.5),this.gazeAt=0,this.gazeDir=[0,0],this.lookXW.set(3.6,.6,2.2,13),this.lookYW.set(2.4,.6,2.2,13),this.flipAt=this.nextFlip(this.t,.6);break;case`working`:this.yawW.set(16*J5,.9,1.8,4),this.pitchW.set(3*J5,1.2,2.4,3),this.rollW.set(0,1,2,3),this.lookXW.set(2,.5,1.2,12),this.lookYW.set(1,.5,1.2,12),this.hopPhase=0,this.hopCount=0,this.laughAt=this.t+.5+this.rand()*1.2;break;case`sleeping`:this.yawW.set(7*J5,3,6,.7),this.pitchW.set(3*J5,3,6,.7),this.rollW.set(2*J5,3,6,.6),this.lookXW.set(0,2,4,2),this.lookYW.set(0,2,4,2),this.nodAt=this.t+2.5+this.rand()*4}}setPointer(e,t,n){this.ptrTargetX=Math.max(-1.2,Math.min(1.2,e)),this.ptrTargetY=Math.max(-1.2,Math.min(1.2,t)),this.ptrTargetS=Math.max(0,Math.min(1,n))}poke(){this.flip.active&&this.flip.p<.6||(this.flipPoked=!0,this.flip.duration=H5(this.jump,!0),this.flipSide=this.rand()<.5?-1:1,this.flip.fire(),this.flipAt=this.nextFlip(this.t,1.1))}setTurn(e){let t=Math.max(0,e);t!==this.turnK&&(this.turnK=t,this.state==="default"&&(this.gazeAt=0))}setJump(e){let t=this.jump.every;Object.assign(this.jump,e),e.every!==void 0&&e.every!==t&&(this.flipAt=this.nextFlip(this.t,1))}nextGaze(){let e=this.rand,[t,n]=this.gazeDir;if(t!==0||n!==0){let r=e();return r<.66?[-t,-n]:r<.85?[-t,n]:[0,0]}let r=[[1,-1],[-1,1],[-1,-1],[1,1]];return r[Math.floor(e()*r.length)]}nextFlip(e,t){let n=this.jump.every;return n>0?e+n*t*(.625+this.rand()*.75):1/0}update(e){e=Math.min(e,.05),this.t+=e;let t=this.t,n=this.pose,r=n.w;if(this.tr<1){this.tr=Math.min(1,this.tr+e/this.trDuration);let t=ime(this.tr);for(let e=0;e<3;e++){let n=+(L5[e]===this.state);r[e]=this.wFrom[e]+(n-this.wFrom[e])*t}}let[i,a,o]=r,s={pitch:0,roll:0,y:0,lookX:0,lookY:0};for(let e=0;e<3;e++){let t=r7[L5[e]];s.pitch+=t.pitch*r[e],s.roll+=t.roll*r[e],s.y+=t.y*r[e],s.lookX+=t.lookX*r[e],s.lookY+=t.lookY*r[e]}if(this.state==="default"&&t>=this.gazeAt){let[e,n]=this.nextGaze();this.gazeDir=[e,n];let r=.84+this.rand()*.16;this.yawW.aim(e*e7*r*this.turnK),this.pitchW.aim(n*t7*r),this.rollW.aim(e*n7*r*this.turnK),this.gazeAt=t+ame+this.rand()*1.8000000000000003}this.yawW.update(t,e),this.pitchW.update(t,e),this.rollW.update(t,e),this.lookXW.update(t,e),this.lookYW.update(t,e),this.ptrS=X5(this.ptrS,this.ptrTargetS,8,e),this.ptrX=X5(this.ptrX,this.ptrTargetX,14,e),this.ptrY=X5(this.ptrY,this.ptrTargetY,14,e);let c=this.ptrS,l=1-.75*c;this.baseYaw=X5(this.baseYaw,this.yawW.value*l+22*J5*this.ptrX*c,5,e);let u=s.pitch+this.pitchW.value*l-12*J5*this.ptrY*c,d=s.roll+this.rollW.value*l,f=s.y,p=s.lookX+this.lookXW.value*l+4.5*this.ptrX*c,m=s.lookY+this.lookYW.value*l+3*this.ptrY*c,h=0,g=0,_=1,v=1,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e)));return r*r*(3-2*r)},O=e=>D(.1,.26,e)*(1-D(.66,.9,e)),k=e=>Y5*(1.5*e+.9*Z5(e));if(t>=this.blinkAt&&!this.blink.active&&i+a>.5&&(this.blink.fire(),this.blinkAgain=!this.blinkAgain&&this.rand()<.22,this.blinkAt=t+(this.blinkAgain?.28:2.2+this.rand()*2.6)),this.blink.update(e),this.blink.active&&(x=Math.sin(Math.PI*this.blink.p)),t>=this.dartAt&&!this.dart.active&&i+a>.5&&(this.dart.fire(),this.dartX=(this.rand()*2-1)*4,this.dartY=(this.rand()*2-1)*2,this.dart.duration=.25+this.rand()*.45,this.dartAt=t+1.2+this.rand()*2.6),this.dart.update(e),this.dart.active){let e=this.dart.p,t=e<.15?e/.15:e>.8?(1-e)/.2:1;S+=this.dartX*t*(i+a),C+=this.dartY*t*(i+a)}if(this.state==="default"&&t>=this.flipAt&&!this.flip.active&&(this.flipPoked=!1,this.flip.duration=H5(this.jump,!1),this.flipSide=this.rand()<.5?-1:1,this.flip.fire(),this.flipAt=this.nextFlip(t,1)),this.flip.update(e),this.flip.active){let e=this.jump,t=V5(e,this.flipPoked),n=(this.flip.p*this.flip.duration-t)/e.time,r=Math.min(1,Math.max(0,n)),i=Math.sin(Math.PI*r);h+=Y5*e.spin*Z5(r),g-=e.height*i;let a=(n-1)*e.time-e.land,o=this.flipPoked?e.clickSquashTime:e.squashTime,s=e=>this.flipPoked?e*e*(3-2*e):q5(e-1),c=Math.max(0,e.groundTime),l=U5[e.squashEase]*o,u=a-l-c,d=a<=l?K5(a/o,e.squashEase):u<=0?G5((a-l)/c,e.groundEase):W5(u/e.riseTime,e.riseEase),f=(n<0?s(Math.max(0,1+n*e.time/t)):a>0?d:n<.2?q5(n):0)*e.squash;_+=.16*f-.06*i*e.stretch,v+=-.18*f+.09*i*e.stretch,b+=this.flipSide*e.lean*J5*i,e.spin>0&&(w=Math.max(w,i),T=Math.max(T,O(r)),E=k(r))}let A=this.jump,j=Math.max(0,A.groundTime),ee=j+A.riseTime;if(this.state===`working`&&(this.hopGain=a),this.hopGain>.02&&(this.state===`working`||this.hopPhase>0)){this.hopPhase+=e/R5,this.hopPhase>=1&&(this.state===`working`?(--this.hopPhase,this.hopCount+=1):(this.hopPhase-1)*R5>=ee&&(this.hopPhase=0,this.hopGain=0));let t=this.hopGain,n=Math.min(1,this.hopPhase),r=Math.sin(Math.PI*n),i=this.hopCount%3==2;g-=(i?z5:18)*r*t;let a=this.state!==`working`&&this.hopPhase>1?(this.hopPhase-1)*R5:-1,o=a<0?q5(this.hopPhase):a<j?G5(a/j,A.groundEase):W5((a-j)/A.riseTime,A.riseEase);_+=(.16*o-.06*r)*t,v+=(-.18*o+.09*r)*t,i&&(h+=Y5*Z5(n)*t,w=Math.max(w,r*t),O(n)*t>T&&(T=O(n)*t,E=k(n))),b+=(this.hopCount%2==0?1:-1)*6*J5*r*t}if(this.state===`working`&&t>=this.laughAt&&!this.laughEv.active&&(this.laughEv.fire(),this.laughEv.duration=.6+this.rand()*.5,this.laughAt=t+1.6+this.rand()*2.2),this.laughEv.update(e),this.laughEv.active){let e=this.laughEv.p;w=Math.max(w,e<.18?e/.18:e>.78?(1-e)/.22:1)}if(this.state===`sleeping`&&t>=this.nodAt&&!this.nod.active&&(this.nod.fire(),this.nodAt=t+4+this.rand()*4),this.nod.update(e),this.nod.active){let e=this.nod.p,t=e<.72?Z5(e/.72):1-Z5((e-.72)/.28);y-=13*J5*t*o}this.breathPhase+=e/(3.6+1.2*o);let M=Math.sin(this.breathPhase*Y5);n.breath=M,_+=M*(.008+.014*o),v+=M*(.012+.02*o);let te=Math.sin(t*Y5/3.4)*2*(1-o);n.yaw=this.baseYaw+h;let ne=this.baseYaw-this.prevYaw;ne=((ne+Math.PI)%Y5+Y5)%Y5-Math.PI,this.prevYaw=this.baseYaw;let N=e>0?Math.abs(ne)/e:0,re=e>0?Math.max(-2.2,Math.min(2.2,ne/e*2.4)):0;this.gazeLead=X5(this.gazeLead,re,9,e);let ie=Math.min(.22,.055*N);this.jellyV+=(256*(ie-this.jelly)-14.4*this.jellyV)*e,this.jelly+=this.jellyV*e;let ae=Math.max(-.08,Math.min(.28,this.jelly))*.6;_*=1+ae,v*=1-.55*ae,n.pitch=u+y,n.roll=d+b,n.x=0,n.y=f+g+te,n.sx=_,n.sy=v,n.eyeOpen=1,n.laugh=X5(n.laugh,w,30,e),n.blinkL=x,n.blinkR=x,n.lookX=p+S+this.gazeLead,n.lookY=m+C,n.whirl=T,n.whirlAngle=E}};function i7(e){let t=r7[e];return{yaw:0,pitch:t.pitch,roll:t.roll,x:0,y:t.y,sx:1,sy:1,eyeOpen:1,blinkL:0,blinkR:0,lookX:t.lookX,lookY:t.lookY,breath:0,laugh:0,whirl:0,whirlAngle:0,w:L5.map(t=>+(t===e))}}var a7=64,o7=4096,s7=24,sme=0xe8d4a51000,c7=48*Math.PI/180,l7=Math.cos(c7),cme=Math.sin(c7),lme=(e,t)=>t+(1-t)*Math.sqrt(Math.max(0,1-e*e));function u7(e,t,n,r,i,a){let o=0;i[0]=0,a[0]=-1e30,a[1]=1e30;for(let n=1;n<t;n++){let t=0;for(;;){let r=i[o];if(t=(e[n]+n*n-e[r]-r*r)/(2*(n-r)),t>a[o])break;o--}o++,i[o]=n,a[o]=t,a[o+1]=1e30}o=0;for(let s=0;s<t;s++){for(;a[o+1]<s;)o++;let t=i[o];n[s]=(s-t)*(s-t)+e[t],r[s]=t}}function d7(e,t,n,r,i){let a=new Float32Array(n),o=new Float32Array(n),s=new Int32Array(n),c=new Int32Array(n),l=new Float32Array(n+1),u=new Float32Array(n*n),d=new Int32Array(n*n);for(let r=0;r<n;r++){for(let i=0;i<n;i++)a[i]=e[i*n+r]===t?0:sme;u7(a,n,o,s,c,l);for(let e=0;e<n;e++)u[e*n+r]=o[e],d[e*n+r]=s[e]}for(let e=0;e<n;e++){let t=e*n;for(let e=0;e<n;e++)a[e]=u[t+e];u7(a,n,o,s,c,l);for(let e=0;e<n;e++)r[t+e]=o[e],i&&(i[t+e]=d[t+s[e]]*n+s[e])}}function f7(e,t,n){for(let r=0;r<t;r++){let i=r*t;for(let r=0;r<t;r++){let a=r<2?0:r-2,o=r<1?0:r-1,s=r>t-2?t-1:r+1,c=r>t-3?t-1:r+2;n[i+r]=(e[i+a]+4*e[i+o]+6*e[i+r]+4*e[i+s]+e[i+c])*.0625}}for(let r=0;r<t;r++)for(let i=0;i<t;i++){let a=i<2?0:i-2,o=i<1?0:i-1,s=i>t-2?t-1:i+1,c=i>t-3?t-1:i+2;e[i*t+r]=(n[a*t+r]+4*n[o*t+r]+6*n[i*t+r]+4*n[s*t+r]+n[c*t+r])*.0625}}function ume(e,t,n){let r=[];for(let n=t,i=1;i<=4&&n%2==0||i===1;n>>=1,i<<=1){let a=new Uint8Array(n*n);for(let r=0;r<n;r++)for(let o=0;o<n;o++){let s=0;for(let n=0;n<i;n++)for(let a=0;a<i;a++)s+=e[(r*i+n)*t+o*i+a];a[r*n+o]=+(s>=128*i*i)}if(r.push({n,mask:a,phi:new Float32Array(n*n)}),i===4)break}let i=(e,t,n,r)=>{let{n:i,mask:a,phi:o}=e,s=t*t;for(let e=0;e<n;e++)for(let e=1;e<i-1;e++){let t=e*i;for(let e=1;e<i-1;e++){let n=t+e;if(!a[n])continue;let c=(o[n-1]+o[n+1]+o[n-i]+o[n+i]+s)*.25;o[n]+=r*(c-o[n])}}};for(let e=r.length-1;e>=0;e--){let t=r[e],a=1<<e;if(e<r.length-1){let n=r[e+1],i=t.n,a=n.n;for(let e=0;e<i;e++){let r=Math.min(a-1,Math.max(0,(e+.5)/2-.5)),o=r|0,s=Math.min(a-1,o+1),c=r-o;for(let r=0;r<i;r++){let l=e*i+r;if(!t.mask[l])continue;let u=Math.min(a-1,Math.max(0,(r+.5)/2-.5)),d=u|0,f=Math.min(a-1,d+1),p=u-d;t.phi[l]=(n.phi[o*a+d]*(1-p)+n.phi[o*a+f]*p)*(1-c)+(n.phi[s*a+d]*(1-p)+n.phi[s*a+f]*p)*c}}}let o=Math.min(1.9,2/(1+Math.sin(Math.PI/t.n))-.05);i(t,n*a,4,1),i(t,n*a,e===2?100:e===1?30:16,o),i(t,n*a,8,1)}return r[0].phi}var dme=[1,1,0,-1,-1,-1,0,1],fme=[0,1,1,1,0,-1,-1,-1],pme=[1,Math.SQRT2,1,Math.SQRT2,1,Math.SQRT2,1,Math.SQRT2];function mme(e,t,n){let r=106/t,i=t*t,a=new Uint8Array(i);for(let t=0;t<i;t++)a[t]=+(e[t]>=128);let o=new Float32Array(i),s=new Float32Array(i),c=new Int32Array(i);d7(a,0,t,o,null),d7(a,1,t,s,c);let l=new Float32Array(i),u=new Float32Array(i);for(let t=0;t<i;t++){let n=e[t]/255;l[t]=r*(n>0&&n<1?n-.5:a[t]?Math.sqrt(o[t])-.5:.5-Math.sqrt(s[t]))}f7(l,t,u),f7(l,t,u);let d=ume(e,t,r),f=0;for(let e=0;e<i;e++)d[e]>f&&(f=d[e]);let p=2*Math.sqrt(f),m=Math.min(.9*n+.12*p,1.2*p),h=f>0?m/Math.sqrt(f):0,g=new Float32Array(i);for(let e=0;e<i;e++)g[e]=d[e]>0?h*Math.sqrt(d[e]):0;f7(g,t,u);let _={N:t,i00:new Uint16Array(i),wx:new Uint8Array(i),wy:new Uint8Array(i),ao:new Uint8Array(i)},{i00:v,wx:y,wy:b,ao:x}=_,S=t<=64?[1,2,3,5,8]:t<=96?[1,2,4,7,11]:[1,2,4,7,11,15],C=t-1;for(let e=0;e<t;e++)for(let n=0;n<t;n++){let i=e*t+n,o=a[i]?i:s[i]<=9?c[i]:-1;if(o<0)continue;let u=o%t,d=(o-u)/t,f=u>0?u-1:0,p=u<C?u+1:C,m=d>0?d-1:0,h=d<C?d+1:C,_=-(g[d*t+p]-g[d*t+f])/(2*r),w=-(g[h*t+u]-g[m*t+u])/(2*r),T=1,E=Math.sqrt(_*_+w*w+1);_/=E,w/=E,T/=E;let D=Math.max(0,l[o]);if(D<2){let e=l[d*t+p]-l[d*t+f],n=l[h*t+u]-l[m*t+u],r=Math.hypot(e,n)||1;e/=r,n/=r;let i=.7*(1-D/2);_+=i*(-e-_),w+=i*(-n-w),T+=i*(0-T),E=Math.sqrt(_*_+w*w+T*T)||1,_/=E,w/=E,T/=E}let O=g[o],k=0;for(let e=0;e<8;e++){let n=0;for(let i=0;i<S.length;i++){let a=S[i],o=u+dme[e]*a,s=d+fme[e]*a;o<0?o=0:o>C&&(o=C),s<0?s=0:s>C&&(s=C);let c=(g[s*t+o]-O)/(a*r*pme[e]);c>n&&(n=c)}k+=n/Math.sqrt(1+n*n)}let A=1-Math.min(1,D/3),j=1-.2*A*A,ee=(1-.9*k/8)**1.5*j;x[i]=Math.max(1,Math.round(255*ee**(1/2.2)));let M=(_*.5+.5)*63,te=(w*.5+.5)*63,ne=Math.min(62,Math.max(0,M|0)),N=Math.min(62,Math.max(0,te|0));v[i]=N*a7+ne,y[i]=Math.round(255*Math.min(1,Math.max(0,M-ne))),b[i]=Math.round(255*Math.min(1,Math.max(0,te-N)))}return _}function p7(e){if(typeof OffscreenCanvas==`function`)return new OffscreenCanvas(e,e);if(typeof document<`u`){let t=document.createElement(`canvas`);return t.width=t.height=e,t}return null}function m7(e,t){return e.getContext(`2d`,t?{willReadFrequently:!0}:void 0)}function hme(e,t){let n=p7(t),r=n&&m7(n,!0);if(!r)return null;let i=106/t;r.setTransform(1/i,0,0,1/i,3/i,3/i),r.fillStyle=`#fff`,r.fill(e);let a=r.getImageData(0,0,t,t).data,o=new Uint8ClampedArray(t*t);for(let e=0;e<t*t;e++)o[e]=a[e*4+3];return o}var h7=new Map,g7=new Set,_7=new WeakMap,gme=0;function v7(e){let t=_7.get(e);return t||_7.set(e,t=`p${gme++}`),t}var y7=[],b7=!1;function x7(){b7=!1;let e=y7.shift();e&&e(),y7.length&&S7()}function S7(){if(b7)return;b7=!0;let e=globalThis.requestIdleCallback;e?e(x7,{timeout:120}):setTimeout(x7,16)}function _me(e){y7.push(e),S7()}function C7(e,t,n,r,i){let a=`${e}|${n}|${Math.round(r)}`,o=h7.get(a);if(o)return o;let s=()=>{if(g7.delete(a),h7.has(a))return;let e=hme(t,n);e&&(h7.size>=48&&h7.clear(),h7.set(a,mme(e,n,r)))};return i?(s(),h7.get(a)??null):(g7.has(a)||(g7.add(a),_me(s)),null)}function vme(e,t,n=192,r=.65){C7(e,t,w7(n),15*r,!0)}function w7(e){return e<=100?64:e<=224?96:128}var T7=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,E7=new Map;function yme(e){let t=E7.get(e);if(!t){let n=P5(e);if(!n){let t=p7(1),r=t&&m7(t,!0);if(r){r.fillStyle=e,r.fillRect(0,0,1,1);let t=r.getImageData(0,0,1,1).data;n=[t[0],t[1],t[2]]}else n=[128,128,128]}t=[T7(n[0]/255),T7(n[1]/255),T7(n[2]/255)],E7.size>200&&E7.clear(),E7.set(e,t)}return t}var D7=2048,O7=2.5,k7=D7/O7,A7=new Float32Array(D7);for(let e=0;e<D7;e++){let t=(e+.5)/k7,n=t<=.75?t:.75+.25*(1-Math.exp(-(t-.75)/.25));A7[e]=255*(n<=.0031308?12.92*n:1.055*n**(1/2.4)-.055)}var j7=e=>A7[e<=0?0:e>=O7?2047:e*k7|0],M7=1024,N7=new Map;function P7(e){let t=N7.get(e);if(!t){t=new Float32Array(1025);for(let n=0;n<=M7;n++)t[n]=(n/M7)**+e;N7.size>16&&N7.clear(),N7.set(e,t)}return t}var F7=[.92,.96,1],I7=[1,.98,.95],L7=(e,t,n)=>{let r=n<=e?0:n>=t?1:(n-e)/(t-e);return r*r*(3-2*r)},R7=(e,t,n)=>1-L7(e-t,e+t,n);function bme(e,t,n,r){let{L:i,V:a,H:o,U:s,W:c,A:l,B:u}=n,d=Math.max(t[0],t[1],t[2],.05),f=[t[0]/d,t[1]/d,t[2]/d],p=Math.max(.03,.3-.15*r.shadow),m=.15+.14*r.spread,h=.85,g=Math.min(90,Math.round(110/r.spread**1.3)),_=Math.max(2,Math.round(8/r.spread)),v=P7(g),y=P7(_),b=.45*r.highlight,x=.1*r.highlight,S=.11*r.highlight,C=.3*r.rim,w=[p*f[0],p*f[1],p*f[2]];for(let n=0;n<a7;n++)for(let r=0;r<a7;r++){let d=r/63*2-1,f=n/63*2-1,p=d*d+f*f;if(p>1.14)continue;if(p>1){let e=1/Math.sqrt(p);d*=e,f*=e,p=1}let g=Math.sqrt(1-p),_=d*i[0]+f*i[1]+g*i[2],T=Math.max(0,d*a[0]+f*a[1]+g*a[2]),E=Math.max(0,d*o[0]+f*o[1]+g*o[2]),D=Math.min(1,Math.max(0,(_+m)/(1+m))),O=1-T,k=O*O,A=k*O,j=A*k,ee=E*M7|0,M=(b*v[ee]+x*y[ee])*(1+3*j),te=2*T*d-a[0],ne=2*T*f-a[1],N=2*T*g-a[2],re=.45+.55*L7(-.4,.6,te*s[0]+ne*s[1]+N*s[2]),ie=te*c[0]+ne*c[1]+N*c[2],ae=0;if(ie>.5){let e=(te*l[0]+ne*l[1]+N*l[2])/ie,t=(te*u[0]+ne*u[1]+N*u[2])/ie;ae=R7(.34,.12,Math.abs(e))*R7(.12,.06,Math.abs(t))}let oe=C*A*re+S*ae,se=(n*a7+r)*3;e[se]=j7(t[0]*(w[0]+h*D)+M*I7[0]+oe*F7[0]),e[se+1]=j7(t[1]*(w[1]+h*D)+M*I7[1]+oe*F7[1]),e[se+2]=j7(t[2]*(w[2]+h*D)+M*I7[2]+oe*F7[2])}}function z7(e,t,n,r){let i=(t*.5+.5)*63,a=(n*.5+.5)*63,o=Math.min(62,Math.max(0,i|0)),s=Math.min(62,Math.max(0,a|0)),c=i-o,l=a-s,u=(s*a7+o)*3,d=(1-c)*(1-l),f=c*(1-l),p=(1-c)*l,m=c*l;for(let t=0;t<3;t++)r[t]=e[u+t]*d+e[u+3+t]*f+e[u+192+t]*p+e[u+192+3+t]*m}function xme(e,t,n,r){let{N:i,i00:a,wx:o,wy:s,ao:c}=e;for(let e=0,l=0;e<i*i;e++,l+=4){let i=c[e];if(i===0){n[l+3]=0;continue}let u=r[i],d=a[e]*3,f=o[e]*(1/255),p=s[e]*(1/255),m=(1-f)*(1-p)*u,h=f*(1-p)*u,g=(1-f)*p*u,_=f*p*u;n[l]=t[d]*m+t[d+3]*h+t[d+192]*g+t[d+192+3]*_,n[l+1]=t[d+1]*m+t[d+4]*h+t[d+192+1]*g+t[d+192+4]*_,n[l+2]=t[d+2]*m+t[d+5]*h+t[d+192+2]*g+t[d+192+5]*_,n[l+3]=255}}var B7=e=>{let t=Math.hypot(e[0],e[1],e[2])||1;return[e[0]/t,e[1]/t,e[2]/t]};function Sme(e){let t=Math.cos(e.roll),n=Math.sin(e.roll),r=t*e.lx+n*e.ly,i=-n*e.lx+t*e.ly,a=e.facing<0?-1:1,o=a*Math.min(1,Math.abs(e.facing)/.16),{cy:s,sy:c,cp:l,sp:u}=e,d=(e,t,n,r=o)=>B7([s*e+c*u*t-c*l*n,l*t+u*n,r*(c*e-s*u*t+s*l*n)]),f=d(l7*r,l7*i,cme),p=d(0,0,1,a),m=B7([f[0]+p[0],f[1]+p[1],f[2]+p[2]]),h=d(r,i,0,a),g=Math.cos(80*Math.PI/180),_=Math.sin(80*Math.PI/180),v=g*r-_*i,y=_*r+g*i,b=B7([.55*v,.55*y,.83]),x=B7([b[1],-b[0],0]),S=[b[1]*x[2]-b[2]*x[1],b[2]*x[0]-b[0]*x[2],b[0]*x[1]-b[1]*x[0]];return{L:f,V:p,H:m,U:h,W:d(b[0],b[1],b[2],a),A:d(x[0],x[1],x[2],a),B:d(S[0],S[1],S[2],a)}}var V7=new WeakMap;function Cme(e,t){let n=e.canvas??e,r=V7.get(n);r||(r=new Map,V7.set(n,r));let i=r.get(t);return i||(i={N:0,img:null,mc:new Float32Array(o7*3),mcPrev:new Float32Array(o7*3),mcMix:new Float32Array(o7*3),mixVersion:0,blendT:1,blendFrames:1,sinceBuild:0,L:null,V:null,lx:NaN,ly:NaN,base:``,shadow:NaN,highlight:NaN,spread:NaN,rim:NaN,version:0,imgVersion:-1,imgAoK:NaN,imgForm:null,aoK:-1,aoMul:new Float32Array(256),near:null,rimG:null,far:null,scratch:[null,null],scratchIdx:0,scratchN:0,scratchStale:!0,sprites:[null,null,null],spriteVersion:-1,spritePx:0},r.size>4&&r.clear(),r.set(t,i)),i}var H7=1/48,U7=(e,t)=>!t||Math.abs(e[0]-t[0])>=H7||Math.abs(e[1]-t[1])>=H7||Math.abs(e[2]-t[2])>=H7;function W7(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function G7(e,t,n,r,i){let a=Math.sqrt(1-n*n),o=[0,0,0],s=1-r;if(typeof e.createConicGradient==`function`){let n=e.createConicGradient(0,50,50);for(let e=0;e<=s7;e++){let r=e/s7*Math.PI*2;z7(t,a*Math.cos(r),a*Math.sin(r),o),n.addColorStop(e/s7,`rgb(${o[0]*s|0} ${o[1]*s|0} ${o[2]*s|0})`)}return n}let c=e.createLinearGradient(50+i[0]*50,50+i[1]*50,50-i[0]*50,50-i[1]*50),l=(e,n,r)=>{z7(t,e,n,o),c.addColorStop(r,`rgb(${o[0]*s|0} ${o[1]*s|0} ${o[2]*s|0})`)};return l(a*i[0],a*i[1],0),l(-a*i[1],a*i[0],.5),l(-a*i[0],-a*i[1],1),c}var wme=typeof navigator<`u`&&/AppleWebKit\//.test(navigator.userAgent)&&!/Chrome\/|Chromium\/|Edg\//.test(navigator.userAgent),K7=[[.55,()=>0],[0,()=>0],[0,e=>Math.min(.6,.25*e.shadow)]];function Tme(e,t,n,r,i,a){let o=w7(n.dev),s=C7(t.typeKey??v7(t.path),t.path,o,n.halfDepth,!!n.still);if(!s)return!1;let c=Cme(e,t.typeKey??v7(t.path)),l=Sme(n),u=(()=>{let e=Math.hypot(l.L[0],l.L[1]);return e<.05?[0,-1]:[l.L[0]/e,l.L[1]/e]})();if((U7(l.L,c.L)||U7(l.V,c.V)||n.lx!==c.lx||n.ly!==c.ly||r.base!==c.base||a.shadow!==c.shadow||a.highlight!==c.highlight||a.spread!==c.spread||a.rim!==c.rim)&&(c.version>0&&c.mcPrev.set(c.mcMix),bme(c.mc,yme(r.base),l,a),c.version===0?(c.mcMix.set(c.mc),c.blendT=1):(c.blendFrames=Math.min(10,Math.max(1,c.sinceBuild)),c.blendT=0),c.sinceBuild=0,c.mixVersion++,c.L=l.L,c.V=l.V,c.lx=n.lx,c.ly=n.ly,c.base=r.base,c.shadow=a.shadow,c.highlight=a.highlight,c.spread=a.spread,c.rim=a.rim,c.version++,c.near=c.rimG=c.far=null),c.sinceBuild++,c.blendT<1){c.blendT=Math.min(1,c.blendT+1/c.blendFrames);let e=c.blendT>=1?1:c.blendT*c.blendT*(3-2*c.blendT),t=c.mcPrev,n=c.mc,r=c.mcMix;for(let i=0;i<o7*3;i++)r[i]=t[i]+(n[i]-t[i])*e;c.mixVersion++}let d=Math.min(1.3,1.2*a.shadow);if(d!==c.aoK){for(let e=0;e<256;e++)c.aoMul[e]=Math.max(0,1-d*(1-e/255));c.aoK=d}if((!c.img||c.N!==o)&&(c.img=new ImageData(o,o),c.N=o,c.imgVersion=-1),(c.imgVersion!==c.mixVersion||c.imgAoK!==d||c.imgForm!==s)&&(xme(s,c.mcMix,c.img.data,c.aoMul),c.imgVersion=c.mixVersion,c.imgAoK=d,c.imgForm=s,c.scratchStale=!0),c.scratchN!==o&&(c.scratch=[null,null],c.scratchN=o,c.scratchStale=!0),c.scratchStale){c.scratchIdx^=1;let e=c.scratch[c.scratchIdx];if(!e){let t=p7(o),n=t&&m7(t,!1);if(!t||!n)return!1;e=c.scratch[c.scratchIdx]={c:t,g:n}}e.g.putImageData(c.img,0,0),c.scratchStale=!1}let f=c.scratch[c.scratchIdx],p=t.sides===`sprite`||t.sides!==`vector`&&wme;if(p){let e=Math.ceil(106*n.dev/100);if(c.spritePx!==e&&(c.sprites=[null,null,null],c.spritePx=e,c.spriteVersion=-1),c.spriteVersion!==c.version){let n=e/106;for(let r=0;r<3&&p;r++){let i=c.sprites[r];if(!i){let t=p7(e),n=t&&m7(t,!1);if(!t||!n){p=!1;break}i=c.sprites[r]={c:t,g:n}}i.g.setTransform(1,0,0,1,0,0),i.g.clearRect(0,0,e,e),i.g.setTransform(n,0,0,n,3*n,3*n),i.g.fillStyle=G7(i.g,c.mc,K7[r][0],K7[r][1](a),u),i.g.fill(t.path)}p&&(c.spriteVersion=c.version)}}!p&&!c.near&&(c.near=G7(e,c.mc,.55,0,u),c.rimG=G7(e,c.mc,0,0,u),c.far=G7(e,c.mc,0,Math.min(.6,.25*a.shadow),u));let{cy:m,sy:h,cp:g,sp:_,halfDepth:v,cap:y}=n,b=n.facing>=0?1:-1,[x,S,C,w,T,E]=n.ctm,D=null;p&&(e.imageSmoothingEnabled=!0,e.imageSmoothingQuality=`high`);let O=1,k=0,A=0,j=1,ee=0,M=0;for(let n=0;n<16;n++){let r=-1+2*(b>0?n:16-n)/16,i=lme(r,y),a=r*b,o=m*i,s=h*_*i,l=g*i,u=r*h*v-50*o,d=-r*m*_*v-50*s-50*l,f=O*j-k*A,x=j/f,S=-k/f,C=-A/f,w=O/f,T=(A*M-j*ee)/f,E=(k*ee-O*M)/f;e.transform(x*o+C*s,S*o+w*s,C*l,w*l,x*u+C*d+T,S*u+w*d+E),O=o,k=s,A=0,j=l,ee=u,M=d;let te=a>.4?0:a>=0?1:2;if(p)e.drawImage(c.sprites[te].c,-3,-3,106,106);else{let n=te===0?c.near:te===1?c.rimG:c.far;n!==D&&(e.fillStyle=D=n),e.fill(t.path)}}e.setTransform(x,S,C,w,T,E);let te=1/(m*g),ne=h*v/m,N=-_*v*te,re=Math.hypot(ne,N),ie=re>1e-6?b*ne/re:1,ae=re>1e-6?b*N/re:0,oe=50*y+Math.hypot(50*(1-y),re),se=(oe+50)/100,ce=(oe-50)/2,le=1+(se-1)*ie*ie,ue=(se-1)*ie*ae,de=1+(se-1)*ae*ae,fe=W7(W7(n.ctm,[m,h*_,0,g,0,0]),[le,ue,ue,de,ce*ie-50*le-50*ue,ce*ae-50*ue-50*de]);if(e.save(),e.setTransform(fe[0],fe[1],fe[2],fe[3],fe[4],fe[5]),e.clip(t.path),e.imageSmoothingEnabled=!0,e.imageSmoothingQuality=`high`,e.drawImage(f.c,-3,-3,106,106),e.restore(),n.dev>=256&&a.rim>0&&a.highlight>0){e.save(),e.globalCompositeOperation=`source-atop`,e.setTransform(fe[0],fe[1],fe[2],fe[3],fe[4],fe[5]);let n=Math.min(.5,.3*a.rim*Math.min(1.4,a.highlight)),r=e.createLinearGradient(50+u[0]*50,50+u[1]*50,50-u[0]*50,50-u[1]*50);r.addColorStop(0,`rgba(235,244,255,${n.toFixed(3)})`),r.addColorStop(.45,`rgba(235,244,255,${(.35*n).toFixed(3)})`),r.addColorStop(.75,`rgba(235,244,255,0)`),e.strokeStyle=r,e.lineJoin=`round`,e.lineWidth=1.3,e.stroke(t.path),e.restore()}return!0}var q7=1.5,J7=.1,Y7=17,Eme=15,X7=(e,t)=>t+(1-t)*Math.sqrt(Math.max(0,1-e*e)),Dme=25,Ome=6.3,kme={eyes:1,mouth:-3.5},Z7=new Map;function Ame(e,t,n){let r=`${e}|${t}|${n}`,i=Z7.get(r);if(!i){let a=I5(e,-.3*t,.05*t),o=I5(e,-.12*t,.03*t),s=[],c=[];for(let t=0;t<Y7;t++){let n=t/16;s.push(n>.6?``:$7(a,o,n/.6)),c.push(n>=.5?e:$7(a,e,n/.5))}i={base:e,far:a,near:o,light:I5(e,.04*n),dark:I5(e,-.3*t,.05*t),capTop:I5(e,.035*n),capBottom:I5(e,-.035*t),crispMix:s,smoothMix:c,grad:null},Z7.size>200&&Z7.clear(),Z7.set(r,i)}return i}var Q7=e=>(e.startsWith(`hsl(`)?e:I5(e,0)).match(/[\d.]+/g).map(Number);function $7(e,t,n){let r=Q7(e),i=Q7(t),a=r.map((e,t)=>e+(i[t]-e)*n);return`hsl(${a[0].toFixed(1)} ${a[1].toFixed(1)}% ${a[2].toFixed(1)}%)`}var e9=34,jme=Math.PI*1.55,Mme=57,Nme=.4,t9=-.28,n9=new Map;function Pme(e){let t=n9.get(e);return t||(t={base:I5(e,.1,.02),light:I5(e,.3,.04),dark:I5(e,-.22,.08),halo:I5(e,.2)},n9.size>200&&n9.clear(),n9.set(e,t)),t}var r9=(e,t)=>e.replace(`)`,` / ${Math.max(0,Math.min(1,t)).toFixed(3)})`);function i9(e,t,n,r,i,a,o){let s=o?.strength??0,c=Math.min(1,t.whirl*s);if(c<=.01)return;let l=o?.size??1,u=o?.width??1,d=o?.length??1,f=o?.tilt??1,p=jme*d,m=Pme(n),h=-t.whirlAngle,g=Mme*l,_=g*Nme*f*(a?1.14:.86),v=Math.atan2(i,r)-t9;e.save(),e.rotate(t9),e.translate(0,5),e.lineCap=`butt`;let y=(t,n,r,i,a)=>{e.strokeStyle=i,e.lineWidth=r,e.beginPath(),e.ellipse(0,a,g,_,0,t,n,!1),e.stroke()};if(a)for(let e=0;e<e9;e++){let t=e/e9,n=h+t*p,r=n+p/e9+.012;if(Math.sin((r+n)/2)<=0)continue;let i=(1-t)**1.3;y(n,r,(2+8*i)*1.5*u,`rgba(0,0,0,${(.2*c*i).toFixed(3)})`,3.5)}for(let e=0;e<e9;e++){let t=e/e9,n=h+t*p,r=n+p/e9+.012,i=(r+n)/2;if(Math.sin(i)>0!==a)continue;let o=.6+.4*Math.sin(i),s=(1-t)**1.3,l=1+.18*Math.sin(t*9+1.2),d=(2+8*s)*o*u*l,f=c*(.3+.7*s)*o,g=.5+.5*Math.cos(i-v);y(n,r,d*2.6,r9(m.halo,f*.2),0),y(n,r,d*.8,r9(m.dark,f*.45),d*.32),y(n,r,d,r9(m.base,f*.72),0),y(n,r,d*.62,r9(m.light,f*.78*(.4+.6*g)),-d*.16),y(n,r,d*.24,`rgba(255,255,255,${(f*.9*(.15+.85*g*g)).toFixed(3)})`,-d*.3)}e.restore()}function a9(e,t,n,r){let i=t*q7;e.clearRect(0,0,i,i);let a=t/100,o,s;if(r.dpr!==void 0)o=r.dpr,s=[o,0,0,o,0,0];else if(e.getTransform){let t=e.getTransform();s=[t.a,t.b,t.c,t.d,t.e,t.f],o=t.a||1}else o=1,s=[1,0,0,1,0,0];let c=r.shadow??.35,l=r.highlight??1.3,u=Eme*(r.depth??.65),d=1-.09999999999999998*(r.rim??.5),f=r.spread??1.55,p=(r.light??265)*Math.PI/180,m=Math.sin(p),h=-Math.cos(p),g=Ame(r.color,c,l),_=Math.cos(n.yaw),v=Math.sin(n.yaw),y=Math.cos(n.pitch),b=Math.sin(n.pitch),x=_*y,S=e=>Math.abs(e)<.22?e<0?-.22:.22:e,C=S(_),w=S(y),T=Math.cos(n.roll),E=Math.sin(n.roll),D=n.sx*a,O=n.sy*a,k=50*(1-n.sy)*a,A=W7(s,[T*D,E*D,-E*O,T*O,i/2+n.x*a-E*k,i/2+J7*t+n.y*a+T*k]);e.save(),e.setTransform(A[0],A[1],A[2],A[3],A[4],A[5]),e.lineCap=`round`,e.lineJoin=`round`;let j=r.shading,ee=(i,a,s)=>{let u=g.near,p=g.base;if(j===`crisp`){if(!g.grad||g.grad.lx!==m||g.grad.ly!==h){let t=e.createLinearGradient(m*56,h*56,-m*56,-h*56);t.addColorStop(0,g.light),t.addColorStop(.45,g.near),t.addColorStop(1,g.dark);let n=e.createLinearGradient(m*46,h*46,-m*46,-h*46);n.addColorStop(0,g.capTop),n.addColorStop(1,g.capBottom),g.grad={lx:m,ly:h,lit:t,cap:n}}u=g.grad.lit,p=g.grad.cap}let _=!1;j===`plastic`&&(_=Tme(e,{...r,path:i,typeKey:a},{cy:C,sy:v,cp:w,sp:b,facing:x,roll:n.roll,halfDepth:s,cap:d,lx:m,ly:h,dev:t*o,ctm:A,still:r.still},g,null,{shadow:c,highlight:l,spread:f,rim:r.rim??.5}));let y=j===`plastic`&&!_?`smooth`:j,S=y===`smooth`,T=S&&typeof Path2D==`function`?new Path2D:null,E=x>=0?1:-1,[D,O,k,ee,M,te]=A,ne=null,N=1,re=0,ie=0,ae=1,oe=0,se=0;for(let t=0;t<Y7&&!_;t++){let n=-1+2*(E>0?t:16-t)/16,r=X7(n,d),a=t/16,o=C*r,c=v*b*r,l=w*r,f=n*v*s-50*o,m=-n*C*b*s-50*c-50*l,h=N*ae-re*ie,_=ae/h,y=-re/h,x=-ie/h,D=N/h,O=(ie*se-ae*oe)/h,k=(re*oe-N*se)/h;e.transform(_*o+x*c,y*o+D*c,x*l,D*l,_*f+x*m+O,y*f+D*m+k),N=o,re=c,ie=0,ae=l,oe=f,se=m;let A;A=S?g.smoothMix[t]:t===16?p:a>.6?u:g.crispMix[t],A!==ne&&(e.fillStyle=ne=A),e.fill(i),T&&T.addPath(i,{a:o,b:c,c:0,d:l,e:f,f:m})}if(_||e.setTransform(D,O,k,ee,M,te),T&&y===`smooth`){e.save(),e.clip(T);let t=Math.min(1,.34*c),n=e.createRadialGradient(-m*45,-h*45,4*f,-m*45,-h*45,84*f);n.addColorStop(0,`rgba(0,0,0,${t})`),n.addColorStop(.5,`rgba(0,0,0,${t*.35})`),n.addColorStop(1,`rgba(0,0,0,0)`),e.globalCompositeOperation=`multiply`,e.fillStyle=n,e.fillRect(-120,-120,240,240),e.globalCompositeOperation=`source-over`;let r=Math.min(1,.22*l),i=e.createRadialGradient(m*37,h*37,0,m*37,h*37,62*f);i.addColorStop(0,`rgba(255,255,255,${r})`),i.addColorStop(.6,`rgba(255,255,255,${r*.23})`),i.addColorStop(1,`rgba(255,255,255,0)`),e.fillStyle=i,e.fillRect(-120,-120,240,240),e.restore()}return _};i9(e,n,r.color,m,h,!1,r.whirl),r.parts&&ee(r.parts,`${r.typeKey??`custom`}:parts`,u*(r.partsDepth??.4));let M=ee(r.path,r.typeKey??`custom`,u);if(x>-.2){e.save();{let t=x>=0?1:-1,n=X7(t,d),i=C*n,a=v*b*n,o=w*n,s=t*v*u-50*i,c=-t*C*b*u-50*a-50*o,[l,f,p,m,h,g]=A;e.setTransform(l*i+p*a,f*i+m*a,p*o,m*o,l*s+p*c+h,f*s+m*c+g),e.clip(r.path),e.setTransform(l,f,p,m,h,g)}e.translate(r.faceX-50,r.faceY-50),e.scale(r.faceScale,r.faceScale),M&&(e.globalAlpha=.93),Rme(e,n,r),e.restore()}i9(e,n,r.color,m,h,!0,r.whirl),e.restore()}var o9=30;function Fme(e,t,n,r){let i=Math.asin(Math.max(-1,Math.min(1,e/o9)))+n,a=Math.asin(Math.max(-1,Math.min(1,-t/o9)))+r,o=Math.cos(a);return{x:o9*Math.sin(i)*o,y:-30*Math.sin(a),sx:Math.cos(i),sy:o,z:Math.cos(i)*o}}var s9=8,c9=new Map;function Ime(e,t,n){let r=Math.round(e*50),i=Math.round(t*50),a=Math.round(n*50),o=r+2e3*i+4e6*a,s=c9.get(o);if(!s){let e=r/50,t=i/50,n=a/50,c=`M${-e} ${t}`;for(let r=1;r<=s9;r++){let i=r/s9,a=1-i;c+=` L${(a*a*-e+i*i*e).toFixed(3)} ${((a*a+i*i)*t+2*a*i*n).toFixed(3)}`}s=new Path2D(c),c9.size>256&&c9.clear(),c9.set(o,s)}return s}var l9=Math.sin(.684),u9=Math.cos(.684),d9=new Map;function Lme(e){let t=e=>Math.round(e*50)/50,n=t(e.hw),r=t(e.t0),i=t(e.a),a=t(e.yt),o=t(e.ab),s=t(e.yb),c=`${n},${r},${i},${a},${o},${s}`,l=d9.get(c);if(l)return l;let u=e=>e.toFixed(3),d=r*l9,f=r*u9,p=-n+d,m=-f,h=n-d,g=-f,_=-n-d,v=f,y=n+d,b=f,x=4/3*r*u9,S=4/3*r*l9,C=`M${u(p)} ${u(m)}C${u(-n+i*n)} ${u(a-r)} ${u(n-i*n)} ${u(a-r)} ${u(h)} ${u(g)}C${u(h+x)} ${u(g-S)} ${u(y+x)} ${u(b-S)} ${u(y)} ${u(b)}C${u(n-o*n)} ${u(s+r)} ${u(-n+o*n)} ${u(s+r)} ${u(_)} ${u(v)}C${u(_-x)} ${u(v-S)} ${u(p-x)} ${u(m-S)} ${u(p)} ${u(m)}Z`;return l=new Path2D(C),d9.size>256&&d9.clear(),d9.set(c,l),l}function Rme(e,t,n){let[r,i,a]=t.w,o=n.ink,s=kme[n.face],c=Dme/2,l=t.lookX,u=t.lookY,{yaw:d,pitch:f}=t,p=(t,n,r,i=1)=>{let a=Fme(t,n,d,f);a.z<=.02||i<=.01||(e.save(),e.globalAlpha=i*Math.min(1,a.z*5),e.translate(a.x,a.y),e.scale(Math.max(.02,a.sx),Math.max(.02,a.sy)),r(),e.restore())},m=(e,t)=>Math.abs(e)<=t?0:Math.sign(e)*(Math.abs(e)-t)/(1-t),h=e=>Math.max(-1,Math.min(1,e)),g=m(h(-t.pitch/.26-t.lookY/7),.34),_=Math.abs(m(h(t.lookX/4.5),.4)),v=Math.max(.3,1+.55*g-.1*_),y=1-.05*g+.12*_,b=r+i*(1-t.laugh),x=i*t.laugh,S=Math.max(0,-t.y)/26,C=.5+.5*t.breath;for(let n of[-1,1]){let r=n<0?t.blinkL:t.blinkR,i=Math.max(0,Math.min(1,t.eyeOpen*(1-r))),d=b*i,f=b*(1-i),m=x,h=a,g=d*.01+f*5.4+m*6.2+h*6,_=d*1.1*v+f*.6+m*(2.2-S*1.5)+h*(-1.4+C),w=d*-3.3*v+f*.6+m*(-11.4-4*S)+h*(5.4+2*C),T=d*Ome*2*y+f*2.8+m*4.4+h*4,E=l*(d+.5*(f+m)),D=u*(d+.5*f);p(n*c+E,s+D,()=>{e.strokeStyle=o,e.lineWidth=T,e.stroke(Ime(g,_,w))})}if(n.face===`mouth`){let n=l*.35,s=(.6+.4*r)*(1+.06*t.breath),c=(.6+.4*i)*(1+.25*Math.max(0,-t.y)/26),u=2.7*a*(1+.25*t.breath),d=(e,t,n)=>r*e+i*t+a*n,f={hw:d(6.5*s,9.5*c,u),t0:d(1.9,0,0),a:d(2/3,2/3,0),yt:d(3.53*s,1.6*c,-4*u/3),ab:d(2/3,0,0),yb:d(3.53*s,17.3*c,4*u/3)};p(n,d(12.5,11.6,15.5),()=>{e.fillStyle=o,e.fill(Lme(f))})}}var f9={x:NaN,y:NaN},p9=new Set,m9=0,h9=0;function g9(e){m9=0;let t=h9?Math.min(.1,(e-h9)/1e3):0;h9=e,p9.forEach(e=>e(t)),p9.size&&(m9=requestAnimationFrame(g9))}function _9(){m9||typeof document>`u`||document.hidden||(h9=0,m9=requestAnimationFrame(g9))}var v9=!1;function zme(){v9||typeof document>`u`||(v9=!0,document.addEventListener(`pointermove`,e=>{f9.x=e.clientX,f9.y=e.clientY},{passive:!0}),document.addEventListener(`pointerleave`,()=>{f9.x=NaN,f9.y=NaN}),window.addEventListener(`blur`,()=>{f9.x=NaN,f9.y=NaN}),document.addEventListener(`visibilitychange`,()=>{document.hidden?(m9&&cancelAnimationFrame(m9),m9=0):p9.size&&_9()}))}function Bme(e){return zme(),p9.add(e),_9(),()=>{p9.delete(e),!p9.size&&m9&&(cancelAnimationFrame(m9),m9=0)}}function y9(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0)%1e3/1e3}var b9=(e,t,n)=>Math.min(n,Math.max(t,Number.isFinite(e)?e:1)),x9=new Map;function S9(e){let t=x9.get(e);return t||(t=new Path2D(e),x9.set(e,t)),t}var C9=()=>typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,Vme=(0,M.forwardRef)(function({type:e=`clover`,path:t,face:n,state:r=`default`,size:i=64,color:a,ink:o,brightness:s=1,saturation:c=1.5,speed:l=1,paused:u=!1,seed:d,shading:f=`plastic`,shadow:p=.35,highlight:m=1.3,depth:h=.65,light:g=265,rim:_=.5,spread:v=1.55,interactive:y=!0,turn:b=1,theme:x=`auto`,whirl:S=0,whirlSize:C=1,whirlWidth:w=1,whirlLength:T=1,whirlTilt:E=1,jumpHeight:D=26,jumpTime:O=.68,jumpStretch:k=1,jumpSpin:A=1,jumpLean:j=6,jumpEvery:ee=8,jumpLand:te=0,jumpSquash:ne=1.15,jumpSquashTime:N=.37,jumpSquashEase:re=`pulse`,jumpGroundTime:ie=.11,jumpGroundEase:ae=`pulse`,jumpRiseTime:oe=.33,jumpRiseEase:se=`pulse`,jumpClickSquashTime:ce=.24,className:le,style:ue,"aria-label":de,...fe},pe){let me=(0,M.useRef)(null);(0,M.useImperativeHandle)(pe,()=>me.current);let he=(0,M.useId)(),ge=k5[e]??k5.clover,_e=n??ge.face,ve=a??ge.color,ye=s===1&&c===1?ve:I5(ve,(Math.min(2,Math.max(0,s))-1)*.35,(Math.min(2,Math.max(0,c))-1)*.5),be=o??Xpe(ye),xe=Math.min(1,Math.max(0,d??y9(he))),Se=r in j5?r:`default`,Ce=u||!(l>0),we=f===!0?`crisp`:f===!1?`flat`:f,Te=typeof t==`string`&&t.trim()?t.trim():null,Ee=Te?`path:${y9(Te)}:${Te.length}`:e,De=(0,M.useRef)(null),Oe=(0,M.useRef)(null),ke=(0,M.useRef)(0),Ae=(0,M.useRef)(l);Ae.current=l;let je=(0,M.useRef)(y);je.current=y,Oe.current={path:typeof Path2D>`u`?null:S9(Te??M5[e]??M5.clover),face:_e,faceX:ge.faceX,faceY:ge.faceY,faceScale:ge.faceScale,color:ye,ink:be,shading:we,shadow:b9(p,0,2),highlight:b9(m,0,2),depth:b9(h,.2,2),light:g,rim:b9(_,0,2),spread:b9(v,.4,2.5),typeKey:Ee,still:Ce||C9(),whirl:{strength:b9(S,0,2),size:b9(C,.6,1.6),width:b9(w,.4,2),length:b9(T,.4,1.6),tilt:b9(E,.5,1.8)},parts:typeof Path2D<`u`&&!Te&&N5[e]?S9(N5[e]):void 0};let Me=e=>{if(x!==`auto`)return x;let t=e?.closest(`[data-theme], .dark, .light`);if(t){let e=t.getAttribute(`data-theme`);if(e===`dark`||e===`light`)return e;if(t.classList.contains(`dark`))return`dark`;if(t.classList.contains(`light`))return`light`}return typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`},Ne=()=>{let e=me.current,t=Oe.current;if(!e||!t||!t.path)return;let n=e.clientWidth/1.5||ke.current||(typeof i==`number`?i:64);if(!n)return;let r=Math.min(2,typeof devicePixelRatio==`number`&&devicePixelRatio||1),a=Math.round(n*q7*r);(e.width!==a||e.height!==a)&&(e.width=a,e.height=a),ke.current=n;let o=e.getContext(`2d`);o&&(o.setTransform(r,0,0,r,0,0),t.dpr=r,a9(o,n,De.current?De.current.pose:i7(Se),t))};(0,M.useLayoutEffect)(()=>{if(De.current?De.current.setState(Se):De.current=new ome(xe,Se),De.current.setTurn(b9(b,0,2)),De.current.setJump({height:D,time:Math.max(.2,O),stretch:k,spin:Math.max(0,Math.round(A)),lean:j,every:ee,land:te,squash:ne,squashTime:Math.max(.05,N),squashEase:re,groundTime:Math.max(0,ie),groundEase:ae,riseTime:Math.max(.05,oe),riseEase:se,clickSquashTime:Math.max(.05,ce)}),C9()){let e=me.current;if(e&&Oe.current&&Oe.current.path){let t=e.clientWidth/1.5||ke.current||(typeof i==`number`?i:64);if(!t)return;ke.current=t;let n=Math.min(2,typeof devicePixelRatio==`number`&&devicePixelRatio||1);e.width=e.height=Math.round(t*q7*n);let r=e.getContext(`2d`);r&&(Oe.current.theme=Me(e),Oe.current.dpr=n,r.setTransform(n,0,0,n,0,0),a9(r,t,i7(Se),Oe.current))}}else Oe.current&&me.current&&(Oe.current.theme=Me(me.current)),Ne()}),(0,M.useEffect)(()=>{var e;if(we!==`plastic`||!((e=Oe.current)!=null&&e.path))return;let t=Oe.current.path,n=(typeof i==`number`?i:64)*Math.min(2,typeof devicePixelRatio==`number`&&devicePixelRatio||1),r=(typeof requestIdleCallback==`function`?requestIdleCallback:e=>setTimeout(e,1))(()=>vme(Ee,t,n,h));return()=>{typeof cancelIdleCallback==`function`?cancelIdleCallback(r):clearTimeout(r)}},[we,Ee,i,h]),(0,M.useEffect)(()=>{if(Ce||C9())return;let e=me.current;if(!e)return;let t=!0,n=null,r=t=>{let n=De.current;if(n){if(je.current&&!Number.isNaN(f9.x)){let t=e.getBoundingClientRect(),r=t.width/1.5||1,i=(f9.x-(t.left+t.width/2))/r,a=(f9.y-(t.top+t.height/2+J7*r))/r,o=Math.hypot(i,a),s=o<1?1:o>3?0:1-(o-1)/2;n.setPointer(i/Math.max(1,o),a/Math.max(1,o),s)}else n.setPointer(0,0,0);n.update(t*Ae.current),Ne()}},i=()=>{n||=Bme(r)},a=()=>{n&&n(),n=null},o=null;return typeof IntersectionObserver==`function`?(o=new IntersectionObserver(e=>{t=e[0]?.isIntersecting??!0,t?i():a()}),o.observe(e)):i(),()=>{a(),o&&o.disconnect()}},[Ce]);let Pe=typeof i==`number`?`${i*q7}px`:`calc(${i} * ${q7})`,Fe=e=>typeof i==`number`?`${-i*e}px`:`calc(${i} * ${-e})`,Ie=.5/2,Le={display:`inline-block`,verticalAlign:`middle`,width:Pe,height:Pe,marginLeft:Fe(Ie),marginRight:Fe(Ie),marginTop:Fe(.35),marginBottom:Fe(.15),flex:`none`,...ue},Re=e=>{var t,n;y&&!Ce&&((t=De.current)==null||t.poke()),(n=fe.onClick)==null||n.call(fe,e)};return(0,L.jsx)(`canvas`,{ref:me,className:le?`ba ${le}`:`ba`,"data-bot-avatar":e,"data-face":_e,"data-state":Se,role:`img`,"aria-label":de??`${ge.label} bot, ${j5[Se]}`,style:Le,...fe,onClick:Re})}),Hme=137.508,Ume=.618033988749895;function Wme(e){return{type:A5[e%A5.length],color:`hsl(${e*Hme%360}, 72%, 58%)`,seed:e*Ume%1}}var Gme=e=>Math.round(e*.21);function Kme({avatarIndex:e,working:t=!1,size:n=24,badge:r,originBadge:i,goalBadge:a,timerBadge:o,className:s,...c}){let l=f5();return(0,L.jsxs)(`span`,{"data-slot":`bot-avatar`,"data-working":t,className:I(`relative inline-flex shrink-0`,s),style:{width:n,height:n},...c,children:[(0,L.jsx)(`span`,{className:`flex`,style:{transform:`translateY(${Gme(n)}px)`},children:(0,L.jsx)(Vme,{...Wme(e),size:n,state:t?`working`:`default`,turn:t?void 0:0,paused:!t||l,interactive:!1,"aria-hidden":!0})}),r?(0,L.jsx)(`span`,{className:`absolute -top-1 -left-1 flex`,children:r}):null,a?(0,L.jsx)(`span`,{className:`absolute -top-1 -right-1 flex`,children:a}):null,i?(0,L.jsx)(`span`,{className:`absolute -bottom-1 -left-1 flex`,children:i}):null,o?(0,L.jsx)(`span`,{className:`absolute -right-1 -bottom-1 flex`,children:o}):null]})}function qme({...e}){return(0,L.jsx)(Xre,{"data-slot":`context-menu`,...e})}function Jme({...e}){return(0,L.jsx)(Qre,{"data-slot":`context-menu-trigger`,...e})}function Yme({className:e,...t}){return(0,L.jsx)($re,{children:(0,L.jsx)(tie,{"data-slot":`context-menu-content`,className:I(`z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})})}function Xme({className:e,variant:t=`default`,...n}){return(0,L.jsx)(nie,{"data-slot":`context-menu-item`,"data-variant":t,className:I(`relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50`,e),...n})}var Zme=`md:group-hover/menu-item:flex md:group-focus-within/menu-item:flex md:group-data-[actions-open=true]/menu-item:flex`,Qme=`md:group-hover/menu-item:hidden md:group-focus-within/menu-item:hidden md:group-data-[actions-open=true]/menu-item:hidden`,w9=`transition-[transform,opacity] duration-200 ease-out motion-reduce:transition-none`,T9=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function $me(e){let t=M.useRef(null),n=M.useRef(null),[r,i]=M.useState({x:0,y:0});return M.useLayoutEffect(()=>{let r=t.current,a=n.current;if(!e||!r||!a)return;let o=()=>{let e=T9(a.getBoundingClientRect()),t=T9(r.getBoundingClientRect()),n={x:t.x-e.x,y:t.y-e.y};i(e=>e.x===n.x&&e.y===n.y?e:n)};o();let s=new ResizeObserver(o);return s.observe(r),s.observe(a),()=>s.disconnect()},[e]),{avatarRef:t,slotRef:n,offset:r}}function ehe({link:e,title:t,avatar:n,context:r,projectIcon:i,time:a,worktree:o,actions:s,actionsOpen:c=!1,current:l=!1,tooltip:u,flipId:d,className:f,compact:p=!1,decoration:m,...h}){let{avatarRef:g,slotRef:_,offset:v}=$me(!!i&&!!r),y=p?ZR:KR,b=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`span`,{ref:g,"data-slot":`thread-avatar`,className:I(`relative flex shrink-0 items-center justify-center`,p?`size-5`:`size-6`),children:[(0,L.jsx)(`span`,{className:I(w9,i&&`group-data-[current=true]/menu-item:scale-80 group-data-[current=true]/menu-item:opacity-0`),children:n}),i&&!r?(0,L.jsx)(`span`,{"data-slot":`thread-project-fade`,className:I(w9,`absolute opacity-0 scale-80 group-data-[current=true]/menu-item:scale-[1.4] group-data-[current=true]/menu-item:opacity-100`),children:i}):null]}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[r?(0,L.jsxs)(`span`,{"data-slot":`thread-context`,className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,children:[i?(0,L.jsx)(`span`,{ref:_,"data-slot":`thread-project-slot`,className:`z-10 flex size-[17px] shrink-0`,style:{"--project-offset-x":`${v.x}px`,"--project-offset-y":`${v.y}px`},children:(0,L.jsx)(`span`,{className:I(w9,`flex group-data-[current=true]/menu-item:[transform:translate(var(--project-offset-x),var(--project-offset-y))_scale(1.4)]`),children:i})}):null,(0,L.jsx)(`span`,{className:I(`truncate`,w9,i&&`group-data-[current=true]/menu-item:-translate-x-[21px]`,`group-data-[current=true]/menu-item:font-semibold`),children:r})]}):null,(0,L.jsx)(`span`,{"data-slot":`thread-title`,className:I(p?`truncate`:`line-clamp-2 break-words`,`text-sm font-normal text-foreground/80 group-data-[current=true]/menu-item:text-foreground`),children:t})]})]});return(0,L.jsxs)(y,{className:I(p&&`group/menu-item`,f),"data-flip-id":d,"data-current":l,"data-actions-open":c,...h,children:[(0,L.jsx)(JR,{asChild:!0,isActive:l,size:`lg`,tooltip:u,className:I(`h-auto gap-2 pr-14 [&>span:last-child]:overflow-visible [&>span:last-child]:whitespace-normal!`,p?`min-h-8 py-1`:`min-h-14 py-2`),children:M.cloneElement(e,void 0,b)}),(0,L.jsxs)(`div`,{"data-slot":`thread-aside`,className:I(`pointer-events-none absolute right-2 flex h-6 items-center justify-end`,p?`top-1.5`:`top-2`),children:[(0,L.jsx)(`span`,{"data-slot":`thread-time`,className:`text-xs text-muted-foreground tabular-nums ${s?`hidden md:inline ${Qme}`:``}`,children:a}),s?(0,L.jsx)(`div`,{"data-slot":`thread-actions`,className:`pointer-events-auto flex items-center gap-0.5 md:hidden ${Zme}`,children:s}):null]}),o&&!p?(0,L.jsx)(`div`,{"data-slot":`thread-worktree`,className:`pointer-events-auto absolute right-2 bottom-1.5 flex h-4 items-center justify-end`,children:o}):null,m]})}function the({last:e=!1,className:t,...n}){return(0,L.jsxs)(`span`,{"data-slot":`tree-branch`,"data-last":e,"aria-hidden":!0,className:I(`pointer-events-none absolute top-0 -left-2.5 h-full w-2.5`,t),...n,children:[e?(0,L.jsx)(`span`,{className:`absolute top-1/2 -bottom-1 left-[-1px] w-px bg-sidebar`}):null,(0,L.jsx)(`span`,{className:`absolute top-1/2 left-0 h-px w-full bg-sidebar-border`})]})}function nhe({expanded:e,className:t,...n}){return(0,L.jsx)(eq,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"data-slot":`tree-toggle`,className:I(`absolute right-2 bottom-1.5 flex size-5 items-center justify-center rounded-sm text-muted-foreground hover:bg-sidebar-accent hover:text-foreground`,t),...n,children:(0,L.jsx)(SI,{className:I(`size-3.5 transition-transform motion-reduce:transition-none`,e&&`rotate-90`)})})})}var rhe=(e,t)=>{if(e.lastRunEndedAt===null)return!1;let n=fz.getLastSeenAt(e.id,t)??fz.getSeenBaseline(Date.now(),t);return e.lastRunEndedAt>n};function ihe(e,t,n){return e.status===`running`?`running`:e.status===`error`?`error`:!t&&!e.parentId&&rhe(e,n)?`unseen`:null}var ahe=e=>hv(e)&&e.code===`has_unmerged_work`;function ohe({title:e,onConfirm:t,onClose:n}){let{run:r,error:i,pending:a}=bW(),[o,s]=(0,M.useState)(null),c=o!==null,l=async()=>{try{await t(c)}catch(e){if(c||!ahe(e))throw e;s(e instanceof Error?e.message:String(e));return}n()};return(0,L.jsx)(yB,{open:!0,onOpenChange:e=>!e&&n(),children:(0,L.jsxs)(SB,{children:[(0,L.jsxs)(CB,{children:[(0,L.jsxs)(TB,{children:[`Delete `,e,`?`]}),(0,L.jsx)(EB,{children:`The thread disappears from tau. Its transcript stays on disk.`})]}),(0,L.jsx)(yW,{message:o?`${o}. Delete it anyway? This work is lost.`:null}),(0,L.jsx)(yW,{message:i}),(0,L.jsxs)(wB,{children:[(0,L.jsx)(Z,{variant:`outline`,onClick:n,children:`Cancel`}),(0,L.jsx)(Z,{variant:`destructive`,disabled:a,onClick:()=>r(l),children:c?`Delete anyway`:`Delete thread`})]})]})})}var E9=e=>e.agentType===`fork`?e.parentId:e.forkOf?.conversationId??null,she=e=>E9(e)!==null;function che({conversation:e}){let t=E9(e),n=Mw().data?.find(e=>e.id===t),r=n?`Fork of ${n.title.trim()||`New thread`}`:`Fork of another thread`;return(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsx)(`span`,{role:`img`,"aria-label":r,className:`flex size-3.5 items-center justify-center rounded-full bg-sidebar text-muted-foreground ring-1 ring-sidebar-border`,children:(0,L.jsx)(XI,{className:`size-2.5`})})}),(0,L.jsx)(CR,{side:`right`,children:r})]})}var lhe=e=>e.goal?.state===`active`;function uhe({conversation:e}){let t=`Goal: ${e.goal?.condition??``}`;return(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsx)(`span`,{role:`img`,"aria-label":t,className:`flex size-3.5 items-center justify-center rounded-full bg-sidebar text-primary ring-1 ring-sidebar-border`,children:(0,L.jsx)(eR,{className:`size-2.5`})})}),(0,L.jsx)(CR,{side:`right`,children:t})]})}function D9({Item:e,archived:t,onRename:n,onArchive:r,onDelete:i}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(e,{onSelect:n,children:`Rename thread`}),(0,L.jsx)(e,{onSelect:r,children:t?`Unarchive`:`Archive`}),(0,L.jsx)(e,{variant:`destructive`,onSelect:i,children:`Delete`})]})}var dhe=e=>e.timers>0;function fhe({conversation:e}){let t=zK(e.nextTimerAt,Date.now());return(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsx)(`span`,{role:`img`,"aria-label":t,className:`flex size-3.5 items-center justify-center rounded-full bg-sidebar text-muted-foreground ring-1 ring-sidebar-border`,children:(0,L.jsx)(hoe,{className:`size-2.5`})})}),(0,L.jsx)(CR,{side:`right`,children:t})]})}var O9=e=>e.workspace.mode===`worktree`&&e.workspace.state!==`removed`,phe=e=>{let{branch:t,base:n}=e.workspace;return[t??`worktree`,n?`→ ${n}`:null].filter(Boolean).join(` `)};function mhe({warning:e}){let t=e.startsWith(`Uncommitted changes`),n=e.startsWith(`Unmerged commits`)||e.startsWith(`Uncommitted changes and`);return(0,L.jsxs)(L.Fragment,{children:[t&&(0,L.jsx)(AL,{className:`size-2.5`,"aria-hidden":!0}),n&&(0,L.jsx)(pI,{className:`size-2.5`,"aria-hidden":!0}),!t&&!n&&(0,L.jsx)(cR,{className:`size-2.5`,"aria-hidden":!0})]})}function hhe({ahead:e,behind:t,dirty:n}){return(0,L.jsxs)(L.Fragment,{children:[e>0&&(0,L.jsxs)(`span`,{"aria-hidden":!0,children:[`↑`,e]}),t>0&&(0,L.jsxs)(`span`,{"aria-hidden":!0,children:[`↓`,t]}),n>0&&(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,"aria-hidden":!0,children:[(0,L.jsx)(AL,{className:`size-2.5`}),n]})]})}function ghe({conversation:e}){let t=e.unmergedWarning,n=Pw(e.id,O9(e)&&t===null).data;if(!O9(e))return null;let r=n?.dirtyFiles.length??0,i=n?.ahead??0,a=n?.behind??0,o=n!==void 0&&e.workspace.state===`merged`&&i===0&&r===0,s=t||[o?`merged`:n&&i===0&&a===0&&r===0?`clean`:null,i>0?`${i} ahead`:null,a>0?`${a} behind`:null,r>0?`${r} uncommitted`:null].filter(Boolean).join(` · `),c=t??[phe(e),s].filter(Boolean).join(` · `);return(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsxs)(`span`,{role:`img`,"aria-label":c,className:t!==null||i>0||r>0?`flex items-center gap-1 text-[11px] text-amber-600 tabular-nums dark:text-amber-400`:o?`flex items-center gap-1 text-[11px] text-green-500 tabular-nums`:`flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums`,children:[o?(0,L.jsx)(QI,{className:`size-3`,"aria-hidden":!0}):(0,L.jsx)(JI,{className:`size-3`,"aria-hidden":!0}),t?(0,L.jsx)(mhe,{warning:t}):(0,L.jsx)(hhe,{ahead:i,behind:a,dirty:r})]})}),(0,L.jsx)(CR,{side:`right`,children:c})]})}var _he=(e,t,n)=>[e,n.agentType,t?.name,n.model?.modelId,n.status].filter(Boolean).join(` · `);function k9({conversation:e,project:t,active:n,showProject:r,depth:i=0,last:a=!1,branches:o}){let s=Sw(),c=J(),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(!1),p=e.title.trim()||`New thread`,m=e.archivedAt!==null,h=ihe(e,n,s),g=yC(),_=bt(),{isMobile:v,setOpenMobile:y}=MR(),b=()=>u(null),x=async()=>{await Promise.all([g.invalidateQueries({queryKey:Y.conversations(e.projectId)}),g.invalidateQueries({queryKey:Y.allConversations})])},S=async t=>{await c.conversations.rename(e.id,t),await x()},C=async()=>{await c.conversations.archive(e.id,!m),await x()},w=async t=>{await c.conversations.remove(e.id,{force:t}),n&&_(`/`),await x()},T=e=>t?(0,L.jsx)(w5,{id:t.id,name:t.name,iconUrl:t.iconUrl?lU(t.iconUrl,s):null,home:t.kind===`home`,tile:e}):null,E=m?soe:coe,D=i>0?(0,L.jsx)(the,{last:a}):o?(0,L.jsx)(nhe,{expanded:o.expanded,"aria-label":`${o.expanded?`Collapse`:`Expand`} subagents of ${p}`}):void 0;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(qme,{children:[(0,L.jsx)(Jme,{asChild:!0,children:(0,L.jsx)(ehe,{actionsOpen:d,"data-depth":i,compact:i>0,decoration:D,flipId:e.id,current:n,title:p,tooltip:_he(p,t,e),link:(0,L.jsx)(Ln,{to:iU(e.projectId,e.id,s),"aria-current":n?`page`:void 0,onClick:()=>v&&y(!1)}),avatar:(0,L.jsx)(Kme,{size:i>0?20:24,avatarIndex:e.avatarIndex,working:e.status===`running`,badge:h&&h!==`running`?(0,L.jsx)(TU,{status:h}):void 0,originBadge:she(e)?(0,L.jsx)(che,{conversation:e}):void 0,goalBadge:lhe(e)?(0,L.jsx)(uhe,{conversation:e}):void 0,timerBadge:dhe(e)?(0,L.jsx)(fhe,{conversation:e}):void 0}),context:i===0&&r?t?.name:void 0,projectIcon:i>0?void 0:T(17),worktree:i===0?(0,L.jsx)(ghe,{conversation:e}):void 0,time:(0,L.jsxs)(L.Fragment,{children:[i>0?(0,L.jsx)(zq,{conversationId:e.id,enabled:e.status===`running`}):null,(0,L.jsx)(w6,{at:e.lastActivityAt})]}),actions:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z,{variant:`ghost`,size:`icon-xs`,"aria-label":`${m?`Unarchive`:`Archive`} ${p}`,onClick:C,children:(0,L.jsx)(E,{})}),(0,L.jsxs)(FW,{onOpenChange:f,children:[(0,L.jsx)(IW,{asChild:!0,children:(0,L.jsx)(Z,{variant:`ghost`,size:`icon-xs`,"aria-label":`Actions for ${p}`,children:(0,L.jsx)(MI,{})})}),(0,L.jsx)(LW,{side:`right`,align:`start`,children:(0,L.jsx)(D9,{Item:RW,archived:m,onRename:()=>u(`rename`),onArchive:C,onDelete:()=>u(`delete`)})})]})]})})}),(0,L.jsx)(Yme,{children:(0,L.jsx)(D9,{Item:Xme,archived:m,onRename:()=>u(`rename`),onArchive:C,onDelete:()=>u(`delete`)})})]}),l===`rename`&&(0,L.jsx)(xW,{title:`Rename thread`,label:`Title`,initialValue:e.title,onSubmit:S,onClose:b}),l===`delete`&&(0,L.jsx)(ohe,{title:p,onConfirm:w,onClose:b})]})}function vhe({message:e}){return(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsxs)(CW,{variant:`destructive`,className:`mx-2 mb-1`,"data-testid":`unmerged-warning`,children:[(0,L.jsx)(cR,{}),d_(e)]})}),(0,L.jsx)(CR,{children:e})]})}function A9({conversations:e,activeConversationId:t,projects:n,showProject:r}){let[i,a]=(0,M.useState)(!1),{inFlight:o}=O5();if(e.length===0)return null;let s=e.filter(e=>e.parentId===null);return(0,L.jsxs)($K,{className:`group/archived`,children:[(0,L.jsxs)(eq,{className:`flex w-full items-center gap-1 px-2 py-1 text-xs text-muted-foreground`,children:[(0,L.jsx)(SI,{className:`size-3 transition-transform group-data-[state=open]/archived:rotate-90`}),`Archived (`,e.length,`)`]}),i&&(0,L.jsx)(Kpe,{archived:s,onClose:()=>a(!1)}),(0,L.jsx)(tq,{children:(0,L.jsxs)(GR,{children:[e.map(e=>(0,L.jsxs)(M.Fragment,{children:[(0,L.jsx)(k9,{conversation:e,project:n.get(e.projectId),active:e.id===t,showProject:r}),e.unmergedWarning!==null&&(0,L.jsx)(vhe,{message:e.unmergedWarning})]},e.id)),r&&(0,L.jsx)(KR,{children:(0,L.jsxs)(JR,{size:`sm`,className:`text-muted-foreground hover:text-destructive`,"aria-disabled":o,onClick:()=>o?eH.info(`Already deleting…`):a(!0),children:[(0,L.jsx)(oR,{}),`Delete all archived`]})})]})})]})}function yhe({project:e,onClose:t}){let n=J(),r=Y3(),i=(0,M.useId)(),[a,o]=(0,M.useState)(``),s=yC(),{run:c,error:l,pending:u}=bW();return(0,L.jsx)(yB,{open:!0,onOpenChange:e=>!e&&t(),children:(0,L.jsx)(SB,{children:(0,L.jsxs)(`form`,{onSubmit:async r=>{r.preventDefault(),await c(async()=>{await n.projects.setFolder(e.id,a.trim()),await s.invalidateQueries({queryKey:Y.projects}),await s.invalidateQueries({queryKey:Y.conversations(e.id)})})&&(eH.success(`${e.name} now uses ${a.trim()}`),t())},className:`flex flex-col gap-4`,children:[(0,L.jsxs)(CB,{children:[(0,L.jsx)(TB,{children:`Change folder`}),(0,L.jsxs)(EB,{children:[`Point `,e.name,` at the same repository in another place, for example after you moved it.`]})]}),(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Current folder: `,(0,L.jsx)(`span`,{className:`font-mono`,children:e.path})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`label`,{htmlFor:i,className:`text-sm font-medium`,children:[`New folder`,r]}),(0,L.jsx)(J3,{id:i,value:a,onValueChange:o,placeholder:`~/src/my-app`,autoFocus:!0,"aria-invalid":l?!0:void 0}),(0,L.jsx)(yW,{message:l})]}),(0,L.jsxs)(wB,{children:[(0,L.jsx)(Z,{type:`button`,variant:`outline`,onClick:t,children:`Cancel`}),(0,L.jsx)(Z,{type:`submit`,disabled:u||a.trim()===``,children:`Change folder`})]})]})})})}function j9({projectId:e,error:t,onRemove:n}){let r=J(),i=yC();return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 px-2 py-1`,children:[(0,L.jsx)(CW,{variant:`destructive`,className:`w-fit`,children:`Clone failed`}),t&&(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(Z,{size:`sm`,variant:`outline`,onClick:async()=>{await r.projects.retryClone(e),await i.invalidateQueries({queryKey:Y.projects})},children:`Retry`}),(0,L.jsx)(Z,{size:`sm`,variant:`ghost`,onClick:n,children:`Remove`})]})]})}function M9({project:e,onConfirm:t,onClose:n}){let{run:r,error:i,pending:a}=bW();return(0,L.jsx)(yB,{open:!0,onOpenChange:e=>!e&&n(),children:(0,L.jsxs)(SB,{children:[(0,L.jsxs)(CB,{children:[(0,L.jsxs)(TB,{children:[`Remove `,e.name,`?`]}),(0,L.jsxs)(EB,{children:[`The project and its conversations disappear from tau. Files in `,e.path,` stay untouched.`]})]}),(0,L.jsx)(yW,{message:i}),(0,L.jsxs)(wB,{children:[(0,L.jsx)(Z,{variant:`outline`,onClick:n,children:`Cancel`}),(0,L.jsx)(Z,{variant:`destructive`,disabled:a,onClick:async()=>{await r(t)&&n()},children:`Remove project`})]})]})})}function N9({node:e,project:t,projects:n,activeConversationId:r,showProject:i}){let{conversation:a,children:o}=e,{isExpanded:s,toggle:c}=_pe(),l=s(a.id),u=(0,L.jsx)(k9,{conversation:a,project:t,active:a.id===r,showProject:i,branches:o.length>0?{expanded:l}:void 0});return o.length===0?u:(0,L.jsxs)($K,{open:l,onOpenChange:()=>c(a.id),"data-testid":`thread-tree-${a.id}`,children:[u,(0,L.jsx)(tq,{children:(0,L.jsx)(XR,{className:`mr-0 ml-5`,children:o.map((e,a)=>(0,L.jsx)(k9,{depth:1,last:a===o.length-1,conversation:e,project:n.get(e.projectId)??t,active:e.id===r,showProject:i},e.id))})})]})}function P9(e,t){let n=J(),r=yC();return async()=>{await n.projects.remove(e),await Promise.all([r.invalidateQueries({queryKey:Y.projects}),r.invalidateQueries({queryKey:Y.allConversations})]),t()}}function bhe({section:e,projects:t,activeConversationId:n,open:r,onOpenChange:i,onRemoved:a}){let o=J(),s=Sw(),{project:c,active:l,archived:u}=e,[d,f]=(0,M.useState)(null),p=yC(),m=bt(),h=()=>f(null),g=c.kind===`home`,_=P9(c.id,a);return(0,L.jsxs)(VR,{role:`group`,"aria-label":c.name,children:[(0,L.jsxs)($K,{open:r,onOpenChange:i,children:[(0,L.jsx)(HR,{asChild:!0,title:c.path,className:`pr-14`,children:(0,L.jsxs)(eq,{className:`w-full gap-1.5`,children:[(0,L.jsx)(SI,{className:r?`rotate-90 transition-transform`:`transition-transform`}),(0,L.jsx)(w5,{id:c.id,name:c.name,iconUrl:c.iconUrl?lU(c.iconUrl,s):null,home:g}),(0,L.jsx)(`span`,{className:`truncate`,children:c.name}),c.status===`cloning`&&(0,L.jsx)(gG,{className:`ml-1 size-3`,"aria-label":`Cloning`})]})}),(0,L.jsxs)(FW,{children:[(0,L.jsx)(IW,{asChild:!0,children:(0,L.jsx)(UR,{"aria-label":`Actions for ${c.name}`,className:`right-8`,children:(0,L.jsx)(MI,{})})}),(0,L.jsxs)(LW,{side:`right`,align:`start`,children:[c.status===`ready`&&(0,L.jsx)(RW,{onSelect:()=>m(aU(c.id,s)),children:`New thread`}),!g&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(RW,{onSelect:()=>f(`rename`),children:`Rename project`}),(0,L.jsx)(RW,{onSelect:()=>f(`icon`),children:`Change icon`}),(0,L.jsx)(RW,{onSelect:()=>f(`folder`),children:`Change folder…`}),(0,L.jsx)(RW,{variant:`destructive`,onSelect:()=>f(`remove`),children:`Remove project`})]}),(0,L.jsx)(zW,{}),(0,L.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:_6(c.path)})]})]}),c.status===`ready`&&(0,L.jsx)(UR,{"aria-label":`New thread in ${c.name}`,title:`New thread`,onClick:()=>m(aU(c.id,s)),children:(0,L.jsx)(PL,{})}),(0,L.jsxs)(tq,{children:[c.status===`failed`&&(0,L.jsx)(j9,{projectId:c.id,error:c.error,onRemove:()=>f(`remove`)}),c.status===`ready`&&(0,L.jsxs)(WR,{children:[(0,L.jsxs)(GR,{children:[l.length===0&&(0,L.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:`No threads yet`}),m6(l).map(e=>(0,L.jsx)(N9,{node:e,project:c,projects:t,activeConversationId:n,showProject:!1},e.conversation.id))]}),(0,L.jsx)(A9,{conversations:u,activeConversationId:n,projects:t,showProject:!1})]})]})]}),d===`rename`&&(0,L.jsx)(xW,{title:`Rename project`,label:`Name`,initialValue:c.name,onSubmit:async e=>{await o.projects.rename(c.id,e),await p.invalidateQueries({queryKey:Y.projects})},onClose:h}),d===`remove`&&(0,L.jsx)(M9,{project:c,onConfirm:_,onClose:h}),d===`folder`&&(0,L.jsx)(yhe,{project:c,onClose:h}),d===`icon`&&(0,L.jsx)(Ipe,{project:c,onClose:h})]})}function xhe({projects:e,conversations:t,activeConversationId:n,onProjectRemoved:r}){let i=(0,M.useRef)(null),{overrides:a,setOpen:o}=gpe(),s=Ale(_t().pathname,Sw()),c=kle(e,t);C5(i,c.map(e=>v6(e,a,s)).join(`,`));let l=new Map(e.map(e=>[e.id,e]));return(0,L.jsx)(`div`,{ref:i,children:c.map(e=>(0,L.jsx)(bhe,{section:e,projects:l,activeConversationId:n,open:v6(e,a,s),onOpenChange:t=>o(e.project.id,t),onRemoved:()=>r(e.project.id)},e.project.id))})}function She({project:e,onRemoved:t}){let[n,r]=(0,M.useState)(!1),i=P9(e.id,t);return(0,L.jsxs)(KR,{"aria-label":e.name,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 text-sm`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:e.name}),e.status===`cloning`&&(0,L.jsx)(gG,{className:`size-3`,"aria-label":`Cloning`})]}),e.status===`failed`&&(0,L.jsx)(j9,{projectId:e.id,error:e.error,onRemove:()=>r(!0)}),n&&(0,L.jsx)(M9,{project:e,onConfirm:i,onClose:()=>r(!1)})]})}function Che({projects:e,conversations:t,activeConversationId:n,onProjectRemoved:r}){let i=(0,M.useRef)(null);C5(i,`threads`);let a=new Map(e.map(e=>[e.id,e])),o=e.filter(e=>e.status!==`ready`),s=new Set(e.filter(e=>e.status===`ready`).map(e=>e.id)),c=t.filter(e=>s.has(e.projectId));return(0,L.jsx)(VR,{children:(0,L.jsxs)(WR,{children:[(0,L.jsx)(`div`,{ref:i,children:(0,L.jsxs)(GR,{children:[o.map(e=>(0,L.jsx)(She,{project:e,onRemoved:()=>r(e.id)},e.id)),m6(f6(c)).map(e=>(0,L.jsx)(N9,{node:e,project:a.get(e.conversation.projectId),projects:a,activeConversationId:n,showProject:!0},e.conversation.id))]})}),(0,L.jsx)(A9,{conversations:p6(c),activeConversationId:n,projects:a,showProject:!0})]})})}function F9({mode:e,activeConversationId:t,onProjectRemoved:n}){let r=Sw(),i=Tw(),a=Mw(),o=e===`threads`?Che:xhe;return(0,M.useEffect)(()=>{r!==void 0&&i.data&&a.data&&xpe(r,{savedAt:Date.now(),projects:i.data.map(({id:e,name:t})=>({id:e,name:t})),threads:a.data.filter(e=>e.archivedAt===null).map(({id:e,projectId:t,title:n,updatedAt:r})=>({id:e,projectId:t,title:n,updatedAt:r}))})},[r,i.data,a.data]),i.isPending?(0,L.jsx)(YR,{showIcon:!0}):i.isError?(0,L.jsx)(`p`,{className:`px-4 text-sm text-destructive`,children:_C(i.error)}):(0,L.jsx)(o,{projects:i.data,conversations:a.data??[],activeConversationId:t,onProjectRemoved:n})}function whe({machine:e,now:t}){let n=qw(e.id).data??bpe(e.id),r=n?.threads??[];return(0,L.jsxs)(WR,{className:`opacity-60`,"data-stale":!0,children:[(0,L.jsx)(`p`,{className:`px-2 pb-1 text-xs text-muted-foreground`,children:HG(e,t)}),n===void 0?(0,L.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:`No threads were seen yet.`}):n.projects.filter(e=>r.some(t=>t.projectId===e.id)).map(t=>(0,L.jsxs)(VR,{role:`group`,"aria-label":t.name,className:`p-0`,children:[(0,L.jsx)(HR,{children:t.name}),(0,L.jsx)(GR,{children:r.filter(e=>e.projectId===t.id).map(t=>(0,L.jsx)(KR,{children:(0,L.jsx)(JR,{asChild:!0,size:`sm`,children:(0,L.jsx)(Ln,{to:iU(t.projectId,t.id,e.id),children:(0,L.jsx)(`span`,{className:`truncate`,children:t.title})})})},t.id))})]},t.id))]})}var The=[{value:`threads`,label:`Threads`,icon:(0,L.jsx)(cL,{})},{value:`projects`,label:`Projects`,icon:(0,L.jsx)(KI,{})}],I9=(e,t)=>e===t;function Ehe(){let[e,t]=(0,M.useState)(()=>Date.now());return(0,M.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),3e4);return()=>clearInterval(e)},[]),e}function Dhe({machine:e,mode:t}){let n=uU(),r=bt(),i=Ehe(),a=I9(n.machineId,e.id);return(0,L.jsx)(b5,{machine:e,name:e.name,children:VG(e)?(0,L.jsx)(w3,{machineId:e.id,children:(0,L.jsx)(F9,{mode:t,activeConversationId:a?n.conversationId:void 0,onProjectRemoved:e=>a&&e===n.projectId&&r(`/`)})}):(0,L.jsx)(whe,{machine:e,now:i})})}function Ohe({mode:e}){let{machines:t}=PG(),n=uU(),r=bt(),i=(0,L.jsx)(F9,{mode:e,activeConversationId:I9(n.machineId,void 0)?n.conversationId:void 0,onProjectRemoved:e=>n.machineId===void 0&&e===n.projectId&&r(`/`)});return t.length===0?i:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(b5,{machine:void 0,name:`This machine`,children:i}),t.map(t=>(0,L.jsx)(Dhe,{machine:t,mode:e},t.id))]})}function khe(){let[e,t]=hpe(),n=bt(),r=_5();return(0,L.jsxs)(PR,{"aria-label":`Projects and threads`,children:[(0,L.jsxs)(RR,{className:`gap-2 px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(mpe,{}),(0,L.jsx)(FR,{className:`hidden shrink-0 md:inline-flex`})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(Z,{variant:`outline`,size:`sm`,className:`min-w-0`,onClick:()=>n(aU()),children:[(0,L.jsx)(mL,{}),(0,L.jsx)(`span`,{className:`truncate`,children:`New thread`})]}),(0,L.jsx)(A6,{value:e,onChange:t,options:The,"aria-label":`Sidebar view`})]})]}),(0,L.jsx)(BR,{children:(0,L.jsx)(Ohe,{mode:e})}),(0,L.jsx)(zR,{children:(0,L.jsxs)(Z,{variant:`ghost`,className:`justify-start`,onClick:r,children:[(0,L.jsx)(WL,{}),`Settings`]})}),(0,L.jsx)(IR,{})]})}function Ahe({machine:e}){return e.status===`update-required`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`h2`,{className:`text-base font-medium`,children:[`Update tau on `,e.name]}),(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This machine runs tau `,e.tauVersion,`, which does not match this one. Run the command on`,` `,e.name,`, then it comes back by itself.`]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`code`,{className:`rounded-md bg-muted px-2 py-1 text-xs`,children:UG}),(0,L.jsx)(hq,{text:UG,label:`Copy update command`})]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`h2`,{className:`text-base font-medium`,children:`This machine is offline`}),(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e.name,` was last seen `,BG(e.lastSeenAt,Date.now()),`. Its threads come back when it connects again.`]})]})}function jhe({machine:e}){return(0,L.jsxs)(`div`,{role:`status`,"data-testid":`machine-offline`,className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,L.jsx)(NG,{os:e.os,status:e.status,className:`size-6`}),(0,L.jsx)(Ahe,{machine:e}),(0,L.jsx)(Z,{asChild:!0,variant:`outline`,size:`sm`,children:(0,L.jsx)(Ln,{to:`/`,children:`Back to new thread`})})]})}function Mhe(){return(0,L.jsxs)(`div`,{role:`status`,className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,L.jsx)(`h2`,{className:`text-base font-medium`,children:`This machine is not linked`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`It was disconnected, or this link is old.`}),(0,L.jsx)(Z,{asChild:!0,variant:`outline`,size:`sm`,children:(0,L.jsx)(Ln,{to:`/`,children:`Back to new thread`})})]})}var Nhe=`tau:new-thread-draft`,L9=e=>QR(Nhe,e),R9={projectId:null,model:null,thinkingLevel:null,workspace:null},Phe=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],Fhe=[`worktree`,`checkout`];function Ihe(e){return typeof e==`object`&&!!e&&typeof e.provider==`string`&&typeof e.modelId==`string`}function Lhe(e){if(typeof e!=`object`||!e)return R9;let t=e;return{projectId:typeof t.projectId==`string`?t.projectId:null,model:Ihe(t.model)?{provider:t.model.provider,modelId:t.model.modelId}:null,thinkingLevel:typeof t.thinkingLevel==`string`&&Phe.includes(t.thinkingLevel)?t.thinkingLevel:null,workspace:typeof t.workspace==`string`&&Fhe.includes(t.workspace)?t.workspace:null}}function Rhe(e){try{let t=window.localStorage.getItem(L9(e));return t?Lhe(JSON.parse(t)):R9}catch{return R9}}function zhe(e,t){try{window.localStorage.setItem(L9(t),JSON.stringify(e))}catch{}}function Bhe(e){try{window.localStorage.removeItem(L9(e))}catch{}}var z9=`tau:new-thread-request`;function B9(){return globalThis.crypto?.randomUUID?.()??`req-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Vhe(){try{let e=window.sessionStorage.getItem(z9);if(e)return e;let t=B9();return window.sessionStorage.setItem(z9,t),t}catch{return B9()}}function Hhe(){try{window.sessionStorage.removeItem(z9)}catch{}}function V9({value:e,label:t,icon:n}){return(0,L.jsxs)(xR,{children:[(0,L.jsx)(SR,{asChild:!0,children:(0,L.jsx)(U3,{value:e,"aria-label":t,className:`text-muted-foreground aria-checked:bg-muted aria-checked:text-foreground`,children:(0,L.jsx)(n,{})})}),(0,L.jsx)(CR,{children:t})]})}function Uhe({projectId:e,value:t,onChange:n,disabled:r}){let i=Tw().data?.find(t=>t.id===e),a=ww().data?.workspaceDefault??`per-project`,o=a===`per-project`?i?.lastWorkspaceMode??`worktree`:a;return i?.isGitRepo?(0,L.jsxs)(H3,{type:`single`,variant:`outline`,size:`sm`,spacing:0,value:t??o,onValueChange:e=>e&&n(e),disabled:r,"aria-label":`Where the thread works`,children:[(0,L.jsx)(V9,{value:`worktree`,label:`Worktree`,icon:JI}),(0,L.jsx)(V9,{value:`checkout`,label:`Main checkout`,icon:WI})]}):null}function Whe(){let e=J(),t=yC(),[n,r]=(0,M.useState)(!1),i=async()=>{r(!0);try{t.setQueryData(Y.githubRepos,await e.github.refreshRepos())}catch{await t.invalidateQueries({queryKey:Y.githubRepos})}finally{r(!1)}};return(0,L.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Refresh GitHub repos`,disabled:n,onClick:()=>void i(),children:(0,L.jsx)(IL,{className:n?`animate-spin`:void 0})})}function Ghe({repo:e,onClose:t,onUsed:n}){return(0,L.jsx)(yB,{open:e!==null,onOpenChange:e=>!e&&t(),children:(0,L.jsx)(SB,{children:e?(0,L.jsx)(Khe,{repo:e,onUsed:n}):null})})}function Khe({repo:e,onUsed:t}){let n=J(),r=Y3(),[i,a]=(0,M.useState)(`clone`),[o,s]=(0,M.useState)(``),[c,l]=(0,M.useState)(null),{run:u,error:d,pending:f}=bW(),p=()=>u(async()=>{let r=await n.github.use({nameWithOwner:e.nameWithOwner,mode:i,...i===`folder`&&{path:o.trim()}});i===`clone`?l(r):t(r)});return c?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(CB,{children:[(0,L.jsxs)(TB,{children:[`Cloning `,e.nameWithOwner]}),(0,L.jsxs)(EB,{children:[`Cloning into `,c.path]})]}),(0,L.jsx)(wB,{children:(0,L.jsx)(Z,{type:`button`,onClick:()=>t(c),children:`Continue`})})]}):(0,L.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),p()},children:[(0,L.jsxs)(CB,{children:[(0,L.jsxs)(TB,{children:[`Use `,e.nameWithOwner]}),(0,L.jsx)(EB,{children:`This repository has no copy in your code folder yet.`})]}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(Z,{type:`button`,variant:i===`clone`?`default`:`outline`,onClick:()=>a(`clone`),children:`Clone`}),(0,L.jsx)(Z,{type:`button`,variant:i===`folder`?`default`:`outline`,onClick:()=>a(`folder`),children:`Use an existing folder`})]}),i===`folder`?(0,L.jsx)(J3,{"aria-label":`Folder path${r}`,placeholder:`~/path/to/repo`,value:o,onValueChange:s}):null,(0,L.jsx)(yW,{message:d}),(0,L.jsx)(wB,{children:(0,L.jsx)(Z,{type:`submit`,disabled:f||i===`folder`&&!o.trim(),children:i===`clone`?`Clone now`:`Use folder`})})]})}var H9=`Projects`,U9=`machine:`,qhe=(e,t)=>`${U9}${e}:${t}`,W9=(e,t=H9,n=e.id,r)=>({value:n,label:e.name,group:t,disabled:e.status===`failed`,icon:(0,L.jsx)(w5,{id:e.id,name:e.name,iconUrl:e.iconUrl?lU(e.iconUrl,r):null,home:e.kind===`home`}),...e.status!==`ready`&&{hint:e.status}});function Jhe(){let e=E3();return{all:e,groupOf:t=>e.length>1?t.name:H9}}function Yhe({projects:e,projectId:t,onProject:n,disabled:r,onMachineProject:i}){let a=J(),o=Sw(),{all:s,groupOf:c}=Jhe(),l=hz(),u=s.find(e=>e.machineId===o),d=s.filter(e=>e.machineId!==o),[f,p]=(0,M.useState)(!1),[m,h]=(0,M.useState)(null),g=yC(),_=Nw(),v=Qne(_.data?.state===`connected`),[y,b]=(0,M.useState)(!1),[x,S]=(0,M.useState)(null),{run:C,error:w}=bW(),T=async e=>{await g.invalidateQueries({queryKey:Y.projects}),n(e.id)},E=e=>C(async()=>{await T(await a.github.use({nameWithOwner:e.nameWithOwner,mode:`local`}))}),D=e=>{let t=v.data?.find(t=>t.nameWithOwner===e);t&&(t.localPath?E(t):S(t))},O=e=>{if(e.startsWith(U9)){let[,t=``,...n]=e.split(`:`);i?.(t,n.join(`:`));return}let t=Ple(e);t?D(t):n(e)},k=s.length>1?Object.fromEntries(s.map(e=>[c(e),(0,L.jsx)(NG,{os:e.os,status:e.status},e.name)])):{},A=[...n5(e).map(e=>W9(e,u?c(u):H9,e.id,o)),...d.flatMap(e=>n5([...e.projects]).map(t=>W9(t,c(e),qhe(e.machineId??``,t.id),e.machineId))),...Lle({status:_.data,repos:v.data,reposFailed:v.isError})];return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(nK,{"aria-label":`Project`,variant:`ghost`,size:`sm`,className:`w-auto min-w-0 max-w-full`,contentClassName:`w-[min(32rem,calc(100vw-2rem))]`,disabled:r,options:A,value:t,onChange:O,onOpenChange:e=>e&&void g.invalidateQueries({queryKey:Y.githubRepos}),footer:e=>(0,L.jsxs)(Z,{variant:`ghost`,size:`sm`,className:`w-full justify-start font-normal`,onClick:()=>{e(),s.length>1?p(!0):b(!0)},children:[(0,L.jsx)(PL,{}),`Add project…`]}),groupIcons:k,groupActions:_.data?.state===`connected`?{[T6]:(0,L.jsx)(Whe,{})}:void 0}),(0,L.jsx)(yW,{message:w,className:`w-full`}),f&&(0,L.jsx)(Z3,{machines:s,onClose:()=>p(!1),onChoose:e=>{p(!1),e===o?b(!0):h({machineId:e})}}),m&&(0,L.jsx)(w3,{machineId:m.machineId,children:(0,L.jsx)(X3,{onClose:()=>h(null),onAdded:e=>{l.invalidateQueries({queryKey:Y.projects}),l.invalidateQueries({queryKey:[`machine-data`]}),i?.(m.machineId,e.id)}})},m.machineId??`local`),y&&(0,L.jsx)(X3,{onClose:()=>b(!1),onAdded:e=>void T(e)}),(0,L.jsx)(Ghe,{repo:x,onClose:()=>S(null),onUsed:e=>{S(null),T(e)}})]})}var G9=({provider:e,modelId:t})=>({provider:e,modelId:t});function K9(){let e=J(),t=Sw(),n=bt(),r=yC(),[i]=Vn(),a=Tw(),o=Ew(),s=ww(),[c]=(0,M.useState)(()=>Rhe(t)),[l,u]=(0,M.useState)(c.projectId),[d,f]=(0,M.useState)(c.model),[p,m]=(0,M.useState)(c.thinkingLevel),[h,g]=(0,M.useState)(c.workspace),[_,v]=(0,M.useState)(!1),y=i.get(`project`);(0,M.useEffect)(()=>{zhe({projectId:y??l,model:d,thinkingLevel:p,workspace:h},t)},[y,l,d,p,h,t]);let b=(0,M.useRef)(null),x=(0,M.useMemo)(()=>({model:()=>b.current?.openModel(),thinking:()=>b.current?.openThinking()}),[]);if(!a.data||!o.data||!s.data)return(0,L.jsx)(Xhe,{});let S=y??l??fz.getLastProjectId(t),C=Efe(a.data,S),w=d??fz.getLastModel(t),T=Cfe(o.data,w,s.data.defaultModel),E=Tfe(T,p??s.data.defaultThinkingLevel??fz.getLastThinkingLevel(t)),D=t5(o.data,T??null)?.thinkingLevels??[`off`],O=a.data.find(e=>e.id===C)?.status===`cloning`,k=async({text:i,images:a})=>{v(!0);try{let o=await e.conversations.start({projectId:C,text:i,requestId:Vhe(),...T&&{model:G9(T)},thinkingLevel:E,...h&&{workspace:h},...a.length>0&&{images:a}});Hhe(),Bhe(t),r.invalidateQueries({queryKey:Y.projects}),fz.setLastProjectId(o.projectId,t),T&&fz.setLastModel(G9(T),t),fz.setLastThinkingLevel(E,t),n(iU(o.projectId,o.id,t))}finally{v(!1)}},A=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Yhe,{projects:a.data,projectId:C,onProject:u,onMachineProject:(e,t)=>n(aU(t,e),{replace:!0}),disabled:_}),(0,L.jsx)(Uhe,{projectId:C,value:h,onChange:g,disabled:_}),O?(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Cloning…`}):null,(0,L.jsx)(hK,{ref:b,models:o.data,model:T?G9(T):null,onModel:f,levels:D,level:E,onLevel:m,disabled:_})]});return(0,L.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-4 p-6`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold`,children:`New thread`}),(0,L.jsx)(`div`,{className:`w-full max-w-2xl`,children:(0,L.jsx)(VH,{target:`new`,imagesAllowed:T?.images??!0,busy:_,disabled:O,toolbar:A,projectId:C,commands:x,onSend:k})})]})}function Xhe(){return(0,L.jsxs)(`div`,{role:`status`,"aria-label":`Loading`,className:`flex flex-col gap-3 p-4`,children:[(0,L.jsx)(Si,{className:`h-8 w-48`}),(0,L.jsx)(Si,{className:`h-24 w-full`})]})}function Zhe(e){let t=Mw().data?.find(t=>t.id===e)?.title,n=qG(Sw());(0,M.useEffect)(()=>{let e=[t,n,`tau`].filter(Boolean);return document.title=e.join(` · `),()=>{document.title=`tau`}},[t,n])}var Qhe=`/p/:projectId/c/:conversationId/terminal/:terminalId`,$he=`/m/:machineId/p/:projectId/c/:conversationId/terminal/:terminalId`;function ege(){let e=vt(Qhe)?.params.terminalId,t=vt($he)?.params.terminalId;return e??t}function q9({projectId:e,conversationId:t}){let n=ege();return Zhe(t),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(dU,{}),(0,L.jsx)(vW,{projectId:e,conversationId:t,terminalId:n,children:(0,L.jsx)(Ace,{id:t},t)})]})}function tge({machineId:e,projectId:t,conversationId:n}){let{machines:r,isLoading:i}=PG(),a=r.find(t=>t.id===e);return i?null:a?VG(a)?(0,L.jsx)(D3,{machineId:e,children:(0,L.jsx)(q9,{projectId:t,conversationId:n})}):(0,L.jsx)(jhe,{machine:a}):(0,L.jsx)(Mhe,{})}function J9(){let{machineId:e,projectId:t,conversationId:n}=St();return!t||!n?(0,L.jsx)(K9,{}):e===void 0?(0,L.jsx)(q9,{projectId:t,conversationId:n}):(0,L.jsx)(tge,{machineId:e,projectId:t,conversationId:n})}function Y9(){let e=Vn()[0].get(`machine`)??void 0,{machines:t}=PG(),n=t.some(t=>t.id===e&&VG(t));return(0,L.jsx)(D3,{machineId:n?e:void 0,children:(0,L.jsx)(K9,{})})}function nge(){let{isMobile:e,open:t}=MR();return!e&&t?null:(0,L.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-2 border-b px-3`,children:[(0,L.jsx)(FR,{"aria-label":`Open sidebar`}),(0,L.jsx)(`span`,{className:`text-sm font-semibold`,children:`tau`})]})}function rge(){return(0,L.jsxs)(NR,{defaultOpen:fz.getSidebarOpen(),onOpenChange:fz.setSidebarOpen,defaultWidth:fz.getSidebarWidth(),onWidthChange:fz.setSidebarWidth,children:[(0,L.jsx)(khe,{}),(0,L.jsx)(fpe,{}),(0,L.jsx)(ppe,{}),(0,L.jsx)(qce,{}),(0,L.jsxs)(LR,{className:`h-dvh min-w-0`,children:[(0,L.jsx)(nge,{}),(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-auto`,children:(0,L.jsxs)(Gt,{children:[(0,L.jsx)(Ut,{path:`/p/:projectId/c/:conversationId/*`,element:(0,L.jsx)(J9,{})}),(0,L.jsx)(Ut,{path:`/m/:machineId/p/:projectId/c/:conversationId/*`,element:(0,L.jsx)(J9,{})}),(0,L.jsx)(Ut,{path:`/new`,element:(0,L.jsx)(Y9,{})}),(0,L.jsx)(Ut,{path:`*`,element:(0,L.jsx)(Y9,{})})]})})]})]})}function ige({className:e,...t}){return(0,L.jsx)(`span`,{"data-slot":`brand-text`,className:I(`bg-brand-gradient bg-clip-text text-transparent`,e),...t})}function age(){let e=J(),t=(0,M.useId)(),n=(0,M.useId)(),r=yC(),i=Ew(),{run:a,error:o,pending:s}=bW(),[c,l]=(0,M.useState)(null),[u,d]=(0,M.useState)(null);if(i.isError)return(0,L.jsx)(yW,{message:_C(i.error)});if(i.isPending)return(0,L.jsx)(Si,{className:`h-9 w-full`});let f=()=>a(async()=>{c&&(await e.settings.setFastModel(u),await e.settings.setDefaultModel(c),await r.invalidateQueries({queryKey:Y.settings}))});return(0,L.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,L.jsx)(`label`,{htmlFor:t,className:`text-sm font-medium`,children:`Default model`}),(0,L.jsx)(mK,{id:t,models:i.data,value:c,onChange:l}),(0,L.jsx)(`label`,{htmlFor:n,className:`text-sm font-medium`,children:`Fast model (optional)`}),(0,L.jsx)(mK,{id:n,models:i.data,value:u,onChange:d,clearLabel:`Same as thread`,onClear:()=>d(null)}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The fast model names new threads. Changing the default model only affects new conversations. Existing ones keep their model.`}),(0,L.jsx)(yW,{message:o}),(0,L.jsx)(Z,{type:`submit`,disabled:!c||s,children:`Continue`})]})}function oge({connected:e,onContinue:t}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Models come from providers. We found the connections below on this computer, including any API keys and Claude CLI login.`}),(0,L.jsx)(J8,{}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e?`You’re connected. Continue to choose your models.`:`Connect at least one provider to continue. Keys stay on this computer.`}),(0,L.jsx)(Z,{disabled:!e,onClick:t,children:`Continue`})]})}function sge({keyConfigured:e}){let[t,n]=(0,M.useState)(!1),r=t&&e;return(0,L.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background p-4`,children:(0,L.jsxs)(`div`,{className:`flex w-full max-w-2xl flex-col gap-6 rounded-xl border bg-card p-6 text-card-foreground shadow-sm`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:[`Welcome to `,(0,L.jsx)(ige,{children:`tau`})]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r?`Step 2 of 2. Choose your models and projects folder.`:`Step 1 of 2. Review your providers.`})]}),r?(0,L.jsx)(age,{}):(0,L.jsx)(oge,{connected:e,onContinue:()=>n(!0)}),r?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(d8,{}),(0,L.jsx)(Z,{type:`button`,variant:`ghost`,onClick:()=>n(!1),children:`Back to providers`})]}):null]})})}var X9=()=>(0,M.useSyncExternalStore)(fz.subscribeTheme,fz.getTheme),cge=`(prefers-color-scheme: dark)`,lge=(e,t)=>e===`dark`||e===`system`&&t,Z9=()=>window.matchMedia(cge);function Q9(){let e=lge(fz.getTheme(),Z9().matches);document.documentElement.classList.toggle(`dark`,e)}function uge(){Q9();let e=Z9(),t=fz.subscribeTheme(Q9);return e.addEventListener(`change`,Q9),()=>{t(),e.removeEventListener(`change`,Q9)}}var dge=({...e})=>{let t=X9();return(0,L.jsx)(hH,{theme:t,className:`toaster group`,icons:{success:(0,L.jsx)(TI,{className:`size-4`}),info:(0,L.jsx)(iL,{className:`size-4`}),warning:(0,L.jsx)(cR,{className:`size-4`}),error:(0,L.jsx)(SL,{className:`size-4`}),loading:(0,L.jsx)(uL,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},toastOptions:{classNames:{toast:`cn-toast`}},...e})};function fge({children:e}){return(0,L.jsx)(w3,{children:(0,L.jsxs)(bR,{children:[e,(0,L.jsx)(dge,{})]})})}function pge(){let e=Cw(),t=ww(),n=e.error??t.error;if(n)return(0,L.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center p-6`,children:(0,L.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:_C(n)})});if(!e.data||!t.data)return(0,L.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center p-6`,"aria-busy":`true`,children:(0,L.jsx)(Si,{className:`h-8 w-48`})});let r=e.data.some(gne);return!r||!t.data.defaultModel?(0,L.jsx)(sge,{keyConfigured:r}):(0,L.jsx)(npe,{children:(0,L.jsx)(rge,{})})}function mge(){return(0,L.jsx)(fge,{children:(0,L.jsx)(In,{children:(0,L.jsx)(pge,{})})})}uge();var $9=document.getElementById(`root`);if(!$9)throw Error(`Missing #root`);(0,un.createRoot)($9).render((0,L.jsx)(M.StrictMode,{children:(0,L.jsx)(mge,{})}));
|