@soleone/factory 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/cli.mjs +228 -66
- package/dist/web/assets/index-2UZaUTUZ.js +80 -0
- package/dist/web/assets/index-DcONJvgj.css +2 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-CeezqU5U.js +0 -80
- package/dist/web/assets/index-D6pZboac.css +0 -2
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=B,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.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`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),B=Symbol.for(`react.lazy`),V=Symbol.for(`react.activity`),ee=Symbol.for(`react.legacy_hidden`),H=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.for(`react.view_transition`),ne=Symbol.for(`react.recoverable`),re=Symbol.iterator;function U(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case V:return`Activity`;case te:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case B:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,W=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},se=[],q=-1;function ce(e){return{current:e}}function le(e){0>q||(e.current=se[q],se[q]=null,q--)}function ue(e,t){q++,se[q]=e.current,e.current=t}var de=ce(null),fe=ce(null),pe=ce(null),me=ce(null);function he(e,t){switch(ue(pe,t),ue(fe,e),ue(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?pp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=pp(t),e=mp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(de),ue(de,e)}function ge(){le(de),le(fe),le(pe)}function _e(e){var t=e.memoizedState;t!==null&&(ch._currentValue=t.memoizedState,ue(me,e)),t=de.current;var n=mp(t,e.type);t!==n&&(ue(fe,e),ue(de,n))}function ve(e){fe.current===e&&(le(de),le(fe)),me.current===e&&(le(me),ch._currentValue=K)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+ye+e+be}var Se=!1;function Ce(e,t){if(!e||Se)return``;Se=!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(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);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=`
|
|
6
|
+
`+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{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);case 30:return xe(`ViewTransition`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(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 Ze(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=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(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 Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(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-Ue(n),i=1<<r;t|=e[r],n&=~i}return t}function et(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 tt(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(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-Ue(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&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(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 lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=G.p;return e===0?(e=window.event,e===void 0?32:wh(e.type)):e}function dt(e,t){var n=G.p;try{return G.p=e,t()}finally{G.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft,xt=`__reactLoad$`+ft;function St(e){delete e[pt],delete e[mt],delete e[_t],delete e[vt]}function Ct(e){var t;if(t=e[pt])return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mm(e);e!==null;){if(n=e[pt])return n;e=mm(e)}return t}e=n,n=e.parentNode}return null}function wt(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Tt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Et(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Dt(e){e[bt]=!0}function Ot(e){e[xt]=void 0}var kt=new Set,At={};function jt(e,t){Mt(e,t),Mt(e+`Capture`,t)}function Mt(e,t){for(At[e]=t,e=0;e<t.length;e++)kt.add(t[e])}var Nt=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]*$`),Pt={},Ft={};function It(e){return Ee.call(Ft,e)?!0:Ee.call(Pt,e)?!1:Nt.test(e)?Ft[e]=!0:(Pt[e]=!0,!1)}var Lt=!1;function Rt(){var e=Lt;return Lt=!1,e}function zt(e,t,n){if(It(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 Bt(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 Vt(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 Ht(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Wt(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 Gt(e){if(!e._valueTracker){var t=Ut(e)?`checked`:`value`;e._valueTracker=Wt(e,t,``+e[t])}}function Kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ut(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var qt=/[\n"\\]/g;function Jt(e){return e.replace(qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function J(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=``+Ht(t)):e.value!==``+Ht(t)&&(e.value=``+Ht(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Xt(e,Ht(n)):o===`number`&&e.value==t?Xt(e,Ht(e.value)):Xt(e,Ht(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=``+Ht(s):e.removeAttribute(`name`)}function Yt(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)){Gt(e);return}n=n==null?``:``+Ht(n),t=t==null?n:``+Ht(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),Gt(e)}function Xt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function Zt(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=``+Ht(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 Qt(e,t,n){t!=null&&(t=``+Ht(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Ht(n)}function $t(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ht(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Gt(e)}function en(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tn=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 nn(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||tn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function rn(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]=``,Lt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(nn(e,a,r),Lt=!0)}else for(var o in t)t.hasOwnProperty(o)&&nn(e,o,t[o])}function an(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 on=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 ln(){}var un=null;function dn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fn=null,pn=null;function mn(e){var t=wt(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(J(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="`+Jt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));J(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&&Kt(r)}break a;case`textarea`:Qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Zt(e,!!n.multiple,t,!1)}}}var hn=!1;function gn(e,t,n){if(hn)return e(t,n);hn=!0;try{return e(t)}finally{if(hn=!1,(fn!==null||pn!==null)&&(zd(),fn&&(t=fn,e=pn,pn=fn=null,mn(t),e)))for(t=0;t<e.length;t++)mn(e[t])}}function _n(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||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 vn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,yn=!1;if(vn)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){yn=!0}}),window.addEventListener(`test`,bn,bn),window.removeEventListener(`test`,bn,bn)}catch{yn=!1}var xn=null,Sn=null,Cn=null;function wn(){if(Cn)return Cn;var e,t=Sn,n=t.length,r,i=`value`in xn?xn.value:xn.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 Cn=i.slice(e,1<r?1-r:void 0)}function Tn(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 En(){return!0}function Dn(){return!1}function On(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)?En:Dn,this.isPropagationStopped=Dn,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=En)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=En)},persist:function(){},isPersistent:En}),t}var kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},An=On(kn),jn=D({},kn,{view:0,detail:0}),Mn=On(jn),Nn,Pn,Fn,In=D({},jn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kn,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!==Fn&&(Fn&&e.type===`mousemove`?(Nn=e.screenX-Fn.screenX,Pn=e.screenY-Fn.screenY):Pn=Nn=0,Fn=e),Nn)},movementY:function(e){return`movementY`in e?e.movementY:Pn}}),Ln=On(In),Y=On(D({},In,{dataTransfer:0})),Rn=On(D({},jn,{relatedTarget:0})),zn=On(D({},kn,{animationName:0,elapsedTime:0,pseudoElement:0})),Bn=On(D({},kn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Vn=On(D({},kn,{data:0})),Hn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Un={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`},Wn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Gn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Wn[e])?!!t[e]:!1}function Kn(){return Gn}var qn=On(D({},jn,{key:function(e){if(e.key){var t=Hn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Tn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Un[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kn,charCode:function(e){return e.type===`keypress`?Tn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Tn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Jn=On(D({},In,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Yn=On(D({},kn,{submitter:0})),Xn=On(D({},jn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kn})),Zn=On(D({},kn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Qn=On(D({},In,{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})),$n=On(D({},kn,{newState:0,oldState:0,source:0})),er=[9,13,27,32],tr=vn&&`CompositionEvent`in window,nr=null;vn&&`documentMode`in document&&(nr=document.documentMode);var rr=vn&&`TextEvent`in window&&!nr,ir=vn&&(!tr||nr&&8<nr&&11>=nr),ar=` `,or=!1;function sr(e,t){switch(e){case`keyup`:return er.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function cr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var lr=!1;function ur(e,t){switch(e){case`compositionend`:return cr(t);case`keypress`:return t.which===32?(or=!0,ar):null;case`textInput`:return e=t.data,e===ar&&or?null:e;default:return null}}function dr(e,t){if(lr)return e===`compositionend`||!tr&&sr(e,t)?(e=wn(),Cn=Sn=xn=null,lr=!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 ir&&t.locale!==`ko`?null:t.data;default:return null}}var fr={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 pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!fr[e.type]:t===`textarea`}function mr(e,t,n,r){fn?pn?pn.push(r):pn=[r]:fn=r,t=Xf(t,`onChange`),0<t.length&&(n=new An(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var hr=null,gr=null;function _r(e){Hf(e,0)}function vr(e){if(Kt(Tt(e)))return e}function yr(e,t){if(e===`change`)return t}var br=!1;if(vn){var xr;if(vn){var Sr=`oninput`in document;if(!Sr){var Cr=document.createElement(`div`);Cr.setAttribute(`oninput`,`return;`),Sr=typeof Cr.oninput==`function`}xr=Sr}else xr=!1;br=xr&&(!document.documentMode||9<document.documentMode)}function wr(){hr&&(hr.detachEvent(`onpropertychange`,Tr),gr=hr=null)}function Tr(e){if(e.propertyName===`value`&&vr(gr)){var t=[];mr(t,gr,e,dn(e)),gn(_r,t)}}function Er(e,t,n){e===`focusin`?(wr(),hr=t,gr=n,hr.attachEvent(`onpropertychange`,Tr)):e===`focusout`&&wr()}function Dr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return vr(gr)}function Or(e,t){if(e===`click`)return vr(t)}function kr(e,t){if(e===`input`||e===`change`)return vr(t)}function Ar(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var jr=typeof Object.is==`function`?Object.is:Ar;function Mr(e,t){if(jr(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(!Ee.call(t,i)||!jr(e[i],t[i]))return!1}return!0}function Nr(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 Pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fr(e,t){var n=Pr(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=Pr(n)}}function Ir(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ir(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nr(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=Nr(e.document)}return t}function Rr(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 zr=vn&&`documentMode`in document&&11>=document.documentMode,Br=null,Vr=null,Hr=null,Ur=!1;function Wr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ur||Br==null||Br!==Nr(r)||(r=Br,`selectionStart`in r&&Rr(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}),Hr&&Mr(Hr,r)||(Hr=r,r=Xf(Vr,`onSelect`),0<r.length&&(t=new An(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Br)))}function Gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Kr={animationend:Gr(`Animation`,`AnimationEnd`),animationiteration:Gr(`Animation`,`AnimationIteration`),animationstart:Gr(`Animation`,`AnimationStart`),transitionrun:Gr(`Transition`,`TransitionRun`),transitionstart:Gr(`Transition`,`TransitionStart`),transitioncancel:Gr(`Transition`,`TransitionCancel`),transitionend:Gr(`Transition`,`TransitionEnd`)},qr={},Jr={};vn&&(Jr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Kr.animationend.animation,delete Kr.animationiteration.animation,delete Kr.animationstart.animation),`TransitionEvent`in window||delete Kr.transitionend.transition);function Yr(e){if(qr[e])return qr[e];if(!Kr[e])return e;var t=Kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Jr)return qr[e]=t[n];return e}var Xr=Yr(`animationend`),Zr=Yr(`animationiteration`),Qr=Yr(`animationstart`),$r=Yr(`transitionrun`),ei=Yr(`transitionstart`),ti=Yr(`transitioncancel`),ni=Yr(`transitionend`),ri=new Map,ii=`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(` `);ii.push(`scrollEnd`);function ai(e,t){ri.set(e,t),jt(t,[e])}var oi=0;function si(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=oi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function ci(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;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 li(e,t){return e=ci(e),t=ci(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var ui=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)},di=[],fi=0,pi=0;function mi(){for(var e=fi,t=pi=fi=0;t<e;){var n=di[t];di[t++]=null;var r=di[t];di[t++]=null;var i=di[t];di[t++]=null;var a=di[t];if(di[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&&vi(n,i,a)}}function hi(e,t,n,r){di[fi++]=e,di[fi++]=t,di[fi++]=n,di[fi++]=r,pi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function gi(e,t,n,r){return hi(e,t,n,r),yi(e)}function _i(e,t){return hi(e,null,null,t),yi(e)}function vi(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-Ue(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function yi(e){if(50<kd)throw kd=0,Ad=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bi={};function xi(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 Si(e,t,n,r){return new xi(e,t,n,r)}function Ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wi(e,t){var n=e.alternate;return n===null?(n=Si(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 Ti(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 Ei(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ci(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case V:return e=Si(31,n,t,a),e.elementType=V,e.lanes=o,e;case j:return Di(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Si(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Si(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Si(19,n,t,a),e.elementType=R,e.lanes=o,e;case ee:case te:return e=a|32,e=Si(30,n,t,e),e.elementType=te,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case B:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Di(e,t,n,r){return e=Si(7,e,r,t),e.lanes=n,e}function Oi(e,t,n){return e=Si(6,e,null,t),e.lanes=n,e}function ki(e){var t=Si(18,null,null,0);return t.stateNode=e,t}function Ai(e,t,n){return t=Si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ji=new WeakMap;function Mi(e,t){if(typeof e==`object`&&e){var n=ji.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},ji.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var Ni=[],Pi=0,Fi=null,Ii=0,Li=[],Ri=0,zi=null,Bi=1,Vi=``;function Hi(e,t){Ni[Pi++]=Ii,Ni[Pi++]=Fi,Fi=e,Ii=t}function Ui(e,t,n){Li[Ri++]=Bi,Li[Ri++]=Vi,Li[Ri++]=zi,zi=e;var r=Bi;e=Vi;var i=32-Ue(r)-1;r&=~(1<<i),n+=1;var a=32-Ue(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Bi=1<<32-Ue(t)+i|n<<i|r,Vi=a+e}else Bi=1<<a|n<<i|r,Vi=e}function Wi(e){e.return!==null&&(Hi(e,1),Ui(e,1,0))}function Gi(e){for(;e===Fi;)Fi=Ni[--Pi],Ni[Pi]=null,Ii=Ni[--Pi],Ni[Pi]=null;for(;e===zi;)zi=Li[--Ri],Li[Ri]=null,Vi=Li[--Ri],Li[Ri]=null,Bi=Li[--Ri],Li[Ri]=null}function Ki(e,t){Li[Ri++]=Bi,Li[Ri++]=Vi,Li[Ri++]=zi,Bi=t.id,Vi=t.overflow,zi=e}var qi=null,Ji=null,Yi=!1,Xi=null,Zi=!1,Qi=Error(i(519));function $i(e){throw aa(Mi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Qi}function ea(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:Uf(`cancel`,t),Uf(`close`,t);break;case`iframe`:case`object`:case`embed`:Uf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Bf.length;n++)Uf(Bf[n],t);break;case`source`:Uf(`error`,t);break;case`img`:case`image`:case`link`:Uf(`error`,t),Uf(`load`,t);break;case`details`:Uf(`toggle`,t);break;case`input`:Uf(`invalid`,t),Yt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Uf(`invalid`,t);break;case`textarea`:Uf(`invalid`,t),$t(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||np(t.textContent,n)?(r.popover!=null&&(Uf(`beforetoggle`,t),Uf(`toggle`,t)),r.onScroll!=null&&Uf(`scroll`,t),r.onScrollEnd!=null&&Uf(`scrollend`,t),r.onClick!=null&&(t.onclick=ln),t=!0):t=!1,t||$i(e,!0)}function ta(e){for(qi=e.return;qi;)switch(qi.tag){case 5:case 31:case 13:Zi=!1;return;case 27:case 3:Zi=!0;return;default:qi=qi.return}}function na(e){if(e!==qi)return!1;if(!Yi)return ta(e),Yi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||hp(e.type,e.memoizedProps)),n=!n),n&&Ji&&$i(e),ta(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ji=pm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ji=pm(e)}else t===27?(t=Ji,wp(e.type)?(e=fm,fm=null,Ji=e):Ji=t):Ji=qi?dm(e.stateNode.nextSibling):null;return!0}function ra(){Ji=qi=null,Yi=!1}function ia(){var e=Xi;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),Xi=null),e}function aa(e){Xi===null?Xi=[e]:Xi.push(e)}var oa=ce(null),sa=null,ca=null;function la(e,t,n){ue(oa,t._currentValue),t._currentValue=n}function ua(e){e._currentValue=oa.current,le(oa)}function da(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 fa(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),da(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),da(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),da(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 pa(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;jr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ch]:e.push(ch))}a=a.return}return e!==null&&fa(t,e,n,r),t.flags|=262144,e!==null}function ma(e){for(e=e.firstContext;e!==null;){if(!jr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ha(e){sa=e,ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ga(e){return va(sa,e)}function _a(e,t){return sa===null&&ha(e),va(e,t)}function va(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ca===null){if(e===null)throw Error(i(308));ca=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ca=ca.next=t;return n}var ya=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()})}},ba=t.unstable_scheduleCallback,xa=t.unstable_NormalPriority,Sa={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ca(){return{controller:new ya,data:new Map,refCount:0}}function wa(e){e.refCount--,e.refCount===0&&ba(xa,function(){e.controller.abort()})}function Ta(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 Ea=null;function Da(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Oa=null,ka=0,Aa=0,ja=null;function Ma(e,t){if(Oa===null){var n=Oa=[];ka=0,Aa=Ff(),ja={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ka++,t.then(Na,Na),t}function Na(){if(--ka===0&&(Ea=null,Oa!==null)){ja!==null&&(ja.status=`fulfilled`);var e=Oa;Oa=null,Aa=0,ja=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pa(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 Fa=W.S;W.S=function(e,t){if(hd=je(),typeof t==`object`&&t&&typeof t.then==`function`&&Ma(e,t),Ea!==null)for(var n=xf;n!==null;)Ta(n,Ea),n=n.next;if(n=e.types,n!==null){for(var r=xf;r!==null;)Ta(r,n),r=r.next;if(Aa!==0){r=Ea,r===null&&(r=Ea=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Fa!==null&&Fa(e,t)};var Ia=ce(null);function La(){var e=Ia.current;return e===null?Xu.pooledCache:e}function Ra(e,t){t===null?ue(Ia,Ia.current):ue(Ia,t.pool)}function za(){var e=La();return e===null?null:{parent:Sa._currentValue,pool:e}}var Ba=Error(i(460)),Va=Error(i(474)),Ha=Error(i(542)),Ua={then:function(){}};function Wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ga(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ln,ln),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ya(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(ln,ln);else{if(e=Xu,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,Ya(e),e}throw qa=t,Ba}}function Ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(qa=e,Ba):e}}var qa=null;function Ja(){if(qa===null)throw Error(i(459));var e=qa;return qa=null,e}function Ya(e){if(e===Ba||e===Ha)throw Error(i(483))}var Xa=null,Za=0;function Qa(e){var t=Za;return Za+=1,Xa===null&&(Xa=[]),Ga(Xa,e,t)}function $a(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function eo(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 to(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=wi(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=Oi(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),$a(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===B&&Ka(i)===t.type)?(t=a(t,n.props),$a(t,n),t.return=e,t):(t=Ei(n.type,n.key,n.props,null,e.mode,r),$a(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=Ai(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=Di(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=Oi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ei(t.type,t.key,t.props,null,e.mode,n),$a(n,t),n.return=e,n;case A:return t=Ai(t,e.mode,n),t.return=e,t;case B:return t=Ka(t),f(e,t,n)}if(oe(t)||U(t))return t=Di(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Qa(t),n);if(t.$$typeof===F)return f(e,_a(e,t),n);eo(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 B:return n=Ka(n),p(e,t,n,r)}if(oe(n)||U(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Qa(n),r);if(n.$$typeof===F)return p(e,t,_a(e,n),r);eo(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 B:return r=Ka(r),m(e,t,n,r,i)}if(oe(r)||U(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Qa(r),i);if(r.$$typeof===F)return m(e,t,n,_a(t,r),i);eo(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),Yi&&Hi(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 Yi&&Hi(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)}),Yi&&Hi(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),Yi&&Hi(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 Yi&&Hi(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)}),Yi&&Hi(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),$a(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===B&&Ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),$a(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Di(o.props.children,e.mode,c,o.key),$a(c,o),c.return=e,e=c):(c=Ei(o.type,o.key,o.props,null,e.mode,c),$a(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=Ai(o,e.mode,c),c.return=e,e=c}return s(e);case B:return o=Ka(o),_(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(U(o)){if(l=U(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,Qa(o),c);if(o.$$typeof===F)return _(e,r,_a(e,o),c);eo(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=Oi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Za=0;var i=_(e,t,n,r);return Xa=null,i}catch(t){if(t===Ba||t===Ha)throw t;var a=Si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var no=to(!0),ro=to(!1),io=!1;function ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oo(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 so(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=yi(e),vi(e,null,n),t}return hi(e,r,t,n),yi(e)}function lo(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,ot(e,n)}}function uo(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 fo=!1;function po(){if(fo){var e=ja;if(e!==null)throw e}}function mo(e,t,n,r){fo=!1;var i=e.updateQueue;io=!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?(Qu&f)===f:(r&f)===f){f!==0&&f===Aa&&(fo=!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:io=!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),od|=o,e.lanes=o,e.memoizedState=d}}function ho(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function go(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ho(n[e],t)}var _o=ce(null),vo=ce(0);function yo(e,t){e=id,ue(vo,e),ue(_o,t),id=e|t.baseLanes}function bo(){ue(vo,id),ue(_o,_o.current)}function xo(){id=vo.current,le(_o),le(vo)}var So=ce(null),Co=null;function wo(e){var t=e.alternate;ue(ko,ko.current&1),ue(So,e),Co===null&&(t===null||_o.current!==null||t.memoizedState!==null)&&(Co=e)}function To(e){ue(ko,ko.current),ue(So,e),Co===null&&(Co=e)}function Eo(e){e.tag===22?(ue(ko,ko.current),ue(So,e),Co===null&&(Co=e)):Do()}function Do(){ue(ko,ko.current),ue(So,So.current)}function Oo(e){le(So),Co===e&&(Co=null),le(ko)}var ko=ce(0);function Ao(e,t){ue(So,So.current),ue(ko,t)}function jo(e){le(ko),le(So),Co===e&&(Co=null)}function Mo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cm(n)||lm(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 No=0,Po=null,Fo=null,Io=null,Lo=!1,Ro=!1,zo=!1,Bo=0,Vo=0,Ho=null,Uo=0;function Wo(){throw Error(i(321))}function Go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jr(e[n],t[n]))return!1;return!0}function Ko(e,t,n,r,i,a){return No=a,Po=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?lc:uc,zo=!1,a=n(r,i),zo=!1,Ro&&(a=Jo(t,n,r,i)),qo(e),a}function qo(e){W.H=cc;var t=Fo!==null&&Fo.next!==null;if(No=0,Io=Fo=Po=null,Lo=!1,Vo=0,Ho=null,t)throw Error(i(300));e===null||Dc||(e=e.dependencies,e!==null&&ma(e)&&(Dc=!0))}function Jo(e,t,n,r){Po=e;var a=0;do{if(Ro&&(Ho=null),Vo=0,Ro=!1,25<=a)throw Error(i(301));if(a+=1,Io=Fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}W.H=dc,o=t(n,r)}while(Ro);return o}function Yo(){var e=W.H,t=e.useState()[0];return t=typeof t.then==`function`?ns(t):t,e=e.useState()[0],(Fo===null?null:Fo.memoizedState)!==e&&(Po.flags|=1024),t}function Xo(){var e=Bo!==0;return Bo=0,e}function Zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Qo(e){if(Lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lo=!1}No=0,Io=Fo=Po=null,Ro=!1,Vo=Bo=0,Ho=null}function $o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Io===null?Po.memoizedState=Io=e:Io=Io.next=e,Io}function es(){if(Fo===null){var e=Po.alternate;e=e===null?null:e.memoizedState}else e=Fo.next;var t=Io===null?Po.memoizedState:Io.next;if(t!==null)Io=t,Fo=e;else{if(e===null)throw Po.alternate===null?Error(i(467)):Error(i(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},Io===null?Po.memoizedState=Io=e:Io=Io.next=e}return Io}function ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var t=Vo;return Vo+=1,Ho===null&&(Ho=[]),e=Ga(Ho,e,t),t=Po,(Io===null?t.memoizedState:Io.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?lc:uc),e}function rs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ns(e);if(e.$$typeof===ne)return;if(e.$$typeof===F)return ga(e)}throw Error(i(438,String(e)))}function is(e){var t=null,n=Po.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Po.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=ts(),Po.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]=H;return t.index++,n}function as(e,t){return typeof t==`function`?t(e):t}function os(e){return ss(es(),Fo,e)}function ss(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?(No&f)===f:(Qu&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===Aa&&(d=!0);else if((No&p)===p){u=u.next,p===Aa&&(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,Po.lanes|=p,od|=p;f=u.action,zo&&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,Po.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!jr(o,e.memoizedState)&&(Dc=!0,d&&(n=ja,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 cs(e){var t=es(),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);jr(o,t.memoizedState)||(Dc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ls(e,t,n){var r=Po,a=es(),o=Yi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!jr((Fo||a).memoizedState,n);if(s&&(a.memoizedState=n,Dc=!0),a=a.queue,Ps(fs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Io!==null&&!!(Io.memoizedState.tag&1),ks(e?9:8,{destroy:void 0},ds.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||No&127||us(r,t,n)}return n}function us(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Po.updateQueue,t===null?(t=ts(),Po.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ds(e,t,n,r){t.value=n,t.getSnapshot=r,ps(t)&&ms(e)}function fs(e,t,n){return n(function(){ps(t)&&ms(e)})}function ps(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jr(e,n)}catch{return!0}}function ms(e){var t=_i(e,2);t!==null&&Pd(t,e,2)}function hs(e){var t=$o();if(typeof e==`function`){var n=e;if(e=n(),zo){He(!0);try{n()}finally{He(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:e},t}function gs(e,t,n,r){return e.baseState=n,ss(e,Fo,typeof r==`function`?r:as)}function _s(e,t,n,r,a){if(ac(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)}};W.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,vs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function vs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=W.T,o={};o.types=a===null?null:a.types,W.T=o;try{var s=n(i,r),c=W.S;c!==null&&c(o,s),ys(e,t,s)}catch(n){xs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),W.T=a}}else try{a=n(i,r),ys(e,t,a)}catch(n){xs(e,t,n)}}function ys(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){bs(e,t,n)},function(n){return xs(e,t,n)}):bs(e,t,n)}function bs(e,t,n){t.status=`fulfilled`,t.value=n,Ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,vs(e,n)))}function xs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ss(t),t=t.next;while(t!==r)}e.action=null}function Ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cs(e,t){return t}function ws(e,t){if(Yi){var n=Xu.formState;if(n!==null){a:{var r=Po;if(Yi){if(Ji){b:{for(var i=Ji,a=Zi;i.nodeType!==8;)if(!a||(i=dm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ji=dm(i.nextSibling),r=i.data===`F!`;break a}}$i(r)}r=!1}r&&(t=n[0])}}return n=$o(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cs,lastRenderedState:t},n.queue=r,n=nc.bind(null,Po,r),r.dispatch=n,r=hs(!1),a=ic.bind(null,Po,!1,r.queue),r=$o(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=_s.bind(null,Po,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ts(e){return Es(es(),Fo,e)}function Es(e,t,n){if(t=ss(e,t,Cs)[0],e=os(as)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ns(t)}catch(e){throw e===Ba?Ha:e}else r=t;t=es();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Po.flags|=2048,ks(9,{destroy:void 0},Ds.bind(null,i,n),null)),[r,a,e]}function Ds(e,t){e.action=t}function Os(e){var t=es(),n=Fo;if(n!==null)return Es(t,n,e);es(),t=t.memoizedState,n=es();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ks(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Po.updateQueue,t===null&&(t=ts(),Po.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 As(){return es().memoizedState}function js(e,t,n,r){var i=$o();Po.flags|=e,i.memoizedState=ks(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ms(e,t,n,r){var i=es();r=r===void 0?null:r;var a=i.memoizedState.inst;Fo!==null&&r!==null&&Go(r,Fo.memoizedState.deps)?i.memoizedState=ks(t,a,n,r):(Po.flags|=e,i.memoizedState=ks(1|t,a,n,r))}function Ns(e,t){js(8390656,8,e,t)}function Ps(e,t){Ms(2048,8,e,t)}function Fs(e){Po.flags|=4;var t=Po.updateQueue;if(t===null)t=ts(),Po.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Is(e){var t=es().memoizedState;return Fs({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ls(e,t){return Ms(4,2,e,t)}function Rs(e,t){return Ms(4,4,e,t)}function zs(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 Bs(e,t,n){n=n==null?null:n.concat([e]),Ms(4,4,zs.bind(null,t,e),n)}function Vs(){}function Hs(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Us(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Go(t,r[1]))return r[0];if(r=e(),zo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r}function Ws(e,t,n){return n===void 0||No&1073741824&&!(Qu&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),Po.lanes|=e,od|=e,n)}function Gs(e,t,n,r){return jr(n,t)?n:_o.current===null?!(No&106)||No&1073741824&&!(Qu&261930)?(Dc=!0,e.memoizedState=n):(e=Md(),Po.lanes|=e,od|=e,t):(e=Ws(e,n,r),jr(e,t)||(Dc=!0),e)}function Ks(e,t,n,r,i){var a=G.p;G.p=a!==0&&8>a?a:8;var o=W.T,s={};s.types=o===null?null:o.types,W.T=s,ic(e,!1,t,n);try{var c=i(),l=W.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?rc(e,t,Pa(c,r),jd(e)):rc(e,t,r,jd(e))}catch(n){rc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{G.p=a,o!==null&&s.types!==null&&(o.types=s.types),W.T=o}}function qs(){}function Js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ys(e).queue;Ks(e,a,t,K,n===null?qs:function(){return Xs(e),n(r)})}function Ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:K},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xs(e){var t=Ys(e);t.next===null&&(t=e.alternate.memoizedState),rc(e,t.next.queue,{},jd())}function Zs(){return ga(ch)}function Qs(){return es().memoizedState}function $s(){return es().memoizedState}function ec(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=so(n);var r=co(t,e,n);r!==null&&(Pd(r,t,n),lo(r,t,n)),t={cache:Ca()},e.payload=t;return}t=t.return}}function tc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ac(e)?oc(t,n):(n=gi(e,t,n,r),n!==null&&(Pd(n,e,r),sc(n,t,r)))}function nc(e,t,n){rc(e,t,n,jd())}function rc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ac(e))oc(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,jr(s,o))return hi(e,t,i,0),Xu===null&&mi(),!1}catch{}if(n=gi(e,t,i,r),n!==null)return Pd(n,e,r),sc(n,t,r),!0}return!1}function ic(e,t,n,r){if(r={lane:2,revertLane:Ff(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(i(479))}else t=gi(e,n,r,2),t!==null&&Pd(t,e,2)}function ac(e){var t=e.alternate;return e===Po||t!==null&&t===Po}function oc(e,t){Ro=Lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var cc={readContext:ga,use:rs,useCallback:Wo,useContext:Wo,useEffect:Wo,useImperativeHandle:Wo,useLayoutEffect:Wo,useInsertionEffect:Wo,useMemo:Wo,useReducer:Wo,useRef:Wo,useState:Wo,useDebugValue:Wo,useDeferredValue:Wo,useTransition:Wo,useSyncExternalStore:Wo,useId:Wo,useHostTransitionStatus:Wo,useFormState:Wo,useActionState:Wo,useOptimistic:Wo,useMemoCache:Wo,useCacheRefresh:Wo,useEffectEvent:Wo},lc={readContext:ga,use:rs,useCallback:function(e,t){return $o().memoizedState=[e,t===void 0?null:t],e},useContext:ga,useEffect:Ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),js(4194308,4,zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){js(4,2,e,t)},useMemo:function(e,t){var n=$o();t=t===void 0?null:t;var r=e();if(zo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=$o();if(n!==void 0){var i=n(t);if(zo){He(!0);try{n(t)}finally{He(!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=tc.bind(null,Po,e),[r.memoizedState,e]},useRef:function(e){var t=$o();return e={current:e},t.memoizedState=e},useState:function(e){e=hs(e);var t=e.queue,n=nc.bind(null,Po,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Vs,useDeferredValue:function(e,t){return Ws($o(),e,t)},useTransition:function(){var e=hs(!1);return e=Ks.bind(null,Po,e.queue,!0,!1),$o().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Po,a=$o();if(Yi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Qu&127||us(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ns(fs.bind(null,r,o,e),[e]),r.flags|=2048,ks(9,{destroy:void 0},ds.bind(null,r,o,n,t),null),n},useId:function(){var e=$o(),t=Xu.identifierPrefix;if(Yi){var n=Vi,r=Bi;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Zs,useFormState:ws,useActionState:ws,useOptimistic:function(e){var t=$o();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ic.bind(null,Po,!0,n),n.dispatch=t,[e,t]},useMemoCache:is,useCacheRefresh:function(){return $o().memoizedState=ec.bind(null,Po)},useEffectEvent:function(e){var t=$o(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},uc={readContext:ga,use:rs,useCallback:Hs,useContext:ga,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:os,useRef:As,useState:function(){return os(as)},useDebugValue:Vs,useDeferredValue:function(e,t){return Gs(es(),Fo.memoizedState,e,t)},useTransition:function(){var e=os(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){return gs(es(),Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is},dc={readContext:ga,use:rs,useCallback:Hs,useContext:ga,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:cs,useRef:As,useState:function(){return cs(as)},useDebugValue:Vs,useDeferredValue:function(e,t){var n=es();return Fo===null?Ws(n,e,t):Gs(n,Fo.memoizedState,e,t)},useTransition:function(){var e=cs(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){var n=es();return Fo===null?(n.baseState=e,[e,n.queue.dispatch]):gs(n,Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is};function fc(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 pc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=so(r);i.payload=t,n!=null&&(i.callback=n),t=co(e,i,r),t!==null&&(Pd(t,e,r),lo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=so(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=co(e,i,r),t!==null&&(Pd(t,e,r),lo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=so(n);r.tag=2,t!=null&&(r.callback=t),t=co(e,r,n),t!==null&&(Pd(t,e,n),lo(t,e,n))}};function mc(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?!Mr(n,r)||!Mr(i,a):!0}function hc(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&&pc.enqueueReplaceState(t,t.state,null)}function gc(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 _c(e){ui(e)}function vc(e){console.error(e)}function yc(e){ui(e)}function bc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function xc(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 Sc(e,t,n){return n=so(n),n.tag=3,n.payload={element:null},n.callback=function(){bc(e,t)},n}function Cc(e){return e=so(e),e.tag=3,e}function wc(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(){xc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){xc(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&pa(t,n,a,!0),n=So.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Co===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ua?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),hf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ua?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)),hf(e,r,a)),!1}throw Error(i(435,n.tag))}return hf(e,r,a),Kd(),!1}if(Yi)return t=So.current,t===null?(r!==Qi&&(t=Error(i(423),{cause:r}),aa(Mi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Mi(r,n),a=Sc(e.stateNode,r,a),uo(e,a),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Qi&&(e=Error(i(422),{cause:r}),aa(Mi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Mi(o,n),dd===null?dd=[o]:dd.push(o),ad!==4&&(ad=2),t===null)return!0;r=Mi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Sc(n.stateNode,r,e),uo(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`&&(vd===null||!vd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Cc(a),wc(a,e,n,r),uo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ec=Error(i(461)),Dc=!1;function Oc(e,t,n,r){t.child=e===null?ro(t,null,n,r):no(t,e.child,n,r)}function kc(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 ha(t),r=Ko(e,t,n,o,a,i),s=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(Yi&&s&&Wi(t),t.flags|=1,Oc(e,t,r,i),t.child)}function Ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,jc(e,t,a,r,i)):(e=Ei(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!il(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Mr:n,n(o,r)&&e.ref===t.ref)return rl(e,t,i)}return t.flags|=1,e=wi(a,r),e.ref=t.ref,e.return=t,t.child=e}function jc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Mr(a,r)&&e.ref===t.ref){if(Dc=!1,t.pendingProps=r=a,il(e,i))e.flags&131072&&(Dc=!0);else return t.lanes=e.lanes,rl(e,t,i)}}return zc(e,t,n,r,i)}function Mc(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 Pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ra(t,a===null?null:a.cachePool),a===null?bo():yo(t,a),Eo(t);else return r=t.lanes=536870912,Pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ra(t,null),bo(),Do()):(Ra(t,a.cachePool),yo(t,a),Do(),t.memoizedState=null);return Oc(e,t,i,n),t.child}function Nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pc(e,t,n,r,i){var a=La();return a=a===null?null:{parent:Sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ra(t,null),bo(),Eo(t),e!==null&&pa(e,t,r,!0),t.childLanes=i,null}function Fc(e,t){return t=Jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ic(e,t,n){return no(t,e.child,null,n),e=Fc(t,t.pendingProps),e.flags|=2,Oo(t),t.memoizedState=null,e}function Lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Yi){if(r.mode===`hidden`)return e=Fc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Nc(null,e);if(To(t),(e=Ji)?(e=sm(e,Zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zi===null?null:{id:Bi,overflow:Vi},retryLane:536870912,hydrationErrors:null},n=ki(e),n.return=t,t.child=n,qi=t,Ji=null)):e=null,e===null)throw $i(t);return t.lanes=536870912,null}return Fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(To(t),a){if(t.flags&256)t.flags&=-257,t=Ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Dc||pa(e,t,n,!1),a=(n&e.childLanes)!==0,Dc||a){if(_o.current===null){if(r=Xu,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,_i(e,s),Pd(r,e,s),Ec;Kd()}t=Ic(e,t,n)}else e=o.treeContext,Ji=dm(s.nextSibling),qi=t,Yi=!0,Xi=null,Zi=!1,e!==null&&Ki(t,e),t=Fc(t,r),t.flags|=134221824;return t}return e=wi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Rc(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 zc(e,t,n,r,i){return ha(t),n=Ko(e,t,n,r,void 0,i),r=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(Yi&&r&&Wi(t),t.flags|=1,Oc(e,t,n,i),t.child)}function Bc(e,t,n,r,i,a){return ha(t),t.updateQueue=null,n=Jo(t,r,n,i),qo(e),r=Xo(),e!==null&&!Dc?(Zo(e,t,a),rl(e,t,a)):(Yi&&r&&Wi(t),t.flags|=1,Oc(e,t,n,a),t.child)}function Vc(e,t,n,r,i){if(ha(t),t.stateNode===null){var a=bi,o=n.contextType;typeof o==`object`&&o&&(a=ga(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=pc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ao(t),o=n.contextType,a.context=typeof o==`object`&&o?ga(o):bi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(fc(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&&pc.enqueueReplaceState(a,a.state,null),mo(t,r,a,i),po(),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=gc(n,s);a.props=c;var l=a.context,u=n.contextType;o=bi,typeof u==`object`&&u&&(o=ga(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)&&hc(t,a,r,o),io=!1;var f=t.memoizedState;a.state=f,mo(t,r,a,i),po(),l=t.memoizedState,s||f!==l||io?(typeof d==`function`&&(fc(t,n,d,r),l=t.memoizedState),(c=io||mc(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,oo(e,t),o=t.memoizedProps,u=gc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=bi,typeof l==`object`&&l&&(c=ga(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)&&hc(t,a,r,c),io=!1,f=t.memoizedState,a.state=f,mo(t,r,a,i),po();var p=t.memoizedState;o!==d||f!==p||io||e!==null&&e.dependencies!==null&&ma(e.dependencies)?(typeof s==`function`&&(fc(t,n,s,r),p=t.memoizedState),(u=io||mc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ma(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,Rc(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=no(t,e.child,null,i),t.child=no(t,null,n,i)):Oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=rl(e,t,i),e}function Hc(e,t,n,r){return ra(),t.flags|=256,Oc(e,t,n,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wc(e){return{baseLanes:e,cachePool:za()}}function Gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function Kc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(ko.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Yi){if(i?wo(t):Do(),(e=Ji)?(e=sm(e,Zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zi===null?null:{id:Bi,overflow:Vi},retryLane:536870912,hydrationErrors:null},n=ki(e),n.return=t,t.child=n,qi=t,Ji=null)):e=null,e===null)throw $i(t);return t.lanes=lm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Do(),i=t.mode,a=Jc({mode:`hidden`,children:a},i),r=Di(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Wc(n),r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(null,r)):(wo(t),qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Xc(e,t,a,o,r,c,s,n)}return i?(Do(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=wi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Di(i,a,n,null),i.flags|=2):i=wi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Nc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Wc(n):(a=i.cachePool,a===null?a=za():(s=Sa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(e.child,r)):(wo(t),n=e.child,e=n.sibling,n=wi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function qc(e,t){return t=Jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Jc(e,t){return e=Si(22,e,null,t),e.lanes=0,e}function Yc(e,t,n){return no(t,e.child,null,n),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(wo(t),t.flags&=-257,Yc(e,t,c)):t.memoizedState===null?(Do(),o=a.fallback,s=t.mode,a=Jc({mode:`visible`,children:a.children},s),o=Di(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,no(t,e.child,null,c),a=t.child,a.memoizedState=Wc(c),a.childLanes=Gc(e,r,c),t.memoizedState=Uc,Nc(null,a)):(Do(),t.child=e.child,t.flags|=128,null);if(wo(t),lm(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,aa({value:a,source:null,stack:null})),Yc(e,t,c)}if(Dc||pa(e,t,c,!1),r=(c&e.childLanes)!==0,Dc||r){if(_o.current!==null)return Yc(e,t,c);if(r=Xu,r!==null&&(a=st(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,_i(e,a),Pd(r,e,a),Ec;return cm(o)||Kd(),Yc(e,t,c)}return cm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Ji=dm(o.nextSibling),qi=t,Yi=!0,Xi=null,Zi=!1,e!==null&&Ki(t,e),t=qc(t,a.children),t.flags|=134221824,t)}function Zc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),da(e.return,t,n)}function Qc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Mo(n)===null&&(t=e),e=e.sibling}return t}function $c(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 el(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 tl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ko.current;if(t.flags&128)return Ao(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ao(t,o),i===`backwards`&&e!==null?(el(e),Oc(e,t,r,n),el(e)):Oc(e,t,r,n),r=Yi?Ii:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zc(e,n,t);else if(e.tag===19)Zc(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=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,el(t)),$c(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&&Mo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$c(t,!0,n,null,a,r);break;case`together`:$c(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$c(t,!1,i,n,a,r)}return t.child}function nl(e,t,n){var r=t.pendingProps;return la(t,t.type,r.value),Oc(e,t,r.children,n),t.child}function rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(pa(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=wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function il(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ma(e)))}function al(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),la(t,Sa,e.memoizedState.cache),ra();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:la(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,To(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return wo(t),t.flags|=128,null;r=pa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Kc(e,t,n):(wo(t),e=rl(e,t,n),e===null?null:e.sibling)}wo(t);break;case 19:if(t.flags&128)return tl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(pa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return tl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ao(t,ko.current),r)break;return null;case 22:return t.lanes=0,Mc(e,t,n,t.pendingProps);case 24:la(t,Sa,e.memoizedState.cache)}return rl(e,t,n)}function ol(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Dc=!0;else{if(!il(e,n)&&!(t.flags&128))return Dc=!1,al(e,t,n);Dc=!!(e.flags&131072)}}else Dc=!1,Yi&&t.flags&1048576&&Ui(t,Ii,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ka(t.elementType),t.type=e,typeof e==`function`)Ci(e)?(r=gc(e,r),t.tag=1,t=Vc(null,t,e,r,n)):(t.tag=0,t=zc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=kc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Ac(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=nl(null,t,n);break a}}throw t=ae(e)||e,Error(i(306,t,``))}}return t;case 0:return zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=gc(r,t.pendingProps),Vc(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,oo(e,t),mo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,la(t,Sa,r),r!==o.cache&&fa(t,[Sa],n,!0),po(),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=Hc(e,t,r,n);break a}if(r!==a){a=Mi(Error(i(424)),t),aa(a),t=Hc(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(Ji=dm(e.firstChild),qi=t,Yi=!0,Xi=null,Zi=!0,n=ro(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ra(),r===a){t=rl(e,t,n);break a}Oc(e,t,r,n)}t=t.child}return t;case 26:return Rc(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Yi||(t.stateNode=Z(t.type,t.pendingProps,pe.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&Yi&&(r=t.stateNode=_m(t.type,t.pendingProps,pe.current),qi=t,Zi=!0,a=Ji,wp(t.type)?(fm=a,Ji=dm(r.firstChild)):Ji=a),Oc(e,t,t.pendingProps.children,n),Rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Yi&&((a=r=Ji)&&(r=am(r,t.type,t.pendingProps,Zi),r===null?a=!1:(t.stateNode=r,qi=t,Ji=dm(r.firstChild),Zi=!1,a=!0)),a||$i(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,hp(a,o)?r=null:s!==null&&hp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ko(e,t,Yo,null,null,n),ch._currentValue=a),Rc(e,t),Oc(e,t,r,n),t.child;case 6:return e===null&&Yi&&((e=n=Ji)&&(n=om(n,t.pendingProps,Zi),n===null?e=!1:(t.stateNode=n,qi=t,Ji=null,e=!0)),e||$i(t)),null;case 13:return Kc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=no(t,null,r,n):Oc(e,t,r,n),t.child;case 11:return kc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Rc(e,t),Oc(e,t,r,n),t.child;case 8:return Oc(e,t,t.pendingProps.children,n),t.child;case 12:return Oc(e,t,t.pendingProps.children,n),t.child;case 10:return nl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ha(t),a=ga(a),r=r(a),t.flags|=1,Oc(e,t,r,n),t.child;case 14:return Ac(e,t,t.type,t.pendingProps,n);case 15:return jc(e,t,t.type,t.pendingProps,n);case 19:return tl(e,t,n);case 31:return Lc(e,t,n);case 22:return Mc(e,t,n,t.pendingProps);case 24:return ha(t),r=ga(Sa),e===null?(a=La(),a===null&&(a=Xu,o=Ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ao(t),la(t,Sa,a)):((e.lanes&n)!==0&&(oo(e,t),mo(t,null,null,n),po()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,la(t,Sa,r),r!==a.cache&&fa(t,[Sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),la(t,Sa,r))),Oc(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:Yi&&Wi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Rc(e,t),Oc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function sl(e){e.flags|=4}function cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Ym(t,r):Ym(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(Ud())e.flags|=8192;else throw qa=Ua,Va}}else e.flags&=-16777217}function ll(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Ud())e.flags|=8192;else throw qa=Ua,Va}}function ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,ud|=t)}function dl(e,t){if(!Yi)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 fl(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 pl(e,t,n){var r=t.pendingProps;switch(Gi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fl(t),null;case 1:return fl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ua(Sa),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(na(t)?sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ia())),fl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(sl(t),o===null?(fl(t),cl(t,a,null,r,n)):(fl(t),ll(t,o))):o?o===e.memoizedState?(fl(t),t.flags&=-16777217):(sl(t),fl(t),ll(t,o)):(e=e.memoizedProps,e!==r&&sl(t),fl(t),cl(t,a,e,r,n)),null;case 27:if(ve(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}e=de.current,na(t)?ea(t,e):(e=_m(a,r,n),t.stateNode=e,sl(t))}return fl(t),t.subtreeFlags&=-33554433,null;case 5:if(ve(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}if(o=de.current,na(t))ea(t,o);else{var s=fp(pe.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[pt]=t,o[mt]=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(ap(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&&sl(t)}}return fl(t),t.subtreeFlags&=-33554433,cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,na(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||np(e.nodeValue,n)),e||$i(t,!0)}else e=fp(e).createTextNode(r),e[pt]=t,t.stateNode=e}return fl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=na(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[pt]=t}else ra(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),e=!1}else n=ia(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Oo(t),t):(Oo(t),null);if(t.flags&128)throw Error(i(558))}return fl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=na(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[pt]=t}else ra(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),a=!1}else a=ia(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Oo(t),t):(Oo(t),null)}return Oo(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),ul(t,t.updateQueue),fl(t),null);case 4:return ge(),e===null&&Kf(t.stateNode.containerInfo),t.flags|=67108864,fl(t),null;case 10:return ua(t.type),fl(t),null;case 19:if(jo(t),r=t.memoizedState,r===null)return fl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)dl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Mo(e),o!==null){for(t.flags|=128,dl(r,!1),e=o.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ti(n,e),n=n.sibling;return Ao(t,ko.current&1|2),Yi&&Hi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>gd&&(t.flags|=128,a=!0,dl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Mo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Yi)return fl(t),null}else 2*je()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,a=!0,dl(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=je(),e.sibling=null,o=ko.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Yi?Ao(t,o):(n=o,ue(So,t),ue(ko,n),Co===null&&(Co=t)),Yi&&Hi(t,r.treeForkCount),e}return fl(t),null;case 22:case 23:return Oo(t),xo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(fl(t),t.subtreeFlags&6&&(t.flags|=8192)):fl(t),n=t.updateQueue,n!==null&&ul(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&&le(Ia),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ua(Sa),fl(t),null;case 25:return null;case 30:return t.flags|=33554432,fl(t),null}throw Error(i(156,t.tag))}function ml(e,t){switch(Gi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ua(Sa),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(Oo(t),t.alternate===null)throw Error(i(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return jo(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 ge(),null;case 10:return ua(t.type),null;case 22:case 23:return Oo(t),xo(),e!==null&&le(Ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ua(Sa),null;case 25:return null;default:return null}}function hl(e,t){switch(Gi(t),t.tag){case 3:ua(Sa),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&Oo(t);break;case 13:Oo(t);break;case 19:jo(t);break;case 10:ua(t.type);break;case 22:case 23:Oo(t),xo(),e!==null&&le(Ia);break;case 24:ua(Sa)}}function gl(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){mf(t,t.return,e)}}function _l(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){mf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){mf(t,t.return,e)}}function vl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{go(t,n)}catch(t){mf(e,e.return,t)}}}function yl(e,t,n){n.props=gc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){mf(e,t,n)}}function bl(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=si(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Ip(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Lp(e);m(e.child,!1,em,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){mf(e,t,n)}}function xl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){mf(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){mf(e,t,n)}else n.current=null}}function Sl(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++)nm(e.stateNode,t[n])}function Cl(e){for(var t=e.return;t!==null&&(El(t)&&nm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function wl(e){for(var t=e.return;t!==null&&(El(t)&&rm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function Tl(e){return e.tag===5||e.tag===3||e.tag===27}function El(e){return e&&e.tag===7&&e.stateNode!==null}function Dl(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){mf(e,e.return,t)}}function Ol(e,t,n){try{var r=e.stateNode;sp(r,e.type,n,t),r[mt]=t}catch(t){mf(e,e.return,t)}}function kl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wp(e.type)||e.tag===4}function Al(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kl(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&&wp(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 jl(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=ln)),Sl(e,r),Lt=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,wp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Sl(e,r),Lt=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,wp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ap(t,r,n),t[pt]=e,t[mt]=n}catch(t){mf(e,e.return,t)}}var Pl=!1,Fl=null;function Il(e){(e.tag===30||e.subtreeFlags&33554432)&&(Pl=!0)}var Ll=null;function Rl(){var e=Ll;return Ll=null,e}var zl=0;function Bl(e,t,n,r,i){return zl=0,Vl(e.child,t,n,r,i)}function Vl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ap(o);r.push(s),s.view&&(a=!0)}else a||Ap(o).view&&(a=!0);Pl=!0,Dp(o,zl===0?t:t+`_`+zl,n),zl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Vl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Hl(e,t){for(;e!==null;)e.tag===5?Op(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Hl(e.child,t)),e=e.sibling}function Ul(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ul(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=li(t.default,t.share),t!==`none`&&(Bl(e,n,t,null,!1)||Hl(e.child,!1))}e=e.sibling}}function X(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=si(r,n),a=li(r.default,n.paired?r.share:r.enter);a===`none`?Ul(e):Bl(e,i,a,null,!1)?(Ul(e),n.paired||t||Nd(e,r.onEnter)):Hl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)X(e,t),e=e.sibling;else Ul(e)}function Wl(e){if(Fl!==null&&Fl.size!==0){var t=Fl;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=li(n.default,n.share);if(a!==`none`&&(Bl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Hl(e.child,!1)),t.delete(r),t.size===0)break}}}Wl(e)}e=e.sibling}}}function Gl(e){if(e.tag===30){var t=e.memoizedProps,n=si(t,e.stateNode),r=Fl===null?void 0:Fl.get(n),i=li(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Bl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Fl.delete(n),Nd(e,t.onShare)):Hl(e.child,!1)),Fl!==null&&Wl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Fl!==null&&Wl(e)}function Kl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=si(t,e.stateNode);t=li(t.default,t.update),e.flags&=-5,t!==`none`&&Bl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Kl(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,Hl(e.child,!1))}ql(e)}e=e.sibling}}function Jl(e){if(e.tag===30)e.stateNode.paired=null,Hl(e.child,!1),ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else ql(e)}function Yl(e){for(e=e.child;e!==null;)e.tag===30?Hl(e.child,!1):e.subtreeFlags&33554432&&Yl(e),e=e.sibling}function Xl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&zl<a.length){var l=a[zl],u=Ap(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&&Dp(c,zl===0?n:n+`_`+zl,i),s&&e.flags&4||(Ll===null&&(Ll=[]),Ll.push(c,zl===0?r:r+`_`+zl,t.memoizedProps)),zl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Xl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Zl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=si(n,r),a=li(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(jp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;zl=0,i=Xl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Zl(e,t);e=e.sibling}}var Ql=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,up=_h,e=Lr(e),Rr(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(dp={focusedElem:e,selectionRange:r},_h=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Gl(r[a]);if(e.alternate===null&&e.flags&2)n&&Il(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Gl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Il(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&Kl(e),lu(n))}}Fl=null}function lu(e){for(;ru!==null;){var t=ru,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=gc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){mf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)im(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:im(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=si(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=li(a.default,a.update),a!==`none`&&Bl(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,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&gl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){mf(n,n.return,e)}else{var i=gc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){mf(n,n.return,e)}}}r&64&&vl(n),r&512&&bl(n,n.return);break;case 3:if(Au(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{go(e,t)}catch(e){mf(n,n.return,e)}}break;case 27:t===null&&r&4&&Nl(n);case 26:case 5:Au(e,n),t===null&&r&4&&Dl(n),r&512&&bl(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=vf.bind(null,n),um(e,n))));break;case 22:if(r=n.memoizedState!==null||Ql,!r){var a=t!==null&&t.memoizedState!==null||$l;t=Ql,i=$l,Ql=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),Ql=t,$l=i}break;case 30:Au(e,n),r&512&&bl(n,n.return);break;case 7:r&512&&bl(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(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){mf(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Lt=!0}catch(t){mf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ep(s,!0):Ep(e.stateNode,!1)}catch(t){mf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&St(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 hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount==`function`)try{Ve.onCommitFiberUnmount(Be,n)}catch{}switch(n.tag){case 26:$l||xl(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||xl(n,t),wl(n);var r=hu,i=gu;wp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),vm(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:$l||xl(n,t),wl(n);case 6:if(n.tag===6&&wl(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),Lt=!0}catch(e){mf(n,t,e)}else try{hu.removeChild(n.stateNode),Lt=!0}catch(e){mf(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,Tp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Uh(e)):Tp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:_l(2,n,t),$l||_l(4,n,t),_u(e,t,n);break;case 1:$l||(xl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&yl(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,_u(e,t,n),$l=r;break;case 30:xl(n,t),_u(e,t,n);break;case 7:$l||xl(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Uh(e)}catch(e){mf(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Uh(e)}catch(e){mf(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=yf.bind(null,e,t);t.then(r,r)}})}function Cu(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(wp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(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}Cu(t,e,n),Eu(e),a&4&&(_l(3,e,e.return),gl(3,e),_l(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&($l||r===null||xl(r,r.return)),a&64&&Ql&&(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=wu,Cu(t,e,n),Eu(e),a&512&&($l||r===null||xl(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(Ql)e.stateNode=Z(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[bt]||r[pt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),ap(r,t,n),r[pt]=e,Dt(r),t=r;break a;case`link`:if(o=Km(`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),ap(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Km(`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),ap(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[pt]=e,Dt(r),t=r}e.stateNode=t}}else Ql||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ol(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?Ql||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&($l||r===null||xl(r,r.return)),r!==null&&a&4&&Ol(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&($l||r===null||xl(r,r.return)),e.flags&32){t=e.stateNode;try{en(t,``),Lt=!0}catch(t){mf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ol(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Lt=!0}catch(t){mf(e,e.return,t)}}break;case 3:if(Lt=!1,Gm=null,o=wu,wu=xm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Uh(t.containerInfo)}catch(t){mf(e,e.return,t)}tu&&(tu=!1,Du(e)),Lt=!1;break;case 4:a=eu,eu=Ql,r=Rt(),o=wu,wu=xm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,Lt&&au&&(ou=!0),Lt=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=je()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Ql,l=$l,u=eu;Ql=c||o,eu=u||o,$l=l||s,Cu(t,e,n),$l=l,eu=u,Ql=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Ql||$l||(t=s||$l,n=Ql,r=$l,Ql=o||Ql,$l=t,ju(e,2),Ql=n,$l=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&($l||r===null||xl(r,r.return)),a=Rt(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&li(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&Lt&&(e.flags|=4),au=o,Lt=a;break;case 21:break;case 7:a&512&&($l||r===null||xl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(kl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(El(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Tl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ml(e,Al(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(en(l,``),n.flags&=-33),Ml(e,Al(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;jl(e,Al(e),u,s);break;default:throw Error(i(161))}}catch(t){mf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,_h=!0,t.reset(),_h=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Zl(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)X(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Rl(),Ou(t,e),!iu&&!ou){if(e=Ll,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Op(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`})),su=!0}Ll=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):X(e,!1));break;case 30:r=iu,i=Rl(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=si(a,o),o=si(n.memoizedProps,o);var s=li(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,zl=0,t=Xl(e,n,t,o,s,a,!0),zl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Ll=i):i!==null&&(i.push.apply(i,Ll),Ll=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:_l(4,n,n.return),ju(n,r);break;case 1:xl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&yl(n,n.return,i),ju(n,r);break;case 27:r&2&&vm(n.stateNode,n.type,n.memoizedProps);case 5:xl(n,n.return),n.tag!==5&&n.tag!==27||wl(n),ju(n,r);break;case 6:wl(n);break;case 26:xl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:xl(n,n.return),ju(n,r);break;case 7:xl(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(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:Mu(i,a,n),gl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){mf(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++)ho(l[i],c)}catch(e){mf(r,r.return,e)}}s&&o&64&&vl(a),bl(a,a.return);break;case 27:n&2&&Nl(a);case 5:a.tag!==5&&a.tag!==27||Cl(a),Mu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 6:Cl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Ql||qm(xm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),bl(a,a.return);break;case 30:Mu(i,a,n),bl(a,a.return);break;case 7:bl(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(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&&wa(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wa(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Yl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Jl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&gl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(e,t,n,r),i&&su&&(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&&wa(a)));break;case 12:if(a&2048){Fu(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){mf(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(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&&Jl(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Jl(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Hl(a.child,!0),Hl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(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:Lu(a,o,s,c,i),gl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(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:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=wu;wu=xm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Fl===null&&(Fl=new Map),Fl.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(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 Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&_l(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_l(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:_l(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:wa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=ga(Sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ga(Sa).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Zu=null,Qu=0,$u=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return Yu&2&&Qu!==0?Qu&-Qu:W.T===null?ut():Ff()}function Md(){if(ld===0){if(!(Qu&536870912)||Yi){var e=Je;Je<<=1,!(Je&3932160)&&(Je=262144),ld=e}else ld=536870912}return e=So.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Ip(si(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===Xu&&($u===2||$u===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,Qu,ld,!1)),rt(e,n),(!(Yu&2)||e!==Xu)&&(e===Xu&&(!(Yu&2)&&(sd|=n),ad===4&&Rd(e,Qu,ld,!1)),Df(e))}function Fd(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Qe(e,t),a=r?Yd(e,t):qd(e,t,!0),o=r;do{if(a===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(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=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,a=4;break a}o=fd,fd=a,o!==null&&(fd===null?fd=o:fd.push.apply(fd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Vd(e,0),Rd(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:Rd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=md+300-je(),10<a)){if(Rd(r,t,ld,!td),Ze(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=vp(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,o,`Throttled`,-0,0),a);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,o,null,-0,0)}break}}while(1);Df(e)}function Id(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:ln},Fl=null,Vu(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=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-je():(a&4194048)===a?hd-je():0,m=th(d,m),m!==null)?(Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l)):nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(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(!jr(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 Rd(e,t,n,r){t=$e(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ue(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function zd(){return Yu&6?!0:(Of(0,!1),!1)}function Bd(){if(Zu!==null){if($u===0)var e=Zu.return;else e=Zu,ca=sa=null,Qo(e),Xa=null,Za=0,e=Zu;for(;e!==null;)hl(e.alternate,e),e=e.return;Zu=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,yp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),Xu=e,Zu=n=wi(e.current,null),Qu=t,$u=0,ed=null,td=!1,nd=Qe(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=$e(e,t),mi(),n}function Hd(e,t){Po=null,W.H=cc,t===Ba||t===Ha?(t=Ja(),$u=3):t===Va?(t=Ja(),$u=4):$u=t===Ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,Zu===null&&(ad=1,bc(e,Mi(t,e.current)))}function Ud(){var e=So.current;return e===null?!0:(Qu&4194048)===Qu?Co===null:(Qu&62914560)===Qu||Qu&536870912?e===Co:!1}function Wd(){var e=W.H;return W.H=cc,e===null?cc:e}function Gd(){var e=W.A;return W.A=qu,e}function Kd(){ad=4,td||(Qu&4194048)!==Qu&&So.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||Xu===null||Rd(Xu,Qu,ld,!1)}function qd(e,t,n){var r=Yu;Yu|=2;var i=Wd(),a=Gd();(Xu!==e||Qu!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if($u!==0&&Zu!==null){var s=Zu,c=ed;switch($u){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:So.current===null&&(t=!0);var l=$u;if($u=0,ed=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=$u,$u=0,ed=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,ca=sa=null,Yu=r,W.H=i,W.A=a,Zu===null&&(Xu=null,Qu=0,mi()),o}function Jd(){for(;Zu!==null;)Zd(Zu)}function Yd(e,t){var n=Yu;Yu|=2;var r=Wd(),a=Gd();Xu!==e||Qu!==t?(_d=null,gd=je()+500,Vd(e,t)):nd=Qe(e,t);a:do try{if($u!==0&&Zu!==null){t=Zu;var o=ed;b:switch($u){case 1:$u=0,ed=null,$d(e,t,o,1);break;case 2:case 9:if(Wa(o)){$u=0,ed=null,Qd(t);break}t=function(){$u!==2&&$u!==9||Xu!==e||($u=7),Df(e)},o.then(t,t);break a;case 3:$u=7;break a;case 4:$u=5;break a;case 7:Wa(o)?($u=0,ed=null,Qd(t)):($u=0,ed=null,$d(e,t,o,7));break;case 5:var s=null;switch(Zu.tag){case 26:s=Zu.memoizedState;case 5:case 27:var c=Zu;if(s?Xm(s):c.stateNode.complete){$u=0,ed=null;var l=c.sibling;if(l!==null)Zu=l;else{var u=c.return;u===null?Zu=null:(Zu=u,ef(u))}break b}}$u=0,ed=null,$d(e,t,o,5);break;case 6:$u=0,ed=null,$d(e,t,o,6);break;case 8:Bd(),ad=6;break a;default:throw Error(i(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return ca=sa=null,W.H=r,W.A=a,Yu=n,Zu===null?(Xu=null,Qu=0,mi(),ad):0}function Xd(){for(;Zu!==null&&!ke();)Zd(Zu)}function Zd(e){var t=ol(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):Zu=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bc(n,t,t.pendingProps,t.type,void 0,Qu);break;case 11:t=Bc(n,t,t.pendingProps,t.type.render,t.ref,Qu);break;case 5:Qo(t);var r=t;r===qi&&(Yi?(ta(r),r.tag===5&&r.stateNode!=null&&(Ji=r.stateNode)):(ta(r),Yi=!0));default:hl(n,t),t=Zu=Ti(t,id),t=ol(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):Zu=t}function $d(e,t,n,r){ca=sa=null,Qo(t),Xa=null,Za=0;var i=t.return;try{if(Tc(e,i,t,n,Qu)){ad=1,bc(e,Mi(n,e.current)),Zu=null;return}}catch(t){if(i!==null)throw Zu=i,t;ad=1,bc(e,Mi(n,e.current)),Zu=null;return}t.flags&32768?(Yi||r===1?e=!0:nd||Qu&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=So.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=pl(t.alternate,t,id);if(n!==null){Zu=n;return}if(t=t.sibling,t!==null){Zu=t;return}Zu=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=ml(e.alternate,e);if(n!==null){n.flags&=32767,Zu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Zu=e;return}Zu=e=n}while(e!==null);ad=6,Zu=null}function nf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Zu=Xu=null,Qu=0),xd=t,bd=e,Sd=n,wd=a,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=pi,it(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=Da(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,bf(Fe,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Pl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=W.T,W.T=null,i=G.p,G.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,G.p=i,W.T=r}}yd=1,Pl?Ed=Pp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,ku(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=W.T,W.T=null;var i=G.p;G.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=dp;var o=Lr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ir(s.ownerDocument.documentElement,s)){if(c!==null&&Rr(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 _=Fr(s,h),v=Fr(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}}_h=!!up,dp=up=null}finally{Yu=a,G.p=i,W.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=W.T,W.T=null;var r=G.p;G.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,G.p=r,W.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,Ae();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),lt(r),n=n.stateNode,Ve&&typeof Ve.onCommitFiberRoot==`function`)try{Ve.onCommitFiberRoot(Be,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=W.T,a=G.p,G.p=2,W.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{W.T=n,G.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=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);Sd&3&&df(),Df(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Of(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,wa(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=lt(Sd),r=W.T,a=G.p;try{G.p=32>n?32:n,W.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Of(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{G.p=a,W.T=r,uf(e,t)}}function pf(e,t,n){t=Mi(n,t),t=Sc(e.stateNode,t,2),e=co(e,t,2),e!==null&&(rt(e,2),Df(e))}function mf(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Mi(n,e),n=Cc(2),r=co(t,n,2),r!==null&&(wc(n,r,t,e),rt(r,2),Df(r));break}}t=t.return}}function hf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;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)||(rd=!0,i.add(n),e=gf.bind(null,e,t,n),t.then(e,e))}function gf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Qu&n)===n&&(ad===4||ad===3&&(Qu&62914560)===Qu&&300>je()-md?Yu&2?cd|=n:Vd(e,0):cd|=n,ud===Qu&&(ud=0)),Df(e)}function _f(e,t){t===0&&(t=tt()),e=_i(e,t),e!==null&&(rt(e,t),Df(e))}function vf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_f(e,n)}function yf(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),_f(e,n)}function bf(e,t){return De(e,t)}var xf=null,Sf=null,Cf=!1,wf=!1,Tf=!1,Ef=0;function Df(e){e!==Sf&&e.next===null&&(Sf===null?xf=Sf=e:Sf=Sf.next=e),wf=!0,Cf||(Cf=!0,Pf())}function Of(e,t){if(!Tf&&wf){Tf=!0;do for(var n=!1,r=xf;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-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Nf(r,a))}else a=Qu,a=Ze(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(r,a)||(n=!0,Nf(r,a))}r=r.next}while(n);Tf=!1}}function kf(){Af()}function Af(){wf=Cf=!1;var e=0;Ef!==0&&_p()&&(e=Ef);for(var t=je(),n=null,r=xf;r!==null;){var i=r.next,a=jf(r,t);a===0?(r.next=null,n===null?xf=i:n.next=i,i===null&&(Sf=n)):(n=r,(e!==0||a&3)&&(wf=!0)),r=i}yd!==0&&yd!==5||Of(e,!1),Ef!==0&&(Ef=0)}function jf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ue(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Qu,n=Ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&($u===2||$u===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Oe(r),lt(n)){case 2:case 8:n=Pe;break;case 32:n=Fe;break;case 268435456:n=Le;break;default:n=Fe}return r=Mf.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Oe(r),e.callbackPriority=2,e.callbackNode=null,2}function Mf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=Qu;return r=Ze(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),jf(e,je()),e.callbackNode!=null&&e.callbackNode===n?Mf.bind(null,e):null)}function Nf(e,t){if(df())return null;Fd(e,t,!0)}function Pf(){Sp(function(){Yu&6?De(Ne,kf):Af()})}function Ff(){if(Ef===0){var e=Aa;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),Ef=e}return Ef}function If(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:cn(e)}function Lf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=If((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?If(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new An(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ef!==0){var e=new FormData(i,o);Js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Rf=0;Rf<ii.length;Rf++){var zf=ii[Rf];ai(zf.toLowerCase(),`on`+(zf[0].toUpperCase()+zf.slice(1)))}ai(Xr,`onAnimationEnd`),ai(Zr,`onAnimationIteration`),ai(Qr,`onAnimationStart`),ai(`dblclick`,`onDoubleClick`),ai(`focusin`,`onFocus`),ai(`focusout`,`onBlur`),ai($r,`onTransitionRun`),ai(ei,`onTransitionStart`),ai(ti,`onTransitionCancel`),ai(ni,`onTransitionEnd`),Mt(`onMouseEnter`,[`mouseout`,`mouseover`]),Mt(`onMouseLeave`,[`mouseout`,`mouseover`]),Mt(`onPointerEnter`,[`pointerout`,`pointerover`]),Mt(`onPointerLeave`,[`pointerout`,`pointerover`]),jt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),jt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),jt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),jt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),jt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),jt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Bf=`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(` `),Vf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Bf));function Hf(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){ui(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){ui(e)}i.currentTarget=null,a=c}}}}function Uf(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(qf(t,e,2,!1),n.add(r))}function Wf(e,t,n){var r=0;t&&(r|=4),qf(n,e,r,t)}var Gf=`_reactListening`+Math.random().toString(36).slice(2);function Kf(e){if(!e[Gf]){e[Gf]=!0,kt.forEach(function(t){t!==`selectionchange`&&(Vf.has(t)||Wf(t,!1,e),Wf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gf]||(t[Gf]=!0,Wf(`selectionchange`,!1,t))}}function qf(e,t,n,r){switch(wh(t)){case 2:var i=vh;break;case 8:i=yh;break;default:i=bh}n=i.bind(null,t,n,e),i=void 0,!yn||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 Jf(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=Ct(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}gn(function(){var r=a,i=dn(n),s=[];a:{var c=ri.get(e);if(c!==void 0){var l=An,u=e;switch(e){case`keypress`:if(Tn(n)===0)break a;case`keydown`:case`keyup`:l=qn;break;case`focusin`:u=`focus`,l=Rn;break;case`focusout`:u=`blur`,l=Rn;break;case`beforeblur`:case`afterblur`:l=Rn;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=Ln;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Y;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Xn;break;case Xr:case Zr:case Qr:l=zn;break;case ni:l=Zn;break;case`scroll`:case`scrollend`:l=Mn;break;case`wheel`:l=Qn;break;case`copy`:case`cut`:case`paste`:l=Bn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Jn;break;case`submit`:l=Yn;break;case`toggle`:case`beforetoggle`:l=$n}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=_n(m,p),g!=null&&d.push(Yf(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!==un&&(u=n.relatedTarget||n.fromElement)&&(Ct(u)||u[ht]))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?Ct(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=Ln,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Jn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Tt(c),h=l==null?u:Tt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ct(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,Zf):null,c!==null&&Qf(s,u,c,d,!1),l!==null&&f!==null&&Qf(s,f,l,d,!0)))}a:{if(c=r?Tt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=yr;else if(pr(c)){if(br)_=kr;else{_=Dr;var v=Er}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&an(r.elementType)&&(_=yr):_=Or;if(_&&=_(e,r)){mr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Tt(r):window,e){case`focusin`:(pr(v)||v.contentEditable===`true`)&&(Br=v,Vr=r,Hr=null);break;case`focusout`:Hr=Vr=Br=null;break;case`mousedown`:Ur=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ur=!1,Wr(s,n,i);break;case`selectionchange`:if(zr)break;case`keydown`:case`keyup`:Wr(s,n,i)}var y;if(tr)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 lr?sr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ir&&n.locale!==`ko`&&(lr||b!==`onCompositionStart`?b===`onCompositionEnd`&&lr&&(y=wn()):(xn=i,Sn=`value`in xn?xn.value:xn.textContent,lr=!0)),v=Xf(r,b),0<v.length&&(b=new Vn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=cr(n),y!==null&&(b.data=y)))),(y=rr?ur(e,n):dr(e,n))&&(b=Xf(r,`onBeforeInput`),0<b.length&&(v=new Vn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Lf(s,e,r,n,i)}Hf(s,t)})}function Yf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xf(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=_n(e,n),i!=null&&r.unshift(Yf(e,i,a)),i=_n(e,t),i!=null&&r.push(Yf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Zf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Qf(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=_n(n,a),l!=null&&o.unshift(Yf(n,l,c))):i||(l=_n(n,a),l!=null&&o.push(Yf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var $f=/\r\n?/g,ep=/\u0000|\uFFFD/g;function tp(e){return(typeof e==`string`?e:``+e).replace($f,`
|
|
9
|
+
`).replace(ep,``)}function np(e,t){return t=tp(t),tp(e)===t}function rp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||en(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&en(e,``+r);else return;break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:rn(e,r,o);return;case`data`:if(t!==`object`){Bt(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`&&rp(e,t,`name`,a.name,a,null),rp(e,t,`formEncType`,a.formEncType,a,null),rp(e,t,`formMethod`,a.formMethod,a,null),rp(e,t,`formTarget`,a.formTarget,a,null)):(rp(e,t,`encType`,a.encType,a,null),rp(e,t,`method`,a.method,a,null),rp(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=ln);return;case`onScroll`:r!=null&&Uf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Uf(`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`:Uf(`beforetoggle`,e),Uf(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(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=on.get(n)||n,zt(e,n,r);else return}Lt=!0}function ip(e,t,n,r,a,o){switch(n){case`style`:rn(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`)en(e,r);else if(typeof r==`number`||typeof r==`bigint`)en(e,``+r);else return;break;case`onScroll`:r!=null&&Uf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Uf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=ln);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!At.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[mt]||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}Lt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}return}Lt=!0}function ap(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Uf(`error`,e),Uf(`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:rp(e,t,o,s,n,null)}}a&&rp(e,t,`srcSet`,n.srcSet,n,null),r&&rp(e,t,`src`,n.src,n,null);return;case`input`:Uf(`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:rp(e,t,r,d,n,null)}}Yt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Uf(`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:rp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Zt(e,!!r,n,!0):Zt(e,!!r,t,!1);return;case`textarea`:for(s in Uf(`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:rp(e,t,s,c,n,null)}$t(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:rp(e,t,l,r,n,null)}return;case`dialog`:Uf(`beforetoggle`,e),Uf(`toggle`,e),Uf(`cancel`,e),Uf(`close`,e);break;case`iframe`:case`object`:Uf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Bf.length;r++)Uf(Bf[r],e);break;case`image`:Uf(`error`,e),Uf(`load`,e);break;case`details`:Uf(`toggle`,e);break;case`embed`:case`source`:case`link`:Uf(`error`,e),Uf(`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:rp(e,t,u,r,n,null)}return;default:if(an(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&ip(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&rp(e,t,c,r,n,null))}var op={};function sp(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)||rp(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&&(Lt=!0),o=m;break;case`name`:m!==f&&(Lt=!0),a=m;break;case`checked`:m!==f&&(Lt=!0),u=m;break;case`defaultChecked`:m!==f&&(Lt=!0),d=m;break;case`value`:m!==f&&(Lt=!0),s=m;break;case`defaultValue`:m!==f&&(Lt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&rp(e,t,p,m,r,f)}}J(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)||rp(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&&(Lt=!0),p=o;break;case`defaultValue`:o!==l&&(Lt=!0),c=o;break;case`multiple`:o!==l&&(Lt=!0),s=o;default:o!==l&&rp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Zt(e,!!n,n?[]:``,!1):Zt(e,!!n,t,!0)):Zt(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:rp(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&&(Lt=!0),p=a;break;case`defaultValue`:a!==o&&(Lt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&rp(e,t,s,a,r,o)}Qt(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:rp(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&&(Lt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:rp(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)&&rp(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:rp(e,t,u,p,r,m)}return;default:if(an(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&ip(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||ip(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&rp(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||rp(e,t,f,p,r,m)}function cp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function lp(){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&&cp(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&&cp(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 up=null,dp=null;function fp(e){return e.nodeType===9?e:e.ownerDocument}function pp(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 mp(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 Z(e,t,n,r){return n=fp(n).createElement(e),n[pt]=r,n[mt]=t,ap(n,e,t),Dt(n),n}function hp(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 gp=null;function _p(){var e=window.event;return e&&e.type===`popstate`?e!==gp&&(gp=e,!0):(gp=null,!1)}var vp=typeof setTimeout==`function`?setTimeout:void 0,yp=typeof clearTimeout==`function`?clearTimeout:void 0,bp=typeof Promise==`function`?Promise:void 0,xp=typeof requestAnimationFrame==`function`?requestAnimationFrame:vp,Sp=typeof queueMicrotask==`function`?queueMicrotask:bp===void 0?vp:function(e){return bp.resolve(null).then(e).catch(Cp)};function Cp(e){setTimeout(function(){throw e})}function wp(e){return e===`head`}function Tp(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),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Q(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Q(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Q(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Ep(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 Dp(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 Op(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 kp(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 Ap(e){return kp(e.getBoundingClientRect(),getComputedStyle(e),e)}function jp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return kp(t,n,e)}function Mp(e){return e.documentElement.clientHeight}function Np(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Pp(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`&&(Mp(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+=Zm(f),u>eh){s.length=o;break}f=new Promise(Np.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 Fp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Fp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Fp.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},Fp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ip(e){return{name:e,group:new Fp(`group`,e),imagePair:new Fp(`image-pair`,e),old:new Fp(`old`,e),new:new Fp(`new`,e)}}function Lp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Lp.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(Hp(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=Bp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Rp,e,s,r)}this._eventListeners=a}};function Rp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Lp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Hp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Bp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,zp,e,n,i),r.splice(t,1),a!==null&&a()}};function zp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Bp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Hp(e,t,n,r){if(e.length===0)return-1;r=Vp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Vp(a.optionsOrUseCapture)===r)return i}return-1}Lp.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,Bp(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,Bp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Lp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Up,e,void 0,void 0)};function Up(e,t){return e.tag!==6&&(e=b(e),hm(e,t))}Lp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Wp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Up(t[n],e);n--);};function Wp(e,t){return t.push(e),!1}Lp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=fp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0))};function Gp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Lp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Lp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,qp,e,void 0,void 0);for(var n=t=0;n<Jp.length;n++){var r=Jp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Jp[t++]=r}Jp.length=t}};function qp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Jp=[],Yp=!1;function Xp(e,t,n){Jp.push({fragmentInstance:e,observer:t,instance:n}),Yp||(Yp=!0,gm(function(){Yp=!1;var e=Jp;Jp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Lp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0),e};function Zp(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}Lp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Lp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Wp,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||Qp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Qp(e,t,n,r,i){var a=Ct(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 $p(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)}Lp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Wp,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),$p(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),$p(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function em(e,t){return e=b(e),tm(e,t),!1}function tm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function nm(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,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Jp.length;i++){var a=Jp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Jp[r++]=a)}Jp.length=r,n.observe(e)}),tm(e,t))}function rm(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,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Xp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function im(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`:im(n),St(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function am(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[bt])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=dm(e.nextSibling),e===null)break}return null}function om(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=dm(e.nextSibling),e===null))return null;return e}function sm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=dm(e.nextSibling),e===null))return null;return e}function cm(e){return e.data===`$?`||e.data===`$~`}function lm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function um(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 dm(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 fm=null;function pm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return dm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mm(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 hm(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 gm(e){xp(function(){xp(function(t){return e(t)})})}function _m(e,t,n){switch(t=fp(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 vm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&rp(e,t,r,null,op,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===ln&&(e.onclick=null),St(e)}function Q(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);St(e)}var ym=new Map,bm=new Set;function xm(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 Sm=G.d;G.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=zd();return e||t}function wm(e){var t=wt(e);t!==null&&t.tag===5&&t.type===`form`?Xs(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=Jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ap(t,`link`,e),Dt(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Jt(n.imageSizes)+`"]`)):i+=`[href="`+Jt(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);ap(o,`link`,e),t===`style`&&(o[xt]=!0,o.onload=o.onerror=function(){Ot(o)}),Dt(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Jt(r)+`"][href="`+Jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=D({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),ap(r,`link`,e),Dt(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Et(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);Dt(c),ap(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,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Et(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Dt(a),ap(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Et(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Dt(a),ap(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=pe.current)?xm(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=Fm(n.href),t=Et(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=Fm(n.href);var o=Et(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.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},ym.set(e,o)),Rm(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=zm(n),t=Et(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 Fm(e){return`href="`+Jt(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[xt]){r.loading=1;return}}else t=e.createElement(`link`),t[xt]=!0,t.onload=t.onerror=Ot.bind(null,t),ap(t,`link`,n),Dt(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 zm(e){return`[src="`+Jt(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Jt(n.href)+`"]`);if(r)return t.instance=r,Dt(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`),Dt(r),ap(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,Dt(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),Dt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ap(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,Dt(a),a):(r=n,(a=ym.get(o))&&(r=D({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Dt(a),ap(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,Hm(r,n.precedence,e));return t.instance}function Hm(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 Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,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[bt]||a[pt]||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 qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Dt(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),Dt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ap(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=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*lp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.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=rh.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 ch={$$typeof:F,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function lh(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=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(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 uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Si(3,null,null,t),e.current=a,a.stateNode=e,t=Ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ao(a),e}function dh(e){return e?(e=bi,e):bi}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=so(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=co(e,r,t),n!==null&&(Pd(n,e,t),lo(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=_i(e,67108864);t!==null&&Pd(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=jd();t=ct(t);var n=_i(e,t);n!==null&&Pd(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=2,bh(e,t,n,r)}finally{G.p=a,W.T=i}}function yh(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=8,bh(e,t,n,r)}finally{G.p=a,W.T=i}}function bh(e,t,n,r){if(_h){var i=xh(r);if(i===null)Jf(e,t,r,Sh,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=wt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ue(o);s.entanglements[1]|=c,o&=~c}Df(a),!(Yu&6)&&(gd=je()+500,Of(0,!1))}}break;case 31:case 13:s=_i(a,2),s!==null&&Pd(s,a,2),zd(),mh(a,2)}if(a=xh(r),a===null&&Jf(e,t,r,Sh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Jf(e,t,r,null,n)}}function xh(e){return e=dn(e),Ch(e)}var Sh=null;function Ch(e){if(Sh=null,e=Ct(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 Sh=e,null}function wh(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(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var Th=!1,Eh=null,Dh=null,Oh=null,kh=new Map,Ah=new Map,jh=[],Mh=`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 Nh(e,t){switch(e){case`focusin`:case`focusout`:Eh=null;break;case`dragenter`:case`dragleave`:Dh=null;break;case`mouseover`:case`mouseout`:Oh=null;break;case`pointerover`:case`pointerout`:kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ah.delete(t.pointerId)}}function Ph(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=wt(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Eh=Ph(Eh,e,t,n,r,i),!0;case`dragenter`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`mouseover`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kh.set(a,Ph(kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=Ct(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,dt(e.priority,function(){gh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){gh(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 Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);un=r,n.target.dispatchEvent(r),un=null}else return t=wt(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Th=!1,Eh!==null&&Lh(Eh)&&(Eh=null),Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh.forEach(Rh),Ah.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Th||(Th=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=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(Ch(r||n)===null)continue;break}var a=wt(n);a!==null&&(e.splice(t,3),t-=3,Js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Eh!==null&&Bh(Eh,e),Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh.forEach(t),Ah.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.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[mt]||null;if(typeof a==`function`)o||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(Ch(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){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 Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fh(n,jd(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),zd(),t[ht]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.1`)throw Error(i(527,qh,`19.3.1`));G.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 Jh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:W,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{Be=Yh.inject(Jh),Ve=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=_c,s=vc,c=yc;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=uh(e,1,!1,null,null,n,r,null,o,s,c,Wh),e[ht]=t.current,Kf(e),new Gh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),b=[{name:`gilt`,label:`Gilt`,mode:`dark`,accent:`#d4af37`,canvas:`#090a0c`},{name:`catppuccin-latte`,label:`Catppuccin Latte`,mode:`light`,accent:`#1e66f5`,canvas:`#e3e4e8`},{name:`catppuccin`,label:`Catppuccin Mocha`,mode:`dark`,accent:`#89b4fa`,canvas:`#161622`},{name:`coppernight`,label:`Copper Night`,mode:`dark`,accent:`#fab387`,canvas:`#0b0b12`},{name:`ethereal`,label:`Ethereal`,mode:`dark`,accent:`#7d82d9`,canvas:`#040816`},{name:`everforest`,label:`Everforest`,mode:`dark`,accent:`#7fbbb3`,canvas:`#21272c`},{name:`flexoki-light`,label:`Flexoki Light`,mode:`light`,accent:`#205ea6`,canvas:`#f2efe4`},{name:`game-boy`,label:`Game Boy`,mode:`light`,accent:`#346856`,canvas:`#88c070`,hidden:!0},{name:`gruvbox`,label:`Gruvbox`,mode:`dark`,accent:`#7daea3`,canvas:`#1e1e1e`},{name:`hackerman`,label:`Hackerman`,mode:`dark`,accent:`#82fb9c`,canvas:`#080910`},{name:`kanagawa`,label:`Kanagawa`,mode:`dark`,accent:`#dcd7ba`,canvas:`#17171e`},{name:`last-horizon`,label:`Last Horizon`,mode:`dark`,accent:`#b59790`,canvas:`#090809`},{name:`lumon`,label:`Lumon`,mode:`dark`,accent:`#8bc9eb`,canvas:`#101b21`},{name:`lupine`,label:`Lupine`,mode:`light`,accent:`#3264eb`,canvas:`#ececec`},{name:`matte-black`,label:`Matte Black`,mode:`dark`,accent:`#e68e0d`,canvas:`#0c0c0c`},{name:`miasma`,label:`Miasma`,mode:`dark`,accent:`#78824b`,canvas:`#191919`},{name:`nord`,label:`Nord`,mode:`dark`,accent:`#81a1c1`,canvas:`#222730`},{name:`oligarchy`,label:`Oligarchy`,mode:`light`,accent:`#c0271c`,canvas:`#e5dbc6`},{name:`osaka-jade`,label:`Osaka Jade`,mode:`dark`,accent:`#509475`,canvas:`#0c1512`},{name:`retro-82`,label:`Retro 82`,mode:`dark`,accent:`#faa968`,canvas:`#031222`},{name:`ristretto`,label:`Ristretto`,mode:`dark`,accent:`#f38d70`,canvas:`#211b1b`},{name:`rose-pine`,label:`Rose Pine Dawn`,mode:`light`,accent:`#56949f`,canvas:`#ede7e1`},{name:`solitude`,label:`Solitude`,mode:`dark`,accent:`#798186`,canvas:`#0c0e10`},{name:`tokyo-night`,label:`Tokyo Night`,mode:`dark`,accent:`#7aa2f7`,canvas:`#13141c`},{name:`vantablack`,label:`Vantablack`,mode:`dark`,accent:`#8d8d8d`,canvas:`#090909`},{name:`white`,label:`White`,mode:`light`,accent:`#6e6e6e`,canvas:`#f5f5f5`}],x=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})),S=o(((e,t)=>{t.exports=x()}))(),C=v.createContext(null),w=new Set,T=e=>(w.add(e),()=>w.delete(e)),E=()=>w.forEach(e=>e()),D=()=>document.documentElement.dataset.theme,O=()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`,k=()=>void 0,A=()=>window.matchMedia(`(prefers-color-scheme: dark)`),j=e=>e===`system`?A().matches:e===`dark`,M=[];function N(e){try{let t=JSON.parse(e??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):M}catch{return M}}function P(e){let t=document.createElement(`style`);t.textContent=`*,*::before,*::after{transition:none!important}`,document.head.appendChild(t),e(),getComputedStyle(document.body),setTimeout(()=>t.remove(),1)}function F({themes:e,storageKey:t,children:n}){let r=v.useSyncExternalStore(T,D,k),i=v.useSyncExternalStore(T,O,k),a=v.useCallback(n=>{let r=e.find(e=>e.name===n);if(r){P(()=>{document.documentElement.dataset.theme=r.name,document.documentElement.classList.toggle(`dark`,j(r.mode))});try{localStorage.setItem(t,r.name)}catch{}E()}},[e,t]),o=`${t}.favorites`,s=v.useSyncExternalStore(T,()=>{try{return localStorage.getItem(o)}catch{return null}},()=>null),c=v.useMemo(()=>N(s),[s]),l=v.useCallback(e=>{let t=c.includes(e)?c.filter(t=>t!==e):[...c,e];try{localStorage.setItem(o,JSON.stringify(t))}catch{return}E()},[c,o]),u=e.find(e=>e.name===r)?.mode;v.useEffect(()=>{if(u!==`system`)return;let e=A(),t=()=>{document.documentElement.classList.toggle(`dark`,e.matches),E()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[u]),v.useEffect(()=>{let e=getComputedStyle(document.documentElement).getPropertyValue(`--background`).trim();e&&document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,e)},[r,i]);let d=v.useMemo(()=>({theme:r,resolvedMode:i,themes:e,setTheme:a,favorites:c,toggleFavorite:l}),[r,i,e,a,c,l]);return(0,S.jsx)(C,{value:d,children:n})}function I(){let e=v.useContext(C);if(!e)throw Error(`useTheme must be used inside <ThemeProvider>`);return e}function L(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`||e.closest(`[role="listbox"], [role="combobox"], [role="dialog"]`)!==null:!1}var R=l(h(),1),z=750;function B(e,t,n){if(n||!t||!(`startViewTransition`in document))return e();let r=document.documentElement;r.classList.add(`theme-reveal`);let i=document.startViewTransition(()=>(0,R.flushSync)(e)),{x:a,y:o}=t,s=Math.hypot(Math.max(a,innerWidth-a),Math.max(o,innerHeight-o));i.ready.then(()=>r.animate({clipPath:[`circle(0px at ${a}px ${o}px)`,`circle(${s}px at ${a}px ${o}px)`]},{duration:z,easing:`cubic-bezier(0.65, 0, 0.35, 1)`,pseudoElement:`::view-transition-new(root)`})).catch(()=>{}),i.finished.finally(()=>r.classList.remove(`theme-reveal`))}var V={};function ee(e,t){let n=v.useRef(V);return n.current===V&&(n.current=e(t)),n}var H=[],te=void 0;function ne(){return te}function re(e){H.push(e)}function U(e){let t=(t,n)=>{let r=ee(ae).current,i;try{te=r;for(let e of H)e.before(r);i=e(t,n);for(let e of H)e.after(r);r.didInitialize=!0}finally{te=void 0}return i};return t.displayName=e.displayName||e.name,t}function ie(e){return v.forwardRef(U(e))}function ae(){return{didInitialize:!1}}function oe(){}var W=Object.freeze([]),G=Object.freeze({}),K=typeof document<`u`?v.useLayoutEffect:()=>{};function se(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var q=se(`https://base-ui.com/production-error`,`Base UI`),ce=v.createContext(void 0);function le(e){let t=v.useContext(ce);if(t===void 0&&!e)throw Error(q(72));return t}function ue(e){v.useEffect(e,W)}var de=0,fe=class e{static create(){return new e}currentId=de;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=de,t()},e)}isStarted(){return this.currentId!==de}clear=()=>{this.currentId!==de&&(clearTimeout(this.currentId),this.currentId=de)};disposeEffect=()=>this.clear};function pe(){let e=ee(fe.create).current;return ue(e.disposeEffect),e}function me(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:he,platform:ge,maxTouchPoints:_e}=me(),ve=he.toLowerCase(),ye=ge.toLowerCase(),be=/^i(os$|p)/.test(ye)||ye===`macintel`&&_e>1,xe=`android`,Se=ye===xe||ve.includes(xe),Ce=!be&&ye.startsWith(`mac`);ye.startsWith(`win`),!Se&&/^(linux|chrome os)/.test(ye);var we=Ce||be,Te=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),Ee=!Te&&ve.includes(`firefox`);!Te&&ve.includes(`chrom`);var De=we,Oe=/jsdom|happydom/.test(ve);function ke(e){e.preventDefault(),e.stopPropagation()}function Ae(e){return`nativeEvent`in e}function je(e){return e.pointerType===``&&e.isTrusted?!0:Se&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Me(e){return Oe?!1:!Se&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Se||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Ne(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Pe(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Fe(){return typeof window<`u`}function Ie(e){return ze(e)?(e.nodeName||``).toLowerCase():`#document`}function Le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){return((ze(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ze(e){return Fe()?e instanceof Node||e instanceof Le(e).Node:!1}function Be(e){return Fe()?e instanceof Element||e instanceof Le(e).Element:!1}function Ve(e){return Fe()?e instanceof HTMLElement||e instanceof Le(e).HTMLElement:!1}function He(e){return!Fe()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Le(e).ShadowRoot}function Ue(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=et(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function We(e){return/^(table|td|th)$/.test(Ie(e))}function Ge(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ke=/transform|translate|scale|rotate|perspective|filter/,qe=/paint|layout|strict|content/,Je=e=>!!e&&e!==`none`,Ye;function Xe(e){let t=Be(e)?et(e):e;return Je(t.transform)||Je(t.translate)||Je(t.scale)||Je(t.rotate)||Je(t.perspective)||!Qe()&&(Je(t.backdropFilter)||Je(t.filter))||Ke.test(t.willChange||``)||qe.test(t.contain||``)}function Ze(e){let t=nt(e);for(;Ve(t)&&!$e(t);){if(Xe(t))return t;if(Ge(t))return null;t=nt(t)}return null}function Qe(){return Ye??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ye}function $e(e){return/^(html|body|#document)$/.test(Ie(e))}function et(e){return Le(e).getComputedStyle(e)}function tt(e){return Be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nt(e){if(Ie(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||He(e)&&e.host||Re(e);return He(t)?t.host:t}function rt(e){let t=nt(e);return $e(t)?(e.ownerDocument||e).body:Ve(t)&&Ue(t)?t:rt(t)}function it(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=rt(e),i=r===e.ownerDocument?.body,a=Le(r);if(i){let e=at(a);return t.concat(a,a.visualViewport||[],Ue(r)?r:[],e&&n?it(e):[])}return t.concat(r,it(r,[],n))}function at(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ot(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function st(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&He(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ct(e,t){let n=e;for(;n;){if(Be(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(He(n)?n.host:null)}return null}function lt(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var ut=`data-base-ui-focusable`,dt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,ft=`ArrowLeft`,pt=`ArrowRight`,mt=`ArrowUp`,ht=`ArrowDown`,gt=`data-starting-style`,_t=`data-ending-style`,vt={[gt]:``},yt={[_t]:``},bt={transitionStatus(e){return e===`starting`?vt:e===`ending`?yt:null}},xt=`data-open`,St=`data-closed`,Ct=`data-anchor-hidden`,wt=`data-popup-open`,Tt=`data-pressed`,Et={[wt]:``},Dt={[wt]:``,[Tt]:``},Ot={[xt]:``},kt={[St]:``},At={[Ct]:``},jt={open(e){return e?Et:null}},Mt={open(e){return e?Dt:null}},Nt={open(e){return e?Ot:kt},anchorHidden(e){return e?At:null}},Pt={...Nt,...bt},Ft=`data-trigger-disabled`;function It(e,t){if(!Be(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Ft);for(let[,e]of t.entries())if(st(e,n))return!e.hasAttribute(Ft);return!1}function Lt(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Rt(e){return e.matches(`html,body`)}function zt(e){return Ve(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Bt(e){return ct(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${dt}`)!=null}function Vt(e){return e?e.getAttribute(`role`)===`combobox`&&zt(e):!1}function Ht(e){if(!e||Oe)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ut(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Wt(e,t){return t!=null&&!Ne(t)?0:typeof e==`function`?e():e}function Gt(e,t,n){let r=Wt(e,n);return typeof r==`number`?r:r?.[t]}function Kt(e){return typeof e==`function`?e():e}function qt(e,t){return t||e===`click`||e===`mousedown`}function Jt(e){return e?.includes(`mouse`)&&e!==`mousedown`}function J(e,t,n,r){let i=!1,a=!1,o=r??G;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Yt(e,t,n){let r=n??G;return{reason:e,event:t??new Event(`base-ui`),...r}}var Xt=`none`,Zt=`trigger-press`,Qt=`trigger-hover`,$t=`trigger-focus`,en=`outside-press`,tn=`item-press`,nn=`close-press`,rn=`clear-press`,an=`chip-remove-press`,on=`input-change`,sn=`input-clear`,cn=`input-press`,ln=`focus-out`,un=`escape-key`,dn=`list-navigation`,fn=`keyboard`,pn=`pointer`,mn=`cancel-open`,hn=`sibling-open`,gn=`disabled`,_n=`missing`,vn=`initial`,yn=`imperative-action`,bn=`window-resize`,xn=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new fe,currentIdRef:{current:null},currentContextRef:{current:null}});function Sn(e,t){e.current=t.current}function Cn(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=v.useRef(n),a=v.useRef(n),o=v.useRef(null),s=v.useRef(null),c=pe();return K(()=>{a.current=n,o.current?i.current={open:Gt(i.current,`open`),close:Gt(n,`close`)}:i.current=n},[n,o,i,a]),(0,S.jsx)(xn.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function wn(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=v.useContext(xn),[d,f]=v.useState(!1),p=v.useRef(n);return K(()=>{p.current=n},[n]),K(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),K(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:Gt(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,J(Xt))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),K(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,Sn(a,s),u.clear()}},[c,i,a,r,s,u]),v.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function Tn(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function En(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Dn(e,t,n,r){let i=ee(kn).current;return An(i,e,t,n,r)&&Mn(i,[e,t,n,r]),i.callback}function On(e){let t=ee(kn).current;return jn(t,e)&&Mn(t,e),t.callback}function kn(){return{callback:null,cleanup:null,refs:[]}}function An(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function jn(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Mn(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Nn(e){let t=ee(Pn,e).current;return t.next=e,K(t.effect),t}function Pn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Fn={...v},In=Fn.useInsertionEffect,Ln=In&&In!==Fn.useLayoutEffect?In:e=>e();function Y(e){let t=ee(Rn).current;return t.next=e,Ln(t.effect),t.trampoline}function Rn(){let e={next:void 0,callback:zn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function zn(){}var Bn=null;globalThis.requestAnimationFrame;var Vn=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Hn=class e{static create(){return new e}static request(e){return Vn.request(e)}static cancel(e){return Vn.cancel(e)}currentId=Bn;request(e){this.cancel(),this.currentId=Vn.request(()=>{this.currentId=Bn,e()})}cancel=()=>{this.currentId!==Bn&&(Vn.cancel(this.currentId),this.currentId=Bn)};disposeEffect=()=>this.cancel};function Un(){let e=ee(Hn.create).current;return ue(e.disposeEffect),e}function Wn(e){return e?.ownerDocument||document}var Gn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Kn={...Gn,position:`fixed`,margin:0,top:0,left:0},qn={...Gn,position:`absolute`},Jn=v.forwardRef(function(e,t){let[n,r]=v.useState();K(()=>{De&&Te&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,S.jsx)(`span`,{...e,ref:t,style:Kn,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Yn=Math.min,Xn=Math.max,Zn=Math.round,Qn=Math.floor,$n=e=>({x:e,y:e}),er={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function tr(e,t,n){return Xn(e,Yn(t,n))}function nr(e,t){return typeof e==`function`?e(t):e}function rr(e){return e.split(`-`)[0]}function ir(e){return e.split(`-`)[1]}function ar(e){return e===`x`?`y`:`x`}function or(e){return e===`y`?`height`:`width`}function sr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function cr(e){return ar(sr(e))}function lr(e,t,n){n===void 0&&(n=!1);let r=ir(e),i=cr(e),a=or(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=vr(o)),[o,vr(o)]}function ur(e){let t=vr(e);return[dr(e),t,dr(t)]}function dr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var fr=[`left`,`right`],pr=[`right`,`left`],mr=[`top`,`bottom`],hr=[`bottom`,`top`];function gr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?pr:fr:t?fr:pr;case`left`:case`right`:return t?mr:hr;default:return[]}}function _r(e,t,n,r){let i=ir(e),a=gr(rr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(dr)))),a}function vr(e){let t=rr(e);return er[t]+e.slice(t.length)}function yr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function br(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:yr(e)}function xr(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 Sr(e,t,n){return Math.floor(e/t)!==n}function Cr(e,t){return t<0||t>=e.length}function wr(e,t){return Dr(e.current,{disabledIndices:t})}function Tr(e,t){return Dr(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Er(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Dr(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Cr(e,u)?-1:u,wrapped:d}}function Dr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&kr(e,a,r));return a}function Or(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=ct(e,`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!kr(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Qn(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!kr(e,r,s))return r}};d&&ke(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Dr(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Dr(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Cr(e,f)&&(f=u)}if(n===`both`){let n=Qn(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&ke(t),u%o===o-1?r&&(f=Dr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Dr(e,{startingIndex:u,disabledIndices:s}),r&&Sr(f,o,n)&&(f=Dr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Sr(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&ke(t),u%o===0?r&&(f=Dr(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Dr(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Sr(f,o,n)&&(f=Dr(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Sr(f,o,n)&&(f=u));let c=Qn(l/o)===n;Cr(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Dr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function kr(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!jr(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ar(e){return e.visibility===`hidden`||e.visibility===`collapse`}function jr(e,t=e?et(e):null){return!e||!e.isConnected||!t||Ar(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Mr=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Nr(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return He(n)?n.host:null}function Pr(e){for(let t of Array.from(e.children))if(Ie(t)===`summary`)return t;return null}function Fr(e,t){let n=Pr(t);return!!n&&(e===n||st(n,e))}function Ir(e){let t=e?Ie(e):``;return e!=null&&e.matches(Mr)&&(t!==`summary`||e.parentElement!=null&&Ie(e.parentElement)===`details`&&Pr(e.parentElement)===e)&&(t!==`details`||Pr(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Lr(e){if(!Ir(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Nr(t)){let n=t!==e,r=Ie(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Ie(t)===`details`&&!t.open&&!Fr(e,t)||t.hasAttribute(`hidden`)||!r&&!Rr(t,n))return!1}return!0}function Rr(e,t){let n=et(e);return t?n.display!==`none`:jr(e,n)}function zr(e){let t=e.tabIndex;if(t<0){let t=Ie(e);if(t===`details`||t===`audio`||t===`video`||Ve(e)&&e.isContentEditable)return 0}return t}function Br(e){if(Ie(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Vr(e,t){let n=Br(e);if(!n)return!0;let r=t.find(e=>{let t=Br(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Br(e);return t?.name===n.name&&t.form===n.form})===n}function Hr(e){if(Ve(e)&&Ie(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ve(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Ur(e,t){Hr(e).forEach(e=>{Ir(e)&&t.push(e),Ur(e,t)})}function Wr(e,t,n){Hr(e).forEach(e=>{Ve(e)&&e.matches(t)&&n.push(e),Wr(e,t,n)})}function Gr(e){return Lr(e)&&zr(e)>=0}function Kr(e){let t=[];return Ur(e,t),t.filter(Lr)}function qr(e){let t=Kr(e);return t.filter(e=>zr(e)>=0&&Vr(e,t))}function Jr(e,t){let n=qr(e),r=n.length;if(r===0)return;let i=ot(Wn(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Yr(e){return Jr(Wn(e).body,1)||e}function Xr(e){return Jr(Wn(e).body,-1)||e}function Zr(e,t,n){if(!e)return null;let r=[];Ur(Wn(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Lr);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!st(n,o)&&Gr(o)&&Vr(o,a))return o}return r[i]}function Qr(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!st(n,r)}function $r(e){qr(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ei(e){let t=[];Wr(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ti(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ti(e,t.id,n)])}function ni(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ri(e){return`data-base-ui-${e}`}var ii=0;function ai(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(ii);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),oe;let o=requestAnimationFrame(a);return ii=o,()=>{ii===o&&(cancelAnimationFrame(o),ii=0)}}var oi=`data-base-ui-inert`,si=new WeakMap,ci=new WeakSet,li=new WeakMap,ui=0;function di(e){return e?He(e)?e.host:di(e.parentNode):null}var fi=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=di(t);return e.contains(n)?n:null}).filter(e=>e!=null),pi=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},mi=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Ie(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function hi(e,t,n,{mark:r=!0}){let i=fi(t,e),a=r?mi(t,pi(i),new Set(i)):[],o=[],s=[];if(n){let e=fi(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);mi(t,pi(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(si.get(e)||0)+1;si.set(e,r),o.push(e),r===1&&n&&ci.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(li.get(e)||0)+1;li.set(e,t),s.push(e),t===1&&e.setAttribute(oi,``)}),ui+=1,()=>{o.forEach(e=>{let t=(si.get(e)||0)-1;si.set(e,t),t||(ci.has(e)||e.removeAttribute(`aria-hidden`),ci.delete(e))}),r&&s.forEach(e=>{let t=(li.get(e)||0)-1;li.set(e,t),t||e.removeAttribute(oi)}),--ui,ui||(si=new WeakMap,ci=new WeakSet,li=new WeakMap)}}function gi(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Wn(e[0]).body;return hi(e,i,n,{mark:r})}function _i(){let[,e]=v.useState({});return v.useCallback(()=>{e({})},[])}var vi=0;function yi(e,t=`mui`){let n=v.useRef(void 0),r=_i(),i=e??n.current;return v.useEffect(()=>{n.current??(vi+=1,n.current=`${t}-${vi}`,e??r())},[e,t,r]),i}var bi=Fn.useId;function xi(e,t){if(bi!==void 0){let n=bi();return e??(t?`${t}-${n}`:n)}return yi(e,t)}var Si=19;function Ci(e){return Si>=e}function wi(e){if(!v.isValidElement(e))return null;let t=e,n=t.props;return(Ci(19)?n?.ref:t.ref)??null}function Ti(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ei(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Di(e,t){return typeof e==`function`?e(t):e}function Oi(e,t){return typeof e==`function`?e(t):e}var ki={};function Ai(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Mi(t);let a=Mi(e);return t&&(a=Ni(a,t)),n&&(a=Ni(a,n)),r&&(a=Ni(a,r)),i&&(a=Ni(a,i)),a}function ji(e){if(e.length===0)return ki;if(e.length===1)return Mi(e[0]);let t=Mi(e[0]);for(let n=1;n<e.length;n+=1)t=Ni(t,e[n]);return t}function Mi(e){return Li(e)?{...e(ki)}:Pi(e)}function Ni(e,t){return Li(t)?t(e):Fi(e,t)}function Pi(e){let t={...e};for(let e in t){let n=t[e];Ii(e,n)&&(t[e]=zi(n))}return t}function Fi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Ti(e.style,r);break;case`className`:e[n]=Vi(e.className,r);break;default:e[n]=Ii(n,r)?Ri(e[n],r):r}}return e}function Ii(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Li(e){return typeof e==`function`}function Ri(e,t){return t?e?(...n)=>{let r=n[0];if(Hi(r)){let i=r;Bi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:zi(t):e}function zi(e){return e&&((...t)=>{let n=t[0];return Hi(n)&&Bi(n),e(...t)})}function Bi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Vi(e,t){return t?e?t+` `+e:t:e}function Hi(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Ui(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=qi(r));let i=Wi(t,n,r);if(n.enabled===!1)return null;let a=n.state??G;return Ji(e,r,i,a)}function Wi(e,t,n){let{className:r,style:i}=e,{state:a=G,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Di(r,a):void 0,d=l?Oi(i,a):void 0,f=l?Ei(a,c):G,p=l&&s?Gi(s):void 0,m=l?Ti(f,p)??{}:G;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?On([m.ref,wi(n),...o]):Dn(m.ref,wi(n),o):Dn(null,null)),l?(u!==void 0&&(m.className=Vi(m.className,u)),d!==void 0&&(m.style=Ti(m.style,d)),m):G}function Gi(e){return Array.isArray(e)?ji(e):Ai(void 0,e)}var Ki=Symbol.for(`react.lazy`);function qi(e){if(e?.$$typeof!==Ki)return e;let t=v.Children.toArray(e)[0];return v.isValidElement(t)?t:e}function Ji(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Ai(n,t.props);return e.ref=n.ref,v.cloneElement(t,e)}return Yi(e,n)}function Yi(e,t){return e===`button`?(0,v.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,v.createElement)(`img`,{alt:``,...t,key:t.key}):v.createElement(e,t)}var Xi={style:{transition:`none`}},Zi=`data-base-ui-click-trigger`,Qi={fallbackAxisSide:`none`},$i={fallbackAxisSide:`end`},ea={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},ta=v.createContext(null),na=()=>v.useContext(ta),ra=ri(`portal`);function ia(e={}){let{ref:t,container:n,componentProps:r=G,elementProps:i}=e,a=xi(),o=na()?.portalNode,[s,c]=v.useState(null),[l,u]=v.useState(null),d=Y(e=>{e!==null&&u(e)}),f=v.useRef(null);K(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(ze(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Ui(`div`,r,{ref:[t,d],props:[{id:a,[ra]:``},i]}),m=s&&p?R.createPortal(p,s):null;return{node:l,nodeId:v.isValidElement(p)?p.props.id:void 0,subtree:m}}var aa=v.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ia({container:o,ref:t,componentProps:e,elementProps:c}),f=v.useRef(null),p=v.useRef(null),m=v.useRef(null),h=v.useRef(null),[g,_]=v.useState(null),y=v.useRef(!1),b=g?.modal,x=g?.open,C=!!g&&!g.modal&&g.open&&!!l;v.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&Qr(e)&&(e.type===`focusin`?y.current&&=(ei(l),!1):($r(l),y.current=!0))}return En(Tn(l,`focusin`,e,!0),Tn(l,`focusout`,e,!0))},[l,b]),K(()=>{l&&x===!0&&y.current&&(ei(l),y.current=!1)},[x,l]);let w=v.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,S.jsxs)(v.Fragment,{children:[d,(0,S.jsxs)(ta.Provider,{value:w,children:[C&&l&&(0,S.jsx)(Jn,{"data-type":`outside`,ref:f,onFocus:e=>{Qr(e,l)?m.current?.focus():Xr(g?g.domReference:null)?.focus()}}),C&&l&&(0,S.jsx)(`span`,{role:s,"aria-owns":u,style:ea}),l&&R.createPortal(a,l),C&&l&&(0,S.jsx)(Jn,{"data-type":`outside`,ref:p,onFocus:e=>{Qr(e,l)?h.current?.focus():(Yr(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,J(`focus-out`,e.nativeEvent)))}})]})]})});function oa(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var sa=class{nodesRef={current:[]};events=oa();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},ca=v.createContext(null),la=v.createContext(null),ua=()=>v.useContext(ca)?.id||null,da=e=>{let t=v.useContext(la);return e??t};function fa(e){let t=xi(),n=da(e),r=ua();return K(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function pa(e){let{children:t,id:n}=e,r=ua();return(0,S.jsx)(ca.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ma(e){let{children:t,externalTree:n}=e,r=ee(()=>n??new sa).current;return(0,S.jsx)(la.Provider,{value:r,children:t})}function ha(e){return e==null?e:`current`in e?e.current:e}function ga(e,t){let n=Le(lt(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(je(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var _a=20,va=[];function ya(){va=va.filter(e=>e.deref()?.isConnected)}function ba(e){ya(),e&&Ie(e)!==`body`&&(va.push(new WeakRef(e)),va.length>_a&&(va=va.slice(-20)))}function xa(){return ya(),va[va.length-1]?.deref()}function Sa(e){return e?Gr(e)?e:qr(e)[0]||e:null}function Ca(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Kr(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Gr(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function wa(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,C=Y(()=>x.current.floatingContext?.nodeId),w=i===!1,T=Vt(_)&&w,E=Nn(i),D=Nn(a),O=Nn(o),k=Nn(u),A=Nn(g),j=da(m),M=na(),N=v.useRef(!1),P=v.useRef(!1),F=v.useRef(!1),I=v.useRef(null),L=v.useRef(``),R=v.useRef(``),z=v.useRef(null),B=v.useRef(null),V=Dn(z,p,M?.beforeInsideRef),ee=Dn(B,M?.afterInsideRef),H=pe(),te=pe(),ne=Un(),re=M!=null,U=Ut(y),ie=Y((e=U)=>e?qr(e):[]),ae=Y(()=>h?.().filter(e=>e!=null)??[]);v.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&st(U,ot(Wn(U)))&&ie().length===0&&!T&&ke(e)}return Tn(Wn(U),`keydown`,e)},[r,U,c,T,ie]),v.useEffect(()=>{if(r||!g)return;let e=Wn(U);function t(){F.current=!1}function n(e){let t=lt(e),n=ae(),r=st(y,t)||st(_,t)||st(M?.portalNode,t)||n.some(e=>e===t||st(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,ct(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,te.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return En(Tn(e,`pointerdown`,n,!0),Tn(e,`pointerup`,t,!0),Tn(e,`pointercancel`,t,!0),Tn(e,`keydown`,i,!0),t)},[r,y,_,U,g,M,te,ae]),v.useEffect(()=>{if(r||!l)return;let e=Wn(U);function n(){P.current=!0,te.start(0,()=>{P.current=!1})}function i(e){let t=lt(e);Gr(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=lt(n);c&&r==null&&a!=null&&st(y,a)&&ba(a),queueMicrotask(()=>{let o=C(),l=t.context.triggerElements,u=ae(),p=r?.hasAttribute(ri(`focus-guard`))&&[z.current,B.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,ha(f),ha(d)].includes(r),m=!(st(_,r)||st(y,r)||st(r,y)||st(M?.portalNode,r)||u.some(e=>e===r||st(e,r))||l.hasMatchingElement(e=>st(e,r))||p||j&&(ti(j.nodesRef.current,o).find(e=>st(e.context?.elements.floating,r)||st(e.context?.elements.domReference,r))||ni(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,Ut(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&U&&Ca(U),s&&i!==_&&!jr(a)&&ot(e)===e.body){if(Ve(U)&&(U.focus(),s===`popup`)){ne.request(()=>{U.focus()});return}let e=ie(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;Ve(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(T||!c)&&r&&m&&!P.current&&(T||r!==xa())&&(N.current=!0,t.setOpen(!1,J(ln,n)))})}function o(){F.current||(x.current.insideReactTree=!0,H.start(0,()=>{x.current.insideReactTree=!1}))}let u=Ve(_)?_:null;if(y||u)return En(u&&Tn(u,`focusout`,a),u&&Tn(u,`pointerdown`,n),y&&Tn(y,`focusin`,i),y&&Tn(y,`focusout`,a),y&&M&&Tn(y,`focusout`,o,!0))},[r,_,y,U,c,j,M,t,l,s,ie,T,C,x,H,te,ne,d,f,ae]),v.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${ri(`portal`)}]`)||[]),t=(j?ni(j.nodesRef.current,C()):[]).find(e=>Vt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=gi([y,...e,z.current,B.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...ae(),t,ha(f),ha(d),T?_:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),i=gi([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,y,c,M,T,j,C,d,f,ae]),K(()=>{if(!g||r||!Ve(U))return;L.current=``,R.current=``;let e=Wn(U),t=ot(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||st(U,t))return;let i=null,a=()=>(i??=ie(U),i[0]||U),o;o=r===!0||r===null?a():ha(r),o||=a();let s=st(U,ot(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&je(c);ai(o,{sync:l,preventScroll:o===U,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=ot(e);return!(t!==o&&st(U,t))}})})},[r,g,U,ie,E,k,A,x]);let oe=v.useRef(null);K(()=>{if(r||!U){oe.current=null;return}oe.current&&=(oe.current.cancelled=!0,null);let e=Wn(U),t=ot(e),n=k.current==null;ba(t);function i(e){if(e.open||(L.current=ga(e.nativeEvent,R.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(ri(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(je(e.nativeEvent)||Me(e.nativeEvent))N.current=!1;else{let e=!1;Wn(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}b.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&Ie(t)!==`body`?t:null,s=n?o||a:a||o;return s||=xa()||null,typeof i==`boolean`?s:ha(i)||s||null}return()=>{b.off(`openchange`,i);let t=ot(e),n=ae(),r=st(y,t)||n.some(e=>e===t||st(e,t))||j&&ti(j.nodesRef.current,C(),!1).some(e=>st(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};oe.current=l,queueMicrotask(()=>{oe.current===l&&(oe.current=null);let n=Sa(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&Ve(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,y,U,D,O,k,b,j,_,C,ae]),K(()=>{if(!Te||g||!y)return;let e=ot(Wn(y));Ve(e)&&zt(e)&&st(y,e)&&e.blur()},[g,y]),K(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{M.setFocusManagerState(null)}},[r,M,c,g,t,l,_]),K(()=>{if(!r&&U)return Ca(U),()=>{queueMicrotask(ya)}},[r,U]);let W=!r&&(!c||!T)&&(re||c);return(0,S.jsxs)(v.Fragment,{children:[W&&(0,S.jsx)(Jn,{"data-type":`inside`,ref:V,onFocus:e=>{if(c){let e=ie();ai(e[e.length-1])}else M?.portalNode&&(N.current=!1,Qr(e,M.portalNode)?Yr(_)?.focus():ha(f??M.beforeOutsideRef)?.focus())}}),n,W&&(0,S.jsx)(Jn,{"data-type":`inside`,ref:ee,onFocus:e=>{c?ai(ie()[0]):M?.portalNode&&(l&&(N.current=!0),Qr(e,M.portalNode)?Xr(_)?.focus():ha(d??M.afterOutsideRef)?.focus())}})]})}function Ta(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Zt}=t,l=e.context.dataRef,u=v.useRef(void 0),d=Un(),f=pe(),p=v.useMemo(()=>{function t(t,n,r,i){let a=J(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Ne(e.pointerType,!0)&&Me(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Ne(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=lt(s),p=zt(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:Ne(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return v.useMemo(()=>n?{reference:p}:G,[n,p])}function Ea(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Da(e){return e!=null&&e.clientX!=null}function Oa(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=v.useRef(!1),l=v.useRef(null),[u,d]=v.useState(),[f,p]=v.useState([]),m=Y(t=>{e.set(`positionReference`,t)}),h=Y((t,n,i)=>{c.current||(!s.current.openEvent||Da(s.current.openEvent))&&e.set(`positionReference`,Ea(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=Y(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=Ne(u)?a:i;v.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=Le(a);function r(t){let n=lt(t);st(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||Da(s.current.openEvent)?l.current=Tn(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),v.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),v.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),v.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=v.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return v.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function ka(){return!1}function Aa(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ja(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ka,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=da(c),m=Y(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Y(()=>a),{escapeKey:y,outsidePress:b}=Aa(s),x=v.useRef(!1),S=v.useRef(!1),C=v.useRef(!1),w=v.useRef(!1),T=v.useRef(!1),E=v.useRef(``),D=v.useRef(null),O=pe(),k=pe(),A=pe(),j=Y(()=>{k.clear(),d.current.insideReactTree=!1}),M=Y(e=>{let t=d.current.floatingContext?.nodeId;return(p?ti(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Y(t=>Lt(t,e.select(`floatingElement`))||Lt(t,e.select(`domReferenceElement`))),P=Y(t=>{o()&&e.setOpen(!1,J(Zt,t.nativeEvent))}),F=Y(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=Ae(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=J(un,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=Y(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=Y(t=>{if(!l||!n||t.button!==0)return;let r=lt(t.nativeEvent);st(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=Y(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});v.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),v.useEffect(()=>j,[j]),v.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new fe,i=Wn(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(Te?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function v(e){let t=d.current.floatingContext?.nodeId,n=p&&ti(p.nodesRef.current,t).some(t=>Lt(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=lt(n),i=`[${ri(`inert`)}]`,a=Be(r)?r.getRootNode():null,o=Array.from((He(a)?a:Wn(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>st(e,r))))return;let c=Be(r)?r:null;for(;c&&!$e(c);){let e=nt(c);if($e(e)||!Be(e))break;c=e}if(!(o.length&&Be(r)&&!Rt(r)&&!st(r,e.select(`floatingElement`))&&o.every(e=>!st(c,e)))){if(Ve(r)&&!(`touches`in n)){let e=$e(r),t=et(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!v(n)){if(f()===`intentional`){if(n.detail!==0&&!je(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof h!=`function`||h(n))&&(M(`__outsidePressBubbles`)||(e.setOpen(!1,J(en,n)),j()))}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=lt(e);if(!n)return;let r=Tn(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():v(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,j())))}function V(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function ee(e){L(e,V)}function H(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function te(e){L(e,H)}let ne=En(r&&En(Tn(i,`keydown`,F),Tn(i,`compositionstart`,a),Tn(i,`compositionend`,o)),g&&En(Tn(i,`click`,z,!0),Tn(i,`pointerdown`,z,!0),Tn(i,`pointerup`,B,!0),Tn(i,`pointercancel`,B,!0),Tn(i,`mousedown`,z,!0),Tn(i,`mouseup`,B,!0),Tn(i,`touchstart`,R,{capture:!0,passive:!0}),Tn(i,`touchmove`,ee,{capture:!0,passive:!0}),Tn(i,`touchend`,te,{capture:!0,passive:!0})));return()=>{ne(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,y,b,F,j,_,M,N,p,e,O,A]);let z=v.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=v.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return v.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}var Ma=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(q(99,this.componentName,e,this.componentName));t.setOpen(!0,J(yn,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,J(yn))}};function Na(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),K(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Be(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Pa(e,t=!1,n=!1,r=!1){let[i,a]=v.useState(e&&t?`idle`:void 0),[o,s]=v.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),K(()=>{if(!e&&o&&i!==`ending`&&n){let e=Hn.request(()=>{a(`ending`)});return()=>{Hn.cancel(e)}}},[e,o,i,n]),K(()=>{if(!e||t||i===void 0)return;let n=Hn.request(()=>{a(void 0)});return()=>{Hn.cancel(n)}},[t,e,i]),K(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Hn.request(()=>{a(`idle`)});return()=>{Hn.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Fa(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Ia=null;function La(e){if(!Ia){let e=[];Ia=e,queueMicrotask(()=>{Ia=null,R.flushSync(()=>{for(let t of e)t()})})}Ia.push(e)}function Ra(e,t=!1,n=!1){let r=Un();return Y((i,a=null)=>{r.cancel();let o=ha(e);if(o==null)return;let s=o,c=()=>{n?La(()=>{a?.aborted||i()}):R.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Fa(s).map(e=>e.finished.then(oe))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Fa(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=gt;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function za(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Y(a),s=Ra(r,n,i);v.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Ba(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=Y(i),{mounted:c,setMounted:l,transitionStatus:u}=Pa(t,!1,!1,o),d=!t&&r;K(()=>{t&&s(!1)},[t,s]);let f=v.useRef(c),p=v.useRef(!1),m=_i(),h=()=>{f.current=!1,l(!1),a()};K(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=Y(()=>{f.current&&(t?(p.current=!0,m()):h())});return za({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var Va={tabIndex:-1,[ut]:``};function Ha(e){return t=>t!==`touch`||e.current}function Ua(e,t=!1){let n=xi(),r=ua()!=null,i=ee(()=>e(n,r)).current;return Na({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Wa({handle:e,store:t}){return K(()=>e.attachStore(t),[e,t]),null}function Ga(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Ka(e,t){let n=v.useRef(null);return Y(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Ga(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ga(t))})}function qa(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function Ja(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ya(e,t,n,r={}){let i=n.reason,a=i===Qt,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Ja(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=qa(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?R.flushSync(l):l()}function Xa(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Ka(e,n),o=Y(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Y(e=>{a(e),e&&o(e)});return K(()=>(s(t.current),()=>s(null)),[s,t,n,e]),K(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Za(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=v.useRef(null),i=e.useState(`open`);K(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=J(Xt);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Qa(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Ba({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return ee(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function $a(e,t){e.useSyncedValues(t),K(()=>()=>{e.update({activeTriggerProps:G,inactiveTriggerProps:G,popupProps:G})},[e])}function eo(e,t){K(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),K(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var to=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},no=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ro=o(((e,t)=>{t.exports=no()})),io=o((e=>{var t=d(),n=ro();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ao=o(((e,t)=>{t.exports=io()})),oo=ro(),so=ao(),co=Ci(19)?fo:po;function lo(e,t,n,r,i){return co(e,t,n,r,i)}function uo(e,t,n,r,i){let a=v.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,oo.useSyncExternalStore)(e.subscribe,a,a)}re({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,oo.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function fo(e,t,n,r,i){let a=ne();if(!a)return uo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function po(e,t,n,r,i){return(0,so.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var mo=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return lo(this,e,t,n,r)}},ho=class extends mo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){v.useDebugValue(e);let n=this;K(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;K(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;K(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){v.useDebugValue(e);let n=this,r=t!==void 0;K(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return v.useDebugValue(e),lo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){v.useDebugValue(e);let n=Y(t??oe);this.context[e]=n}useStateSetter(e){let t=v.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},go={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},_o=class extends ho{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:oa(),nested:n,triggerElements:i},go),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Pe(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function vo(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new _o({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:G,inactiveTriggerProps:G,popupProps:G}}var yo=e=>e.triggerIdProp??e.activeTriggerId,bo=e=>e.openProp??e.open,xo=e=>(e.popupElement?.id??e.floatingId)||void 0;function So(e,t){return t!==void 0&&bo(e)&&yo(e)===t}function Co(e,t){return So(e,t)?!0:t!==void 0&&bo(e)&&yo(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var wo={open:bo,mounted:e=>e.mounted,transitionStatus:e=>bo(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:yo,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:xo,isTriggerActive:(e,t)=>t!==void 0&&yo(e)===t,isOpenedByTrigger:(e,t)=>So(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&yo(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Co(e,t)?xo(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function To(e){let t=v.useCallback(t=>e===void 0?oe:e.subscribeStore(t),[e]),n=v.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,oo.useSyncExternalStore)(t,n,()=>e?.serverStore)}function Eo(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=xi(),a=ua()!=null,o=ee(()=>new _o({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new to,floatingId:i,syncOnly:!1,nested:a})).current;return K(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Be(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Do=Ce&&Te;function Oo(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=v.useRef(!1),s=v.useRef(null),c=v.useRef(!0),l=pe();v.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Le(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Ve(t)&&t===ot(Wn(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return En(Tn(r,`blur`,i),Do&&Tn(r,`keydown`,a,!0),Do&&Tn(r,`pointerdown`,l,!0))},[e,n]),v.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);Be(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=v.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=lt(n.nativeEvent);if(Be(a)){if(Do&&!n.relatedTarget){if(!c.current&&!zt(a))return}else if(!Ht(a))return}let u=It(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,J($t,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,J($t,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=Be(r)&&r.hasAttribute(ri(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=ot(Wn(t));(r||n!==t)&&(st(a.current.floatingContext?.refs.floating.current,n)||st(t,n)||o||It(r??n,e.context.triggerElements)||e.setOpen(!1,J($t,i)))})}}},[a,r,e,l]);return v.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var ko=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new fe;restTimeout=new fe;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Ao=new WeakMap;function jo(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Ao.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Ao.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Mo(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Ao.get(n);a&&a!==e&&jo(a),jo(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ao.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function No(e){let t=e.context.dataRef.current,n=ee(()=>t.hoverInteractionState??ko.create()).current;return t.hoverInteractionState||=n,ue(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Po(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=da(),u=ua(),d=No(e),f=pe(),p=Y(()=>qt(c.current.openEvent?.type,d.interactedInside)),m=Y(()=>Jt(c.current.openEvent?.type)),h=Y(()=>{jo(d)});K(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),v.useEffect(()=>h,[h]),K(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&Be(s)&&o){let e=s,t=o,n=Wn(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??ct(e,`[data-rootownerid]`)??n.body;return Mo(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),v.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ti(l.nodesRef.current,u).length>0)}function a(t){let n=Gt(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,J(Qt,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=lt(e);Bt(t)?d.interactedInside=ct(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(It(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&Be(o)&&ti(l.nodesRef.current,r,!1).some(e=>st(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,J(Qt,n)),l.events.emit(`floating.closed`,n)})}let y=o;return En(y&&Tn(y,`mouseenter`,g),y&&Tn(y,`mouseleave`,_),y&&Tn(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var Fo={current:null};function Io(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Fo,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=da(l),y=No(e),b=v.useRef(!1),x=Nn(i),S=Nn(r),C=Nn(o),w=Nn(n),T=Nn(p),E=Nn(f),D=Y(()=>qt(h.current.openEvent?.type,y.interactedInside)),O=Y(()=>T.current?.()!==!1),k=Y((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!st(t,n);if(!Be(r))return!1;let a=r;return i.hasMatchingElement(e=>st(e,a))&&(!t||!st(t,a))}),A=Y(()=>{y.handler&&=(Wn(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Y(()=>{jo(y)});return u&&(y.handleCloseOptions=i?.__options),v.useEffect(()=>A,[A]),v.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===Qt,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,y,A]),v.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Gt(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,J(Qt,t)),_?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,J(Qt,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!Be(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Ne(y.pointerType))return;let n=Kt(C.current),r=Gt(S.current,`open`,y.pointerType),i=lt(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(Be(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(st(t,i)){c=t;break}}Be(o)&&Be(s)&&!e.context.triggerElements.hasElement(o)&&st(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&Be(c)&&Be(s)&&st(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,J(Qt,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,J(Qt,t,c))}):g&&O()&&e.setOpen(!0,J(Qt,t,c)))}function o(n){if(D()){j();return}A();let r=Wn(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!It(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else(y.pointerType!==`touch`||!st(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){st(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=m?Tn(r,`mouseout`,l):void 0;return s?En(Tn(r,`mousemove`,i,{once:!0}),Tn(r,`mouseenter`,i),Tn(r,`mouseleave`,o),f):En(Tn(r,`mouseenter`,i),Tn(r,`mouseleave`,o),f)},[A,j,h,S,e,n,x,y,u,k,D,a,s,C,c,_,w,d,E,O,m]),v.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!Ne(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Mo(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Kt(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,J(Qt,n,r))}y.pointerType===`touch`?R.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function Lo(e){return Te&&e.movementX===0&&e.movementY===0}function Ro(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function zo(e,t){return Ro(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Bo(e,t,n){return Ro(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Vo(e,t,n){return Ro(t,n?e===ft:e===pt,e===ht)}function Ho(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Ro(t,n?e===pt:e===ft,e===mt)}function Uo(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=Ut(D),j=Vt(O),M=Nn(A),N=ua(),P=da(S),F=v.useRef(f),I=v.useRef(o??-1),L=v.useRef(null),R=v.useRef(!0),z=Y(e=>{i(I.current===-1?null:I.current,e)}),B=v.useRef(!!D),V=v.useRef(E),ee=v.useRef(!1),H=v.useRef(!1),te=v.useRef(null),ne=Nn(h),re=Nn(E),U=Nn(o),ie=Nn(x),ae=Un(),oe=Un(),W=Y(()=>{ae.cancel();function e(e){d||(te.current=ai(e,{sync:ee.current,preventScroll:!0}))}let t=n.current[I.current],r=H.current;t&&e(t),(ee.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),ue&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});K(()=>{k.current.orientation=g},[k,g]),K(()=>{E||(L.current=null),(!E||f!==`auto`)&&(F.current=f)},[E,f]),K(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(H.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),K(()=>{if(a){if(!E)ee.current=!1;else if(D){if(r==null){if(ee.current=!1,U.current!=null)return;if(B.current&&(I.current=-1,W()),(!V.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||Bo(L.current,_,u)||l?wr(n):Tr(n),L.current=null,z())};t()}}else Cr(n.current,r)||(I.current=r,W(),H.current=!1)}}},[a,E,D,r,U,l,n,_,u,z,W,oe]),K(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=ot(Wn(O??t??null)),r=e.some(e=>e.context&&st(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),K(()=>{V.current=E,B.current=!!D});let G=r!=null,se=Y(e=>{if(!re.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),q=Y(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),ce=Y(()=>wr(n,ne.current)),le=Y(t=>{if(R.current=!1,ee.current=!0,t.which===229||!re.current&&t.currentTarget===M.current)return;if(l&&Ho(t.key,g,u,T)){zo(t.key,q())||ke(t),e.setOpen(!1,J(dn,t.nativeEvent));let n=C?.current??O;Ve(n)&&n.focus();return}r!=null&&r!==I.current&&!Cr(n.current,r)&&(I.current=r);let i=I.current,a=wr(n,h),o=Tr(n,h);if(j||(t.key===`Home`&&(ke(t),I.current=a,z(t)),t.key===`End`&&(ke(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,g,c,u,h,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),g===`both`)return}if(zo(t.key,g)){ke(t);let e=ot(t.currentTarget.ownerDocument);if(E&&!d&&st(t.currentTarget,e)&&!n.current.some(t=>t!=null&&st(t,e))){I.current=Bo(t.key,g,u)?a:o,z(t),r===I.current&&W();return}let{index:l,wrapped:f}=Er(n.current,i,{decrement:!Bo(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(ee.current=!1),I.current=l,z(t)}}),ue=v.useMemo(()=>({onFocus(e){ee.current=!0,se(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Lo(e)||(ee.current=!0,H.current=!1,p&&se(e))},onPointerLeave(e){if(!re.current||!R.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ie.current&&(te.current?.(),te.current=null,I.current=-1,z(e),!d)){let e=M.current,t=ot(Wn(e));e&&st(e,t)&&e.focus({preventScroll:!0})}}}),[se,re,M,p,n,z,ie,d]),de=v.useMemo(()=>d&&E&&G&&{"aria-activedescendant":`${b}-${r}`},[d,E,G,b,r]),fe=v.useMemo(()=>({...j?{}:de,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=lt(t.nativeEvent);if(n&&!st(M.current,n))return;ke(t);let r=J(ln,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&Ve(i)&&i.focus()}else le(t)},onPointerMove(e){Lo(e)||(R.current=!0)}}),[de,le,M,j,e,E,d,O,C]),pe=v.useMemo(()=>{function t(t){e.setOpen(!0,J(dn,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&je(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&Me(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=Vo(n.key,q(),u),o=zo(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||zt(n.currentTarget)))return le(n);if(r||m||!i){if(s){let e=zo(n.key,q());L.current=l&&e?null:n.key}l?a&&(ke(n),r?(I.current=ce(),z(n),d&&M.current?.focus()):t(n)):o&&(U.current!=null&&(I.current=U.current),ke(n),!r&&m?t(n):le(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[le,f,ce,l,z,e,m,g,_,q,u,U,d,M]),me=v.useMemo(()=>({...de,...pe}),[de,pe]);return v.useMemo(()=>a?{reference:me,floating:fe,item:ue,trigger:pe}:{},[a,me,fe,pe,ue])}function Wo(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=Y(s),f=e.useState(`open`),p=pe(),m=v.useRef(``),h=v.useRef(u??i??-1),g=v.useRef(null),_=Y(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!jr(n)||n?.matches(`:disabled`)?!1:o==null||!kr(W,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(ke(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(ke(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),y=Y(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);st(r,n)||st(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});K(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let b=v.useMemo(()=>({onKeyDown:_,onBlur:y}),[_,y]);return v.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Go=.1,Ko=Go*Go,qo=.5;function Jo(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Yo(e,t,n,r,i,a,o,s,c,l){let u=!1;return Jo(e,t,n,r,i,a)&&(u=!u),Jo(e,t,i,a,o,s)&&(u=!u),Jo(e,t,o,s,c,l)&&(u=!u),Jo(e,t,c,l,n,r)&&(u=!u),u}function Xo(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Zo(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Qo(e={}){let{blockPointerEvents:t=!1}=e,n=new fe,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Ko;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=lt(r),g=r.type===`mouseleave`,_=st(u,h),v=st(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Be(r.relatedTarget)&&st(u,r.relatedTarget))return;function y(){return!!(s&&ti(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Zo(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Zo(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Zo(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Zo(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Xo(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?qo/2:qo*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+qo+1,o=C||T?S.bottom-qo:S.top,s=C?T?S.bottom-qo:S.top:S.bottom-qo;M=Yo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?qo/2:qo*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-qo,o=C||T?S.top+qo:S.bottom,s=C?T?S.top+qo:S.bottom:S.top+qo;M=Yo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?qo/2:qo*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+qo+1,o=w||E?S.right-qo:S.left,s=w?E?S.right-qo:S.left:S.right-qo;M=Yo(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?qo/2:qo*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-qo,o=w||E?S.left+qo:S.right,s=w?E?S.left+qo:S.right:S.left+qo;M=Yo(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function $o(e,t,n){let{reference:r,floating:i}=e,a=sr(t),o=cr(t),s=or(o),c=rr(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=ir(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function es(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}=nr(t,e),p=br(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=xr(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=xr(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 ts=50,ns=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:es},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=$o(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<ts&&(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}=$o(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},rs=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}=nr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=rr(r),_=sr(o),v=rr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[vr(o)]:ur(o)),x=p!==`none`;!d&&x&&b.push(..._r(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=lr(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`||_===sr(t)||T.every(e=>sr(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=sr(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{}}}},is=new Set([`left`,`top`]);async function as(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rr(n),s=ir(n),c=sr(n)===`y`,l=is.has(o)?-1:1,u=a&&c?-1:1,d=nr(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 os=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 as(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}}}}},ss=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}=nr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=sr(i),p=ar(f),m=u[p],h=u[f],g=(e,t)=>tr(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}}}}}},cs=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}=nr(e,t),u={x:n,y:r},d=sr(i),f=ar(d),p=u[f],m=u[d],h=nr(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=is.has(rr(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}}}},ls=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}=nr(e,t),c=await i.detectOverflow(t,s),l=rr(n),u=ir(n),d=sr(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=Yn(p-c[m],g),y=Yn(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*Xn(c.left,c.right):S=p-2*Xn(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 us(e){let t=et(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ve(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Zn(n)!==a||Zn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ds(e){return Be(e)?e:e.contextElement}function fs(e){let t=ds(e);if(!Ve(t))return $n(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=us(t),o=(a?Zn(n.width):n.width)/r,s=(a?Zn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ps=$n(0);function ms(e){let t=Le(e);return!Qe()||!t.visualViewport?ps:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Le(e)}function gs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ds(e),o=$n(1);t&&(r?Be(r)&&(o=fs(r)):o=fs(e));let s=hs(a,n,r)?ms(a):$n(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=Le(a),t=Be(r)?Le(r):r,n=e,i=at(n);for(;i&&t!==n;){let e=fs(i),t=i.getBoundingClientRect(),r=et(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=Le(i),i=at(n)}}return xr({width:u,height:d,x:c,y:l})}function _s(e,t){let n=tt(e).scrollLeft;return t?t.left+n:gs(Re(e)).left+n}function vs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-_s(e,n),y:n.top+t.scrollTop}}function ys(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Re(r),s=t?Ge(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=$n(1),u=$n(0),d=Ve(r);if((d||!a)&&((Ie(r)!==`body`||Ue(o))&&(c=tt(r)),d)){let e=gs(r);l=fs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?vs(o,c):$n(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 bs(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function xs(e){let t=tt(e),n=e.ownerDocument.body,r=Xn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Xn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+_s(e),o=-t.scrollTop;return et(n).direction===`rtl`&&(a+=Xn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ss=25;function Cs(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Le(e),a=Re(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Qe()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(_s(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<=Ss&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ws(e,t){let n=gs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=fs(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ts(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Cs(e,n,t);else if(t===`document`)r=xs(Re(e));else if(Be(t))r=ws(t,n);else{let n=ms(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return xr(r)}function Es(e,t){let n=t.get(e);if(n)return n;let r=it(e,[],!1).filter(e=>Be(e)&&Ie(e)!==`body`),i=null,a=et(e).position===`fixed`,o=a?nt(e):e;for(;Be(o)&&!$e(o);){let e=et(o),t=Xe(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=nt(o)}return t.set(e,r),r}function Ds(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ge(t)?[]:Es(t,this._c):[].concat(n),r],o=Ts(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=Ts(t,a[e],i);s=Xn(n.top,s),c=Yn(n.right,c),l=Yn(n.bottom,l),u=Xn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Os(e){let{width:t,height:n}=us(e);return{width:t,height:n}}function ks(e,t,n){let r=Ve(t),i=Re(t),a=n===`fixed`,o=gs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=$n(0);if((r||!a)&&((Ie(t)!==`body`||Ue(i))&&(s=tt(t)),r)){let e=gs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=_s(i));let l=i&&!r&&!a?vs(i,s):$n(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 As(e){return et(e).position===`static`}function js(e,t){if(!Ve(e)||et(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Re(e)===n&&(n=n.ownerDocument.body),n}function Ms(e,t){let n=Le(e);if(Ge(e))return n;if(!Ve(e)){let t=nt(e);for(;t&&!$e(t);){if(Be(t)&&!As(t))return t;t=nt(t)}return n}let r=js(e,t);for(;r&&We(r)&&As(r);)r=js(r,t);return r&&$e(r)&&As(r)&&!Xe(r)?n:r||Ze(e)||n}var Ns=async function(e){let t=this.getOffsetParent||Ms,n=this.getDimensions,r=await n(e.floating);return{reference:ks(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ps(e){return et(e).direction===`rtl`}var Fs={convertOffsetParentRelativeRectToViewportRelativeRect:ys,getDocumentElement:Re,getClippingRect:Ds,getOffsetParent:Ms,getElementRects:Ns,getClientRects:bs,getDimensions:Os,getScale:fs,isElement:Be,isRTL:Ps};function Is(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ls(e,t,n){let r=null,i,a=Re(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=Qn(d),h=Qn(a.clientWidth-(u+f)),g=Qn(a.clientHeight-(d+p)),_=Qn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Xn(0,Yn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Is(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=Le(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Rs(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=ds(e),u=i||a?[...l?it(l):[],...t?it(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ls(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?gs(e):null;c&&g();function g(){let t=gs(e);h&&!Is(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 zs=os,Bs=ss,Vs=rs,Hs=ls,Us=cs,Ws=(e,t,n)=>{let r=new Map,i=n??{},a={...Fs,...i.platform,_c:r};return ns(e,t,{...i,platform:a})},Gs=typeof document<`u`?v.useLayoutEffect:function(){};function Ks(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(!Ks(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)&&!Ks(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Js(e,t){let n=qs(e);return Math.round(t*n)/n}function Ys(e){let t=v.useRef(e);return Gs(()=>{t.current=e}),t}function Xs(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Ks(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=Ys(c),O=Ys(i),k=Ys(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Ws(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Ks(T.current,t)&&(T.current=t,R.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Gs(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Gs(()=>(j.current=!0,()=>{j.current=!1}),[]),Gs(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Js(N.floating,u.x),r=Js(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qs(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Zs=(e,t)=>{let n=zs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qs=(e,t)=>{let n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},$s=(e,t)=>({fn:Us(e).fn,options:[e,t]}),ec=(e,t)=>{let n=Vs(e);return{name:n.name,fn:n.fn,options:[e,t]}},tc=(e,t)=>{let n=Hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},nc=class extends ho{setState(e){}update(e){}set(e,t){}notifyAll(){}},rc={...wo,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},ic=class extends ho{constructor(e,t,n){let r=new to;super(oc(e,r,t,n),sc(r),rc)}setOpen=(e,t)=>{Ya(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,J(Zt,e))}};function ac(){let e=new to,t=new nc(Object.freeze(oc(void 0,e)),Object.freeze(sc(e)),rc);return Object.assign(t,{setOpen:oe,cancelPendingOpen:oe})}function oc(e,t,n,r=!1){return{...vo(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function sc(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var cc=U(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Ua((e,t)=>new ic({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Za(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=Qa(h,p),C=p.useState(`isInstantPhase`),w=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=v.useRef(null);K(()=>{m&&t&&p.setOpen(!1,J(gn))},[m,t,p]),K(()=>{x===`ending`&&T===`none`||x!==`ending`&&C?(w!==`delay`&&(E.current=w),p.set(`instantType`,`delay`)):E.current!==null&&(p.set(`instantType`,E.current),E.current=null)},[x,C,T,w,p]),K(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),v.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,J(yn))}),[b,p]);let D=h||_||!t&&a!==`none`;return(0,S.jsxs)(ce.Provider,{value:p,children:[l&&(0,S.jsx)(Wa,{handle:l,store:p}),D&&(0,S.jsx)(lc,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function lc({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=ja(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Oa(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=v.useMemo(()=>Ai(a.reference,i.reference),[a.reference,i.reference]);return $a(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??G}),null}function uc(e){return xi(e,`base-ui`)}var dc=v.createContext(void 0);function fc(){return v.useContext(dc)}var pc=`data-base-ui-tooltip-trigger`;function mc(e){let t=lt(e);return Be(t)?t:null}var hc=ie(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=le(!0),m=To(a)??p;if(!m)throw Error(q(82));let h=uc(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=v.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Xa(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),w=fc(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=wn(y,{open:_}),k=No(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Nn(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=v.useRef(!1),I=pe(),L=v.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=ct(e,`[${pc}]`);return n!==null&&n!==t&&st(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let V=Io(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Qo():null,restMs:R,delay(){return u==null&&O?{close:Gt(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),ee=Oo(y,{enabled:!j}).reference,H=e=>{let t=F.current,n=mc(e),r=B(n),i=b.current,a=i&&n&&st(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,J(Qt,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&Ne(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,J(Qt,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},te=m.useState(`appliedTriggerProps`,C||N!==`none`);return Ui(`button`,e,{state:{open:_},ref:[t,S,b],props:[V,ee,te,{onMouseOver(e){H(e.nativeEvent)},onFocus(e){z(mc(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Ft]:j?``:void 0,[pc]:j?void 0:``},f],stateAttributesMapping:jt})}),gc=v.createContext(void 0);function _c(){let e=v.useContext(gc);if(e===void 0)throw Error(q(70));return e}var vc=v.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=ia({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,S.jsxs)(v.Fragment,{children:[l,c&&R.createPortal(n,c)]})}),yc=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return le().useState(`mounted`)||n?(0,S.jsx)(gc.Provider,{value:n,children:(0,S.jsx)(vc,{ref:t,...r})}):null}),bc=v.createContext(void 0);function xc(){let e=v.useContext(bc);if(e===void 0)throw Error(q(71));return e}function Sc(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=v.useState(null),d=v.useRef(null),f=da(n),p=v.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Xs({...e,elements:{...p,...l&&{reference:l}}}),h=v.useCallback(e=>{let t=Be(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=v.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=v.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),y=v.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return K(()=>{o&&(d.current=o)},[o]),K(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),v.useMemo(()=>({...m,context:y,refs:g,elements:_,rootStore:r}),[m,g,_,y,r])}var Cc=v.createContext(void 0);function wc(){return v.useContext(Cc)?.direction??`ltr`}var Tc=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}=nr(e,t)||{};if(l==null)return{};let d=br(u),f={x:n,y:r},p=cr(i),m=or(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=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=tr(D,k,O),j=!c.arrow&&ir(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Ec=(e,t)=>{let{name:n,fn:r}=Tc(e);return{name:n,fn:r,options:[e,t]}},Dc={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Oc={sideX:`left`,sideY:`top`},kc=`--available-width`,Ac=`--available-height`,jc=`--anchor-width`,Mc=`--anchor-height`,Nc=`--transform-origin`,Pc=kc,Fc=Ac;function Ic(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Lc(e,t,n){let{rects:r,placement:i}=e;return{side:Ic(t,rr(i),n),align:ir(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Rc(e){return zc(e,Sc)}function zc(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=_.side||`flip`,T=_.align||`flip`,E=_.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=Y(k),j=k?A:n,M=Nn(n),N=Nn(g),P=wc()===`rtl`,[F,I]=v.useState(null);!g&&F!==null&&I(null);let L=S===`placement`,R=F?rr(F):null,z=F&&L?ir(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],V=z||o,ee=V===`center`?B:`${B}-${V}`,H=l;typeof H==`number`?H={top:H,right:H,bottom:H,left:H}:H&&={top:H.top||0,right:H.right||0,bottom:H.bottom||0,left:H.left||0};let te=+(i===`bottom`),ne=+(i===`top`),re=+(i===`right`),U=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:H},ae=v.useRef(null),oe=Nn(a),W=Nn(s),G=typeof a==`function`?0:a,se=typeof s==`function`?0:s,q=[];p&&q.push(p),q.push(Zs(e=>{let t=Lc(e,i,P),n=typeof oe.current==`function`?oe.current(t):oe.current,r=typeof W.current==`function`?W.current(t):W.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[G,se,P,i]));let ce=T===`none`&&w!==`shift`,le=!ce&&(u||D||w===`shift`),ue=w===`none`?null:ec({...ie,padding:{top:H.top+1+te,right:H.right+1+U,bottom:H.bottom+1+ne,left:H.left+1+re},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),de=ce?null:Qs({...ie,rootBoundary:O,mainAxis:T!==`none`,crossAxis:le,limiter:u||D?void 0:$s(e=>{if(!ae.current)return{};let{width:t,height:n}=ae.current.getBoundingClientRect(),r=sr(rr(e.placement)),i=r===`y`?t:n,a=r===`y`?H.left+H.right:H.top+H.bottom;return{offset:i/2+a/2}})},[ie,u,D,O,H,T]);w===`shift`||T===`shift`||V===`center`?q.push(de,ue):q.push(ue,de),q.push(tc({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Pc,`${t}px`),i.setProperty(Fc,`${n}px`);let a=Le(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(jc,`${u}px`),i.setProperty(Mc,`${d}px`)}}),Ec(e=>({element:ae.current||Wn(e.elements.floating).createElement(`div`),padding:ae.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=rr(r),u=ir(r),d=sr(l)===`y`,f=ae.current,p=typeof a==`function`?a(Lc(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return le&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Nc,d?`${m} ${h}`:`${h} ${m}`),{}}},Dc,x),K(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=v.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:pe,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:q,strategy:r,whileElementsMounted:m?void 0:(...e)=>Rs(...e,fe),nodeId:b,externalTree:C}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||Oc,Te=xe?r:`fixed`,Ee=v.useMemo(()=>{let e;return e=xe?x?{position:Te,[Ce]:he,[we]:ge}:{...Se,position:Te}:{position:Te,top:0,left:0},e[Pc]=`100vw`,e[Fc]=`100vh`,xe||(e.opacity=0),e},[x,Te,Ce,he,we,ge,Se,xe]),De=v.useRef(null);K(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(Bc(t)?t.current:t)||null;n!==De.current&&(pe.setPositionReference(n),De.current=n)},[g,pe,j,M]),v.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&Bc(e)&&e.current!==De.current&&(pe.setPositionReference(e.current),De.current=e.current)},[g,pe,j,M]),v.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return Rs(me.reference,me.floating,ve,fe)},[m,g,me,ve,fe]);let Oe=rr(ye),ke=Ic(i,Oe,P),Ae=ir(ye)||`center`,je=!!_e.hide?.referenceHidden;K(()=>{S&&g&&xe&&(Oe!==B||L&&Ae!==V)&&I(ye)},[S,L,g,xe,ye,Oe,Ae,B,V]);let Me=v.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:ae,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,ae,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function Bc(e){return e!=null&&`current`in e}function Vc(e){return e===`starting`?Xi:G}function Hc(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Ui(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Vc(r),i],stateAttributesMapping:Nt})}var Uc=v.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=$i,style:g,..._}=e,y=le(),b=_c(),x=y.useState(`open`),C=y.useState(`mounted`),w=y.useState(`trackCursorAxis`),T=y.useState(`disableHoverablePopup`),E=y.useState(`floatingRootContext`),D=y.useState(`instantType`),O=y.useState(`transitionStatus`),k=Rc({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),A=Hc(e,v.useMemo(()=>({open:x,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[x,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!C,inert:!x||w===`both`||T});return(0,S.jsx)(bc.Provider,{value:k,children:A})}),Wc=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=le(),{side:s,align:c}=xc(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);za({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Po(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Ui(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Va,f,Vc(d),a],stateAttributesMapping:Pt})}),Gc=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=le(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=xc();return Ui(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Nt})}),Kc=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=v.useMemo(()=>({open:t,close:n}),[t,n]);return(0,S.jsx)(dc.Provider,{value:t,children:(0,S.jsx)(Cn,{delay:i,timeoutMs:r,children:e.children})})};function qc(e){return Ci(19)?e:e?`true`:void 0}function Jc(e){let[t,n]=v.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var Yc=class extends Ma{constructor(){super(ac(),`Tooltip`)}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(`open`)??!1}};function Xc(){return new Yc}var Zc=48,Qc=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Zc-t;return n},$c=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},el=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Zc;n+=i>>>1^-(i&1),t[r]=n}return t},tl=384,nl=[],rl=$c(Qc(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),il=$c(Qc(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),al=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,ol=(()=>{let e=rl.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=rl[n];i<rl[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(rl[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=rl[i];a<rl[i+1];a++)n[r++]=e,e+=t[e]}return n})(),sl=Qc(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),cl=$c(Qc(`123333359346463635126536711576`)),ll=Qc(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ul=Qc(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),dl=el(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),fl=(()=>{let e=new Int32Array(319).fill(-1),t=el(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=el(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),pl=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),ml=el(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),hl=el(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),gl=el(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±`),_l=new Int32Array(987),vl=new Int32Array(987),yl=new Int32Array(987),bl=``,xl=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<ml.length;r++)for(let i of pl[gl[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),xl[a*2]=bl.length,xl[a*2+1]=i.length,bl+=i),_l[n]=ml[r],vl[n]=hl[r],yl[n]=a,n++}}var Sl=el(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Cl=$c(Qc(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),wl=el(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),Tl=Qc(`ij`),El=Qc(``),Dl=Qc(`1`),Ol={GROUP_COUNT:tl,customValidatorNames:nl,edgeStart:rl,labelStart:il,labelText:al,edgeTarget:ol,nodeGroup:sl,nodeVlist:fl,vlistPat:cl,vlistOps:ll,vlistRef:ul,vlistGroup:dl,litAnchor:_l,litGroup:vl,litPool:yl,poolOffsets:xl,poolText:bl,adjGid:Sl,adjStart:Cl,adjTgt:wl,patGid:Tl,patTgt:El,postfixLookupGroups:Dl,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},kl=`line`in Error(),Al=-1,jl=-1,Ml=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Nl=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Pl=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Ml(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(Ml(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,ee=V.length,H=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),te=/\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$/,ne=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,re=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ie=0,ae=-1,oe=-1,W=-1,G=-1,K=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,se=e=>/\s/.test(String.fromCharCode(e)),q=(e,t,n)=>{if(ie=0,ae=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ie=1;else if(r===40&&i===41)ie=2;else return;W=t+1,G=n-1;let a=t+1;if(K(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!K(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(ae=t+1,oe=a,W=a+1)}},ce=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},le=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ue=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,de=e=>!!e&&!Number.isNaN(Number(e)),fe=(e,t,n)=>{if(n-t<11||!ce(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&ce(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ce(e,t+10,t+18,`-normal/`)},pe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],me=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),he=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],ge=(e,t,n,r)=>{if(e>=10){if(e>=25)return H[e-25](t.slice(n,r));let i=e-10;if(ie!==pe[i])return!1;if(ae>=0){for(let e of me[i])if(ce(t,ae,oe,e))return!0;return!1}switch(he[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(W,G);return te.test(e)&&!ne.test(e)}case 3:return de(t.slice(W,G));case 4:return U.test(t.slice(W,G));default:return re.test(t.slice(W,G))}}switch(e){case 0:return!0;case 1:return ie===0;case 2:return ie===1;case 3:return ie===2;case 4:return le.test(t.slice(n,r));case 5:return de(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&de(t.slice(n,r-1));case 8:return ue.test(t.slice(n,r));default:return fe(t,n,r)}},_e=new Set(typeof E==`string`?E.split(` `):E),ve=(e,t,n,r,i,a)=>{let o=Ml(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},ye=new Map,be=new Map,xe=2,Se=4096,Ce=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||_e.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=be.get(s);return c===void 0&&be.set(s,c=xe++),c},we=new Map,Te=r,Ee=r+4096,De=()=>Te++,Oe=2097152,ke=8192,Ae=new Int32Array(ke),je=Array(ke).fill(null),Me=new Int32Array(ke),Ne=new Int32Array(ke),Pe=new Uint8Array(ke),Fe=0,Ie=(e,t,n,r,i,a,o,s)=>{let c=e;if(je[e]!==null){if(je[e|1]===null)c=e|1;else if(!(Fe++&3))c=e|Fe>>2&1;else return}je[c]=t.slice(n,r),Ae[c]=i,Me[c]=a,Ne[c]=o,Pe[c]=s},Le=()=>je.fill(null),Re=256,ze=[new Int32Array(Re),new Int32Array(Re),new Int32Array(Re),new Int32Array(Re)],[Be,Ve,He,Ue]=ze,We=new Uint8Array(Re),Ge=new Uint8Array(Re),Ke=()=>{Re*=2,ze=ze.map(e=>{let t=new Int32Array(Re);return t.set(e),t}),[Be,Ve,He,Ue]=ze;let e=new Uint8Array(Re);e.set(We),We=e,Ge=new Uint8Array(Re)},qe=64,Je=new Int32Array(qe),Ye=new Int32Array(qe),Xe=new Int32Array(r),Ze=2048,Qe=21,$e=new Float64Array(Ze),et=new Int32Array(Ze),tt=0,nt=(e,t)=>{if(e===0&&t<r)return Xe[t]===tt?1:(Xe[t]=tt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Qe;for(;et[i]===tt;){if($e[i]===n)return 1;i=i+1&Ze-1}return $e[i]=n,et[i]=tt,0},rt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Al:ve(we,e,t+1,r,0,De)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ye[t];if(r>n)continue;let i=Je[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;q(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(ge(d[t],e,r,n))return p[h+t]}return Al},it=e=>{let t=e.length,n=0,c=0,u=!1;(xe>Se||ye.size>Se)&&(ye=new Map,be=new Map,xe=2,Le()),Te>Ee&&(we=new Map,Te=r,Le());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&se(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&se(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Re&&Ke();let _=n++;Be[_]=p,Ve[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Ae[y]===v&&je[y]!==null&&je[y].length===g?t=y:Ae[y|1]===v&&je[y|1]!==null&&je[y|1].length===g&&(t=y|1),t>=0){let n=je[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){He[_]=Me[t],Ue[_]=Ne[t],We[_]=Pe[t];continue}}}let b=p;if(ee!==0){if(h-p<=ee||!e.startsWith(V,p)){He[_]=Al,Ie(y,e,p,h,v,Al,0,0);continue}b=p+ee}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Je[0]=0,Ye[0]=M,R=1);let z=jl,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?jl:P,B=R),P!==jl){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=jl;else{let e=i[P],t=i[P+1],c=jl;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===qe){qe*=2;let e=new Int32Array(qe);e.set(Je),Je=e;let t=new Int32Array(qe);t.set(Ye),Ye=t}Je[R]=r,Ye[R]=t+2,R++}}A===D&&(z=F<I?jl:P,B=R);let H=F<I?jl:P,te,ne=!1;if(A>=0){if(ne=!0,te=rt(e,E,A,z,B),te!==Al&&te<r&&j[te]){let t=rt(e,E,D,H,R);t!==Al&&t!==te&&(te=t,ne=!1)}else te===Al&&(te=rt(e,E,D,H,R),ne=!1)}else te=rt(e,E,D,H,R);let re=0,U=0;te===Al?He[_]=Al:(U=+!!ne,re=b>=C?+!!O:ve(ye,e,b,C,+!!O,e=>Ce(e,O)),He[_]=te,We[_]=U,Ue[_]=re),Ie(y,e,p,h,v,te,re,U)}if(n===0)return``;if(n===1)return Be[0]===0&&Ve[0]===t?e:e.slice(Be[0],Ve[0]);if(n*k>Ze){for(;n*k>Ze;)Ze<<=1,Qe--;$e=new Float64Array(Ze),et=new Int32Array(Ze)}if(xe>=Oe||Te>=Oe)throw Error(`cn: too many distinct classes in one merge`);tt=tt+1|0,tt===0&&(Xe.fill(0),et.fill(0),tt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=He[e];if(t===Al){Ge[e]=1;continue}let n=Ue[e];if(nt(n,t)===1)Ge[e]=0,f=!0;else if(Ge[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)nt(n,x[e]);if(We[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&nt(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ge[m]){m++;continue}let t=Be[m],r=Ve[m],i=m+1;for(;i<n&&Ge[i]&&Be[i]===r+1&&e.charCodeAt(r)===32;)r=Ve[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},at=16384,ot=new Int32Array(at*2),st=0,ct=1,lt=Object.create(null),ut=Object.create(null),dt=new Map,ft=new Map,pt=0,mt=0,ht=()=>{st^=at,ct=ct+1|0,mt=0},gt=e=>{let t=lt[e];if(t!==void 0)return t;let n=Nl(e,0,e.length),r=(n&16383)+st,i=ot[r]===(n^ct)||ot[r^at]===(n^ct-1);return i&&(t=ut[e],t!==void 0)?(lt[e]=t,t):(t=it(e),i?(lt[e]=t,++pt>z&&(pt=0,ut=lt,lt=Object.create(null),ht())):(ot[r]=n^ct,++mt>at&&ht()),t)},_t=e=>{let t=dt.get(e);if(t!==void 0)return t;let n=Nl(e,0,e.length),r=(n&16383)+st,i=ot[r]===(n^ct)||ot[r^at]===(n^ct-1);return i&&(t=ft.get(e),t!==void 0)?(dt.set(e,t),t):(t=it(e),i?(dt.set(e,t),++pt>z&&(pt=0,ft=dt,dt=new Map,ht())):(ot[r]=n^ct,++mt>at&&ht()),t)},vt=e=>{let t=Nl(e,0,e.length),n=(t&16383)+st;return ot[n]===(t^ct)||ot[n^at]===(t^ct-1)||(ot[n]=t^ct,++mt>at&&ht(),!1)},yt=z===0?it:kl?e=>{let t=dt.get(e);return t===void 0?_t(e):t}:gt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?yt(arguments[0]):yt(Ll.apply(null,arguments))},mergeString:yt,seenBefore:z===0?()=>!1:vt,mergeUncached:it}},Fl=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Fl(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Il=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Fl(i,t);a&&(n&&(n+=` `),n+=a)}return n},Ll=function(){return Il(arguments,!1)},Rl=256,zl=16,Bl=1024,Vl=4096,Hl=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Vl).fill(``),l=Array(Vl).fill(``),u=Array(Vl).fill(``));let i=Nl(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Fl(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>zl&&(_.miss=zl,_.skip=Bl,_.e.length=0,_.at=0);let u=_.e;u.length<Rl?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Fl(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Ul=Pl(Ol),X=Hl(Ul.mergeString,Ul);Ul.merge;function Wl({delay:e=0,...t}){return(0,S.jsx)(Kc,{"data-slot":`tooltip-provider`,delay:e,...t})}function Gl({...e}){return(0,S.jsx)(cc,{"data-slot":`tooltip`,...e})}function Kl({...e}){return(0,S.jsx)(hc,{"data-slot":`tooltip-trigger`,...e})}function ql({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,S.jsx)(yc,{children:(0,S.jsx)(Uc,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,S.jsxs)(Wc,{"data-slot":`tooltip-content`,className:X(`z-50 inline-flex w-fit max-w-xs origin-(--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=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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),...o,children:[a,(0,S.jsx)(Gc,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var Jl=new Set;function Yl(){for(let e of Jl)e.isOpen&&e.close()}function Xl(e){return(0,v.useEffect)(()=>{function e(){document.hidden&&Yl()}return window.addEventListener(`blur`,Yl),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,Yl),document.removeEventListener(`visibilitychange`,e)}},[]),(0,S.jsx)(Wl,{...e})}function Zl(e){let[t]=(0,v.useState)(Xc);return(0,v.useEffect)(()=>(Jl.add(t),()=>{Jl.delete(t)}),[t]),(0,S.jsx)(Gl,{handle:t,...e})}var Ql=`factory.theme`,$l=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function eu(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:$l(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var tu=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},nu=e=>{let t=tu(e);return t.charAt(0).toUpperCase()+t.slice(1)},ru=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),iu={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 au(e){return e!=null}function ou(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??iu.width,a=e.size??e.height??iu.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?ru(...c):ru(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??iu[`stroke-width`])*Number(e.size??e.width??iu.width)/Number(t.size??t.width??iu.width):t.strokeWidth??iu[`stroke-width`];return[`svg`,{...Object.entries(iu).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&au(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&au(t.width)&&{[r(`width`)]:t.width},...`height`in t&&au(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 su(e,t={}){return ou(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var cu=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},lu=(0,v.createContext)({}),uu=()=>(0,v.useContext)(lu),du=(0,v.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:y=``}=uu()??{},b=!!c||cu(d),[x,S,C=[]]=su(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:ru(y,s),hasA11yProp:b,attributes:d});return(0,v.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function fu(e,t=[],n=[]){let r=typeof e==`string`?eu(e,t,n):e,i=(0,v.forwardRef)(({className:e,...t},n)=>(0,v.createElement)(du,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=nu(r.name)),i}var pu={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};pu.node;var mu=fu(pu),hu={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};hu.node;var gu=fu(hu),_u={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};_u.node;var vu=fu(_u),yu={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};yu.node;var bu=fu(yu),xu={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};xu.node;var Su=fu(xu),Cu={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Cu.node;var wu=fu(Cu),Tu={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Tu.node;var Eu=fu(Tu),Du={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Du.node;var Ou=fu(Du),ku={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};ku.node;var Au=fu(ku),ju={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`]};ju.node;var Mu=fu(ju),Nu={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Nu.node;var Pu=fu(Nu),Fu={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Fu.node;var Iu=fu(Fu),Lu={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`]};Lu.node;var Ru=fu(Lu),zu={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};zu.node;var Bu=fu(zu),Vu={name:`drafting-compass`,size:24,node:[[`path`,{d:`m12.99 6.74 1.93 3.44`,key:`iwagvd`}],[`path`,{d:`M19.136 12a10 10 0 0 1-14.271 0`,key:`ppmlo4`}],[`path`,{d:`m21 21-2.16-3.84`,key:`vylbct`}],[`path`,{d:`m3 21 8.02-14.26`,key:`1ssaw4`}],[`circle`,{cx:`12`,cy:`5`,r:`2`,key:`f1ur92`}]]};Vu.node;var Hu=fu(Vu),Uu={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Uu.node;var Wu=fu(Uu),Gu={name:`factory`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M16 16h.01`,key:`1f9h7w`}],[`path`,{d:`M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z`,key:`1iv0i2`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]};Gu.node;var Ku=fu(Gu),qu={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};qu.node;var Ju=fu(qu),Yu={name:`flame`,size:24,node:[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]};Yu.node;var Xu=fu(Yu),Zu={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`}]]};Zu.node;var Qu=fu(Zu),$u={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`}]]};$u.node;var ed=fu($u),td={name:`git-pull-request-closed`,size:24,node:[[`path`,{d:`m15.5 3.5 5 5`,key:`1kmx7t`}],[`path`,{d:`m15.5 8.5 5-5`,key:`saftza`}],[`path`,{d:`M18 11.62V15`,key:`1greaj`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}]]};td.node;var nd=fu(td),rd={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};rd.node;var id=fu(rd),ad={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`}]]};ad.node;var od=fu(ad),sd={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};sd.node;var cd=fu(sd),ld={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};ld.node;var ud=fu(ld),dd={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};dd.node;var fd=fu(dd),pd={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};pd.node;var md=fu(pd),hd={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};hd.node;var gd=fu(hd),_d={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};_d.node;var vd=fu(_d),yd={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};yd.node;var bd=fu(yd),xd={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]};xd.node;var Sd=fu(xd),Cd={name:`package-check`,size:24,node:[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]};Cd.node;var wd=fu(Cd),Td={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};Td.node;var Ed=fu(Td),Dd={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};Dd.node;var Od=fu(Dd),kd={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};kd.node;var Ad=fu(kd),jd={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};jd.node;var Md=fu(jd),Nd={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`}]]};Nd.node;var Pd=fu(Nd),Fd={name:`reply`,size:24,node:[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]};Fd.node;var Id=fu(Fd),Ld={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Ld.node;var Rd=fu(Ld),zd={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};zd.node;var Bd=fu(zd),Vd={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Vd.node;var Hd=fu(Vd),Ud={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Ud.node;var Wd=fu(Ud),Gd={name:`sticky-note`,size:24,node:[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]};Gd.node;var Kd=fu(Gd),qd={name:`text-quote`,size:24,node:[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]};qd.node;var Jd=fu(qd),Yd={name:`train-front`,size:24,node:[[`path`,{d:`M8 3.1V7a4 4 0 0 0 8 0V3.1`,key:`1v71zp`}],[`path`,{d:`m9 15-1-1`,key:`1yrq24`}],[`path`,{d:`m15 15 1-1`,key:`1t0d6s`}],[`path`,{d:`M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z`,key:`1p0hjs`}],[`path`,{d:`m8 19-2 3`,key:`13i0xs`}],[`path`,{d:`m16 19 2 3`,key:`xo31yx`}]]};Yd.node;var Xd=fu(Yd),Zd={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};Zd.node;var Qd=fu(Zd),$d={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`}]]};$d.node;var ef=fu($d),tf={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};tf.node;var nf=fu(tf);function rf(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=rf(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function af(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=rf(e))&&(r&&(r+=` `),r+=t);return r}var of=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,sf=af,cf=(e,t)=>n=>{if(t?.variants==null)return sf(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=of(t)||of(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 sf(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)};function lf({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty`,className:X(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function uf({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-header`,className:X(`flex max-w-sm flex-col items-center gap-2`,e),...t})}function df({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-title`,className:X(`font-heading text-sm font-medium tracking-tight`,e),...t})}function ff({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-description`,className:X(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function pf({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-content`,className:X(`flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance`,e),...t})}var mf=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});function hf(e){let t=Math.round((Date.now()-Date.parse(e))/6e4);if(t<1)return`just now`;if(t<60)return`${t} min ago`;let n=Math.round(t/60);return n<48?`${n} h ago`:`${Math.round(n/24)} days ago`}var gf=e=>Math.round((Date.now()-Date.parse(e))/6e4),_f=e=>e.split(`/`).filter(Boolean).at(-1)??e,vf=e=>`${_f(e.repo)}: ${e.title||e.id}`,yf=e=>e.replace(/T(\d\d)(\d\d)(\d\d)$/,`T$1:$2:$3Z`),bf=({model:e,effort:t})=>[e,t].filter(Boolean).join(`, `),xf=e=>[e.agent,bf(e)].filter(Boolean).join(` `),Sf=e=>e.charAt(0).toUpperCase()+e.slice(1);async function Cf(e,t,n){let r=await fetch(t,{method:e,body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json();if(!r.ok)throw Error(i.error);return i}var wf={candidates:()=>Cf(`GET`,`/api/candidates`),refreshCandidates:()=>Cf(`POST`,`/api/candidates/refresh`),blueprints:()=>Cf(`GET`,`/api/blueprints`),saveBlueprint:e=>Cf(`PUT`,`/api/blueprints`,e),deleteBlueprint:e=>Cf(`POST`,`/api/blueprints/delete`,{name:e}),runBlueprint:(e,t)=>Cf(`POST`,`/api/blueprints/run`,{name:e,repo:t}),prompt:e=>Cf(`POST`,`/api/candidates/prompt`,{repo:e.repo,id:e.id}),jobPrompt:e=>Cf(`GET`,`/api/jobs/${e}/prompt`),repos:()=>Cf(`GET`,`/api/repos`),clone:e=>Cf(`POST`,`/api/repos/clone`,{name:e}),queue:(e,t)=>Cf(`POST`,`/api/jobs`,{items:e,pin:t}),ownJob:e=>Cf(`POST`,`/api/jobs/own`,e),remove:e=>Cf(`POST`,`/api/jobs/${e}/remove`),retry:e=>Cf(`POST`,`/api/jobs/${e}/retry`),answer:(e,t)=>Cf(`POST`,`/api/jobs/${e}/answer`,{text:t}),goal:(e,t)=>Cf(`POST`,`/api/jobs/${e}/${t}`),newGoal:e=>Cf(`POST`,`/api/goals`,e),importPlan:e=>Cf(`POST`,`/api/goals/import`,{plan:e}),replan:(e,t)=>Cf(`POST`,`/api/jobs/${e}/replan`,{why:t}),verify:(e,t)=>Cf(`POST`,`/api/jobs/${e}/verify`,{need:t}),followup:(e,t)=>Cf(`POST`,`/api/jobs/${e}/followup`,{task:t}),review:(e,t)=>Cf(`POST`,`/api/jobs/${e}/review`,{agent:t}),prDetails:e=>Cf(`GET`,`/api/jobs/${e}/pr`),merge:e=>Cf(`POST`,`/api/jobs/${e}/merge`),rebase:e=>Cf(`POST`,`/api/jobs/${e}/rebase`),mergeTrain:e=>Cf(`POST`,`/api/train`,{ids:e}),close:e=>Cf(`POST`,`/api/jobs/${e}/close`),move:(e,t)=>Cf(`POST`,`/api/jobs/${e}/move`,{index:t}),models:()=>Cf(`GET`,`/api/models`),saveSettings:e=>Cf(`PUT`,`/api/settings`,e),turnOn:e=>Cf(`POST`,`/api/on`,e),turnOff:()=>Cf(`POST`,`/api/off`),chat:e=>Cf(`POST`,`/api/chat`,{message:e}),abortChat:()=>Cf(`POST`,`/api/chat/abort`),answerChat:e=>Cf(`POST`,`/api/chat/answer`,e),resetChat:()=>Cf(`POST`,`/api/chat/reset`)};function Tf(){let[e,t]=(0,v.useState)(),[n,r]=(0,v.useState)(),i=(0,v.useCallback)(()=>Cf(`GET`,`/api/state`).then(t,e=>r(`Can't reach factory serve: ${e.message}`)),[]);return(0,v.useEffect)(()=>{let e=()=>void Cf(`GET`,`/api/state`).then(t,e=>r(`Can't reach factory serve: ${e.message}`));e();let n=setInterval(e,3e3);return()=>clearInterval(n)},[]),{snapshot:e,error:n,act:(0,v.useCallback)(async e=>{try{await e(),r(void 0)}catch(e){r(e.message)}await i()},[i])}}function Ef(e){return Ui(e.defaultTagName??`div`,e,e)}var Df=cf(`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`,accent:`bg-(--om-accent) text-(--om-dark-background)`}},defaultVariants:{variant:`default`}});function Of({className:e,variant:t=`default`,render:n,...r}){return Ef({defaultTagName:`span`,props:Ai({className:X(Df({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var kf=v.createContext(void 0);function Af(e=!1){let t=v.useContext(kf);if(t===void 0&&!e)throw Error(q(16));return t}function jf(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:v.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Mf(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Le(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Nf(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=v.useRef(null),s=Af(!0),c=a??s!==void 0,{props:l}=jf({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=v.useCallback(()=>{let e=o.current;Pf(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return K(u,[u]),{getButtonProps:v.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Ai({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Bi(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Pf(r),s=!i&&Ff(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Mf(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Mf(r,e)))},onKeyUp(e){t||(Bi(e),a?.(e),e.target===e.currentTarget&&i&&c&&Pf(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Mf(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Y(e=>{o.current=e,u()})}}function Pf(e){return Ve(e)&&e.tagName===`BUTTON`}function Ff(e){return Ve(e)&&e.tagName===`A`&&!!e.href}var If=v.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Nf({disabled:i,focusableWhenDisabled:a,native:o});return Ui(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Lf=cf(`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 Rf({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,S.jsx)(If,{"data-slot":`button`,className:X(Lf({variant:t,size:n,className:e})),...r})}var zf=`data-valid`,Bf=`data-invalid`,Vf={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Hf={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Uf={disabled:!1,...Hf},Wf={valid(e){return e===null?null:e?{[zf]:``}:{[Bf]:``}}},Gf={invalid:void 0,name:void 0,validityData:{state:Vf,errors:[],error:``,value:``,initialValue:null},setValidityData:oe,disabled:void 0,setTouched:oe,setDirty:oe,setFilled:oe,setFocused:oe,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Uf,registerFieldControl:oe,validation:{getValidationProps:(e,t=G)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:oe,getInputControl:()=>null,commit:async()=>{},change:oe}},Kf=v.createContext(Gf);function qf(e=!0){let t=v.useContext(Kf);if(t.setValidityData===oe&&!e)throw Error(q(28));return t}var Jf=v.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:oe,validationMode:`onSubmit`,submitCountRef:{current:0}});function Yf(){return v.useContext(Jf)}var Xf=v.createContext({controlId:void 0,registerControlId:oe,resetControlId:oe,labelId:void 0,setLabelId:oe,messageIds:[],setMessageIds:oe,getDescriptionProps:e=>e});function Zf(){return v.useContext(Xf)}function Qf(e,t,n,r=!0,i,a){let[o,s]=v.useState(),c=uc(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return K(()=>{let i=e||t||l||!r?void 0:$f(n.current,c);o!==i&&s(i)}),u}function $f(e,t){let n=ep(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ep(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function tp(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Zf(),o=uc(),s=ee(()=>Symbol()),c=v.useRef(!1),l=v.useRef(!1),u=Y(()=>{c.current&&i!==oe&&(c.current=!1,i(s.current,void 0))});return K(()=>{if(!n||i===oe){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),K(()=>u,[u]),(n?r:void 0)??t??o}var np=v.createContext({disabled:!1});function rp(){return v.useContext(np)}function ip(e,t,n){let{setFocused:r,focusOwnerRef:i}=qf(),a=Y(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return K(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function ap(e,t,n,r,i=!0,a){let{registerFieldControl:o}=qf(),s=ee(()=>Symbol());K(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),K(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function op(e,t){let n=v.useRef(e),r=Y(t);K(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var sp=v.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:y,setFilled:b,validationMode:x,validation:S}=qf(),{clearErrors:C,elementRef:w,submitCountRef:T}=Yf(),E=h||s,D=m??a,O={...p,disabled:E},{labelId:k}=Zf(),A=tp({id:i}),j=o!==void 0,M=o==null?void 0:String(o),N=Y(()=>S.inputRef.current?.value);ap(S.inputRef,A,M,N,!E,a),K(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,l,S.inputRef,b]),op(M,()=>{M!==void 0&&(C(D),_(M!==(y.initialValue??``)),S.change(M))});let P=v.useRef(null),F=ip(E,P),I=pe();return Ui(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:u,...j?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=J(Xt,e.nativeEvent);c?.(t,n),!j&&(_(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(g(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},f,e=>S.getValidationProps(E,e)],stateAttributesMapping:Wf})}),cp=v.forwardRef(function(e,t){return(0,S.jsx)(sp,{ref:t,...e})});function lp({className:e,type:t,...n}){return(0,S.jsx)(cp,{type:t,"data-slot":`input`,className:X(`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})}var up={note:`note`,ask:`asked`,assume:`assumed`,answer:`you answered`,result:`result`,step:`step`,train:`merge train`,factory:`factory`};function dp({job:e,act:t,queued:n}){let r=e.notes.findLast(e=>e.kind===`result`),i=[...new Set(e.notes.flatMap(e=>e.followups??[]))],a=e.attempts.at(-1)?.branch;return!r&&i.length===0&&!a?null:(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border bg-popover p-2 text-sm`,children:[r&&(0,S.jsxs)(`span`,{children:[r.text,` `,r.confidence&&(0,S.jsxs)(Of,{variant:`outline`,children:[r.confidence,` confidence`]})]}),a&&(0,S.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Unpushed work kept on branch `,a]}),i.map(r=>(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-muted-foreground`,children:[(0,S.jsxs)(`span`,{children:[`Follow-up: `,r]}),n.has(r)?(0,S.jsx)(`span`,{children:`queued`}):(0,S.jsx)(Rf,{variant:`outline`,size:`xs`,onClick:()=>t(()=>wf.followup(e.id,r)),children:`Queue`})]},r))]})}function fp({job:e,question:t,act:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),s=async()=>{o(!0);try{await n(()=>wf.answer(e.id,r.trim()))}finally{o(!1)}};return(0,S.jsxs)(`form`,{className:`flex flex-col gap-2 rounded-md border border-warning/60 p-2`,onSubmit:e=>{e.preventDefault(),s()},children:[(0,S.jsxs)(`span`,{className:`text-foreground`,children:[e.agent,` asks: `,t.text]}),(0,S.jsxs)(`span`,{className:`flex gap-2`,children:[(0,S.jsx)(lp,{"aria-label":`Your answer`,placeholder:`Your answer; the job goes back in the queue with it`,value:r,onChange:e=>i(e.target.value)}),(0,S.jsx)(Rf,{type:`submit`,variant:`outline`,size:`sm`,disabled:a||!r.trim(),children:a?`Sending…`:`Answer`})]})]})}var pp;function mp(e){if(!pp){if(typeof document>`u`)return;pp=document.createElement(`textarea`)}var t=`&${e};`;pp.innerHTML=t;var n=pp.value;return n===t?void 0:n}var Z=32,hp=9,gp=13,_p=10,vp=96,yp=126,bp=91,xp=94,Sp=62,Cp=35,wp=37,Tp=45,Ep=61,Dp=92,Op=42,kp=95,Ap=60,jp=64,Mp=93,Np=33,Pp=38,Fp=58,Ip=70,Lp=102,Rp=104,zp=119,Bp=116,Vp=112,Hp=115,Up=160,Wp=12,Gp=44,Kp=59,qp=63,Jp=46,Yp=47,Xp=39,Zp=34,Qp=43,$p=124,em=123,tm=125,nm=40,rm=41,im=78,am=110,om=79,sm=111,cm=120,lm=88,um=30,dm=48,fm=57,pm=65,mm=90,hm=97,gm=122,_m=128,vm=32,Q={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22};function ym(e){if(!Bm(e,`---`))return null;let t=3;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t<e.length&&e[t]===`\r`&&t++,t>=e.length||e[t]!==`
|
|
10
|
+
`)return null;t++;let n=!1;for(;t<e.length;){let r=t;for(;t<e.length&&e[t]!==`
|
|
11
|
+
`&&e[t]!==`\r`;)t++;if(t>=e.length)break;let i=t;if(e[t]===`\r`&&t++,t<e.length&&e[t]===`
|
|
12
|
+
`&&t++,Bm(e,`---`,r))return{endPos:t,hasValidYaml:n};if(!n){let t=oh(e,r,i);if(t<i){let r=e.charCodeAt(t);if(r>=hm&&r<=gm||r>=pm&&r<=mm||r>=dm&&r<=fm||r===kp){for(t++;t<i&&(r=e.charCodeAt(t),r>=hm&&r<=gm||r>=pm&&r<=mm||r>=dm&&r<=fm||r===kp||r===Tp||r===Jp);)t++;t<i&&e.charCodeAt(t)===Fp&&(t++,t>=i?n=!0:(r=e.charCodeAt(t),(r===Z||r===hp)&&(n=!0)))}}}}return null}var bm=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,xm={class:`className`,for:`htmlFor`,allowfullscreen:`allowFullScreen`,allowtransparency:`allowTransparency`,autocomplete:`autoComplete`,autofocus:`autoFocus`,autoplay:`autoPlay`,cellpadding:`cellPadding`,cellspacing:`cellSpacing`,charset:`charSet`,classid:`classId`,colspan:`colSpan`,contenteditable:`contentEditable`,contextmenu:`contextMenu`,crossorigin:`crossOrigin`,enctype:`encType`,formaction:`formAction`,formenctype:`formEncType`,formmethod:`formMethod`,formnovalidate:`formNoValidate`,formtarget:`formTarget`,frameborder:`frameBorder`,hreflang:`hrefLang`,inputmode:`inputMode`,keyparams:`keyParams`,keytype:`keyType`,marginheight:`marginHeight`,marginwidth:`marginWidth`,maxlength:`maxLength`,mediagroup:`mediaGroup`,minlength:`minLength`,novalidate:`noValidate`,radiogroup:`radioGroup`,readonly:`readOnly`,rowspan:`rowSpan`,spellcheck:`spellCheck`,srcdoc:`srcDoc`,srclang:`srcLang`,srcset:`srcSet`,tabindex:`tabIndex`,usemap:`useMap`,viewbox:`viewBox`},Sm={};function Cm(e){if(!e)return Sm;var t={};for(var n in e){var r=xm[n.toLowerCase()];if(r)t[r]=e[n];else{var i=n.indexOf(`:`);i===-1?t[n]=e[n]:t[n.slice(0,i)+n[i+1].toUpperCase()+n.slice(i+2)]=e[n]}}return t}function wm(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)if(wm(e[t]))return!0;return!1}return e!=null&&typeof e!=`boolean`&&e!==``}function Tm(e,t){return typeof e==`string`&&!wm(t)?e:void 0}var Em=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\b)/i;function Dm(e){return e.indexOf(`&`)===-1?e:e.replace(bm,(e,t)=>{var n=mp(t);if(n)return n;if(t[0]===`#`){var r=t[1]===`x`||t[1]===`X`?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return r===0||r>=55296&&r<=57343||r>1114111?`�`:r<=65535?String.fromCharCode(r):String.fromCharCode(55296+(r-65536>>10),56320+(r-65536&1023))}return e})}var Om=RegExp(`^[^/?#]*?(javascript|vbscript|data(?!:image)):`,`i`),km=/[/?#][\s\S]*$/,Am={malformed:3,safe:0,unsafe:1,unsafeDecoded:2},jm=/[^A-Za-z0-9/:]/g,Mm=/[%\t\n\r]/;function Nm(e){return decodeURIComponent(e).replace(jm,``)}function Pm(e){if(Om.test(e))return Am.unsafe;if(!Mm.test(e))return Am.safe;try{return Om.test(Nm(e.replace(km,``)))?Am.unsafeDecoded:Am.safe}catch{return Am.malformed}}function Fm(e){return Pm(e)===Am.safe?e:null}for(var Im={},Lm=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],Rm=0;Rm<Lm.length;Rm++)Im[Lm[Rm]]=`a`;for(Im[231]=Im[199]=`c`,Im[240]=Im[208]=`d`,Lm=[200,201,202,203,233,232,234,235],Rm=0;Rm<Lm.length;Rm++)Im[Lm[Rm]]=`e`;for(Lm=[207,239,206,238,205,237,204,236],Rm=0;Rm<Lm.length;Rm++)Im[Lm[Rm]]=`i`;for(Im[209]=Im[241]=`n`,Lm=[248,216,339,338,213,245,212,244,211,243,210,242],Rm=0;Rm<Lm.length;Rm++)Im[Lm[Rm]]=`o`;for(Lm=[220,252,219,251,218,250,217,249],Rm=0;Rm<Lm.length;Rm++)Im[Lm[Rm]]=`u`;Im[376]=Im[255]=Im[221]=Im[253]=`y`;function zm(e){for(var t=``,n=-1,r=e.length,i=0;i<r;i++){var a=e.charCodeAt(i);if(a>=hm&&a<=gm||a>=dm&&a<=fm)n<0&&(n=i);else if(a>=pm&&a<=mm)n>=0&&(t+=e.slice(n,i),n=-1),t+=String.fromCharCode(a+vm);else if(a===Z||a===Tp)n>=0&&(t+=e.slice(n,i),n=-1),t+=`-`;else{n>=0&&(t+=e.slice(n,i),n=-1);var o=Im[a];o&&(t+=o)}}return n>=0&&(t+=e.slice(n)),t}function Bm(e,t,n){return e.startsWith(t,n)}var Vm=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`,`circle`,`ellipse`,`line`,`path`,`polygon`,`polyline`,`rect`,`use`,`stop`,`animate`,`set`]);function Hm(e){let t=e.toLowerCase();if(Vm.has(t))return!0;let n=t.indexOf(`:`);return n!==-1&&(t=t.slice(n+1),Vm.has(t))}var Um=1,Wm=2,Gm=4,Km=8,qm=16,Jm=32,Ym=64,Xm=(()=>{var e=new Uint8Array(128),t;for(e[hp]=Um,e[_p]=Um|Wm,e[Wp]=Um,e[gp]=Um|Wm,e[Z]=Um,t=Np;t<=Yp;t++)e[t]=Gm;for(t=Fp;t<=jp;t++)e[t]=Gm;for(t=bp;t<=vp;t++)e[t]=Gm;for(t=em;t<=yp;t++)e[t]=Gm;for(t=dm;t<=fm;t++)e[t]=qm;for(t=pm;t<=mm;t++)e[t]=Km;for(t=hm;t<=gm;t++)e[t]=Km;return e})();function Zm(e){return e<_m&&(Xm[e]&Um)!==0}var Qm=/[\p{P}\p{S}]/u,$m=/\p{Zs}/u,eh=[];function th(e){var t=e.indexOf(`\r`),n=e.indexOf(`\0`);if(t===-1&&n===-1)return e;var r=e.length;eh.length=0;var i=0,a=0;for(a=t===-1?n:n===-1||t<n?t:n;a<r;a++){var o=e.charCodeAt(a);o===gp?(i<a&&eh.push(e.slice(i,a)),a+1<r&&e.charCodeAt(a+1)===_p&&a++,eh.push(`
|
|
13
|
+
`),i=a+1):o===0&&(i<a&&eh.push(e.slice(i,a)),eh.push(`�`),i=a+1)}return i<r&&eh.push(e.slice(i)),eh.join(``)}var nh=/>\s+</g,rh=/\n+/g;function ih(e){return e.replace(nh,`><`).replace(rh,` `)}function ah(e){for(var t=``,n=0,r=!1,i=0,a=0;a<e.length;a+=1){var o=e.charCodeAt(a);if(o===Ap){var s=e.charCodeAt(a+1);r=s>=hm&&s<=gm||s>=pm&&s<=mm,i=o}else if(o===Sp)r=!1;else if(r&&i===Ep&&(o===Zp||o===Xp)){var c=e.indexOf(e[a],a+1);c===-1&&(c=e.length),t+=ih(e.slice(n,a+1))+e.slice(a+1,c),n=c,a=c,i=o}else o!==Z&&o!==hp&&o!==_p&&o!==gp&&(i=o)}return(t+ih(e.slice(n))).trim()}function oh(e,t,n){let r=n??e.length;for(;t<r&&(e[t]===` `||e[t]===` `);)t++;return t}function sh(e){if(!e)return!1;for(var t in e)return!0;return!1}function ch(e){return{attrs:{},children:[{type:Q.text,text:e}],h:void 0,c:!0,type:Q.htmlBlock,tag:`header`}}var lh=/^\n+/;function uh(e){for(var t=e.length;t>0&&(e[t-1]===`
|
|
14
|
+
`||e[t-1]===`\r`);)t--;return`${e.slice(0,t).replace(lh,``)}
|
|
15
|
+
|
|
16
|
+
`}function dh(e){if((e.type===Q.htmlSelfClosing||e.type===Q.htmlBlock)&&e.b)return[];if(e.type===Q.paragraph){var t=e.children;return t?t.flatMap(dh):[]}return e.type===Q.text?e.text?.trim()?[e]:[]:e.type===Q.htmlBlock&&e.children?[{...e,children:e.children?.flatMap(dh)}]:[e]}function fh(e){for(var t=0;t<e.length;t++){if(e[t].type===Q.htmlBlock){var n=e[t],r=!1;if(n.c&&t===e.length-1){var i=n.k===void 0?n.b?n.e||``:(n.e||``)+(n.j||``):n.k,a=`</${String(n.tag).toLowerCase()}>`,o=i.toLowerCase().indexOf(a);o!==-1&&i.slice(o+a.length).replace(/<\/[a-z][a-z0-9-]*\s*>/gi,``).trim()&&(r=!0)}r||(n.c=!1)}`children`in e[t]&&e[t].children&&fh(e[t].children)}}function ph(e,t){let n=e.at(-1);return n===void 0||n.type!==Q.htmlBlock||n.c!==!0?!1:(n.h||n.k)===t}function mh(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.type===Q.paragraph&&r.children)for(var i=r.children,a=0;a<i.length;a++){var o=i[a];if(o.type===Q.htmlSelfClosing&&o.b&&o.tag.toLowerCase()===t){var s=e.slice(0,n);a>0&&s.push({type:Q.paragraph,children:i.slice(0,a)});var c=[];if(a+1<i.length){var l=i.slice(a+1).filter(e=>!(e.type===Q.htmlSelfClosing&&e.b));l.length>0&&(c=l)}return c=c.concat(e.slice(n+1)),{found:!0,beforeClose:s,afterClose:c}}}if((r.type===Q.htmlSelfClosing||r.type===Q.htmlBlock)&&r.b&&r.tag.toLowerCase()===t)return{found:!0,beforeClose:e.slice(0,n),afterClose:e.slice(n+1)}}return{found:!1,beforeClose:e,afterClose:[]}}function hh(e){var t=``;for(var n in e){var r=e[n];r===!0?t+=` ${n}`:r!==void 0&&r!=null&&r!==!1&&(t+=` ${n}="${String(r)}"`)}return t}function gh(e,t,n,r){return`<${e}${t===void 0?hh(n):t.length>0&&t.charCodeAt(0)>Z?` ${t}`:t}${r}`}function _h(e,t){var n=e.tag,r=e.type===Q.htmlSelfClosing,i=e,a=i.a,o=`</${n}>`;if(!r&&i.b)return{kind:`literal`,literal:(i.j||o)+(i.e||``)};if(r){var s=e;return s.b?{kind:`literal`,literal:s.j||o}:s.u?{kind:`literal`,literal:s.u}:{kind:`literal`,literal:gh(n,a,e.attrs,` />`)}}var c=gh(n,a,e.attrs,`>`),l=i.children,u=l!=null&&l.length>0;if(i.c&&i.k!==void 0)return u?{kind:`sandwich`,open:c,close:o}:{kind:`literal`,literal:i.k};if(i.c&&!u)return{kind:`literal`,literal:c+(i.e||``)+(i.j||(a===void 0?o:``))};if(l!=null&&l.length>0){for(var d=``,f=0;f<l.length;f++){var p=l[f];if(p.type!==Q.text)return{kind:`sandwich`,open:c,close:o};d+=p.text}return{kind:`literal`,literal:c+(t?t(d):d)+o}}var m=i.e||``;return m&&m.indexOf(o)!==-1?{kind:`literal`,literal:c+m}:{kind:`literal`,literal:c+m+o}}function vh(e,t,n){var r=[],i=e,a=n;if(i&&r.push(i),Array.isArray(t))for(var o=0;o<t.length;o++)r.push(t[o]);else t!=null&&r.push(t);a&&r.push(a);for(var s=[],c=0;c<r.length;c++){var l=r[c];typeof l==`string`&&s.length>0&&typeof s.at(-1)==`string`?s[s.length-1]=s.at(-1)+l:s.push(l)}return s}function yh(e){return e==null||e.tagfilter!==!1}function bh(e,t,n,r){var i=t(e,n,r);return i===null?null:Ah(i)}function xh(e){var t=[];if(!e)return t;for(var n in e)n.charCodeAt(0)===94&&t.push({identifier:n,footnote:e[n].target});return t}function Sh(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(r>=pm&&r<=mm)return e.toLowerCase();t++}return e}var Ch=Object.prototype.hasOwnProperty;function wh(e,t){if(e!=null)return t in(typeof e==`function`?Function.prototype:Object.prototype)&&!Ch.call(e,t)?void 0:e[t]}function Th(e,t){var n=Sh(t);if(n!==t){var r=wh(e,n),i=t.charCodeAt(0);if(r||i<pm||i>mm)return r;var a=i+vm;for(var o in e){var s=o.charCodeAt(0);if(o.length===t.length&&(s===i||s===a||s>=_m)&&o.toLowerCase()===n){var c=wh(e,o);if(c)return c}}}}function Eh(e,t,n){if(t.indexOf(`.`)===-1){var r=wh(e,t);return r||!e?r||n:Th(e,t)||n}var i=t.split(`.`),a=wh(e,i[0]);a===void 0&&e&&(a=Th(e,i[0]));for(var o=1;a!==void 0&&o<i.length;)a=wh(a,i[o]),o++;return a||n}var Dh=/^(?:attr|bool|prop):/i;function Oh(e){var t=e.charCodeAt(4)===Fp&&Dh.test(e)?5:0,n=e.charCodeAt(t),r=e.charCodeAt(t+1);return(n===sm||n===om)&&(r===am||r===im)}function kh(e,t,n){var r;for(var i in t)if(Oh(i)&&typeof t[i]!=`function`){if(r===void 0){var a=e.charCodeAt(0);if(a>=pm&&a<=mm&&Eh(n,e,void 0))return t;r={...t}}delete r[i]}return r||t}function Ah(e){for(var t=!1,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<=Z||r===Zp||r===wp||r===Ap||r===Sp||r===bp||r===Dp||r===Mp||r===xp||r===vp||r>=123){t=!0;break}}if(!t)return e;for(var i=``,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r===wp&&n+2<e.length){var a=e.charCodeAt(n+1),o=e.charCodeAt(n+2);if((a>=dm&&a<=fm||a>=pm&&a<=Ip||a>=hm&&a<=Lp)&&(o>=dm&&o<=fm||o>=pm&&o<=Ip||o>=hm&&o<=Lp)){i+=e[n]+e[n+1]+e[n+2],n+=2;continue}}if(r>=55296&&r<=57343){if(r<=56319&&n+1<e.length){var s=e.charCodeAt(n+1);if(s>=56320&&s<=57343){i+=encodeURI(e[n]+e[n+1]),n++;continue}}i+=e[n]}else i+=encodeURI(e[n])}return i}function jh(...e){return e.filter(Boolean).join(` `)}var Mh=new Set([`title`,`textarea`,`style`,`xmp`,`iframe`,`noembed`,`noframes`,`script`,`plaintext`]),Nh=/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;function Ph(e){return Mh.has(e.toLowerCase())}function Fh(e){return Nh.lastIndex=0,Nh.test(e)}function Ih(e,t){var n=e.toLowerCase();return n===`pre`||n===`textarea`?Dm(t):t}function Lh(e){return Nh.lastIndex=0,e.replace(Nh,(e,t,n,r)=>`<${t}${n}${r}`)}function Rh(e,t){var n=e||{},r=n.slugify,i;if(r){var a=r;i=e=>a(e,zm)}else i=zm;return{disableAutoLink:n.disableAutoLink,disableFrontmatter:n.disableFrontmatter,disableParsingRawHTML:n.disableParsingRawHTML,enforceAtxHeadings:n.enforceAtxHeadings,evalUnserializableExpressions:n.evalUnserializableExpressions,forceBlock:n.forceBlock,forceInline:t===void 0?n.forceInline:t,ignoreHTMLBlocks:n.ignoreHTMLBlocks,optimizeForStreaming:n.optimizeForStreaming,overrides:n.overrides,preserveFrontmatter:n.preserveFrontmatter,sanitizer:n.sanitizer||Fm,slugify:i,tagfilter:yh(n)}}var zh=/^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/,Bh=/^<[A-Z]/,Vh=new Set([`pre`,`script`,`style`,`textarea`]),Hh=/<(?:pre|script|style|textarea)\b/i,Uh=/<(?:pre|script|style|textarea)\b/iy,Wh=/<\/(?:pre|script|style|textarea)>/iy,Gh=String.fromCharCode(um);function Kh(e){return e.indexOf(Gh)===-1?e:e.split(Gh).join(``)}var qh=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,Jh=/^(\s{0,3}#[\s\S]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,Yh=/^#{1,6}\s/,Xh=/^#{1,6}[^#]/;function Zh(e){return e.enforceAtxHeadings===!1?Jh:qh}var Qh=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im,$h=new Uint8Array(128);(()=>{for(var e=[vp,Op,kp,yp,Ep,bp,Np,Ap,Dp,Pp,_p,Rp,zp,Lp],t=0;t<e.length;t++)$h[e[t]]=1})();var eg=/([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;function tg(e){return Vh.has(e)}function ng(e){return Hh.test(e)}function rg(e,t,n){for(var r=t,i=n;r<i&&(e.charCodeAt(r)===Z||e.charCodeAt(r)===hp);)r++;if(r>=i)return!1;e.charCodeAt(r)===$p&&r++;for(var a=0;r<i;){for(;r<i&&(e.charCodeAt(r)===Z||e.charCodeAt(r)===hp);)r++;if(r>=i)break;if(e.charCodeAt(r)===$p&&a>0){for(var o=r+1;o<i&&(e.charCodeAt(o)===Z||e.charCodeAt(o)===hp);)o++;if(o>=i)return!0}if(e.charCodeAt(r)===Fp&&r++,r>=i||e.charCodeAt(r)!==Tp)return!1;for(;r<i&&e.charCodeAt(r)===Tp;)r++;for(r<i&&e.charCodeAt(r)===Fp&&r++,a++;r<i&&(e.charCodeAt(r)===Z||e.charCodeAt(r)===hp);)r++;if(r<i){if(e.charCodeAt(r)===$p)r++;else return!1}}return a>0}var ig=/[\u0000-\u001F\u007F]/g,ag={action:1,background:1,cite:1,data:1,formaction:1,href:1,longdesc:1,poster:1,src:1,"xlink:href":1,xlinkhref:1},og={children:1,dangerouslysetinnerhtml:1,innerhtml:1,outerhtml:1,ref:1},sg=/^\{\s*[[{]/,cg=/[{}"'`]/g,lg=/&#(x[0-9a-f]+|[0-9]+);?/gi;function ug(e){return e.indexOf(`&#`)===-1?e:e.replace(lg,(e,t)=>{var n=t.charCodeAt(0)===cm||t.charCodeAt(0)===lm?Number.parseInt(t.slice(1),16):Number.parseInt(t,10);return n>0&&n<=1114111?String.fromCodePoint(n):e})}var dg;function fg(e){return!!Eh(dg?.overrides,e,void 0)}function pg(e,t,n,r){if(e.charCodeAt(4)===Fp&&Dh.test(e))return pg(e.slice(5),t,n,r);var i=e.toLowerCase();if(og[i]===1)return!0;var a=n&&t.charCodeAt(0)===em;if(i===`attributename`)return!a&&mg(t);var o=Oh(e);if(a&&(ag[i]!==1||sg.test(t)))return!1;if(o)return!(n&&t===``);if(i===`srcdoc`)return!0;if(i===`style`)return/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(t);if(ag[i]===1){var s=ug(Dm(t));if(hg(s,r))return!0;var c=s.replace(ig,``);return c!==s&&hg(c,r)}return!1}function mg(e){var t=ug(Dm(e)).replace(cg,``).trim().toLowerCase();return t=t.slice(t.lastIndexOf(`:`)+1),ag[t]===1||t.slice(0,2)===`on`}function hg(e,t){return t?Pm(e)!==Am.safe:Fm(e)===null}function gg(e,t){return`<`+(e.g?`/`:``)+e.tag+e.i+(t===void 0?e.a:t)+(e.n?e.v?` />`:`/>`:`>`)}function _g(e,t,n,r){for(var i=[],a=t,o=0;o<r.length;o+=2){var s=r[o];if(s>a){var c=e.slice(a,s).trim();c&&i.push(c)}a=r[o+1]}if(a<n){var l=e.slice(a,n).trim();l&&i.push(l)}return i.join(` `)}function vg(e,t){var n=[];if(e!==null)for(var r=0;r<e.length;r+=2)e[r]!==t&&n.push(e[r],e[r+1]);return n}var yg=1024;function bg(e){return Zm(e)||e===Sp||e===Zp||e===Xp}function xg(e){return(e|32)>=hm&&(e|32)<=gm}var Sg=!1;function Cg(e,t,n,r){var i=r===void 0?e.length:r,a=t+2,o=0;for(Sg=!1;a<i;){var s=e.charCodeAt(a);if(Zm(s)||s===Yp||s===Sp)break;a++}for(;a<i;){if(s=e.charCodeAt(a),s===Sp)return Sg||=o>a+1,a+1;if(Zm(s)||s===Yp)a++;else{var c=a;for(a++;a<i&&(s=e.charCodeAt(a),!(Zm(s)||s===Yp||s===Sp||s===Ep));)a++;for(var l=e.slice(c,a);a<i&&Zm(e.charCodeAt(a));)a++;var u=``,d=-1;if(a<i&&e.charCodeAt(a)===Ep){for(a++;a<i&&Zm(e.charCodeAt(a));)a++;var f=e.charCodeAt(a);if(f===Zp||f===Xp){for(d=++a;a<i&&e.charCodeAt(a)!==f;)a++;u=e.slice(d,a),a++}else{for(var p=a;a<i&&(s=e.charCodeAt(a),!(Zm(s)||s===Sp));)a++;u=e.slice(p,a)}}if(!Sg){var m=n===null?void 0:wh(n,l);Sg=pg(l,u,m?.startsWith(u)===!0,!0)}if(r===void 0&&d!==-1)for(var h=u.indexOf(`<`);h!==-1&&!Sg;){if(xg(u.charCodeAt(h+1))){var g=d+h;o=Math.max(o,Cg(e,g,null,Math.min(i,g+yg)))}h=u.indexOf(`<`,h+1)}}}return Sg=!0,i}function wg(e,t,n,r,i,a){var o=e.slice(0,n+yg);if(i!==null&&r!==null){for(var s=o.slice(t,i[0]),c=0;c<i.length;c+=2)s+=` `.repeat(i[c+1]-i[c])+o.slice(i[c+1],c+2<i.length?i[c+2]:o.length);o=s,n-=t,t=0}for(var l=Cg(o,o.charCodeAt(t+1)===Yp?t+1:t,r);!Sg&&l<n;){var u=o.indexOf(`<`,l);if(u===-1||u>=n)break;var d=o.charCodeAt(u+1)===Yp;l=xg(o.charCodeAt(u+(d?2:1)))?Cg(o,d?u+1:u,null):u+1}if(!Sg)return i;if(i===null)return a;for(var f=[],p=0,m=0;p<i.length||m<a.length;)m>=a.length||i[p]<a[m]?(f.push(i[p],i[p+1]),p+=2):(f.push(a[m],a[m+1]),m+=2);return f}function Tg(e,t,n,r){if(e.charCodeAt(t)!==Ap)return null;let i=t+1,a=e.length,o=!1;e.charCodeAt(i)===Yp&&(i++,o=!0);let s=i,c=e.charCodeAt(i);if(!(c>=hm&&c<=gm||c>=pm&&c<=mm))return null;for(;i<a&&(e.charCodeAt(i)>=hm&&e.charCodeAt(i)<=gm||e.charCodeAt(i)>=pm&&e.charCodeAt(i)<=mm||e.charCodeAt(i)>=dm&&e.charCodeAt(i)<=fm||e.charCodeAt(i)===Tp);)i++;let l=e.slice(s,i);if(!l)return null;let u=l.charCodeAt(0),d=u>=pm&&u<=mm,f=d||l.indexOf(`-`)!==-1,p=d&&fg(l),m=i;for(;i<a&&(e.charCodeAt(i)===Z||e.charCodeAt(i)===hp||e.charCodeAt(i)===_p);)i++;let h=e.slice(m,i);if(i===m&&i<a){var g=e.charCodeAt(i);if(g!==Sp&&g!==Yp)return null}let _=i,v={},y=!1;for(var b=null,x=null,S=!1,C=-1;i<a;){let s=e.charCodeAt(i);if(s===Sp){x!==null&&!r&&(b=wg(e,t,i+1,p?v:null,b,x));let n=b?_g(e,_,i,b):e.slice(_,i);return{w:x!==null,v:y,g:o,x:p,y:f,a:n,z:C===-1?void 0:_g(e,_,i,vg(b,C)),q:b!=null,n:!1,i:h,attrs:v,end:i+1,tag:l}}if(s===Z||s===hp||s===_p)i++;else{if(s===Yp&&i+1<a&&e.charCodeAt(i+1)===Sp){y=i>_&&e.charCodeAt(i-1)===Z,x!==null&&!r&&(b=wg(e,t,i+2,p?v:null,b,x));let n=b?_g(e,_,i,b):e.slice(_,i);return{w:x!==null,v:y,g:o,x:p,y:f,a:n,z:C===-1?void 0:_g(e,_,i,vg(b,C)),q:b!=null,n:!0,i:h,attrs:v,end:i+2,tag:l}}var w=i,T=e.charCodeAt(i);if(!(T>=hm&&T<=gm||T>=pm&&T<=mm||T===kp||T===Fp))return null;for(i++;i<a;){var E=e.charCodeAt(i);if(E>=hm&&E<=gm||E>=pm&&E<=mm||E>=dm&&E<=fm||E===kp||E===Jp||E===Fp||E===Tp)i++;else break}for(var D=e.slice(w,i),O=i;i<a&&(e.charCodeAt(i)===Z||e.charCodeAt(i)===hp);)i++;var k,A;if(e.charCodeAt(i)===Ep){for(i++;i<a&&(e.charCodeAt(i)===Z||e.charCodeAt(i)===hp);)i++;var j=e.charCodeAt(i);if(j===Zp||j===Xp){i++;for(var M=i;i<a;){var N=e.charCodeAt(i);if(N===j)break;N===Ap&&xg(e.charCodeAt(i+1))&&(S=!0),i++}if(i>=a)return null;if(k=e.slice(M,i),i++,i<a){var P=e.charCodeAt(i);if(P!==Z&&P!==hp&&P!==_p&&P!==Sp&&P!==Yp)return null}A=i}else if(j===em){var F=1,M=i;for(i++;i<a&&F>0;){var E=e.charCodeAt(i);E===em?F++:E===tm?F--:bg(E)&&(S=!0),i++}k=e.slice(M,i),A=i}else{for(var M=i;i<a;){var I=e.charCodeAt(i);if(I===Z||I===hp||I===Sp||I===_p||I===Zp||I===Xp||I===Ep||I===Ap||I===vp)break;i++}if(i===M)return null;k=e.slice(M,i),A=i}}else k=``,A=O;pg(D,k,p,n)?(b===null&&(b=[]),b.push(w,A),!d&&Oh(D)&&fg(l)?v[D]=k:D.toLowerCase()===`children`&&!sg.test(k)&&fg(l)&&(v.children=k,C=w)):(v[D]=k,S&&(x===null&&(x=[]),x.push(w,A))),S=!1}}return null}var Eg=/</g;function Dg(e,t,n){var r=kg(e,t,n);return r===e?e:kg(r,!0)===r?r:(n!==void 0&&(n.keepingChildren=void 0),r.replace(Eg,`<`))}function Og(e,t){var n=t+1;if(e.charCodeAt(n)===Yp&&n++,!xg(e.charCodeAt(n)))return-1;for(var r=e.charCodeAt(++n);xg(r)||r>=dm&&r<=fm||r===Tp;)r=e.charCodeAt(++n);return r===Sp?n+1:-1}function kg(e,t,n){var r=e.indexOf(`<`);if(r===-1)return e;for(var i=``,a,o=0,s=!1;r!==-1;){var c=Og(e,r);if(c!==-1)r=e.indexOf(`<`,c);else{var l=Tg(e,r,t,!0),u;if(l?.q&&l.w&&l.x)u=e.slice(o,r)+kg(gg(l),t),i+=u,a!==void 0&&(a+=u),o=l.end,s=!0,r=e.indexOf(`<`,l.end);else if(l&&!l.w){if(l.q){var d=e.slice(o,r),f=l.z;a===void 0&&f!==void 0&&n!==void 0&&(a=i),i+=d+gg(l),a!==void 0&&(a+=d+gg(l,f)),o=l.end,s=!0}r=e.indexOf(`<`,l.end)}else if(l||xg(e.charCodeAt(r+1))){var p=Cg(e,l?.g?r+1:r,l?.x?l.attrs:null);Sg&&(u=e.slice(o,r)+e.slice(r,p).replace(Eg,`<`),i+=u,a!==void 0&&(a+=u),o=p,s=!0),r=e.indexOf(`<`,p)}else r=e.indexOf(`<`,r+1)}}if(!s)return e;var m=e.slice(o);return a!==void 0&&n!==void 0&&(n.keepingChildren=a+m),i+m}function Ag(e,t,n){if(!n.optimizeForStreaming&&e.indexOf(`[`)===-1)return!1;for(var r=0,i=e.length,a=!1,o=!1;r<i;){for(var s=e.indexOf(`
|
|
17
|
+
`,r),c=s<0?i:s,l=r,u=0;l<c&&u<4;)if(e.charCodeAt(l)===Z)u++,l++;else if(e.charCodeAt(l)===hp)u+=4,l++;else break;if(l>=c)a=!1,r=s<0?i:s+1;else{if(u<4){var d=e.charCodeAt(l);if(d===vp||d===yp){for(var f=d,p=0,m=l;m<c&&e.charCodeAt(m)===f;)p++,m++;if(p>=3){var h=!0;if(f===vp){for(var g=m;g<c;g++)if(e.charCodeAt(g)===vp){h=!1;break}}if(h){a=!1;for(var _=s<0?i:s+1;_<i;){for(var v=_,y=0;v<i&&y<4;){var b=e.charCodeAt(v);if(b===Z)y++,v++;else if(b===hp)y+=4,v++;else break}if(y<4&&v<i&&e.charCodeAt(v)===f){for(var x=0;v<i&&e.charCodeAt(v)===f;)x++,v++;if(x>=p){for(;v<i&&(e.charCodeAt(v)===Z||e.charCodeAt(v)===hp);)v++;if(v>=i||e.charCodeAt(v)===_p){r=v>=i?i:v+1;break}}}for(;_<i&&e.charCodeAt(_)!==_p;)_++;_<i&&_++}_>=i&&(r=i,o=!0);continue}}}}for(var S=l;S<c&&e.charCodeAt(S)===Sp;){S++,S<c&&e.charCodeAt(S)===Z&&S++;for(var C=0;S<c&&C<4;)if(e.charCodeAt(S)===Z)C++,S++;else if(e.charCodeAt(S)===hp)C+=4,S++;else break;if(C>=4)break;a=!1}if(!a&&u<4&&S<c&&e.charCodeAt(S)===bp&&!(S+1<i&&e.charCodeAt(S+1)===xp)){var w=jg(e,S,t);if(w){r=w,a=!1;continue}}var T=e.charCodeAt(l);if(T===Cp&&u<4)a=!1;else if(u<4&&(T===Tp||T===Op||T===kp)){for(var E=l,D=0;E<c;){var O=e.charCodeAt(E);if(O===T)D++;else if(O!==Z&&O!==hp)break;E++}a=!(D>=3&&E>=c)}else a=!0;r=s<0?i:s+1}}return o}function jg(e,t,n){let r=e.length;if(e.charCodeAt(t)!==bp)return null;let i=t+1<r&&e.charCodeAt(t+1)===xp,a=t+1;for(;a<r;){var o=e.charCodeAt(a);if(o===Mp){a++;break}if(o===bp)return null;o===Dp&&a+1<r&&a++,a++}if(a>r||e.charCodeAt(a-1)!==Mp)return null;let s=Kh(e.slice(t+1,a-1));if(s.length>999)return null;let c=Fg(s);if(!c||a>=r||e.charCodeAt(a)!==Fp)return null;a++;let l=!1;for(;a<r;){let t=e.charCodeAt(a);if(t===Z||t===hp)a++;else if(t===_p&&!l)l=!0,a++;else if(t===um&&l)a++;else break}if(i){let t=e.indexOf(`
|
|
18
|
+
`,a),i=t<0?r:t;return n[c]={target:e.slice(a,i).trim(),title:void 0},t<0?r:t+1}var u;if(a<r&&e.charCodeAt(a)===Ap){a++;for(var d=a;a<r&&e.charCodeAt(a)!==Sp&&e.charCodeAt(a)!==_p;)e.charCodeAt(a)===Dp&&a+1<r&&e.charCodeAt(a+1)!==_p&&a++,a++;if(a>=r||e.charCodeAt(a)!==Sp)return null;u=e.slice(d,a),a++;for(var f=e.indexOf(`
|
|
19
|
+
`,a),p=f<0?r:f,m=a;m<p&&(e.charCodeAt(m)===Z||e.charCodeAt(m)===hp);)m++;if(m<p){if(m===a)return null;var h=e.charCodeAt(m);if(h!==Zp&&h!==Xp&&h!==nm)return null}}else{for(var d=a,g=0;a<r;){var o=e.charCodeAt(a);if(o===nm)g++;else if(o===rm){if(g===0)break;g--}else{if(o===Z||o===hp||o===_p)break;if(o===Dp&&a+1<r){var _=e.charCodeAt(a+1);_!==Z&&_!==hp&&_!==_p&&a++}}a++}if(u=e.slice(d,a),!u)return null}for(;a<r&&(e.charCodeAt(a)===Z||e.charCodeAt(a)===hp);)a++;var v=e.indexOf(`
|
|
20
|
+
`,a),y=v<0?r:v,b,x=!1,S=a,C=a;if(a===y&&a<r)for(C=a+1;C<r&&(e.charCodeAt(C)===Z||e.charCodeAt(C)===hp);)C++;if(C<r){var w=e.charCodeAt(C);if(w===Zp||w===Xp||w===nm){for(var T=w===nm?41:w,E=C+1,D=E;E<r;){var O=e.charCodeAt(E);if(O===T){for(var k=E+1;k<r&&(e.charCodeAt(k)===Z||e.charCodeAt(k)===hp);)k++;(k>=r||e.charCodeAt(k)===_p)&&(b=Kh(e.slice(D,E)),x=!0,S=k<r?k+1:r);break}if(O===Dp&&E+1<r)E+=2;else{if(O===_p&&E+1<r&&e.charCodeAt(E+1)===_p)break;E++}}if(!x&&C===a)return null}}if(x)return n[c]||(n[c]={target:Dm(Lg(u)),title:b===void 0?b:Dm(Lg(b))}),S;for(;a<y&&(e.charCodeAt(a)===Z||e.charCodeAt(a)===hp);)a++;return a<y?null:(n[c]||(n[c]={target:Dm(Lg(u)),title:b}),v<0?r:v+1)}var Mg=new Uint8Array(Xm);for(Mg[Cp]|=Jm,Mg[Sp]|=Jm,Mg[Tp]|=Jm|Ym,Mg[Qp]|=Jm,Mg[Op]|=Jm|Ym,Mg[kp]|=Jm|Ym,Mg[vp]|=Jm|Ym,Mg[yp]|=Jm|Ym,Mg[Ap]|=Jm|Ym,Mg[bp]|=Ym,Mg[Np]|=Ym,Mg[$p]|=Jm,Ng=dm;Ng<=fm;Ng++)Mg[Ng]|=Jm;var Ng;function Pg(e){if(e.indexOf(`[`)<0&&e.indexOf(`]`)<0)return!1;for(var t=0;t<e.length;t++)if(e.charCodeAt(t)===Dp)t++;else if(e.charCodeAt(t)===bp||e.charCodeAt(t)===Mp)return!0;return!1}function Fg(e){for(var t=e.length,n=!0,r=t>0,i=0;i<t;i++){var a=e.charCodeAt(i);if(a===Z){if(n){r=!1;break}n=!0}else if(a<33||a>126||a>=pm&&a<=mm){r=!1;break}else n=!1}if(r&&!n)return e;var o=e.replace(/\s+/g,` `).trim();return o.indexOf(`ẞ`)===-1?o.toLowerCase():o.replace(/\u1E9E/g,`ss`).toLowerCase()}function Ig(e){return e<_m?Mg[e]:e===Up?Um:0}function Lg(e){return e.indexOf(`\\`)===-1?e:e.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,`$1`)}var Rg=null,zg=-1,Bg=-1,Vg=null,Hg=-1,Ug=-1;function Wg(e,t){if(t>=zg&&t<=Bg&&e===Rg)return Bg;var n=e.indexOf(`
|
|
21
|
+
`,t),r=n<0?e.length:n;return Rg=e,zg=t,Bg=r,r}function Gg(e,t){let n=Wg(e,t);return n<e.length?n+1:n}function Kg(e,t,n){for(;t<n;){let n=e.charCodeAt(t);if(n!==Z&&n!==hp)break;t++}return t}function qg(e,t){let n=Gg(e,t);if(n>=Hg&&n<=Ug&&e===Vg)return Ug;for(Vg=e,Hg=n;n<e.length&&!Qg(e,n,Wg(e,n));)n=Gg(e,n);return Ug=n<e.length?n:e.length,Ug}function Jg(e,t,n,r){let i=0;for(;t+i<n&&e.charCodeAt(t+i)===r;)i++;return i}var Yg=0,Xg=0;function Zg(e,t,n){for(Yg=0,Xg=0;t+Xg<n;){let n=e.charCodeAt(t+Xg);if(n===hp)Yg+=4-Yg%4;else if(n===Z)Yg++;else break;Xg++}}function Qg(e,t,n){return Kg(e,t,n)>=n}function $g(e,t,n){for(;t<n;){var r=e.charCodeAt(t);if(r!==_p&&r!==Z&&r!==hp)return!1;t++}return!0}function e_(e,t){if(!e)return e;var n=t.A||=Object.create(null),r=n[e];if(r===void 0)return n[e]=0,e;for(var i=r+1,a=`${e}-${i}`;n[a]!==void 0;)i++,a=`${e}-${i}`;return n[e]=i,n[a]=0,a}function t_(e,t,n,r){let i=Wg(e,t);if(Zg(e,t,i),Yg>3)return null;let a=t+Xg;if(e.charCodeAt(a)!==Cp)return null;let o=Jg(e,a,i,Cp);if(o<1||o>6||(a+=o,r.enforceAtxHeadings!==!1&&a<i&&e.charCodeAt(a)!==Z&&e.charCodeAt(a)!==hp))return null;a=Kg(e,a,i);for(var s=i;s>a&&e.charCodeAt(s-1)===Z;)s--;for(var c=s;s>a&&e.charCodeAt(s-1)===Cp;)s--;if(s<c){if(s===a||e.charCodeAt(s-1)===Z)for(;s>a&&e.charCodeAt(s-1)===Z;)s--;else s=c}let l=U_(e.slice(a,s),!1,n,r);return{node:{type:Q.heading,level:o,children:l,id:``},end:Gg(e,i)}}function n_(e,t,n){var r=e.charCodeAt(t);if(r!==Ep&&r!==Tp)return!1;for(var i=t;i<n&&e.charCodeAt(i)===r;)i++;for(;i<n&&(e.charCodeAt(i)===Z||e.charCodeAt(i)===hp);)i++;return i>=n}function r_(e,t){let n=Wg(e,t);if(Zg(e,t,n),Yg>3)return null;let r=t+Xg,i=e.charCodeAt(r);if(i!==Tp&&i!==Op&&i!==kp)return null;let a=0;for(;r<n;){let t=e.charCodeAt(r);if(t===i)a++;else if(t!==Z&&t!==hp)return null;r++}return a<3?null:{node:{type:Q.breakThematic},end:Gg(e,n)}}var i_=0,a_=0,o_=``;function s_(e,t,n){let r=Wg(e,t);if(Zg(e,t,r),Yg>3)return null;let i=Yg,a=t+Xg,o=e.charCodeAt(a);if(o!==vp&&o!==yp)return null;let s=Jg(e,a,r,o);if(s<3)return null;a+=s;let c=Kg(e,a,r),l=r;if(o===vp){for(let t=c;t<r;t++)if(e.charCodeAt(t)===vp)return null}for(;l>c&&(e.charCodeAt(l-1)===Z||e.charCodeAt(l-1)===hp);)l--;let u=e.slice(c,l),d=``,f=``,p=u.indexOf(` `);p===-1?d=u:(d=u.slice(0,p),f=u.slice(p+1).trim()),d=Lg(d);var m;if(f){eg.lastIndex=0;for(var h;(h=eg.exec(f))!=null;){var g=h[2]===void 0?h[3]:h[2];pg(h[1],g,!1)||(m||={},m[h[1]]=g)}}let _=Gg(e,r),{length:v,length:y}=e;var b;o===i_&&s===a_?b=o_:(b=String.fromCharCode(o).repeat(s),i_=o,a_=s,o_=b);for(var x=_;x<e.length;){var S=e.indexOf(b,x);if(S===-1)break;for(var C=S,w=0;C>0&&w<4&&e.charCodeAt(C-1)===Z;)C--,w++;if(w<=3&&(C===0||e.charCodeAt(C-1)===_p)){for(var T=S+s;T<e.length&&e.charCodeAt(T)===o;)T++;var E=Wg(e,T);if(Qg(e,T,E)){v=C,y=Gg(e,E);break}}x=S+1}var D;if(i===0)D=v>_&&e.charCodeAt(v-1)===_p?e.slice(_,v-1):e.slice(_,v);else{D=``;for(var O=_;O<v;){var k=Wg(e,O);Zg(e,O,k);var A=Math.min(Xg,i);D+=`${e.slice(O+A,k)}
|
|
22
|
+
`,O=Gg(e,k)}D.length>0&&D.charCodeAt(D.length-1)===_p&&(D=D.slice(0,-1))}return n.inList&&(D=Kh(D)),{node:{type:Q.codeBlock,lang:d||void 0,text:D,infoString:f||void 0,attrs:m},end:y}}function c_(e,t,n){for(var r=0,i=t;i<n&&r<4;)e.charCodeAt(i)===hp?r+=4-r%4:r++,i++;if(r<4)return``;for(var a=``,o=4;o<r;o++)a+=` `;return a+e.slice(i,n)}function l_(e,t){if(Zg(e,t,Wg(e,t)),Yg<4)return null;let n=``,r=t;for(;r<e.length;){let t=Wg(e,r);if(Zg(e,r,t),Qg(e,r,t)){for(var i=`${c_(e,r,t)}
|
|
23
|
+
`,a=Gg(e,t);a<e.length;){var o=Wg(e,a);if(Qg(e,a,o))i+=`${c_(e,a,o)}
|
|
24
|
+
`,a=Gg(e,o);else{Zg(e,a,o),Yg>=4&&(n+=i,r=a);break}}if(r!==a)break;continue}if(Yg<4)break;let d=0,f=0;var s=0;for(let n=r;n<t&&f<4;n++){if(e.charCodeAt(n)===hp){var c=4-f%4;f+c>4&&(s=f+c-4),f+=c}else f++;d++}var l=``;if(s>0)for(var u=0;u<s;u++)l+=` `;l+=e.slice(r+d,t),n+=`${l}
|
|
25
|
+
`,r=Gg(e,t)}for(;n.length>0&&n.charCodeAt(n.length-1)===_p;)n=n.slice(0,-1);return n?{node:{type:Q.codeBlock,lang:void 0,text:n,infoString:void 0,attrs:void 0},end:r}:null}function u_(e,t,n,r){if(Zg(e,t,Wg(e,t)),Yg>3)return null;let i=t+Xg;if(e.charCodeAt(i)!==Sp)return null;let a=``,o=t,s,c=!1,l=!1,u=!1;for(;o<e.length;){let t=Wg(e,o);Zg(e,o,t);let n=o+Xg;if(e.charCodeAt(n)===Sp){let r=n+1;var d=Yg+1,f=!1;if(r<t){var p=e.charCodeAt(r);p===Z?(r++,d++,f=!0):p===hp&&(f=!0)}for(var m=``,h=!1,g=r;g<t;g++)if(e.charCodeAt(g)===hp){h=!0;break}if(h){var _=d;if(f&&r<t&&e.charCodeAt(r)===hp){for(var v=4-_%4,y=0;y<v-1;y++)m+=` `;_+=v,r++}for(var b=r;b<t;b++)if(e.charCodeAt(b)===hp){for(var x=4-_%4,S=0;S<x;S++)m+=` `;_+=x}else m+=e[b],_++}else m=e.slice(r,t);if(!(a||s)){let n=m.match(/^\[!([A-Za-z]+)\]\s*$/);if(n){s=n[1].toUpperCase(),o=Gg(e,t);continue}}a+=`${m}
|
|
26
|
+
`;var C=m.trimStart();C.startsWith("```")||C.startsWith(`~~~`)?u=!u:(m.startsWith(` `)||m.startsWith(` `))&&(u=!0),l=C.length>0,o=Gg(e,t)}else if(a&&!Qg(e,o,t)&&l){if(Yg<4){var w=o+Xg,T=w<t?e.charCodeAt(w):0;if(T===Cp||T===Sp||T===vp||T===yp||T===Ap||(T===Tp||T===Op||T===kp)&&r_(e,o)||(T===Tp||T===Op||T===Qp)&&w+1<t&&(e.charCodeAt(w+1)===Z||e.charCodeAt(w+1)===hp))break;if(T>=dm&&T<=fm){for(var E=w;E<t&&e.charCodeAt(E)>=dm&&e.charCodeAt(E)<=fm;)E++;if(E<t&&(e.charCodeAt(E)===Jp||e.charCodeAt(E)===rm))break}}if(u)break;a+=`${e.slice(o,t)}
|
|
27
|
+
`,c=!0,o=Gg(e,t)}else break}if(!(a||s))return null;var{inBlockQuote:D,m:O}=n;n.inBlockQuote=!0,c&&(n.m=!0);var k=n.f;n.f=k||!$g(e,o,e.length);let A=Nv(a||``,n,r);return n.f=k,n.inBlockQuote=D,n.m=O,{node:{type:Q.blockQuote,children:A,alert:s||void 0},end:o}}function d_(e,t,n){for(var r=0,i=t;i<n;i++)e.charCodeAt(i)===hp?r+=4-r%4:r++;return r}function f_(e,t,n){if(Zg(e,t,n),Yg>3)return null;var r=t+Xg;if(r>=n)return null;var i=e.charCodeAt(r),a=Yg,o=r,s=r;if(i===Tp||i===Op||i===Qp){if(o=r+1,o<n&&e.charCodeAt(o)!==Z&&e.charCodeAt(o)!==hp&&e.charCodeAt(o)!==_p)return null}else if(i>=dm&&i<=fm){for(;s<n&&s-r<9;){var c=e.charCodeAt(s);if(c<dm||c>fm)break;s++}if(s>r&&s<n){var l=e.charCodeAt(s);if(l===Jp||l===rm){if(o=s+1,o<n&&e.charCodeAt(o)!==Z&&e.charCodeAt(o)!==hp&&e.charCodeAt(o)!==_p)return null}else return null}else return null}else return null;var u=o,d=d_(e,t,o),f=0,p=u,m=d;if(u>=n)return{ordered:i>=dm&&i<=fm,marker:i>=dm&&i<=fm?e[s]:e[r],start:i>=dm&&i<=fm?Number.parseInt(e.slice(r,s),10):void 0,contentStart:u,contentCol:d+1,markerCol:a,isEmpty:!0};for(;p<n&&(e.charCodeAt(p)===Z||e.charCodeAt(p)===hp);){if(e.charCodeAt(p)===hp){var h=4-m%4;m+=h}else m++;p++,f++}var g=p>=n,_=m-d;return g||_>4?(m=d+1,p=u+1,f=1):f===0&&(m=d+1,p=u,f=1),{ordered:i>=dm&&i<=fm,marker:i>=dm&&i<=fm?e[s]:e[r],start:i>=dm&&i<=fm?Number.parseInt(e.slice(r,s),10):void 0,contentStart:p,contentCol:m,markerCol:a,isEmpty:g}}var p_=0;function m_(e,t,n,r){var i=0,a=t;for(p_=0;a<n&&i<r;){var o=e.charCodeAt(a);if(o===hp){var s=4-i%4;if(i+s>r){p_=i+s-r,a++,i=r;break}i+=s}else if(o===Z)i++;else break;a++}return a}function h_(e,t,n,r){var i=Wg(e,t),a=f_(e,t,i);if(!a)return null;var o=[],s=t,c=a.contentCol,l=``,u=a.isEmpty,d=!1,f=!1;if(!a.isEmpty){for(var p=!1,m=a.contentStart;m<i;m++)if(e.charCodeAt(m)===hp){p=!0;break}if(p){var h=``,g=d_(e,t,a.contentStart),_=g-a.contentCol;if(_>0)for(var v=0;v<_;v++)h+=` `;for(var y=a.contentStart;y<i;y++)if(e.charCodeAt(y)===hp){for(var b=4-g%4,x=0;x<b;x++)h+=` `;g+=b}else h+=e[y],g++;l=`${h}
|
|
28
|
+
`}else l=`${e.slice(a.contentStart,i)}
|
|
29
|
+
`}for(s=Gg(e,i);s<e.length;){var S=Wg(e,s);Zg(e,s,S);var C=e.charCodeAt(s+Xg);if(Yg<c&&(C===Tp||C===Op||C===kp)&&Yg<=3&&r_(e,s))break;var w=f_(e,s,S);if(w&&w.ordered===a.ordered&&w.marker===a.marker&&w.markerCol<c)o.push({contentCol:c,raw:l,hasBlankAfter:d,isEmpty:u}),d&&(f=!0),c=w.contentCol,u=w.isEmpty,d=!1,l=w.isEmpty?``:`${e.slice(w.contentStart,S)}
|
|
30
|
+
`,s=Gg(e,S);else if(Qg(e,s,S)){var T=m_(e,s,S,c);if(p_>0||T<S){for(var E=``,D=0;D<p_;D++)E+=` `;l+=`${E+e.slice(T,S)}
|
|
31
|
+
`}else l+=`
|
|
32
|
+
`;s=Gg(e,S);for(var O=!1,k=0;k<l.length;k++){var A=l.charCodeAt(k);if(A!==_p&&A!==gp&&A!==Z&&A!==hp){O=!0;break}}if(u&&!O){if(s<e.length){var j=Wg(e,s),M=f_(e,s,j);if(!M||M.ordered!==a.ordered||M.marker!==a.marker)break;d=!0}else break}if(s<e.length){var N=Wg(e,s);Zg(e,s,N);var P=e.charCodeAt(s+Xg);if((P===Tp||P===Op||P===kp)&&Yg<=3&&r_(e,s))break;var F=f_(e,s,N);if(F&&F.ordered===a.ordered&&F.marker===a.marker&&F.markerCol<c){d=!0;continue}if(!Qg(e,s,N)&&Yg<c)break}}else if(Yg>=c){var I=m_(e,s,S,c);if(p_>0){for(var L=``,R=c,z=0;z<p_;z++)L+=` `,R++;for(var B=I;B<S;B++)if(e.charCodeAt(B)===hp){for(var V=4-R%4,ee=0;ee<V;ee++)L+=` `;R+=V}else L+=e[B],R++;l+=`${L}
|
|
33
|
+
`}else l+=`${e.slice(I,S)}
|
|
34
|
+
`;s=Gg(e,S)}else{for(var H=!1,te=0;te<l.length;te++){var ne=l.charCodeAt(te);if(ne!==_p&&ne!==gp&&ne!==Z&&ne!==hp){H=!0;break}}if(!d&&H&&!u){var re=s+Xg,U=e.charCodeAt(re);if(!(U===Cp||U===Sp||U===Ap||U===vp||U===yp||(U===Tp||U===Op||U===kp||U===Qp)&&(r_(e,s)!=null||f_(e,s,S)!=null)||U>=dm&&U<=fm&&f_(e,s,S)!=null)){l+=`${e.slice(re,S)}
|
|
35
|
+
`,s=Gg(e,S);continue}}break}}if(o.push({contentCol:c,raw:l,hasBlankAfter:d,isEmpty:u}),o.length===0)return null;var ie=f;if(!ie)for(var ae=0;ae<o.length;ae++){if(o[ae].hasBlankAfter&&ae<o.length-1){ie=!0;break}if(!o[ae].isEmpty){for(var oe=o[ae].raw,W=oe.length,G=0,K=!1,se=!1,q=!1,ce=!1,le=0,ue=0,de=-1;G<W;){var fe=oe.indexOf(`
|
|
36
|
+
`,G);if(fe<0&&(fe=W),ce){Zg(oe,G,fe);for(var pe=oe.slice(G+Xg,fe),me=0;me<pe.length&&pe.charCodeAt(me)===le;)me++;me>=ue&&pe.slice(me).trim()===``&&(ce=!1),G=fe<W?fe+1:W}else if(Qg(oe,G,fe))de>=0?q=!0:K&&(se=!0),G=fe<W?fe+1:W;else{if(Zg(oe,G,fe),de>=0){if(Yg>=de){G=fe<W?fe+1:W;continue}var he=f_(oe,G,fe);if(he&&he.markerCol<de&&he.contentCol<=de||he){G=fe<W?fe+1:W;continue}de=-1,q&&=(se=!0,!1)}var ge=oe.slice(G+Xg,fe),_e=ge.charCodeAt(0);if((_e===vp||_e===yp)&&Yg<=3){for(var ve=0;ve<ge.length&&ge.charCodeAt(ve)===_e;)ve++;if(ve>=3){if(se&&K){ie=!0;break}ce=!0,le=_e,ue=ve,K=!0,G=fe<W?fe+1:W;continue}}var ye=Yg<=3?f_(oe,G,fe):null;if(ye&&K){if(se){ie=!0;break}de=ye.contentCol,q=!1,G=fe<W?fe+1:W,K=!0}else{if(se){ie=!0;break}K=!0,G=fe<W?fe+1:W}}}if(ie)break}}for(var be=[],xe=0;xe<o.length;xe++){for(var Se=o[xe],Ce=Se.raw,we=Ce.length;we>0&&Ce.charCodeAt(we-1)===_p;)we--;var Te=we<Ce.length?Ce.slice(0,we):Ce,Ee=null;if(Te.length>=3&&Te.charCodeAt(0)===bp){var De=Te[1];(De===` `||De===`x`||De===`X`)&&Te.charCodeAt(2)===Mp&&(Ee={type:Q.gfmTask,completed:De===`x`||De===`X`},Te=Te.slice(3))}var Oe;if(Se.isEmpty&&Te.trim()===``)Oe=[];else if(ie){var ke=n.inList;n.inList=!0;var Ae=n.f;n.f=Ae||xe!==o.length-1,Oe=Nv(Te,n,r),n.f=Ae,n.inList=ke}else{var je=n.inList;n.inList=!0;var Me=n.f;if(n.f=Me||xe!==o.length-1,Oe=Nv(Te,n,r),n.f=Me,n.inList=je,Oe.length===1&&Oe[0].type===Q.paragraph)Oe=Oe[0].children;else if(n.r){var Ne=[];n.r.push({src:Oe,dest:Ne,unwrap:!0}),Oe=Ne}else{for(var Pe=[],Fe=0;Fe<Oe.length;Fe++)if(Oe[Fe].type===Q.paragraph)for(var Ie=Oe[Fe].children,Le=0;Le<Ie.length;Le++)Pe.push(Ie[Le]);else Pe.push(Oe[Fe]);Oe=Pe}}if(Ee){var Re=[Ee,{type:Q.text,text:` `}];if(n.r)n.r.push({src:Oe,dest:Re,unwrap:!1});else for(var ze=0;ze<Oe.length;ze++)Re.push(Oe[ze]);be.push(Re)}else be.push(Oe)}return{node:{type:a.ordered?Q.orderedList:Q.unorderedList,start:a.ordered?a.start:void 0,items:be},end:s}}var g_=new Set(`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(`.`));function __(e,t,n){let r={};var i=t.charCodeAt(0),a=i>=pm&&i<=mm&&!!Eh(n.overrides,t,void 0);for(let[i,c]of Object.entries(e)){let e=i.toLowerCase();if(e===`style`&&typeof c==`string`){let e={},t=[],n=0,a=0;for(let e=0;e<c.length;e++){let r=c.charCodeAt(e);r===nm?n++:r===rm?n--:r===Kp&&n===0&&(t.push(c.slice(a,e)),a=e+1)}a<c.length&&t.push(c.slice(a));let o=!1;t.forEach(t=>{let n=t.indexOf(`:`);if(n===-1)return;let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();if(r&&i){if(/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(i)){o=!0;return}let t=r.indexOf(`-`)===-1?r:r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());e[t]=i}}),!o&&Object.keys(e).length>0&&(r[i]=e)}else if((e===`href`||e===`src`)&&n?.sanitizer){let a=n.sanitizer(c,t,e);a!=null&&(r[i]=a)}else if(c===``)r[i]=!0;else if(a&&c.length>=2&&c.charCodeAt(0)===em&&c.charCodeAt(c.length-1)===tm){var o=c.slice(1,-1);if(o.length>0){var s=o.charCodeAt(0);if(s===bp||s===em)try{r[i]=JSON.parse(o);continue}catch{}}if(o===`true`){r[i]=!0;continue}if(o===`false`){r[i]=!1;continue}if(n?.evalUnserializableExpressions)try{r[i]=(0,eval)(`(${o})`);continue}catch{}r[i]=o}else r[i]=c}return r}function v_(e,t,n,r){let i=t.length;for(var a=t.charAt(0),o=r-i,s=n;s<=o;){var c=e.indexOf(a,s);if(c===-1||c>o)return-1;for(var l=!0,u=1;u<i;u++){var d=e.charCodeAt(c+u),f=t.charCodeAt(u);if(d>=pm&&d<=mm&&(d+=vm),f>=pm&&f<=mm&&(f+=vm),d!==f){l=!1;break}}if(l)return c;s=c+1}return-1}function y_(e,t,n){for(var r=0;r<n.length;r++){var i=e.charCodeAt(t+r);if(i>=pm&&i<=mm&&(i+=vm),i!==n.charCodeAt(r))return!1}return!0}function b_(e,t,n){for(var r=t.charAt(0),i=Math.min(n,e.length-t.length),a=i<0?-1:e.lastIndexOf(r,i);a!==-1&&!y_(e,a,t);)a=a===0?-1:e.lastIndexOf(r,a-1);return a}var x_=null,S_=Object.create(null),C_=null,w_=0;function T_(){x_=null,S_=Object.create(null),C_=null,w_=0}function E_(e){return e===Sp||e===Z||e===hp||e===_p}function D_(e){for(var t=Object.create(null),n=e.indexOf(`</`);n!==-1;){for(var r=n+2,i=e.charCodeAt(r);r<e.length&&i!==Yp&&!E_(i);)i=e.charCodeAt(++r);(r===e.length||i!==Yp)&&(t[e.slice(n+2,r).toLowerCase()]=n),n=e.indexOf(`</`,r-1)}return t}var O_=-1;function k_(e,t,n,r){let i=n.toLowerCase(),a=`<${i}`,o=`</${i}`,s=1,c=t;if(O_=-1,x_===e){if(C_!==null){var l=C_[i];if(l===void 0||l<t)return-1}var u=S_[i];if(u!==void 0){if(t>=u.noCloseFrom&&r<=u.noCloseEnd)return-1;if(r===u.failEnd){var d=u.failStarts,f=A_(d,t);if(f<d.length&&d[f]===t)return-1}}}for(var p=null,m=-1,h=-2,g=-2;c<r&&s>0;){if(h!==-1&&h<c&&(h=v_(e,a,c,r)),g<c&&(g=v_(e,o,c,r)),g===-1){m=c;break}if(h!==-1&&h<g){let t=Tg(e,h);t?(t.tag.toLowerCase()===i&&!t.g&&!t.n&&!Hm(t.tag)&&(s++,p===null&&(p=[]),p.push(t.end)),c=t.end):c=h+1}else{var _=g+o.length;if(E_(_<e.length?e.charCodeAt(_):Sp)){if(s--,s===0){O_=g;let t=g+o.length;for(;t<e.length&&e.charCodeAt(t)!==Sp;)t++;return t+1}p===null&&(p=[]),p.push(-1)}c=g+1}}x_!==e&&(T_(),x_=e),w_+=r-t,C_===null&&w_>=e.length&&(C_=D_(e));var v=S_[i];v===void 0&&(v=S_[i]={failEnd:-1,failStarts:[],noCloseEnd:-1,noCloseFrom:-1}),m!==-1&&(v.noCloseFrom=m,v.noCloseEnd=r);var y=v.failStarts;if(v.failEnd!==r&&(y.length=0,v.failEnd=r),y.length=A_(y,t),p===null)return-1;for(var b=s,x=s,S=p.length-1;S>=0;S--){var C=p[S]!==-1;b<x&&(p[S]=-1),x<b&&(b=x),x+=C?-1:1}for(S=0;S<p.length;S++)p[S]!==-1&&y.push(p[S]);return-1}function A_(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>1;e[i]<t?n=i+1:r=i}return n}var j_=null,M_=null;function N_(e,t,n,r,i){if(e!==null&&e.s===t&&n>=e.from&&n<=e.at)return e;for(var a=t.indexOf(r,n);a!==-1;){if(i.lastIndex=a,i.test(t))return{at:a,from:n,s:t};a=t.indexOf(r,a+1)}return{at:t.length,from:n,s:t}}function P_(e,t,n){for(var r=0,i=t,a=e.charCodeAt(i);a===_p||a===Z||a===hp;)a===_p&&r++,a=e.charCodeAt(++i);if(r<2||a!==Ap)return!1;if(e.slice(i,i+n.length).toLowerCase()!==n)return!0;var o=i+n.length;return!E_(o<e.length?e.charCodeAt(o):Sp)}function F_(e,t){var n=Tg(e,t);if(n===null)return!1;var r=n.tag.charCodeAt(0);return r>=pm&&r<=mm||n.tag.includes(`-`)}function I_(e,t,n,r){if(r.ignoreHTMLBlocks||r.disableParsingRawHTML)return null;var i=Wg(e,t);if(Zg(e,t,i),Yg>3&&!n.inHTML)return null;var a=t+Xg;if(e.charCodeAt(a)!==Ap)return null;var o=e.indexOf(`>`,a+1);if(o!==-1&&o<i){var s=e.slice(a+1,o);if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(s)||/^[^\s@]+@[^\s@]+$/.test(s))return null}var c=L_(e,a);if(c>=1&&c<=5){var l=e.length;if(c===1){M_=N_(M_,e,a,`</`,Wh);var u=M_.at;u<e.length&&(l=Gg(e,e.indexOf(`>`,u)+1))}else{var d=c===2?`-->`:c===3?`?>`:c===4?`>`:`]]>`,f=e.indexOf(d,a);f>=0&&(l=Gg(e,f+d.length))}var p=e.slice(a,l);if(c>=2)return{node:{type:Q.htmlComment,text:Dg(p),t:!1,raw:!0},end:l};var m=`div`,h=p.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);h&&(m=h[1]);var g=Tg(e,a),_={},v;g&&!g.g&&(_=__(g.attrs,m,r),v=g.i+g.a);var y=[],b=v_(p,`</${m.toLowerCase()}`,0,p.length),x=``,S,C,w;if(g?.g){w=Cv(e,a,g.end,m);for(var T=p.slice(g.end-a);T.length>0&&T.charCodeAt(T.length-1)===_p;)T=T.slice(0,-1);T&&(C=Dg(T))}else if(g&&!g.g){var E=g.end-a;if(b===-1){for(var D=p;D.length>0&&D.charCodeAt(D.length-1)===_p;)D=D.slice(0,-1);S=Dg(D);var O=E;p.charCodeAt(O)===_p&&(O+=1),x=D.slice(O)}else{var k=E;p.charCodeAt(k)===_p&&k++;for(var A=b;A>k;){var j=p.charCodeAt(A-1);if(j!==Z&&j!==hp&&j!==_p&&j!==gp)break;A--}var M=p.slice(k,A);M&&(C=Dg(M));for(var N=p.slice(b);N.length>0&&N.charCodeAt(N.length-1)===_p;)N=N.slice(0,-1);w=Dg(N),x=p.slice(E,b).trim()}}var P=g?g.g:!1;return{node:{type:Q.htmlBlock,tag:m,attrs:_,a:v,children:y,e:C,j:w,k:S,h:void 0,text:x&&Dg(x),c:!0,b:P},end:l}}if(c===6||c===7){var F=qg(e,t),I=F<e.length?F:e.length,L=e.slice(a,I),R=F<e.length?Gg(e,F):e.length,z=Tg(e,a);if(z){var B=z.tag,V=B.toLowerCase();if(z.g){var ee=e.slice(z.end,I),H={keepingChildren:void 0},te=ee?Dg(ee,void 0,H):void 0;return{node:{type:Q.htmlBlock,tag:B,attrs:{},children:[],j:Cv(e,a,z.end,B),e:te,h:H.keepingChildren,text:te||``,c:!0,b:!0},end:R}}if(z.n||Hm(B))return{node:{type:Q.htmlBlock,tag:B,attrs:__(z.attrs,B,r),a:z.i+z.a,children:[],h:void 0,text:``,c:!1,b:!1},end:z.end<e.length&&e.charCodeAt(z.end)===_p?z.end+1:z.end};var ne=n.d||0,re=e.slice(a,I),U=-1,ie=-1,ae=!1;if(ne<10){for(var oe=`</${V}`,W=z.end-a,G=1,K=W,se=-2,q=-2;K<re.length&&G>0&&(se!==-1&&se<K&&(se=v_(re,`<${V}`,K,re.length)),q<K&&(q=v_(re,oe,K,re.length)),q!==-1);)if(se!==-1&&se<q){var ce=se+V.length+1;if(ce<re.length){var le=re.charCodeAt(ce);(le===Z||le===hp||le===_p||le===Sp||le===Yp)&&G++}K=se+1}else{var ue=q+oe.length;if(ue<re.length){if(E_(re.charCodeAt(ue))&&(G--,G===0)){U=q;for(var de=ue;de<re.length&&re.charCodeAt(de)!==Sp;)de++;ie=de+1;break}}else if(G--,G===0){U=q,ie=re.length;break}K=q+1}if(U===-1&&!z.g&&(c===6||z.y)&&!P_(e,z.end,oe)){j_=N_(j_,e,z.end,`<`,Uh);var fe=k_(e,z.end,V,j_.at);if(fe!==-1){var pe=O_;if(pe>qg(e,z.end)){var me=Wg(e,fe);I=me,R=Gg(e,me),re=e.slice(a,I),L=e.slice(a,I),U=pe-a,ie=fe-a,ae=!0}}}}var he=z.a.indexOf(`
|
|
37
|
+
`)!==-1||z.i.indexOf(`
|
|
38
|
+
`)!==-1,ge=!1;U!==-1&&(ge=re.slice(ie).trim().length===0);var _e=!1,ve=I,ye=R;if(U!==-1){var be=a+ie,xe=Wg(e,be-1);if(be<xe){for(var Se=be;Se<xe&&(e.charCodeAt(Se)===Z||e.charCodeAt(Se)===hp);)Se++;if(Se<xe&&e.charCodeAt(Se)===Ap){var Ce=Tg(e,Se);Ce&&!Ce.g&&(_e=!0,ve=be,ye=be,ge=!0)}}if(!_e){var we=Gg(e,xe);if(we<I){for(var Te=we;Te<I&&(e.charCodeAt(Te)===Z||e.charCodeAt(Te)===hp);)Te++;Te<I&&e.charCodeAt(Te)===Ap&&Tg(e,Te)&&(_e=!0,ve=xe,ye=we,ge=!0)}}!_e&&n.inHTML&&(_e=!0,ve=xe,ye=Gg(e,xe),ge=e.slice(be,xe).trim().length===0)}var Ee=[],De=``;if(U!==-1){De=re.slice(z.end-a,U);var Oe=De.trim();if(Oe){var{inline:ke,inHTML:Ae,d:je}=n;if(n.inHTML=!0,n.d=ne+1,V===`p`)n.inline=!0,Ee=U_(Oe,!1,n,r);else{var Me=De.indexOf(`
|
|
39
|
+
|
|
40
|
+
`)!==-1,Ne=Zh(r).test(Oe),Pe=Qh.test(Oe),Fe=Me||Ne||n.inHTML&&Pe;De.length>=2&&De.charCodeAt(0)===_p&&De.charCodeAt(De.length-1)===_p&&!Me&&!Ne&&!Pe?Ee=[{type:Q.text,text:Oe}]:Fe||Pe?(n.inline=!1,Ee=Nv(De,n,r)):(n.inline=!0,Ee=U_(Oe,!1,n,r))}n.inline=ke,n.inHTML=Ae,n.d=je}}var Ie=!1;if(c===6&&U!==-1&&!n.inHTML&&!he){var Le=/<[a-zA-Z][^>]*>/.test(De),Re=De.indexOf(`
|
|
41
|
+
|
|
42
|
+
`)!==-1||Zh(r).test(De);Le&&!Re&&(Ie=!0)}if(!ae&&(n.inHTML||c===7||he||!ge||Ie)){var ze,Be,Ve=!1;if(U!==-1&&_e){var He=!1;if(n.inHTML&&ie<re.length){for(var Ue=ie;Ue<re.length&&re.charCodeAt(Ue)!==_p;)Ue++;var We=re.slice(ie,Ue).trim();He=We.length>1&&We.charCodeAt(0)===Ap&&We.charCodeAt(1)!==Yp}Be=He?re.slice(z.end-a):De,Ve=!0}else(c===7||n.inHTML)&&U!==-1?(Be=re.slice(z.end-a),Be.charCodeAt(0)===_p&&(Be=Be.slice(1))):_e?ze=e.slice(a,ve):he?ze=L:(Be=re.slice(z.end-a),Be.charCodeAt(0)===_p&&(Be=Be.slice(1)));var Ge=ze!==void 0,Ke=Be||``;ze!==void 0&&(Ke=ze);var qe={keepingChildren:void 0},Je=Dg(Ke,void 0,qe),Ye=De;U===-1&&(Ye=re.slice(z.end-a)),!(U!==-1&&_e)&&Ye.charCodeAt(0)===_p&&(Ye=Ye.slice(1));var Xe=Je;Ye!==Ke&&(Xe=Dg(Ye));var Ze={type:Q.htmlBlock,tag:B,attrs:__(z.attrs,B,r),a:z.i+z.a,children:Ee,e:Ge?void 0:Je,k:Ge?Je:void 0,h:qe.keepingChildren,text:Xe,c:!0,b:!1};return Ve&&(Ze.C=!0),{node:Ze,end:ye}}var Qe=Dg(De);return{node:{type:Q.htmlBlock,tag:B,attrs:__(z.attrs,B,r),a:z.i+z.a,children:Ee,e:ae?void 0:Qe,h:void 0,text:Qe,c:!1,b:!1},end:ye}}var $e=L.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/),et=$e?$e[2]:`div`,tt=$e?$e[1]===`/`:!1,nt,rt,it,at={keepingChildren:void 0},ot=``;if(tt){var st=L.indexOf(`>`);st===-1?nt=L:(nt=L.slice(0,st+1),ot=L.slice(st+1),ot&&(rt=Dg(ot,void 0,at)))}else it=Dg(L,void 0,at);return{node:{type:Q.htmlBlock,tag:et,attrs:{},children:[],e:rt,j:nt,k:it,h:at.keepingChildren,text:it||rt||``,c:!0,b:tt},end:R}}var ct=Tg(e,a);if(!ct)return null;var lt=ct.tag,ut=lt.toLowerCase(),dt=lt.charCodeAt(0),ft=dt>=pm&&dt<=mm;if(!(ft||g_.has(ut)||Vh.has(ut)||ut.includes(`-`)))return null;if(ct.g)return{node:{type:Q.htmlSelfClosing,tag:lt,attrs:{},j:Cv(e,a,ct.end,lt),b:!0},end:ct.end};var pt=k_(e,ct.end,lt,e.length),mt=[];if(pt!==-1){var ht=O_,gt=e.slice(ct.end,ht),_t=gt.trim();if(_t){var vt=gt.indexOf(`
|
|
43
|
+
|
|
44
|
+
`)!==-1,yt=Zh(r).test(_t),bt=Qh.test(_t),{inline:xt,inHTML:St,d:Ct}=n;n.inHTML=!0,n.d=(n.d||0)+1,vt||yt||bt?(n.inline=!1,mt=Nv(gt,n,r)):(n.inline=!0,mt=U_(_t,!1,n,r)),n.inline=xt,n.inHTML=St,n.d=Ct}var wt=Wg(e,pt),Tt=e.slice(pt,wt).trim()?pt:Gg(e,pt),Et=ft?e.slice(a,pt):e.slice(a,Tt),Dt={keepingChildren:void 0},Ot=Dg(Et,void 0,Dt);return{node:{type:Q.htmlBlock,tag:lt,attrs:__(ct.attrs,lt,r),a:ct.i+ct.a,children:mt,k:Ot,h:Dt.keepingChildren,text:Dg(gt),c:!0,b:!1},end:Tt}}var kt=qg(e,ct.end),At=kt<e.length?Gg(e,kt):kt,jt=e.slice(ct.end,kt);if(jt.trim()){var{inline:Mt,inHTML:Nt,d:Pt}=n;n.inline=!1,n.inHTML=!0,n.d=(n.d||0)+1,mt=Nv(jt,n,r),n.inline=Mt,n.inHTML=Nt,n.d=Pt}var Ft={keepingChildren:void 0},It=Dg(e.slice(ct.end,kt),void 0,Ft);return{node:{type:Q.htmlBlock,tag:lt,attrs:__(ct.attrs,lt,r),a:ct.i+ct.a,children:mt,e:It,h:Ft.keepingChildren,text:It,c:!0,b:!1},end:At}}function L_(e,t){if(e.charCodeAt(t)!==Ap)return 0;var n=t+1,r=e.length;if(e.charCodeAt(n)===Np&&e.charCodeAt(n+1)===Tp&&e.charCodeAt(n+2)===Tp)return 2;if(e.charCodeAt(n)===qp)return 3;if(e.charCodeAt(n)===Np){var i=e.charCodeAt(n+1);if(i>=pm&&i<=mm)return 4;if(e.slice(n+1,n+8)===`[CDATA[`)return 5}for(var a=e.charCodeAt(n)===Yp,o=a?n+1:n,s=o;s<r;){var c=e.charCodeAt(s);if(c>=pm&&c<=mm||c>=hm&&c<=gm||c>=dm&&c<=fm||c===Tp)s++;else break}if(s===o)return 0;var l=e.slice(o,s);if(Vh.has(l.toLowerCase())){if(a)return 0;var u=e.charCodeAt(s);return+(u===Z||u===hp||u===Sp||u===_p||s>=r)}if(g_.has(l.toLowerCase())){if(a){for(var d=s;d<r&&(e.charCodeAt(d)===Z||e.charCodeAt(d)===hp);)d++;return d<r&&e.charCodeAt(d)===Sp?6:0}var f=s<r?e.charCodeAt(s):-1;return f===Z||f===hp||f===Sp||f===_p||f===Yp||f===-1?6:0}if(a){for(var p=s;p<r&&(e.charCodeAt(p)===Z||e.charCodeAt(p)===hp);)p++;if(p<r&&e.charCodeAt(p)===Sp){var m=Wg(e,t);if(e.slice(p+1,m).trim()===``)return 7}}else{var h=Wg(e,t),g=Tg(e,t);if(g&&g.end<=h&&e.slice(g.end,h).trim()===``)return 7}return 0}function R_(e,t,n){for(var r=0,i=e.length;r<i&&(e.charCodeAt(r)===Z||e.charCodeAt(r)===hp||e.charCodeAt(r)===um);)r++;for(;i>r&&(e.charCodeAt(i-1)===Z||e.charCodeAt(i-1)===hp);)i--;r<i&&e.charCodeAt(r)===$p&&r++,i>r&&e.charCodeAt(i-1)===$p&&(i-2<r||e.charCodeAt(i-2)!==Dp)&&i--;for(var a=[],o=r,s=!1,c=[],l=r;l<i;){var u=e.charCodeAt(l);if(u===Dp&&l+1<i)e.charCodeAt(l+1)===$p?(s||(s=!0,c=[]),c.push(e.slice(o,l)),c.push(`|`),l+=2,o=l):l+=2;else if(u===vp){for(var d=0;l<i&&e.charCodeAt(l)===vp;)d++,l++;for(var f=!1;l<i&&!f;){for(var p=0;l<i&&e.charCodeAt(l)===vp;)p++,l++;p===d?f=!0:p===0&&l++}}else if(u===$p){var m=s?(c.push(e.slice(o,l)),c.join(``)):e.slice(o,l);a.push(m.trim()),l++,o=l,s=!1,c=[]}else l++}var h=s?(c.push(e.slice(o,i)),c.join(``)):e.slice(o,i);return a.push(h.trim()),a.map(e=>{var r=e.indexOf(`\\|`)===-1?e:e.replace(/\\[\s\S]/g,e=>e===`\\|`?`|`:e);return r?U_(r,!1,t,n):[]})}function z_(e,t,n,r){let i=Wg(e,t);var a=e.indexOf(`|`,t);if(a<0||a>=i)return null;let o=Gg(e,i);if(o>=e.length)return null;let s=Wg(e,o);if(!rg(e,o,s))return null;let c=e.slice(t,i),l=e.slice(o,s);for(var u=[],d=0,f=l.length;d<f&&(l.charCodeAt(d)===Z||l.charCodeAt(d)===hp);)d++;for(d<f&&l.charCodeAt(d)===$p&&d++;d<f;){for(;d<f&&(l.charCodeAt(d)===Z||l.charCodeAt(d)===hp);)d++;if(d>=f||l.charCodeAt(d)===$p)break;var p=l.charCodeAt(d)===Fp;for(p&&d++;d<f&&l.charCodeAt(d)===Tp;)d++;var m=d<f&&l.charCodeAt(d)===Fp;for(m&&d++,u.push(p&&m?`center`:m?`right`:p?`left`:null);d<f&&(l.charCodeAt(d)===Z||l.charCodeAt(d)===hp);)d++;d<f&&l.charCodeAt(d)===$p&&d++}let h=R_(c,n,r);if(u.length!==h.length)return null;let g=[],_=Gg(e,s);for(;_<e.length;){let t=Wg(e,_),i=e.slice(_,t);if(Qg(e,_,t))break;if(Zg(e,_,t),Yg<4){var v=e.charCodeAt(_+Xg);if(v===Sp||v===Cp||(v===Tp||v===Op||v===kp)&&r_(e,_))break;if(v===vp||v===yp){for(var y=_+Xg,b=0;y<t&&e.charCodeAt(y)===v;)b++,y++;if(b>=3)break}}g.push(R_(i,n,r)),_=Gg(e,t)}if(r.optimizeForStreaming&&g.length===0)return null;for(var x=h.length,S=0;S<g.length;S++)if(g[S].length<x)for(;g[S].length<x;)g[S].push([]);else g[S].length>x&&(g[S].length=x);return{node:{type:Q.table,header:h,cells:g,align:u},end:_}}function B_(e,t,n){if(Zg(e,t,Wg(e,t)),Yg>3)return null;var r=t+Xg;if(e.charCodeAt(r)!==bp)return null;if(r+1<e.length&&e.charCodeAt(r+1)===xp)return V_(e,r,n)||null;n.refs||=Object.create(null);var i=jg(e,r,n.refs);return i===null?null:{node:{type:Q.refCollection},end:i}}function V_(e,t,n){var r=e.length;if(e.charCodeAt(t)!==bp||t+1>=r||e.charCodeAt(t+1)!==xp)return null;for(var i=t+2,a=i;i<r&&e.charCodeAt(i)!==Mp;){if(e.charCodeAt(i)===_p)return null;i++}if(i>=r)return null;var o=`^${e.slice(a,i)}`.toLowerCase();if(i++,i>=r||e.charCodeAt(i)!==Fp)return null;for(i++;i<r&&(e.charCodeAt(i)===Z||e.charCodeAt(i)===hp);)i++;if(i<r&&e.charCodeAt(i)===_p){for(i++;e.charCodeAt(i)===um;)i++;for(;i<r&&(e.charCodeAt(i)===Z||e.charCodeAt(i)===hp);)i++}var s=e.indexOf(`
|
|
45
|
+
`,i);s<0&&(s=r);for(var c=e.slice(i,s).trim(),l=s<r?s+1:r;l<r;){var u=Wg(e,l);if(Zg(e,l,u),Yg>=2&&!Qg(e,l,u))c+=`
|
|
46
|
+
${e.slice(l,u)}`,l=Gg(e,u);else if(Qg(e,l,u)){var d=Gg(e,u);if(d<r&&(Zg(e,d,Wg(e,d)),Yg>=2)){c+=`
|
|
47
|
+
`,l=Gg(e,u);continue}break}else break}var f=n.refs;return f&&!f[o]&&(f[o]={target:c,title:void 0}),{node:{type:Q.footnote},end:l}}function H_(e,t,n,r){let i=t,a=0,o=0,s=-1;for(;i<e.length;){let t=s>=0?s:Wg(e,i);if(s=-1,Qg(e,i,t))break;if(Zg(e,i,t),Yg<4&&o>0&&!n.m){let n=e.charCodeAt(i+Xg);if(n===Ep||n===Tp){let r=i+Xg;for(;r<t&&e.charCodeAt(r)===n;)r++;for(;r<t&&(e.charCodeAt(r)===Z||e.charCodeAt(r)===hp);)r++;if(r>=t){a=n===Ep?1:2,i=Gg(e,t);break}}}o=t;let x=Gg(e,t);if(x<e.length){if(e.charCodeAt(x)===um){var c=Wg(e,x);i=Gg(e,c),o=c;continue}let t=Wg(e,x);if(s=t,Zg(e,x,t),Yg<4){let a=e.charCodeAt(x+Xg);if(a===Sp){i=x;break}if(a===Cp){for(var l=x+Xg,u=0;l<t&&e.charCodeAt(l)===Cp&&u<=6;)u++,l++;if(u>=1&&u<=6&&(r.enforceAtxHeadings===!1||l>=t||e.charCodeAt(l)===Z||e.charCodeAt(l)===hp)){i=x;break}}if(a===vp||a===yp){for(var d=x+Xg,f=0;d<t&&e.charCodeAt(d)===a;)f++,d++;if(f>=3){i=x;break}}if(a===Ap){var p=x+Xg+1,m=p<t?e.charCodeAt(p):0,h=m===Np||m===qp;if(!h&&m===Yp){for(var g=p+1,_=g;_<t&&(e.charCodeAt(_)>=pm&&e.charCodeAt(_)<=mm||e.charCodeAt(_)>=hm&&e.charCodeAt(_)<=gm||e.charCodeAt(_)>=dm&&e.charCodeAt(_)<=fm||e.charCodeAt(_)===Tp);)_++;_>g&&(h=g_.has(e.slice(g,_).toLowerCase()))}else if(!h){for(var v=p;v<t&&(e.charCodeAt(v)>=pm&&e.charCodeAt(v)<=mm||e.charCodeAt(v)>=hm&&e.charCodeAt(v)<=gm||e.charCodeAt(v)>=dm&&e.charCodeAt(v)<=fm||e.charCodeAt(v)===Tp);)v++;if(v>p){var y=e.slice(p,v).toLowerCase();h=g_.has(y)||Vh.has(y)}}if(h&&I_(e,x,n,r)){i=x;break}}if(a===Tp||a===Op||a===Qp){let n=x+Xg+1;if(n<t&&(e.charCodeAt(n)===Z||e.charCodeAt(n)===hp)&&Kg(e,n,t)<t&&!r_(e,x)){i=x;break}}if(a>=dm&&a<=fm){let n=x+Xg;for(;n<t&&e.charCodeAt(n)>=dm&&e.charCodeAt(n)<=fm;)n++;if(n<t&&(e.charCodeAt(n)===Jp||e.charCodeAt(n)===rm)&&n-(x+Xg)===1&&e.charCodeAt(x+Xg)===49){var b=n+1;if(b<t&&(e.charCodeAt(b)===Z||e.charCodeAt(b)===hp)&&Kg(e,b,t)<t){i=x;break}}}if(a===$p){let n=Gg(e,t);if(n<e.length&&rg(e,n,Wg(e,n))){i=x;break}}if((a===Tp||a===Op||a===kp)&&r_(e,x)){if(a!==Tp){i=x;break}let n=0,r=x+Xg;for(;r<t&&e.charCodeAt(r)===Tp;)n++,r++;for(;r<t&&(e.charCodeAt(r)===Z||e.charCodeAt(r)===hp);)r++;if(r<t){i=x;break}}}}i=Gg(e,t)}for(var x=a?o:i;x>t&&(e.charCodeAt(x-1)===_p||e.charCodeAt(x-1)===gp||e.charCodeAt(x-1)===Z||e.charCodeAt(x-1)===hp);)x--;for(var S=t;S<x&&(e.charCodeAt(S)===Z||e.charCodeAt(S)===hp);)S++;if(S>=x)return null;for(var C=!1,w=S;w<x;w++)if(e.charCodeAt(w)===um){C=!0;break}var T=C?e.slice(S,x).replace(/\u001E/g,``):e.slice(S,x);if(!T)return null;let E=U_(T,!0,n,r);return a?{node:{type:Q.heading,level:a,children:E,id:``},end:i}:{node:{type:Q.paragraph,children:E},end:i}}function U_(e,t,n,r){var i=n.o;if(!i){var a=n.l;n.l=t;var o=jv(e,0,e.length,n,r);return n.l=a,o}var s=[];return i.push({dest:s,text:e,breaks:t,inline:n.inline,inAnchor:n.inAnchor,inHTML:n.inHTML,htmlDepth:n.d,inList:n.inList,inBlockQuote:n.inBlockQuote,noSetext:n.m,depth:n.p,notAtEdge:n.f}),s}function W_(e,t,n){if(e.charCodeAt(t)!==vp)return null;let r=Jg(e,t,n,96),i=t+r;for(;i<n;){let a=e.indexOf("`",i);if(a<0||a>=n)return null;let o=Jg(e,a,n,96);if(o===r){let n=e.slice(t+r,a);return n.indexOf(`
|
|
48
|
+
`)!==-1&&(n=n.replace(/\n/g,` `)),n.length>0&&n[0]===` `&&n.at(-1)===` `&&n.trim().length>0&&(n=n.slice(1,-1)),{node:{type:Q.codeInline,text:n},end:a+o}}i=a+o}return null}function G_(e,t,n){if(e.charCodeAt(t)!==vp)return t;let r=Jg(e,t,n,96),i=t+r;for(;i<n;){let a=e.indexOf("`",i);if(a<0||a>=n)return t;let o=Jg(e,a,n,96);if(o===r)return a+o;i=a+o}return t}var K_=1048576,q_=K_;function J_(e,t,n){if(e.charCodeAt(t)!==Ap||q_<=0)return t;if(t+1<n&&e.charCodeAt(t+1)===Yp){let r=t+2;for(;r<n&&e.charCodeAt(r)!==Sp;)r++;return r<n?r+1:(q_-=r-t,t)}if(t+3<n&&e.charCodeAt(t+1)===Np&&e.charCodeAt(t+2)===Tp&&e.charCodeAt(t+3)===Tp){let n=Ev(e,`-->`,t+4);return n<0?t:n+3}let r=t+1,i=r;for(;r<n;){let t=e.charCodeAt(r);if(t>=pm&&t<=mm||t>=hm&&t<=gm||t>=dm&&t<=fm||t===Tp)r++;else break}if(r===i)return t;let a=e.slice(i,r).toLowerCase(),o=!1;for(;r<n;){let i=e.charCodeAt(r);if(i===Sp){r++;break}if(i===Yp&&r+1<n&&e.charCodeAt(r+1)===Sp){r+=2,o=!0;break}if(i===Zp||i===Xp){var s=i;for(r++;r<n&&e.charCodeAt(r)!==s;)r++;r<n&&r++}else{if(i===_p)return q_-=r-t,t;r++}}if(o||Hm(a))return r;let c=1;for(;r<n&&c>0;)if(e.charCodeAt(r)===Ap){if(r+1<n&&e.charCodeAt(r+1)===Yp){let t=r+2,i=t;for(;i<n&&(e.charCodeAt(i)>=pm&&e.charCodeAt(i)<=mm||e.charCodeAt(i)>=hm&&e.charCodeAt(i)<=gm);)i++;if(e.slice(t,i).toLowerCase()===a){for(;i<n&&e.charCodeAt(i)!==Sp;)i++;if(i<n&&i++,c--,c===0)return i}r=i}else{let t=r+1,i=t;for(;i<n&&(e.charCodeAt(i)>=pm&&e.charCodeAt(i)<=mm||e.charCodeAt(i)>=hm&&e.charCodeAt(i)<=gm);)i++;e.slice(t,i).toLowerCase()===a&&c++,r++}}else r++;return r}function Y_(e,t,n,r,i){if(e.charCodeAt(t)!==yp||t+1>=n||e.charCodeAt(t+1)!==yp)return null;let a=t+2;for(;a+1<n;){let o=e.charCodeAt(a);if(o===vp){let t=G_(e,a,n);if(t>a){a=t;continue}}if(o===yp&&e.charCodeAt(a+1)===yp){let n=e.slice(t+2,a),o=jv(n,0,n.length,r,i);return{node:{type:Q.textFormatted,tag:`del`,children:o},end:a+2}}o===Dp&&a+1<n&&a++,a++}return null}function X_(e,t,n,r,i){if(e.charCodeAt(t)!==Ep||t+1>=n||e.charCodeAt(t+1)!==Ep)return null;let a=t+2;for(;a+1<n;){let o=e.charCodeAt(a);if(o===vp){let t=G_(e,a,n);if(t>a){a=t;continue}}if(o===Ep&&e.charCodeAt(a+1)===Ep&&a>t+2){let n=e.slice(t+2,a),o=jv(n,0,n.length,r,i);return{node:{type:Q.textFormatted,tag:`mark`,children:o},end:a+2}}o===Dp&&a+1<n&&a++,a++}return null}function Z_(e,t,n){return e<_m?!!(Ig(e)&Gm):Qm.test(t[n])}function Q_(e,t,n){return e<_m?!!(Ig(e)&Um):$m.test(t[n])}function $_(e,t,n){var r=e.charCodeAt(t);if(r!==Op&&r!==kp)return null;var i=Jg(e,t,n,r);if(i===0)return null;var a=t>0?e.charCodeAt(t-1):32,o=t+i<n?e.charCodeAt(t+i):32,s=Q_(a,e,t-1),c=Q_(o,e,t+i),l=t>0&&Z_(a,e,t-1),u=t+i<n&&Z_(o,e,t+i),d=!c&&(!u||s||l),f=!s&&(!l||c||u),p,m;return r===Op?(p=d,m=f):(p=d&&(!f||l),m=f&&(!d||u)),{len:i,canOpen:p,canClose:m}}function ev(e,t,n,r,i){if(t.length!==0){for(var a=e.length,o=Array(a),s=null,c=null,l=0;l<a;l++){var u={node:e[l],prev:c,next:null};c?c.next=u:s=u,o[l]=u,c=u}for(var d=Array(t.length),f=0;f<t.length;f++)d[f]=o[t[f].idx];for(var p=[],m=0;m<12;m++)p[m]=-1;for(var h=0;h<t.length;){var g=t[h];if(!(g.active&&g.canClose))h++;else{for(var _=(g.ch===Op?0:1)*6+g.len%3*2+ +!!g.canOpen,v=p[_]===void 0?-1:p[_],y=-1,b=h-1;b>v;b--){var x=t[b];if(x.active&&x.ch===g.ch&&x.canOpen&&(!g.canOpen&&!x.canClose||(x.len+g.len)%3!=0||x.len%3==0)){y=b;break}}if(y<0)p[_]=h-1,!g.canOpen&&(g.active=!1),h++;else{var S=t[y],C=S.len>=2&&g.len>=2,w=C?2:1;S.len-=w,g.len-=w;var T=d[y],E=d[h],D=T.node,O=E.node;D.text=D.text.slice(0,D.text.length-w),O.text=O.text.slice(w);for(var k=[],A=T.next;A&&A!==E;)k.push(A.node),A=A.next;var j={node:{type:Q.textFormatted,tag:C?`strong`:`em`,children:k},prev:T,next:E};T.next=j,E.prev=j;for(var M=y+1;M<h;M++)t[M].active=!1;if(S.len===0&&(S.active=!1,D.text===``)){var N=T.prev;j.prev=N,N?N.next=j:s=j}if(g.len===0){if(g.active=!1,O.text===``){var P=E.next;j.next=P,P&&(P.prev=j)}}else continue;h++}}}if(n)for(var F=0;F<n.length;F++){var I=t[n[F]];I.active&&I.len>0&&(d[n[F]].node.text=``)}for(var L=0,R=s;R;){var z=R.node;if(z.type===Q.text){var B=z;if(B.text===``){R=R.next;continue}if(L>0&&e[L-1].type===Q.text){e[L-1].text+=B.text,R=R.next;continue}}e[L++]=z,R=R.next}e.length=L}}function tv(e,t,n,r){return t(e,n,r)===null?null:e}var nv=0,rv=0,iv=0,av=0,ov=0,sv=0;function cv(){return ov===2147483647&&(rv=0,av=0,uv=0,ov=0),++ov}var lv=null,uv=0,dv=[],fv=256;function pv(e,t,n,r,i){let a=e.charCodeAt(t)===Np,o=a?t+1:t;if(e.charCodeAt(o)!==bp||av===sv&&o>=iv)return null;var s=uv===sv?lv:null,c=s===null?0:s[o];if(c<0)return null;var l=c;if(c===0){var u=e.indexOf(`]`,o+1);if(u<0||u>=n)return iv=o,av=sv,null;l=o+1;var d=0;dv[d++]=o;for(var f=n-o>=fv;l<n&&d>0;){var p=e.charCodeAt(l);if(p===Dp&&l+1<n)l+=2;else{if(p===vp){var m=G_(e,l,n);if(m>l){l=m;continue}}if(p===Ap){var h=mv(e,l,n);if(h){l=h.end;continue}var g=J_(e,l,n);if(g>l){q_-=g-l,l=g;continue}}if(p===bp)dv[d++]=l;else if(p===Mp){var _=dv[--d];s===null&&f&&l-o>=fv&&(s=lv=new Int32Array(n),uv=sv),s!==null&&(s[_]=l+1)}l++}}if(d>0){if(s===null&&f&&l-o>=fv&&(s=lv=new Int32Array(n),uv=sv),s!==null)for(;d>0;)s[dv[--d]]=-1;return null}}var v=l-1,y=e.slice(o+1,v),b=l<n?e.charCodeAt(l):0,x=!1;if(b===nm){var S=!0;for(l++;l<n&&(e.charCodeAt(l)===Z||e.charCodeAt(l)===_p);)l++;var C=``,w=l;if(l<n&&e.charCodeAt(l)===Ap){for(l++,w=l;w<n&&e.charCodeAt(w)!==Sp;)if(e.charCodeAt(w)===Dp&&w+1<n)w+=2;else{if(e.charCodeAt(w)===_p){S=!1;break}w++}S&&(w>=n||e.charCodeAt(w)!==Sp)&&(S=!1),S&&(C=e.slice(l,w),w++)}else if(S){var T=rv===sv?nv:-1;if(T>=0&&l>=T)S=!1;else{for(var E=0,D=!1;w<n;){var O=e.charCodeAt(w);if(O===Dp&&w+1<n)w+=2;else{if(O===nm)E++;else if(O===rm){if(D=!0,E===0)break;E--}else if(O===Z||O===_p)break;w++}}w>=n&&!D&&(T<0||l<T)&&(nv=l,rv=sv),C=e.slice(l,w)}}if(S){for(l=w;l<n&&(e.charCodeAt(l)===Z||e.charCodeAt(l)===_p);)l++;var k;if(l<n){var A=e.charCodeAt(l);if(A===Zp||A===Xp||A===nm){var j=A===nm?41:A;l++;for(var M=l;l<n&&e.charCodeAt(l)!==j;)e.charCodeAt(l)===Dp&&l+1<n&&l++,l++;l>=n?S=!1:(k=e.slice(M,l),l++)}}if(S){for(;l<n&&(e.charCodeAt(l)===Z||e.charCodeAt(l)===_p);)l++;(l>=n||e.charCodeAt(l)!==rm)&&(S=!1)}}if(S){if(l++,C=Dm(Lg(C)),k!==void 0&&(k=Dm(Lg(k))),a){var N=yv(jv(y,0,y.length,r,i));return{node:{type:Q.image,target:tv(C,i?.sanitizer||Fm,`img`,`src`),alt:N,title:k},end:l}}var P=r.inAnchor;r.inAnchor=!0;var F=P?[{type:Q.text,text:y}]:jv(y,0,y.length,r,i);return r.inAnchor=P,!r.inAnchor&&vv(F)?null:{node:{type:Q.link,target:tv(C,i?.sanitizer||Fm,`a`,`href`),title:k,children:F},end:l}}l=v+1,x=!0}var I=``,L=l;if(!x&&b===bp){var R=l+1;L=R;for(var z=!1;L<n&&e.charCodeAt(L)!==Mp;)if(e.charCodeAt(L)===Dp&&L+1<n)L+=2;else{if(e.charCodeAt(L)===bp){z=!0;break}L++}if(z||L>=n)return null;var B=e.slice(R,L);if(B.trim())I=Fg(B);else{if(Pg(y))return null;I=Fg(y)}L+=1}else{if(Pg(y))return null;I=Fg(y)}var V=r.refs?.[I];if(!V||I.charCodeAt(0)===xp)return null;if(a)return{node:{type:Q.image,target:tv(V.target,i?.sanitizer||Fm,`img`,`src`),alt:yv(jv(y,0,y.length,r,i)),title:V.title},end:L};var ee=r.inAnchor;r.inAnchor=!0;var F=ee?[{type:Q.text,text:y}]:jv(y,0,y.length,r,i);return r.inAnchor=ee,!r.inAnchor&&vv(F)?null:{node:{type:Q.link,target:tv(V.target,i?.sanitizer||Fm,`a`,`href`),title:V.title,children:F},end:L}}function mv(e,t,n){if(e.charCodeAt(t)!==Ap)return null;for(var r=t+1;r<n;){var i=e.charCodeAt(r);if(i===Sp)break;if(i===Z||i===_p||i===gp||i===Ap)return null;r++}if(r>=n||e.charCodeAt(r)!==Sp)return null;var a=e.slice(t+1,r);return a.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/)?{node:{type:Q.link,target:a,title:void 0,children:[{type:Q.text,text:a}]},end:r+1}:a.indexOf(`@`)!==-1&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)?{node:{type:Q.link,target:`mailto:${a}`,title:void 0,children:[{type:Q.text,text:a}]},end:r+1}:null}function hv(e,t,n,r,i){if(e.charCodeAt(t)!==bp||t+1>=n||e.charCodeAt(t+1)!==xp)return null;let a=t+2;for(;a<n&&e.charCodeAt(a)!==Mp&&e.charCodeAt(a)!==bp&&e.charCodeAt(a)!==_p;)a++;if(a>=n||e.charCodeAt(a)!==Mp)return null;let o=e.slice(t+2,a);return!o||!(i.optimizeForStreaming||r.refs?.[`^${o}`.toLowerCase()])?null:{node:{type:Q.footnoteReference,target:`#${zm(o)}`,text:o},end:a+1}}function gv(e,t,n,r){if(r.disableBareUrls)return null;var i=``,a=!1,o=e.charCodeAt(t);if(o===Rp||o===72?t+8<=n&&e.charCodeAt(t+1)===Bp&&e.charCodeAt(t+2)===Bp&&e.charCodeAt(t+3)===Vp&&(e.charCodeAt(t+4)===Hp&&e.charCodeAt(t+5)===Fp&&e.charCodeAt(t+6)===Yp&&e.charCodeAt(t+7)===Yp?i=`https://`:e.charCodeAt(t+4)===Fp&&e.charCodeAt(t+5)===Yp&&e.charCodeAt(t+6)===Yp&&(i=`http://`)):o===Lp||o===70?t+6<=n&&e.charCodeAt(t+1)===Bp&&e.charCodeAt(t+2)===Vp&&e.charCodeAt(t+3)===Fp&&e.charCodeAt(t+4)===Yp&&e.charCodeAt(t+5)===Yp&&(i=`ftp://`):(o===zp||o===87)&&t+4<=n&&e.charCodeAt(t+1)===zp&&e.charCodeAt(t+2)===zp&&e.charCodeAt(t+3)===Jp&&(i=`www.`,a=!0),!i)return null;let s=t+i.length;for(;s<n;){let t=e.charCodeAt(s);if(t===Z||t===_p||t===hp||t===gp||t===Ap||t===Sp)break;s++}for(var c=0,l=0,u=t;u<s;u++){var d=e.charCodeAt(u);d===nm?c++:d===rm&&l++}let f=s;for(;f>t+i.length;){let n=e.charCodeAt(f-1);if(n===Jp||n===Gp||n===Fp||n===Np||n===qp||n===rm||n===Op||n===kp||n===yp){if(n===rm){if(c>=l)break;l--}f--}else if(n===Kp){for(var p=f-2;p>t&&(e.charCodeAt(p)>=pm&&e.charCodeAt(p)<=mm||e.charCodeAt(p)>=hm&&e.charCodeAt(p)<=gm||e.charCodeAt(p)>=dm&&e.charCodeAt(p)<=fm);)p--;p>=t&&e.charCodeAt(p)===Pp?f=p:f--}else break}if(f<=t+i.length)return null;var m=t+(a?4:i.length),h=e.indexOf(`/`,m);if((h<0||h>f)&&(h=f),a&&e.indexOf(`.`,m)===-1)return null;for(var g=-1,_=-1,v=h-1;v>=m;v--)if(e.charCodeAt(v)===Jp){if(g<0)g=v;else{_=v;break}}for(var v=_>=0?_+1:m;v<h;v++)if(e.charCodeAt(v)===kp)return null;var y=e.slice(t,f),b=a?`http://${y}`:y;return{node:{type:Q.link,target:b,title:void 0,children:[{type:Q.text,text:y}]},end:f}}function _v(e,t,n,r){if(r.disableBareUrls)return null;for(var i=t,a=i;i<n;){var o=e.charCodeAt(i);if(o>=pm&&o<=mm||o>=hm&&o<=gm||o>=dm&&o<=fm||o===Jp||o===Np||o===Cp||o===36||o===wp||o===Pp||o===Xp||o===Op||o===Qp||o===Yp||o===Ep||o===qp||o===xp||o===kp||o===vp||o===em||o===$p||o===tm||o===yp||o===Tp)i++;else break}if(i===a||i>=n||e.charCodeAt(i)!==jp)return null;i++;for(var s=i,c=-1,l=i;i<n;){var o=e.charCodeAt(i);if(o>=pm&&o<=mm||o>=hm&&o<=gm||o>=dm&&o<=fm)i++;else if((o===Tp||o===kp)&&i>s)i++;else if(o===Jp){if(i===s)break;var u=e.charCodeAt(i-1);if(u===Tp||u===kp||i-l>63)break;if(i+1<n){var d=e.charCodeAt(i+1);if(d>=pm&&d<=mm||d>=hm&&d<=gm||d>=dm&&d<=fm)c=i,l=i+1,i++;else break}else break}else break}if(i-l>63||c<0)return null;var f=e.charCodeAt(i-1);if(!(f>=pm&&f<=mm||f>=hm&&f<=gm||f>=dm&&f<=fm)||i<=c+1)return null;for(var p=-1,m=c-1;m>=s;m--)if(e.charCodeAt(m)===Jp){p=m;break}for(var m=p>=0?p+1:s;m<i;m++)if(e.charCodeAt(m)===kp)return null;var h=e.slice(t,i);return{node:{type:Q.link,target:`mailto:${h}`,title:void 0,children:[{type:Q.text,text:h}]},end:i}}function vv(e){for(var t=0;t<e.length;t++)if(e[t].type===Q.link||`children`in e[t]&&Array.isArray(e[t].children)&&vv(e[t].children))return!0;return!1}function yv(e,t){for(var n=``,r=0;r<e.length;r++){var i=e[r];i.type===Q.text?n+=i.text:i.type===Q.breakLine?n+=` `:i.type===Q.codeInline||i.type===Q.footnoteReference?n+=i.text:`children`in i&&Array.isArray(i.children)?n+=yv(i.children,t):!t&&i.type===Q.image&&(n+=i.alt||``)}return n}function bv(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(i.type===Q.heading){var a=i;a.id=e_(n(yv(a.children,!0)),t)}if(`children`in i){var o=i.children;Array.isArray(o)&&bv(o,t,n)}if((i.type===Q.orderedList||i.type===Q.unorderedList)&&Array.isArray(i.items))for(var s=i.items,c=0;c<s.length;c++)bv(s[c],t,n)}}function xv(e){return{type:Q.text,text:e}}function Sv(e,t,n){var r=t+1;if(r>=n)return-1;if(e.charCodeAt(r)===Cp){r++;var i=r<n&&(e.charCodeAt(r)===cm||e.charCodeAt(r)===lm);i&&r++;for(var a=r,o=i?6:7;r<n&&r-a<=o;){var s=e.charCodeAt(r);if(!(s>=dm&&s<=fm||i&&(s>=pm&&s<=Ip||s>=hm&&s<=Lp)))break;r++}return r===a||r-a>o?-1:r<n&&e.charCodeAt(r)===Kp?r+1:-1}for(var c=r;r<n&&r-c<48;){var l=e.charCodeAt(r);if(l>=pm&&l<=mm||l>=hm&&l<=gm||l>=dm&&l<=fm)r++;else break}return r===c?-1:r<n&&e.charCodeAt(r)===Kp?r+1:-1}function Cv(e,t,n,r){return e.lastIndexOf(`<`,n-1)===t?e.slice(t,n):`</${r}>`}function wv(e,t,n){return{node:{type:Q.htmlComment,text:Dg(e.slice(t,n)),t:!1,raw:!0},end:n}}var Tv=null;function Ev(e,t,n){var r=Tv===null?void 0:Tv[t];if(r!==void 0&&n>=r)return-1;var i=e.indexOf(t,n);return i===-1&&(Tv===null&&(Tv={}),Tv[t]=n),i}function Dv(e,t,n,r,i){if(e.charCodeAt(t)!==Ap)return null;var a=t+1;if(a>=n)return null;var o=e.charCodeAt(a);if(o===Np&&a+1<n&&e.charCodeAt(a+1)===Tp&&a+2<n&&e.charCodeAt(a+2)===Tp){var s=a+3;if(s<n&&e.charCodeAt(s)===Sp)return{node:{type:Q.htmlComment,text:``,t:!0},end:s+1};if(s+1<n&&e.charCodeAt(s)===Tp&&e.charCodeAt(s+1)===Sp)return{node:{type:Q.htmlComment,text:`-`,t:!0},end:s+2};var c=Ev(e,`-->`,s);if(c===-1)return null;var l=e.slice(t,c+3),u=Dg(l);return{node:u===l?{type:Q.htmlComment,text:e.slice(t+4,c),t:!1}:{type:Q.htmlComment,text:u,t:!1,raw:!0},end:c+3}}if(o===qp){var d=Ev(e,`?>`,a+1);return d===-1?null:wv(e,t,d+2)}if(o===Np&&a+1<n){var f=e.charCodeAt(a+1);if(f===bp&&e.slice(a+1,a+8)===`[CDATA[`){var p=Ev(e,`]]>`,a+8);return p===-1?null:wv(e,t,p+3)}if(f>=pm&&f<=mm){var m=Ev(e,`>`,a+2);return m===-1?null:wv(e,t,m+1)}}if(o===Yp){var h=a+1;if(h>=n)return null;var g=e.charCodeAt(h);if(!(g>=pm&&g<=mm||g>=hm&&g<=gm))return null;for(h++;h<n;){var _=e.charCodeAt(h);if(_>=pm&&_<=mm||_>=hm&&_<=gm||_>=dm&&_<=fm||_===Tp)h++;else break}for(;h<n&&(e.charCodeAt(h)===Z||e.charCodeAt(h)===hp||e.charCodeAt(h)===_p);)h++;if(h<n&&e.charCodeAt(h)===Sp){var v=e.slice(a+1,h).trim();return{node:{type:Q.htmlSelfClosing,tag:v,attrs:{},j:e.slice(t,h+1),b:!0},end:h+1}}return null}if(!(o>=pm&&o<=mm||o>=hm&&o<=gm))return null;var y=Tg(e,t);if(!y)return null;var b=y.tag,x=b.toLowerCase();if(y.n||Hm(b))return{node:{type:Q.htmlSelfClosing,tag:b,attrs:__(y.attrs,b,i),u:y.q?gg(y):e.slice(t,y.end),b:!1},end:y.end};var S=Vh.has(x),C=k_(e,y.end,b,n);if(C===-1)return{node:{type:Q.htmlSelfClosing,tag:b,attrs:__(y.attrs,b,i),u:y.q?gg(y):e.slice(t,y.end),b:!1},end:y.end};var w=b_(e,`</${x}`,C),T=e.slice(y.end,w);if(S){var E=Dg(T);return{node:{type:Q.htmlBlock,tag:b,attrs:__(y.attrs,b,i),a:y.i+y.a,children:[],e:E||void 0,j:Cv(e,w,C,b),h:void 0,text:E,c:!0,b:!1},end:C}}var D=[],O=T.trim();if(T){var{inAnchor:k,inline:A,l:j}=r;x===`a`&&(r.inAnchor=!0),r.l=!1,O.indexOf(`
|
|
49
|
+
|
|
50
|
+
`)!==-1||(i.enforceAtxHeadings===!1?Xh:Yh).test(O)?(r.inline=!1,D=Nv(O,r,i)):D=jv(T,0,T.length,r,i),r.inAnchor=k,r.inline=A,r.l=j}return{node:{type:Q.htmlBlock,tag:b,attrs:__(y.attrs,b,i),a:y.a,children:D,h:void 0,text:Dg(T),c:!1,b:!1},end:C}}function Ov(e){if(e.indexOf(`[`)===-1)return e;for(var t=e.length,n=new Int32Array(t).fill(-1),r=[],i=0;i<t;i++){var a=e.charCodeAt(i);if((a===bp||a===Mp)&&(i===0||e.charCodeAt(i-1)!==Dp)){if(a===bp)r.push(i);else{var o=r.pop();o!==void 0&&(n[o]=i)}}}var s=[],c=t;for(i=0;i<c;i++)if(!(e.charCodeAt(i)!==bp||i>0&&e.charCodeAt(i-1)===Dp)){var l=i>0&&e.charCodeAt(i-1)===Np,u=n[i];if(u>=0){var d=u+1;if(d<c){var f=e.charCodeAt(d);if(f!==nm&&f!==bp){s.push(i),i=u;continue}for(var p=f===nm?rm:Mp,m=d+1;m<c&&e.charCodeAt(m)!==p;)m++;if(m<c){i=m;continue}}}if(l){c=i-1;var h=s.pop();if(h!==void 0&&n[h]===c-1){i=h-1;continue}break}n[i]=-2,u>=0&&(c=u)}var g=``,_=0;for(i=0;i<c;i++)n[i]===-2&&(g+=e.slice(_,i),_=i+1);return g+e.slice(_,c)}var kv=200,Av=0;function jv(e,t,n,r,i){if(Av++,Av>kv)return Av--,[{type:Q.text,text:e.slice(t,n)}];var a=sv;sv=cv();var o=Tv;Tv=null;var s=x_,c=S_,l=C_,u=w_;let d=r;var f=i.optimizeForStreaming===!0&&Av===1&&!r.f;if(f){let r=e.slice(t,n),i=r,a=0,o=-1;for(let e=0;e<r.length;e++)r.charCodeAt(e)===vp&&(a++,o=e);if(a%2==1&&o!==-1){let e=!1,t=-1,n=0;for(;n<r.length;)r.charCodeAt(n)===vp&&(e?(e=!1,t=-1):(t=n,e=!0)),n++;e&&t!==-1&&(r=r.slice(0,t))}r=Ov(r);let s=r.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);if(s&&s.index!==void 0){var p=s[0].length-s[2].length;if(!(p>=2&&s[0].charCodeAt(p-2)===Yp)){for(var m=!1,h=0,g=0;g<s.index;g++)r.charCodeAt(g)===vp&&h++;if(m=h%2==1,!m){let e=s[1];v_(r,`</${e}`,0,r.length)===-1&&(r=r.slice(0,s.index)+s[2])}}}r!==i&&(e=e.slice(0,t)+r,n=t+r.length)}let _=[];var v=[],y=null;let b=t;var x=``,S=i.disableAutoLink||i.disableBareUrls||d.inAnchor?-1:e.indexOf(`@`,t);for(S>=n&&(S=-1);t<n;){let r=e.charCodeAt(t),a=null;if(r===vp){if(a=W_(e,t,n),!a){var C=Jg(e,t,n,vp);t+=C-1}}else if(r===Op||r===kp){var w=$_(e,t,n);if(w){var T=!1;if(f){var E=t+w.len,D=t>0?e.charCodeAt(t-1):Z,O=t===0||Q_(D,e,t-1);if(w.canOpen){var k=e.charCodeAt(E);T=O||Z_(D,e,t-1)||Q_(k,e,E)||Z_(k,e,E)}else T=E===n&&O}if(T&&(y===null&&(y=[]),y.push(v.length)),w.canOpen||w.canClose||T){(x||t>b)&&(_.push(xv(x+e.slice(b,t))),x=``);var A=xv(e.slice(t,t+w.len));v.push({idx:_.length,ch:r,len:w.len,canOpen:w.canOpen,canClose:w.canClose,active:!0}),_.push(A),t+=w.len,b=t;continue}t+=w.len-1}}else if(r===yp){if(a=Y_(e,t,n,d,i),!a&&f&&t+1<n&&e.charCodeAt(t+1)===yp){(x||t>b)&&(_.push(xv(x+e.slice(b,t))),x=``),t+=2,b=t;continue}}else if(r===Ep)a=X_(e,t,n,d,i);else if(r===bp)t+1<n&&e.charCodeAt(t+1)===xp&&(a=hv(e,t,n,d,i)),a||=pv(e,t,n,d,i);else if(r===Np&&t+1<n&&e.charCodeAt(t+1)===bp)a=pv(e,t,n,d,i);else if(r===Ap)a=mv(e,t,n),!(a||i.disableParsingRawHTML||i.ignoreHTMLBlocks)&&(a=Dv(e,t,n,d,i));else if(r===Pp){var j=Sv(e,t,n);if(j!==-1){var M=e.slice(t,j),N=Dm(M);if(N!==M){x=x+e.slice(b,t)+N,t=j,b=j;continue}}}else if((r===Rp||r===zp||r===Lp)&&!d.inAnchor&&!i.disableAutoLink&&(t===0||e.charCodeAt(t-1)!==Ap)){var P=t+1<n?e.charCodeAt(t+1):0;(r===Rp&&P===Bp||r===Lp&&P===Bp||r===zp&&P===zp)&&(a=gv(e,t,n,i))}if(!a&&S>=0&&S-t<=64&&!d.inAnchor&&!i.disableAutoLink&&!i.disableBareUrls&&(r>=pm&&r<=mm||r>=hm&&r<=gm||r>=dm&&r<=fm)&&(a=_v(e,t,n,i),!a&&t>=S&&(S=e.indexOf(`@`,t+1),S>=n&&(S=-1))),r===_p&&d.l){var F=!1,I=0;if(t>b&&e.charCodeAt(t-1)===Dp)F=!0,I=1;else{for(var L=0,R=t-1;R>=b&&e.charCodeAt(R)===Z;)L++,R--;L>=2&&(F=!0,I=L)}if(F){for((x||t-I>b)&&(_.push(xv(x+e.slice(b,t-I))),x=``),_.push({type:Q.breakLine}),t++;t<n&&e.charCodeAt(t)===Z;)t++;b=t;continue}var z=t>b&&e.charCodeAt(t-1)===Z,B=t+1<n&&e.charCodeAt(t+1)===Z;if(z||B){for(var V=t;V>b&&e.charCodeAt(V-1)===Z;)V--;for(x+=`${e.slice(b,V)}
|
|
51
|
+
`,t++;t<n&&e.charCodeAt(t)===Z;)t++;b=t;continue}}if(a)(x||t>b)&&(_.push(xv(x+e.slice(b,t))),x=``),_.push(a.node),t=a.end,b=t;else{if(r===Dp&&t+1<n&&Ig(e.charCodeAt(t+1))&Gm){(x||t>b)&&(_.push(xv(x+e.slice(b,t))),x=``),_.push(xv(e[t+1])),t+=2,b=t;continue}if(t++,S<0||S-t>64)for(;t<n&&!(S>=0&&S-t<=64);){var ee=e.charCodeAt(t);if(ee<_m&&!$h[ee])t++;else break}}}return(x||n>b)&&(_.push(xv(x+e.slice(b,n))),x=``),v.length>0&&ev(_,v,y,r,i),sv=a,Tv=o,s!==null&&s!==x_&&(x_=s,S_=c,C_=l,w_=u),Av--,_}var Mv=500;function Nv(e,t,n){var r=t.p||0;if(r>Mv)return[{type:Q.text,text:e}];t.p=r+1;var i=Vg,a=Hg,o=Ug,s=x_,c=S_,l=C_,u=w_,d=j_,f=M_;if(n.optimizeForStreaming&&!(t.f||t.B)){for(var p=e.length;p>0&&e.charCodeAt(p-1)===_p;)p--;for(var m=p;m>0&&e.charCodeAt(m-1)!==_p;)m--;if(p>m&&e.charCodeAt(m)===$p){for(var h=!1,g=m+1;g<p;g++){var _=e.charCodeAt(g);if(_!==Z&&_!==hp&&_!==$p&&_!==Fp&&_!==Tp){h=!0;break}}for(var v=!1,y=!1,b=0,x=m,S=m-1;S>0;){for(var C=S;C>0&&e.charCodeAt(C-1)!==_p;)C--;if(e.charCodeAt(C)!==$p)break;x=C;for(var w=!0,T=!1,E=C;E<S;E++){var D=e.charCodeAt(E);if(D===Tp)T=!0;else if(D!==Z&&D!==hp&&D!==Fp&&D!==$p){w=!1;break}}w&&T?(v=!0,y=!0):y||b++,S=C-1}h?v||(e=e.slice(0,m).trimEnd()):e=v&&b>0?e.slice(0,m).trimEnd():e.slice(0,x).trimEnd()}for(var O=-1,k=-1,A=-1,j=!1,M=e.length-1;M>=0;M--)if(e.charCodeAt(M)===Ap){for(var N=M+1<e.length?e.charCodeAt(M+1):0,P=N>=pm&&N<=mm||N>=hm&&N<=gm,F=N===Yp&&M+2<e.length&&(e.charCodeAt(M+2)>=pm&&e.charCodeAt(M+2)<=mm||e.charCodeAt(M+2)>=hm&&e.charCodeAt(M+2)<=gm),I=N===Np||N===qp,L=e.length;L>M+1&&e.charCodeAt(L-1)===_p;)L--;var R=M+1>=L;if((P||F||I||R)&&!(P&&mv(e,M,e.length))){var z=M+1;if((F||P)&&(z=M+2),P||F)for(;z<e.length;){var B=e.charCodeAt(z);if(B>=pm&&B<=mm||B>=hm&&B<=gm||B>=dm&&B<=fm)z++;else break}for(var V=P||F?z:M+2;V<e.length&&e.charCodeAt(V)!==Sp;)V++;if(V>=e.length)O=M,j=!0;else if(P&&e.charCodeAt(V-1)!==Yp&&!Hm(e.slice(M+1,z))){for(var ee=!1,H=V+1;H<e.length;H++)if(e.charCodeAt(H)===Ap){ee=!0;break}ee||(O=M,k=z,A=V+1)}}break}if(O>=0){for(var te=0,ne=0;ne<O;ne++)e.charCodeAt(ne)===vp&&te++;if(te%2==0){if(j)e=e.slice(0,O);else{var re=e.slice(O+1,k);v_(e,`</${re}`,0,e.length)===-1&&(e=e.slice(0,O)+e.slice(A))}}}for(var U=e.length;U>0&&e.charCodeAt(U-1)===_p;)U--;if(U>0){for(var ie=U;ie>0&&e.charCodeAt(ie-1)!==_p;)ie--;for(var ae=ie,oe=0;ae<U&&e.charCodeAt(ae)===Z&&oe<3;)ae++,oe++;if(ie>0&&ae<U&&n_(e,ae,U)){for(var W=ie-1,G=W;G>0&&e.charCodeAt(G-1)!==_p;)G--;Qg(e,G,W)||(e=e.slice(0,ie).trimEnd())}}var K=e.length;if(K>0){for(var se=e.lastIndexOf(`
|
|
52
|
+
`),q=se===-1?0:se+1,ce=K,le=q,ue=0;le<ce&&e.charCodeAt(le)===Z&&ue<3;)le++,ue++;if(le<ce){var de=e.charCodeAt(le),fe=!1;if(de===Op||de===Tp||de===Qp){var pe=le+1;if(pe>=ce||e.charCodeAt(pe)===Z||e.charCodeAt(pe)===hp){for(var me=pe;me<ce&&(e.charCodeAt(me)===Z||e.charCodeAt(me)===hp);)me++;me>=ce&&(fe=!0)}}else if(de>=dm&&de<=fm){for(var he=le;he<ce&&e.charCodeAt(he)>=dm&&e.charCodeAt(he)<=fm;)he++;if(he<ce&&(e.charCodeAt(he)===Jp||e.charCodeAt(he)===rm)){var ge=he+1;if(ge>=ce||e.charCodeAt(ge)===Z||e.charCodeAt(ge)===hp){for(var _e=ge;_e<ce&&(e.charCodeAt(_e)===Z||e.charCodeAt(_e)===hp);)_e++;_e>=ce&&(fe=!0)}}}fe&&(e=e.slice(0,q).trimEnd())}}}if(t.inline)return jv(e,0,e.length,t,n);let ve=[],ye=0;var be=e.length,xe=-2;if(ye===0&&!n.disableFrontmatter&&e.startsWith(`---`)){let t=ym(e);if(t?.hasValidYaml){if(n.preserveFrontmatter!==!1){let n=e.slice(0,t.endPos).trimEnd();ve.push({type:Q.frontmatter,text:n})}ye=t.endPos}}for(;ye<be;){for(var Se=e.indexOf(`
|
|
53
|
+
`,ye),Ce=Se<0?be:Se;ye<be&&Qg(e,ye,Ce);)ye=Ce<be?Ce+1:Ce,ye<be&&(Se=e.indexOf(`
|
|
54
|
+
`,ye),Ce=Se<0?be:Se);if(ye>=be)break;var we=e.charCodeAt(ye)===um;Zg(e,ye,Ce);let r=null;var Te=t.o?t.o.length:0;if(Rg=e,zg=ye,Bg=Ce,!we&&Yg>=4&&!t.inHTML)r=l_(e,ye);else if(!we){let i=ye+Xg,a=e.charCodeAt(i);a===Cp?r=t_(e,ye,t,n):a===Sp?r=u_(e,ye,t,n):a===vp||a===yp?r=s_(e,ye,t):a===Tp||a===Op||a===kp?(r=r_(e,ye),!r&&(r=h_(e,ye,t,n))):a===Qp||a>=dm&&a<=fm?r=h_(e,ye,t,n):a===Ap?(t.inList&&(xe===-2&&(xe=e.lastIndexOf(Gh)),xe>ye&&!n.ignoreHTMLBlocks&&!n.disableParsingRawHTML&&(L_(e,i)!==0||F_(e,i))&&(e=e.slice(0,ye)+Kh(e.slice(ye)),be=e.length,xe=-1)),r=I_(e,ye,t,n)):a===$p?r=z_(e,ye,t,n):a===bp&&(r=B_(e,ye,t))}if(!r){for(var Ee=!1,De=ye;De<Ce;De++)if(e.charCodeAt(De)===$p){Ee=!0;break}Ee&&(r=z_(e,ye,t,n))}if(r||=H_(e,ye,t,n),r){r.node.type!==Q.refCollection&&ve.push(r.node);var Oe=t.o;if(n.optimizeForStreaming&&Oe&&Oe.length>Te&&!$g(e,r.end,be))for(var ke=Te;ke<Oe.length;ke++)Oe[ke].notAtEdge=!0;ye=r.end}else{var Ae=e.indexOf(`
|
|
55
|
+
`,ye);ye=Ae<0?be:Ae+1}}return Vg=i,Hg=a,Ug=o,x_=s,S_=c,C_=l,w_=u,j_=d,M_=f,t.p=r,ve}function Pv(e,t,n,r){var i=Tg(e,t);return i?{tagName:i.tag,tagLower:i.tag.toLowerCase(),attrs:i.a,whitespaceBeforeAttrs:i.i,isSelfClosing:i.n,hasSpaceBeforeSlash:i.v,isClosing:i.g,hasNewline:i.i.includes(`
|
|
56
|
+
`)||i.a.includes(`
|
|
57
|
+
`),endPos:i.end}:null}function Fv(e,t,n){Av=0;var r=dg;dg=n,e=th(e),q_=e.length*16+K_,!t.refs&&(t.refs=Object.create(null)),(n.optimizeForStreaming||t.inline)&&(t.B=Ag(e,t.refs,n));var i,a;t.o||(t.o=i=[],t.r=a=[]);let o=Nv(e,t,n);if(i&&a){for(var s=i,c={inline:t.inline,inAnchor:t.inAnchor,inHTML:t.inHTML,htmlDepth:t.d,inList:t.inList,inBlockQuote:t.inBlockQuote,noSetext:t.m,depth:t.p,notAtEdge:t.f},l=0;l<s.length;l++){var u=s[l];t.inline=u.inline,t.inAnchor=u.inAnchor,t.inHTML=u.inHTML,t.d=u.htmlDepth,t.inList=u.inList,t.inBlockQuote=u.inBlockQuote,t.m=u.noSetext,t.p=u.depth,t.f=u.notAtEdge,t.l=u.breaks;var d=jv(u.text,0,u.text.length,t,n);t.l=!1;for(var f=0;f<d.length;f++)u.dest.push(d[f])}t.inline=c.inline,t.inAnchor=c.inAnchor,t.inHTML=c.inHTML,t.d=c.htmlDepth,t.inList=c.inList,t.inBlockQuote=c.inBlockQuote,t.m=c.noSetext,t.p=c.depth,t.f=c.notAtEdge;for(var p=a,m=0;m<p.length;m++)for(var h=p[m],g=0;g<h.src.length;g++){var _=h.src[g];if(h.unwrap&&_.type===Q.paragraph)for(var v=_.children,y=0;y<v.length;y++)h.dest.push(v[y]);else h.dest.push(_)}t.o=void 0,t.r=void 0,x_!==null&&T_(),bv(o,t,n.slugify)}return dg=r,sh(t.refs)?[{type:Q.refCollection,refs:t.refs},...o]:o}var Iv;try{Lv=v.createElement(`div`),Iv=typeof Lv==`object`&&Lv&&`$$typeof`in Lv&&typeof Lv.$$typeof==`symbol`?Lv.$$typeof:Symbol.for(`react.transitional.element`)}catch{Iv=Symbol.for(`react.transitional.element`)}var Lv;function Rv(e,t,n){return{$$typeof:Iv,type:e,key:n==null?null:String(n),ref:null,props:t,_owner:null,_store:{},_debugStack:null,_debugTask:null}}function zv(e,t){var n={key:e};if(t){var r=Cm(t);for(var i in r)n[i]=r[i]}return n}var Bv=typeof v.createContext>`u`?void 0:v.createContext(void 0);function Vv(e,t,n,r,i,a,o,s,c){switch(e.type){case Q.blockQuote:{let i={key:n.key};return e.alert&&(i.className=`markdown-alert-${a(e.alert.toLowerCase(),zm)}`,e.children.unshift(ch(e.alert))),r(`blockquote`,i,t(e.children,n))}case Q.breakLine:return r(`br`,{key:n.key});case Q.breakThematic:return r(`hr`,{key:n.key});case Q.frontmatter:return s.preserveFrontmatter?r(`pre`,{key:n.key},e.text):null;case Q.codeBlock:{let t=e.lang?Dm(e.lang):``;var l=e.attrs?Cm(kh(`code`,e.attrs,s.overrides)):{};return l.className=t?`language-${t} lang-${t}`:``,r(`pre`,{key:n.key},r(`code`,l,e.text))}case Q.codeInline:return r(`code`,{key:n.key},e.text);case Q.footnoteReference:return r(`a`,{key:n.key,href:i(e.target,`a`,`href`)||void 0},r(`sup`,null,e.text));case Q.gfmTask:return r(`input`,{checked:e.completed,key:n.key,readOnly:!0,type:`checkbox`});case Q.heading:return r(`h${e.level}`,{id:e.id,key:n.key},t(e.children,n));case Q.htmlBlock:{let a=e;if(yh(s)&&Ph(a.tag)){var u=_h(a);return u.kind===`literal`?r(`span`,{key:n.key},u.literal):r(`span`,{key:n.key},...vh(u.open,a.children?t(a.children,n):null,u.close))}let l=a.k,g=l!==void 0,_=g?l:a.b?a.e||``:(a.e||``)+(a.j||``);if(_&&a.c){let r=tg(a.tag.toLowerCase()),l=a.children,u=l!=null&&l.length>0;if(r){let t=(g?a.text:a.e)||``,r=yh(s)?Lh(t):t;if(/<[a-z][^>]{0,100}>/i.test(t)){var d=zv(n.key,e.attrs);return d.dangerouslySetInnerHTML={__html:r},c(e.tag,d)}return c(e.tag,zv(n.key,e.attrs),Ih(e.tag,r))}let y=RegExp(`^<${a.tag}(\\s|>)`,`i`);if(u&&!y.test(_)&&yh(s)&&Fh(_))return c(e.tag,zv(n.key,e.attrs),t(l,n));if(ng(_)){let t=yh(s)?Lh(_):_;var f=zv(n.key,e.attrs);return f.dangerouslySetInnerHTML={__html:t},c(e.tag,f)}let b=Rh({overrides:s.overrides,slugify:s.slugify,sanitizer:i,tagfilter:!0}),x=ah(a.h||_);if(RegExp(`^<${a.tag}(\\s[^>]*)?>(\\s*</${a.tag}>)?$`,`i`).test(x))return a.children&&a.children.length>0?c(e.tag,zv(n.key,e.attrs),t(a.children,n)):c(e.tag,zv(n.key,e.attrs));let S=Fv(x,{inline:!1,refs:o,inHTML:!1},b);if(fh(S),ph(S,x))return x;let C=a.tag.toLowerCase(),w=g;if(w&&u)return c(e.tag,zv(n.key,e.attrs),t(l,n));if(w)return t(S.flatMap(dh),n);var p=mh(S,C);if(p.found&&p.afterClose.length>0){var m=p.beforeClose.flatMap(dh),h=p.afterClose.flatMap(dh);return Rv(v.Fragment,{children:[c(e.tag,zv(n.key,e.attrs),t(m,n)),t(h,n)]},n.key)}return c(e.tag,zv(n.key,e.attrs),t(S.flatMap(dh),n))}return Hm(e.tag)?c(e.tag,zv(n.key,e.attrs)):c(e.tag,zv(n.key,e.attrs),e.children?t(e.children,n):``)}case Q.htmlSelfClosing:{let t=e;if(yh(s)&&Ph(t.tag)){var g=_h(t);return r(`span`,{key:n.key},g.kind===`literal`?g.literal:g.open+(g.close||``))}return c(e.tag,zv(n.key,e.attrs))}case Q.image:{let t=e.target===null?null:i(e.target,`img`,`src`);return r(`img`,{key:n.key,alt:e.alt&&e.alt.length>0?e.alt:void 0,title:e.title||void 0,src:t||void 0})}case Q.link:{let a={key:n.key};if(e.target!=null){let t=bh(e.target,i,`a`,`href`);t!=null&&(a.href=t)}return e.title&&(a.title=e.title),r(`a`,a,t(e.children,n))}case Q.table:{let i=e;return r(`table`,{key:n.key},r(`thead`,{key:`thead`},r(`tr`,null,i.header.map(function(e,a){return r(`th`,{key:a,style:i.align[a]===null?{}:{textAlign:i.align[a]}},t(e,n))}))),i.cells.length>0&&r(`tbody`,{key:`tbody`},i.cells.map(function(e,a){return r(`tr`,{key:a},e.map(function(e,a){return r(`td`,{key:a,style:i.align[a]===null?{}:{textAlign:i.align[a]}},t(e,n))}))})))}case Q.text:return e.text;case Q.textFormatted:return r(e.tag,{key:n.key},t(e.children,n));case Q.orderedList:case Q.unorderedList:return r(e.type===Q.orderedList?`ol`:`ul`,{key:n.key,start:e.type===Q.orderedList?e.start:void 0},e.items.map(function(e,i){return r(`li`,{key:i},t(e,n))}));case Q.paragraph:return r(`p`,{key:n.key},t(e.children,n));case Q.ref:return null;default:return null}}var Hv=(e,t,n,r,i,a,o)=>{var s=e=>e.map(e=>`text`in e?e.text:``),c=(l,u={})=>{var d=Array.isArray(l)?l:[l],f=(u.renderDepth||0)+1;if(f>2500)return s(d);u.renderDepth=f;for(var p=u.key,m=[],h=!1,g=0;g<d.length;g++){u.key=g;var _=e?e(Vv.bind(null,d[g],c,u,t,n,r,i,a,o),d[g],c,u):Vv(d[g],c,u,t,n,r,i,a,o),v=typeof _==`string`;if(h&&typeof _==`string`){var y=m.at(-1);m[m.length-1]=(typeof y==`string`?y:``)+_}else if(_!=null){if(Array.isArray(_))for(var b=0;b<_.length;b++)m.push(_[b]);else m.push(_)}h=v}return u.key=p,u.renderDepth=f-1,m};return c},Uv=(e,t)=>{let n=Eh(t,e,void 0);return n?typeof n==`function`||typeof n==`object`&&`render`in n?n:Eh(t,`${e}.component`,e):e};function Wv(e,t){let n={...t||{}};n.overrides=n.overrides||{};let r=n.slugify||zm,i=n.sanitizer||Fm,a=n.createElement,o=sh(n.overrides),s=e=>Gv(e,{...n,wrapper:null});function c(e){for(var t in e){var n=e[t];if(typeof n==`string`&&n.length>0&&n.charCodeAt(0)===Ap&&(zh.test(n)||Bh.test(n)||Pv(n,0))){var r=s(n.trim());e[t]=t===`innerHTML`&&Array.isArray(r)?r[0]:r}}}function l(e,t,...r){var i=t||{},s=e;if(o){var c=Eh(n.overrides,`${e}.props`,{});s=Uv(e,n.overrides),i={...i,...c,className:jh(i.className,c.className)||void 0},typeof s==`string`&&Hm(s)&&(delete i.children,r.length=0)}if(!a){var l=i.key;return l!=null&&delete i.key,r.length===1?i.children=r[0]:r.length>1&&(i.children=r),Rv(s,i,l)}return a(s,i,...r)}function u(e,t,...r){var i=t&&kh(e,t,n.overrides);if(i){if(typeof i.children==`string`){var a=i.dangerouslySetInnerHTML===void 0?Tm(i.children,r):void 0;delete i.children,a!==void 0&&(r=[a])}c(i)}return l(e,i,...r)}let d=Rh(n,n.forceInline),f=e[0]&&e[0].type===Q.refCollection?e[0].refs:Object.create(null),p=Hv(n.renderRule,l,i,r,f,n,u),m=p(e,{inline:n.forceInline,refs:f}),h=xh(f);if(h.length>0&&m.push(l(`footer`,{key:`footer`},h.map(function(e){let t=e.identifier.charCodeAt(0)===xp?e.identifier.slice(1):e.identifier,n=Fv(e.footnote,{inline:!0,refs:f},d);return l(`div`,{id:r(t,zm),key:e.identifier},`${t}: `,p(n,{inline:!0,refs:f}))}))),n.wrapper===null)return m;let g=n.wrapper||(n.forceInline?`span`:`div`),_;if(m.length>1||n.forceWrapper)_=m;else return m.length===1?m[0]:null;var v=n.wrapperProps?{...n.wrapperProps}:{};return v.children=_,Rv(g,v,`outer`)}function Gv(e=``,t={}){let n={...t||{}};n.overrides=n.overrides||{},n.slugify,n.sanitizer;function r(e){let t=n.forceInline||!(n.forceBlock||Em.test(e)),r=Rh(n,t);return Wv(Fv(t?e:uh(e),{inline:t,refs:i},r),{...n,forceInline:t})}let i=Object.create(null);return r(e)}function Kv(e){let t=v.useRef(e),n=t.current;if(n!==e){var r=!0,i=0;for(var a in e)if(i++,!Object.is(n[a],e[a])){r=!1;break}if(r){var o=0;for(var s in n)o++;r=o===i}r||(t.current=e)}return t.current}var qv=({children:e,options:t,...n})=>{if(typeof v.useContext>`u`){let r={...t,overrides:{...t?.overrides},wrapperProps:{...t?.wrapperProps,...n}};return Gv(e??``,r)}let r=Bv?v.useContext(Bv):void 0,i=Kv(n),a=v.useMemo(()=>({...r,...t,overrides:{...r?.overrides,...t?.overrides},wrapperProps:{...r?.wrapperProps,...t?.wrapperProps,...i}}),[r,t,i]),o=e??``;return v.useMemo(()=>Gv(o,a),[o,a])},Jv=[`communicator`,`builder`,`grunt`],Yv=[`decompose`,`replan`],Xv=e=>e.id??[e.agent,e.model,e.effort].filter(Boolean).join(`/`),Zv=e=>`${e.repo} ${e.id}`,Qv=[`claude`,`anthropic`,`openai-codex`],$v=e=>e!==void 0&&e.step!==`merged`&&e.step!==`skipped`,ey=e=>e.notes.findLast(e=>e.kind===`factory`&&e.url?.includes(`/pull/`))?.url??e.attempts.findLast(e=>e.url?.includes(`/pull/`))?.url,ty=e=>e.state===`OPEN`&&!e.draft&&e.conflicts===!1&&(e.checks===`passing`||e.checks===`none`),ny=e=>e.state===`OPEN`&&e.conflicts===!0&&!e.fork;function ry(e){let t=new Map;for(let n of e.values())for(let e of n.after)t.set(e,[...t.get(e)??[],n]);let n=new Map,r=e=>{let i=n.get(e.id);if(i!==void 0)return i;n.set(e.id,0);let a=e.state!==`done`&&e.state!==`removed`,o=(t.get(e.id)??[]).map(r),s=+!!a+Math.max(0,...o);return n.set(e.id,s),s};for(let t of e.values())r(t);return n}function iy(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=(e,i=new Set)=>{let a=n.get(e.id);if(a!==void 0)return a;if(i.has(e.id))return 0;i.add(e.id);let o=Math.max(-1,...e.after.flatMap(e=>t.get(e)?[r(t.get(e),i)]:[]))+1;return n.set(e.id,o),o};for(let t of e)r(t);return n}function ay(e){let t=new Map(e.map(e=>[e.id,e])),n=ry(t),r=new Map,i=e=>{let n=r.get(e.id);if(n!==void 0)return n;r.set(e.id,0);let a=+(e.state!==`done`&&e.state!==`removed`)+Math.max(0,...e.after.flatMap(e=>t.has(e)?[i(t.get(e))]:[]));return r.set(e.id,a),a},a=e=>i(e)+(n.get(e.id)??0)-1,o=e.filter(e=>e.state!==`done`&&e.state!==`removed`),s=Math.max(0,...o.map(a));return new Set(o.filter(e=>s>0&&a(e)===s).map(e=>e.id))}var oy=v.createContext(void 0);function sy(e){let t=v.useContext(oy);if(!e&&t===void 0)throw Error(q(27));return t}var cy=v.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=sy(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Ui(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Pt,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),ly=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=sy(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Nf({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,J(nn,e.nativeEvent))}return Ui(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),uy=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=sy(),c=uc(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Ui(`p`,e,{ref:t,props:[{id:c},o]})}),dy=v.createContext(void 0);function fy(){let e=v.useContext(dy);if(e===void 0)throw Error(q(26));return e}var py=`ArrowUp`,my=`ArrowDown`,hy=`ArrowLeft`,gy=`ArrowRight`,_y=new Set([py,my,hy,gy,`Home`,`End`]),vy=[`Shift`,`Control`,`Alt`,`Meta`];function yy(e){return Ve(e)&&e.tagName===`INPUT`}function by(e){return!!(yy(e)&&e.selectionStart!=null||Ve(e)&&e.tagName===`TEXTAREA`)}function xy(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Sy(e,t,`left`),a=Cy(e),o=Cy(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Sy(e,t,`top`),r=Cy(e),i=Cy(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Sy(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Cy(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var wy=`--nested-dialogs`,Ty=`data-nested-dialog-open`,Ey={...Nt,...bt,nestedDialogOpen(e){return e?{[Ty]:``}:null}},Dy=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=sy(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),C=d.useState(`floatingId`);fy(),za({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let w=o===void 0?Ha(c.context.popupRef):o,T=g>0,E=c.useStateSetter(`popupElement`),D=Ui(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:T},props:[f,{id:C,"aria-labelledby":y,"aria-describedby":l,role:x,...Va,hidden:!m,onKeyDown(e){_y.has(e.key)&&e.stopPropagation()},style:{[wy]:g}},s],ref:[t,c.context.popupRef,E],stateAttributesMapping:Ey});return(0,S.jsx)(wa,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:w,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:D})}),Oy=v.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,S.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),ky=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=sy(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,S.jsx)(dy.Provider,{value:n,children:(0,S.jsxs)(aa,{ref:t,...r,children:[a&&o===!0&&(0,S.jsx)(Oy,{ref:i.context.internalBackdropRef,inert:qc(!s)}),e.children]})}):null}),Ay={},jy={},My=``;function Ny(e,t){return Ue(e)?e:t}function Py(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ny(t,n)).overflowY)}function Fy(e){if(typeof document>`u`)return!1;let t=Wn(e);return Le(t).innerWidth-t.documentElement.clientWidth>0}function Iy(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Wn(e),n=t.documentElement,r=t.body,i=Ny(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Ly(e){let t=Wn(e),n=t.documentElement,r=t.body,i=Ny(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Ry(e){let t=Wn(e),n=t.documentElement,r=t.body,i=Le(n),a=0,o=0,s=!1,c=Hn.create();if(Te&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Ay={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},My=n.style.scrollBehavior,jy={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Ny(n,r);s=Iy(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Ay),Object.assign(r.style,jy),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=My)}function d(){u(),c.request(l)}l();let f=Tn(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var zy=new class{lockCount=0;restore=null;timeoutLock=fe.create();timeoutUnlock=fe.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Wn(e),n=t.documentElement,r=t.body,i=Le(n);if(Py(i,n,r)){let t=new i.MutationObserver(()=>{Py(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=be||!Fy(e);this.restore=a?Ly(e):Ry(e)}};function By(e=!0,t=null){K(()=>{if(e)return zy.acquire(t)},[e,t])}function Vy({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=v.useState(0),[d,f]=v.useState(0),p=l===0,m=ja(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=lt(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||st(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return By(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),K(()=>{!r&&!i&&(u(0),f(0))},[r,i]),K(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),$a(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Hy={...wo,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Uy=class extends ho{constructor(e,t,n){let r=new to,i=Wy(e,r,t,n);super(i,Gy(r),Hy)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(qa(this.state,e,t.trigger)))}};function Wy(e,t,n,r=!1){return{...vo(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Gy(e){return{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Ky(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,y=sy(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:_},x=Ua((e,t)=>new Uy({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let C=x.useState(`open`),w=x.useState(`mounted`),T=x.useState(`payload`);eo(x,C),Za(x);let{forceUnmount:E}=Qa(C,x);v.useImperativeHandle(l,()=>({unmount:E,close:()=>x.setOpen(!1,J(yn))}),[E,x]);let D=C||w||u!=null;return(0,S.jsxs)(oy.Provider,{value:x,children:[u&&(0,S.jsx)(Wa,{handle:u,store:x}),D&&(0,S.jsx)(Vy,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:T}):n]})}var qy=U(function(e){return Ky(`dialog`,e)}),Jy=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=sy(),c=uc(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Ui(`h2`,e,{ref:t,props:[{id:c},o]})});function Yy(e){let t=v.useRef(``),n=v.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:v.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Xy(e,t){let{onClick:n,onPointerDown:r}=Yy(Y((n,r)=>{(typeof e==`function`?e():e)||t(r||(be?`touch`:``))}));return v.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Zy(e){let[t,n]=v.useState(null),r=Xy(e,n);return op(e,t=>{t&&!e&&n(null)}),v.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Qy=ie(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=sy(!0),f=To(l)??d;if(!f)throw Error(q(79));let p=uc(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=v.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=Xa(p,_,f,{payload:c}),{getButtonProps:x,buttonRef:S}=Nf({disabled:a,native:o}),C=Ta(m),w=Xy(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,b);return Ui(`button`,e,{state:T,ref:[S,t,y,_],props:[C.reference,E,w,{[Zi]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:jt})});function $y({...e}){return(0,S.jsx)(qy,{"data-slot":`dialog`,...e})}function eb({...e}){return(0,S.jsx)(Qy,{"data-slot":`dialog-trigger`,...e})}function tb({...e}){return(0,S.jsx)(ky,{"data-slot":`dialog-portal`,...e})}function nb({className:e,...t}){return(0,S.jsx)(cy,{"data-slot":`dialog-overlay`,className:X(`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 rb({className:e,children:t,showCloseButton:n=!0,...r}){return(0,S.jsxs)(tb,{children:[(0,S.jsx)(nb,{}),(0,S.jsxs)(Dy,{"data-slot":`dialog-content`,className:X(`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,S.jsxs)(ly,{"data-slot":`dialog-close`,render:(0,S.jsx)(Rf,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,S.jsx)(nf,{}),(0,S.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function ib({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`dialog-header`,className:X(`flex flex-col gap-2`,e),...t})}function ab({className:e,showCloseButton:t=!1,children:n,...r}){return(0,S.jsxs)(`div`,{"data-slot":`dialog-footer`,className:X(`-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,S.jsx)(ly,{render:(0,S.jsx)(Rf,{variant:`outline`}),children:`Close`})]})}function ob({className:e,...t}){return(0,S.jsx)(Jy,{"data-slot":`dialog-title`,className:X(`font-heading text-base leading-none font-medium`,e),...t})}function sb({className:e,...t}){return(0,S.jsx)(uy,{"data-slot":`dialog-description`,className:X(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function cb({className:e,...t}){return(0,S.jsx)(vd,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:X(`size-4 animate-spin`,e),...t})}var lb=v.createContext(void 0);function ub(e){let t=v.useContext(lb);if(t===void 0&&!e)throw Error(q(47));return t}var db={...wo,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!wo.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&wo.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>wo.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},fb=class extends ho{constructor(e,t,n){let r=new to;super(pb(e,r,t,n),mb(r),db)}setOpen=(e,t)=>{let n=t.reason===Qt,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Ja(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=qa(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),R.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function pb(e,t,n,r=!1){let i={...vo(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function mb(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:v.createRef(),beforeTriggerFocusGuardRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),stickIfOpenTimeout:new fe,stickIfOpen:!0,triggerElements:e}}var hb=U(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=_b(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),eo(u,d),Za(u);let{forceUnmount:m}=Qa(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),v.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),v.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,J(yn))}),[m,u]);let h=d||f||s!=null;return(0,S.jsxs)(lb.Provider,{value:u,children:[s&&(0,S.jsx)(Wa,{handle:s,store:u}),h&&(0,S.jsx)(vb,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function gb(e){return ub(!0)?(0,S.jsx)(hb,{props:e}):(0,S.jsx)(ma,{children:(0,S.jsx)(hb,{props:e})})}function _b(e,t){let n=Ua((e,n)=>new fb(t,e,n));return v.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function vb({store:e,modal:t}){let n=ja(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return $a(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}function yb(e,t){function n(n,r,i){let a=n.currentTarget;R.flushSync(()=>{e.setOpen(!1,J(ln,n.nativeEvent,a))}),Zr(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&Qr(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}var bb=ie(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=ub(!0),h=To(s)??m;if(!h)throw Error(q(74));let g=uc(f),_=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),C=v.useRef(null),{registerTrigger:w,isMountedByThisTrigger:T}=Xa(g,C,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),E=h.useState(`isPressOpenedByTrigger`,g),D=h.useState(`isTouchPressOpen`,l),O=h.useState(`hasTriggerFocusGuards`,g),k=Io(y,{enabled:!a&&l&&!D,mouseOnly:!0,move:!1,handleClose:Qo(),restMs:u,delay:{close:d},triggerElementRef:C,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=Ta(y,{stickIfOpen:Y(()=>h.context.stickIfOpen)}),j=Xy(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,T),{getButtonProps:N,buttonRef:P}=Nf({disabled:a,native:o}),F={open(e){return E?Mt.open(e):jt.open(e)}},{handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=yb(h,C),R=Ui(`button`,e,{state:{disabled:a,open:b},ref:[P,t,w,C],props:[A.reference,k,M,j,{[Zi]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},p,N],stateAttributesMapping:F}),z=(0,S.jsx)(v.Fragment,{children:R},g);return O?(0,S.jsxs)(v.Fragment,{children:[(0,S.jsx)(Jn,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:I}),z,(0,S.jsx)(Jn,{ref:h.context.triggerFocusTargetRef,onFocus:L})]}):z}),xb=v.createContext(void 0);function Sb(){let e=v.useContext(xb);if(e===void 0)throw Error(q(45));return e}var Cb=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return ub().useState(`mounted`)||n?(0,S.jsx)(xb.Provider,{value:n,children:(0,S.jsx)(aa,{ref:t,...r})}):null}),wb=v.createContext(void 0);function Tb(){let e=v.useContext(wb);if(!e)throw Error(q(46));return e}function Eb(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=v.useRef(null),o=v.useRef(null),s=Ra(r);K(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),K(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var Db=20;function Ob(e,t,n,r){let[i,a]=v.useState(!1);K(()=>{if(!e||!t||n==null){a(!1);return}let r=Wn(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Db)},[e,t,n]),By(e&&(!t||i),r)}var kb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=$i,..._}=e,v=ub(),y=Sb(),b=fa(),x=v.useState(`floatingRootContext`),C=v.useState(`mounted`),w=v.useState(`open`),T=v.useState(`openChangeReason`),E=v.useState(`activeTriggerElement`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=Rc({anchor:a,floatingRootContext:x,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});Eb({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:k,open:w});let N=D===!0&&T!==`trigger-hover`;Ob(w&&N,O===`touch`,k,E);let P=v.useStateSetter(`positionerElement`),F=Hc(e,{open:w,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:A},{styles:M.positionerStyles,transitionStatus:j,props:_,refs:[t,P],hidden:!C,inert:!w});return(0,S.jsxs)(wb.Provider,{value:M,children:[C&&N&&(0,S.jsx)(Oy,{inert:qc(!w),cutout:E}),(0,S.jsx)(pa,{id:b,children:F})]})}),Ab=v.createContext(void 0);function jb(e){let t=v.useContext(Ab);if(t===void 0&&!e)throw Error(q(69));return t}var Mb=v.createContext(void 0);function Nb(){let[e,t]=v.useState(0),n=Y(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:v.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function Pb(){let e=v.useContext(Mb);K(()=>e?.register(),[e])}var Fb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=ub(),l=Tb(),u=jb(!0)!=null,{context:d,hasClosePart:f}=Nb(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);za({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Po(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?Ha(c.context.popupRef):a,j=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=Ui(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,M],props:[_,{id:E,role:`dialog`,...Va,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&_y.has(e.key)&&e.stopPropagation()}},Vc(g),s],stateAttributesMapping:Pt});return(0,S.jsx)(wa,{context:T,openInteractionType:m,modal:j,disabled:!x||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:Ve(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,S.jsx)(Mb.Provider,{value:d,children:N})})}),Ib=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ub(),s=uc(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Ui(`h2`,e,{ref:t,props:[{id:s},a]})}),Lb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ub(),s=uc(a.id);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),Ui(`p`,e,{ref:t,props:[{id:s},a]})}),Rb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{buttonRef:c,getButtonProps:l}=Nf({disabled:a,focusableWhenDisabled:!1,native:o}),u=ub();return Pb(),Ui(`button`,e,{ref:[t,c],props:[{onClick(e){u.setOpen(!1,J(nn,e.nativeEvent))}},s,l]})});function zb({...e}){return(0,S.jsx)(gb,{"data-slot":`popover`,...e})}function Bb({...e}){return(0,S.jsx)(bb,{"data-slot":`popover-trigger`,...e})}function Vb({...e}){return(0,S.jsx)(Rb,{"data-slot":`popover-close`,...e})}function Hb({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,S.jsx)(Cb,{children:(0,S.jsx)(kb,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,S.jsx)(Fb,{"data-slot":`popover-content`,className:X(`z-50 flex w-72 origin-(--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=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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),...a})})})}function Ub({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`popover-header`,className:X(`flex flex-col gap-0.5 text-sm`,e),...t})}function Wb({className:e,...t}){return(0,S.jsx)(Ib,{"data-slot":`popover-title`,className:X(`font-medium`,e),...t})}function Gb({className:e,...t}){return(0,S.jsx)(Lb,{"data-slot":`popover-description`,className:X(`text-muted-foreground`,e),...t})}var Kb={log:{label:`Log`,title:`Agent log`,name:`agent.log`,noun:`log`},prompt:{label:`Prompt`,title:`Prompt`,name:`prompt.md`,noun:`prompt`}};function qb({log:e,agent:t,kind:n}){let r=Kb[n],i=`/${e.replace(/agent\.log$/,r.name)}`;return(0,S.jsxs)(zb,{children:[(0,S.jsx)(Bb,{render:(0,S.jsx)(Rf,{variant:`link`,size:`xs`}),children:r.label}),(0,S.jsxs)(Hb,{className:`w-xl max-w-[calc(100vw-2rem)]`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,S.jsxs)(Ub,{children:[(0,S.jsx)(Wb,{children:r.title}),(0,S.jsx)(Gb,{children:t})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(`a`,{className:`text-xs underline underline-offset-4`,href:i,target:`_blank`,rel:`noreferrer`,children:[`Open raw `,r.noun]}),(0,S.jsx)(Vb,{render:(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close`}),children:(0,S.jsx)(nf,{})})]})]}),(0,S.jsx)(Jb,{url:i,noun:r.noun})]})]})}function Jb({url:e,noun:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let t=new AbortController;return(async()=>{try{let n=await fetch(e,{signal:t.signal});if(!n.ok)throw Error(`Request failed: ${n.status}`);let i=await n.text();t.signal.aborted||r(Yb(i))}catch{t.signal.aborted||a(!0)}})(),()=>t.abort()},[e]),i?(0,S.jsxs)(`p`,{role:`status`,className:`text-destructive`,children:[`Could not load the `,t,`. Reopen it to try again.`]}):n===void 0?(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,S.jsx)(cb,{}),` Loading `,t,`…`]}):n.trim()?(0,S.jsx)(`pre`,{tabIndex:0,className:`max-h-[min(28rem,50dvh)] overflow-auto rounded-md border bg-muted/50 p-3 font-mono text-xs leading-relaxed wrap-anywhere whitespace-pre-wrap focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,children:n}):(0,S.jsxs)(`p`,{className:`text-muted-foreground`,children:[`The `,t,` is empty.`]})}function Yb(e){if(!e.trimStart().startsWith(`{`))return e;try{let t=JSON.parse(e);return t?.type===`result`&&typeof t.result==`string`&&t.result.trim()?t.result:JSON.stringify(t,null,2)}catch{return e}}function Xb({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=v.useRef(e!==void 0),[a,o]=v.useState(()=>t);return[i&&e!==void 0?e:a,v.useCallback(e=>{i||o(e)},[])]}var Zb=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Qb(){return v.useContext(Zb)}function $b(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Y(i),[,o]=v.useState(0),s=ee(tx).current,c=ee(ex).current,l=v.useRef(0),u=v.useRef(!0),d=v.useRef(null),f=v.useRef(null),p=Y(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=Y((e,t)=>{c.set(e,t),p()}),h=Y(e=>{c.delete(e),p()}),g=Y(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!ix(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&ax(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=rx(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=Y(()=>{let[e,t]=nx(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});K(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),K(()=>{u.current&&y()}),K(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=Y(e=>(s.add(e),()=>{s.delete(e)})),x=v.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,S.jsx)(Zb.Provider,{value:x,children:t})}function ex(){return new Map}function tx(){return new Set}function nx(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>ax(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function rx(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ix(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function ax(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var ox=v.createContext(void 0);function sx(){let e=v.useContext(ox);if(e===void 0)throw Error(q(64));return e}var cx=`data-activation-direction`,lx={tabActivationDirection:e=>({[cx]:e})},ux=v.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=v.useRef([]),[f,p]=v.useState(()=>new Map),[m,h]=Xb({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,y]=v.useState(()=>new Map),b=v.useRef(void 0),x=v.useCallback(e=>dx(_,e),[_]),[C,w]=v.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:T,tabActivationDirection:E}=C,D=E,O=!1;T!==m&&(D=fx(T,m,a,_),O=T!=null&&m!=null&&x(m)==null);let k=O?T:m,A=T!==k||E!==D;K(()=>{A&&w({previousValue:k,tabActivationDirection:D})},[k,A,D]);let j=Y((e,t)=>{t.activationDirection=fx(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),M=Y((e,t)=>{i?.(e,J(t,void 0,void 0,{activationDirection:`none`}))}),N=Y((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),P=v.useCallback(e=>f.get(e),[f]),F=v.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),I=v.useMemo(()=>({getTabElementBySelectedValue:x,getTabIdByPanelValue:F,getTabPanelIdByValue:P,onValueChange:j,orientation:a,registerMountedTabPanel:N,setTabMap:y,tabActivationDirection:D,value:m}),[x,F,P,j,a,N,y,D,m]),L=v.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),R=v.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),z=v.useRef(!u),B=v.useRef(r),V=v.useRef(u),ee=v.useRef(!1);K(()=>{if(g)return;function e(e,t){h(()=>e),w({previousValue:e,tabActivationDirection:`none`}),M(e,t),z.current=!1}if(_.size===0){ee.current&&m!==null&&!b.current?.isConnected&&e(null,_n);return}ee.current=!0,b.current=_.keys().next().value;let t=L?.disabled,n=L==null&&m!==null;if(!t&&m===B.current&&(V.current=!1),V.current&&t&&m===B.current)return;let r=z.current;if(t||n){let n=R??null;if(m===n){z.current=!1;return}let i=_n;r?i=vn:t&&(i=gn),e(n,i)}else r&&L!=null&&(M(m,vn),z.current=!1)},[R,g,M,L,h,_,m]);let H=Ui(`div`,e,{state:{orientation:a,tabActivationDirection:D},ref:t,props:l,stateAttributesMapping:lx});return(0,S.jsx)(ox.Provider,{value:I,children:(0,S.jsx)($b,{elementsRef:d,children:H})})});function dx(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function fx(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=dx(r,e),c=dx(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var px=`data-composite-item-active`;function mx(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Qb(),u=v.useRef(-1),[d,f]=v.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=v.useRef(null),h=v.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return K(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function hx(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Af(),{ref:i,index:a}=mx(e),o=n===a,s=v.useRef(null),c=Dn(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var gx=v.createContext(void 0);function _x(){let e=v.useContext(gx);if(e===void 0)throw Error(q(65));return e}var vx=v.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=sx(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=_x(),{highlightedIndex:y,onHighlightedIndexChange:b}=Af(),x=uc(o),{compositeProps:S,compositeRef:C,index:w}=hx({metadata:v.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),T=a===u,E=v.useRef(!1),D=v.useRef(null),O=Y(e=>{D.current?.(),D.current=e?g(e):null});K(()=>{if(E.current){E.current=!1;return}if(!(T&&w>-1&&y!==w))return;let e=_;if(e!=null){let t=ot(Wn(e));if(t&&st(e,t))return}r||b(w)},[T,w,y,b,r,_]);let{getButtonProps:k,buttonRef:A}=Nf({disabled:r,native:s,focusableWhenDisabled:!0}),j=d(a),M=v.useRef(!1),N=v.useRef(!1);function P(e){f(a,J(Xt,e.nativeEvent,void 0,{activationDirection:`none`}))}function F(e){T||r||P(e)}function I(e){T||r||h&&(!M.current||N.current)&&P(e)}function L(e){if(T||r)return;M.current=!0,N.current=e.button===0;let t=Wn(e.currentTarget);function n(){M.current=!1,N.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return Ui(`button`,e,{state:{disabled:r,active:T,orientation:p,tabActivationDirection:m},ref:[t,A,C,O],props:[S,{role:`tab`,"aria-controls":j,"aria-selected":T,id:x,onClick:F,onFocus:I,onPointerDown:L,[px]:T?``:void 0,onKeyDownCapture(){E.current=!0}},l,k],stateAttributesMapping:lx})}),yx=v.createContext(void 0),bx={disableStyleElements:!1};function xx(){return v.useContext(yx)??bx}var Sx=`data-index`,Cx={...lx,...bt},wx=v.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=sx(),p=uc(),{ref:m,index:h}=mx(),g=r===c,{mounted:_,transitionStatus:y,setMounted:b}=Pa(g),x=!_,S=l(r),C={hidden:x,orientation:u,tabActivationDirection:d,transitionStatus:y},w=v.useRef(null),T=Ui(`div`,e,{state:C,ref:[t,m,w],props:[{"aria-labelledby":S,hidden:x,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:qc(!g),[Sx]:h},s],stateAttributesMapping:Cx});return za({open:g,ref:w,onComplete(){g||b(!1)}}),K(()=>{if(!(p==null||x&&!a))return f(r,p)},[x,a,r,p,f]),a||_?T:null});function Tx(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Ex(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=W}=e,[p,m]=v.useState(0),h=r!=null,g=v.useRef(null),_=Dn(g,c),y=v.useRef([]),b=v.useRef(!1),x=v.useRef(null),S=o??p,C=Y((e,t=!1)=>{if(x.current=y.current[e]??null,(s??m)(e),t){let t=y.current[e];xy(g.current,t,a,n)}}),w=Y(e=>{if(e.size===0)return;if(b.current){let e=y.current,t=e.indexOf(x.current);if(t===-1){let t=e[S];!t||kr(e,S,d)?C(Dx(e,d)):x.current=t}else t!==S&&C(t);return}b.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)C(i);else if(kr(t,S,d)){let e=Dr(t,{disabledIndices:d});Cr(t,e)||C(e)}xy(g.current,r,a,n)});K(()=>{if(d==null||o!=null||!b.current)return;let e=y.current;if(kr(e,S,d)){let t=Dr(e,{disabledIndices:d});Cr(e,t)||C(t)}},[d,o,S,y,C]);let T=Y((e,t,n)=>i?i(e,t,n,y):n),E=Y(e=>{let o=e.key===`Home`||e.key===`End`;if(!_y.has(e.key)||!l&&o||Ox(e,f)||!g.current)return;let s=a===`rtl`,c=s?hy:gy,p=s?gy:hy,m=n===`vertical`?my:c,_=n===`vertical`?py:p,v=lt(e.nativeEvent);if(v!=null&&by(v)&&!Tx(v)){let t=v.selectionStart,n=v.selectionEnd,r=v.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=S,x=wr(y,d),w=Tr(y,d);r!=null&&(b=r({disabledIndices:d,elementsRef:y,event:e,highlightedIndex:S,loopFocus:t,maxIndex:w,minIndex:x,onLoop:T,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=x:e.key===`End`&&(b=w)),b===S&&(E||D)&&(t&&b===w&&E?(b=x,i&&(b=i(e,S,b,y))):t&&b===x&&D?(b=w,i&&(b=i(e,S,b,y))):b=Dr(y.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==S&&!Cr(y.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),C(b,!0),queueMicrotask(()=>{y.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=lt(e.nativeEvent);t&&n!=null&&by(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:y,onMapChange:w,relayKeyboardEvent:E}}function Dx(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!kr(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function Ox(e,t){for(let n of vy)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function kx(e){let{render:t,className:n,style:r,refs:i=W,props:a=W,state:o=G,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:y,modifierKeys:b,highlightItemOnHover:x=!1,tag:C=`div`,...w}=e,{props:T,highlightedIndex:E,onHighlightedIndexChange:D,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=Ex({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:wc(),disabledIndices:y,modifierKeys:b}),j=Ui(C,e,{state:o,ref:i,props:[T,...a,w],stateAttributesMapping:s}),M=v.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:D,highlightItemOnHover:x,relayKeyboardEvent:A}),[E,D,x,A]);return(0,S.jsx)(kf.Provider,{value:M,children:(0,S.jsx)($b,{elementsRef:O,onMapChange:e=>{h?.(e),k(e)},children:j})})}var Ax=v.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=sx(),[d,f]=v.useState(0),[p,m]=v.useState(null),h=v.useRef(new Set),g=v.useRef(new Set),_=v.useRef(null);K(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let y=Y(e=>(h.current.add(e),()=>{h.current.delete(e)})),b=Y(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),x={orientation:c,tabActivationDirection:u},C={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},w=v.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:b,tabsListElement:p}),[n,y,b,p]);return(0,S.jsx)(gx.Provider,{value:w,children:(0,S.jsx)(kx,{render:a,className:r,style:o,state:x,refs:[t,m],props:[C,s],stateAttributesMapping:lx,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:W})})});function jx({className:e,orientation:t=`horizontal`,...n}){return(0,S.jsx)(ux,{"data-slot":`tabs`,"data-orientation":t,className:X(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Mx=cf(`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 Nx({className:e,variant:t=`default`,...n}){return(0,S.jsx)(Ax,{"data-slot":`tabs-list`,"data-variant":t,className:X(Mx({variant:t}),e),...n})}function Px({className:e,...t}){return(0,S.jsx)(vx,{"data-slot":`tabs-trigger`,className:X(`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 aria-disabled:pointer-events-none aria-disabled:opacity-50 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 Fx({className:e,...t}){return(0,S.jsx)(wx,{"data-slot":`tabs-content`,className:X(`flex-1 text-sm outline-none`,e),...t})}var Ix=`max-h-[60dvh] overflow-auto rounded-md border bg-muted/50 p-3 font-mono text-xs leading-relaxed`,Lx={wrapper:null,overrides:{h1:{props:{className:`mt-3 text-base font-semibold first:mt-0`}},h2:{props:{className:`mt-3 font-semibold first:mt-0`}},h3:{props:{className:`mt-2 font-medium first:mt-0`}},ul:{props:{className:`list-disc pl-5`}},ol:{props:{className:`list-decimal pl-5`}},a:{props:{className:`underline underline-offset-4`,target:`_blank`,rel:`noreferrer`}},code:{props:{className:`rounded bg-muted px-1 font-mono text-xs`}},pre:{props:{className:`overflow-auto rounded-md bg-muted p-2`}},blockquote:{props:{className:`border-l-2 pl-3 text-muted-foreground`}},table:{props:{className:`border-collapse text-xs`}},th:{props:{className:`border px-2 py-1 text-left font-medium`}},td:{props:{className:`border px-2 py-1`}}}};function Rx({jobId:e,url:t,pr:n}){return(0,S.jsxs)($y,{children:[(0,S.jsx)(eb,{render:(0,S.jsx)(Rf,{variant:`link`,size:`xs`}),children:`Review`}),(0,S.jsxs)(rb,{className:`sm:max-w-4xl`,children:[(0,S.jsxs)(ib,{className:`mr-8`,children:[(0,S.jsx)(ob,{children:n.title}),(0,S.jsx)(sb,{children:(0,S.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[t.replace(`https://github.com/`,``),` `,(0,S.jsx)(Wu,{className:`size-3`})]})})]}),(0,S.jsx)(zx,{jobId:e,pr:n})]})]})}function zx({jobId:e,pr:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)();return(0,v.useEffect)(()=>{let t=!0;return wf.prDetails(e).then(e=>t&&r(e),e=>t&&a(e.message)),()=>{t=!1}},[e]),i?(0,S.jsxs)(`p`,{role:`status`,className:`text-destructive`,children:[`Could not load the PR: `,i]}):n?(0,S.jsxs)(jx,{defaultValue:`description`,className:`min-w-0`,children:[(0,S.jsxs)(Nx,{children:[(0,S.jsx)(Px,{value:`description`,children:`Description`}),(0,S.jsxs)(Px,{value:`diff`,children:[`Diff`,(0,S.jsxs)(`span`,{className:`text-success`,children:[`+`,t.additions]}),(0,S.jsxs)(`span`,{className:`text-destructive`,children:[`−`,t.deletions]})]})]}),(0,S.jsx)(Fx,{value:`description`,children:(0,S.jsx)(`div`,{tabIndex:0,className:`${Ix} flex flex-col gap-2 font-sans text-sm wrap-anywhere`,children:n.body.trim()?(0,S.jsx)(qv,{options:Lx,children:n.body}):`This PR has no description.`})}),(0,S.jsx)(Fx,{value:`diff`,children:(0,S.jsx)(`pre`,{tabIndex:0,className:Ix,children:n.diff.split(`
|
|
58
|
+
`).map((e,t)=>(0,S.jsx)(`span`,{className:`block ${Bx(e)}`,children:e||` `},t))})})]}):(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,S.jsx)(cb,{}),` Asking GitHub…`]})}function Bx(e){return e.startsWith(`diff --git`)?`mt-3 font-semibold text-foreground first:mt-0`:/^(\+\+\+|---|index |@@)/.test(e)?`text-muted-foreground`:e.startsWith(`+`)?`bg-success/10 text-success`:e.startsWith(`-`)?`bg-destructive/10 text-destructive`:``}function Vx(e,t){let n=new URLSearchParams(location.search);t?n.set(e,t):n.delete(e),history.replaceState(null,``,n.size?`?${n}`:location.pathname)}function Hx(e,t){let[n,r]=(0,v.useState)(()=>new URLSearchParams(location.search).get(e)??t);return[n,n=>{Vx(e,n===t?``:n),r(n)}]}function Ux(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var Wx=`data-checked`,Gx=`data-unchecked`;function Kx(e){return{checked(t){return e.indeterminate?{}:t?{[Wx]:``}:{[Gx]:``}},...Wf}}var qx=v.createContext(void 0);function Jx(){return v.useContext(qx)}var Yx=v.createContext(void 0);function Xx(){let e=v.useContext(Yx);if(e===void 0)throw Error(q(14));return e}var Zx=`data-parent`,Qx=v.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:y,nativeButton:b=!1,style:x,...C}=e,{clearErrors:w}=Yf(),{disabled:T,name:E,setDirty:D,setFilled:O,setTouched:k,state:A,validationMode:j,validityData:M,validation:N}=qf(),P=rp(),{labelId:F,registerControlId:I,getDescriptionProps:L}=Zf(),R=Jx(),z=R?.allValues===void 0?void 0:R.parent,B=z!==void 0,V=T||P.disabled||R?.disabled||o,ee=E??d,H=y??ee,te=uc(),ne=R?.registerControlId!==I,re=tp({id:c||void 0,enabled:ne}),U=b?re:te,ie={};B&&(p?ie=z.getParentProps():H!==void 0&&(ie=z.getChildProps(H)));let{checked:ae=n,indeterminate:oe=l,onCheckedChange:W,...se}=ie,q=R?.value,ce=v.useRef(null),le=ip(V,ce),{getButtonProps:ue,buttonRef:de}=Nf({disabled:V,native:b}),fe=R?.validation??N,[pe,me]=Xb({controlled:H!==void 0&&q!==void 0&&!p?q.includes(H):ae,default:i,name:`Checkbox`,state:`checked`}),he=B?!!ae:pe,ge=B&&oe||l;ap(ce,te,pe,void 0,!R&&!V,d);let _e=z?.registerChildId,ve=v.useRef(null),ye=fe.registerInput,be=R?H:void 0,xe=v.useCallback(e=>ye(e,{controlRef:ce,value:be}),[ye,be]),Se=Dn(u,ve,p?void 0:xe),Ce=Qf(a,F,ve,!b,re,C[`aria-label`]);K(()=>{ve.current&&(ve.current.indeterminate=ge),R||O(pe)},[pe,ge,R,O]),op(pe,()=>{R||(w(ee),D(pe!==M.initialValue),fe.change(pe))});let we=Ai({checked:pe,disabled:V,form:s,name:p?void 0:ee,id:b?void 0:re,required:g,ref:Se,style:ee?qn:Kn,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=J(Xt,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(W?.(t,n),!n.isCanceled&&(me(t),H!==void 0&&R!==void 0&&!p&&!B))){let e=t?[...R.value,H]:R.value.filter(e=>e!==H);R.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){ce.current?.focus()}},y===void 0?G:{value:(R?pe&&y:y)||``},L,e=>fe.getValidationProps(V,e));v.useEffect(()=>{if(!z||H===void 0)return;let e=z.disabledStatesRef.current;return e.set(H,V),()=>{e.delete(H)}},[z,V,H]);let Te=v.useMemo(()=>({...A,checked:he,disabled:V,readOnly:m,required:g,indeterminate:ge}),[A,he,V,m,g,ge]),Ee=Kx(Te),De=Ui(`span`,e,{state:Te,ref:[de,ce,t],props:[{id:U,role:`checkbox`,"aria-checked":ge?`mixed`:he,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Ce,[Zx]:p?``:void 0,onFocus(){le(!0)},onBlur(){let e=ve.current;e&&(k(!0),le(!1),j===`onBlur`&&fe.commit(R?q:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=ve.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),Le(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||Ux(t)?.click()})},onClick(e){if(m||V)return;e.preventDefault();let t=ve.current;t&&Mf(t,e)}},C,se,ue,L,e=>fe.getValidationProps(V,e)],stateAttributesMapping:Ee}),Oe=De.props.id;return K(()=>{if(_e&&!p&&H!==void 0&&Oe!==void 0)return _e(H,Oe)},[_e,p,H,Oe]),(0,S.jsxs)(Yx.Provider,{value:Te,children:[De,!pe&&!R&&ee&&!p&&_!==void 0&&(0,S.jsx)(`input`,{type:`hidden`,form:s,name:ee,value:_,disabled:V}),(0,S.jsx)(`input`,{...we,suppressHydrationWarning:!0})]})}),$x=v.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Xx(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Pa(c),f=v.useRef(null),p={...s,transitionStatus:u};za({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...Kx(s),...bt},h=a||l,g=Ui(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null});function eS({className:e,...t}){return(0,S.jsx)(Qx,{"data-slot":`checkbox`,className:X(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...t,children:(0,S.jsx)($x,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,S.jsx)(wu,{})})})}function tS({className:e,...t}){return(0,S.jsx)(eS,{className:X(`data-checked:border-foreground data-checked:bg-foreground data-checked:text-background dark:data-checked:bg-foreground`,e),...t})}var nS=v.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Ui(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function rS({className:e,...t}){return(0,S.jsx)(`div`,{role:`list`,"data-slot":`item-group`,className:X(`group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2`,e),...t})}var iS=cf(`group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted`,{variants:{variant:{default:`border-transparent`,outline:`border-border`,muted:`border-transparent bg-muted/50`},size:{default:`gap-2.5 px-3 py-2.5`,sm:`gap-2.5 px-3 py-2.5`,xs:`gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0`}},defaultVariants:{variant:`default`,size:`default`}});function aS({className:e,variant:t=`default`,size:n=`default`,render:r,...i}){return Ef({defaultTagName:`div`,props:Ai({className:X(iS({variant:t,size:n,className:e}))},i),render:r,state:{slot:`item`,variant:t,size:n}})}var oS=cf(`flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none`,{variants:{variant:{default:`bg-transparent`,icon:`[&_svg:not([class*='size-'])]:size-4`,image:`size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function sS({className:e,variant:t=`default`,...n}){return(0,S.jsx)(`div`,{"data-slot":`item-media`,"data-variant":t,className:X(oS({variant:t,className:e})),...n})}function cS({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`item-content`,className:X(`flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none`,e),...t})}function lS({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`item-title`,className:X(`line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4`,e),...t})}function uS({className:e,...t}){return(0,S.jsx)(`p`,{"data-slot":`item-description`,className:X(`line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function dS({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`item-actions`,className:X(`flex items-center gap-2`,e),...t})}function fS({leading:e,title:t,meta:n,below:r,progress:i,children:a}){return(0,S.jsxs)(aS,{variant:`outline`,size:`sm`,className:`relative overflow-hidden`,children:[i!==void 0&&(0,S.jsx)(`span`,{"aria-hidden":!0,className:`absolute bottom-0 left-0 h-0.5 w-(--progress) bg-primary transition-all duration-700`,style:{"--progress":`${Math.min(i,1)*100}%`}}),e&&(0,S.jsx)(sS,{children:e}),(0,S.jsxs)(cS,{children:[(0,S.jsx)(lS,{children:t}),(0,S.jsx)(uS,{children:n}),r]}),a&&(0,S.jsx)(dS,{children:a})]})}function pS({title:e,children:t}){return(0,S.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,S.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground`,children:e}),t]})}var mS=Object.keys({claude:/usage limit|You've hit your [\w' ]*limit|You've reached your [\w ]*limit|rate_limit_error/i,pi:/usage limit|usage_limit_reached|usage_not_included|rate_limit_exceeded/i}),hS={claude:[`low`,`medium`,`high`,`xhigh`,`max`],pi:[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`]};function gS(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=Xb({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=Pa(a,!0,!0),u=uc(),[d,f]=v.useState(),p=d===null?void 0:d??u,m=Y(e=>{let t=!a,n=J(Zt,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return v.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var _S=v.createContext(void 0);function vS(){let e=v.useContext(_S);if(e===void 0)throw Error(q(15));return e}var yS=`data-open`,bS=`data-closed`,xS=gt,SS=`data-panel-open`,CS={[yS]:``},wS={[bS]:``},TS={open(e){return e?{[SS]:``}:null}},ES={open(e){return e?CS:wS}},DS={height:void 0,width:void 0};function OS(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=v.useRef(null),f=v.useRef(null),[p,m]=v.useState(DS),h=v.useRef(DS),g=v.useRef(!1),_=v.useRef(s),y=v.useRef(!1),[b,x]=v.useState(!1),S=v.useRef(null),C=Dn(t,d),w=Nn(s),T=Ra(d),E=!s&&!a,D=b?`idle`:u,O=s&&(_.current||y.current),k=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,A=n&&E&&f.current!==`css-animation`,j=Y((e,t=!0)=>{t&&(h.current=e),m(e)}),M=Y(()=>{S.current?.(),S.current=null}),N=Y(e=>{M(),S.current=()=>{S.current=null,e()}}),P=Y(()=>{s&&a&&f.current===`css-animation`&&(y.current=!0)});K(()=>{b&&u!==`starting`&&x(!1)},[b,u]),v.useEffect(()=>()=>{P(),M()},[P,M]),K(()=>{s||(_.current=!1,y.current=!1);let e=d.current;if(!e)return;!s&&S.current&&M();let t=AS(e,O);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=kS(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){j(kS(e)),x(!0);return}if(t===`css-transition`){let t=NS(e);if(j(kS(e)),!n)return t;let r=MS(e,`transition-duration`,`0s`);return N(r),x(!0),t}j(kS(e));let r=MS(e,`animation-name`,`none`);if(!n){r();return}let i=MS(e,`animation-duration`,`0s`);r(),N(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){j(DS,!1),c(!1);return}j(kS(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=kS(e);n.height>0||n.width>0?(j(n),t===`css-animation`&&MS(e,`animation-name`,`none`)()):c(!1)},[a,s,M,j,c,N,O,u]),za({enabled:s&&a&&D===`idle`,open:!0,ref:d,onComplete(){s&&j(DS,!1)}}),v.useEffect(()=>{if(s||!a||D!==`ending`)return;if(!d.current){c(!1),j(DS,!1);return}let e=new AbortController,t=-1;function n(){w.current||(c(!1),j(DS,!1))}return t=Hn.request(()=>{T(n,e.signal)}),()=>{Hn.cancel(t),e.abort()}},[w,a,s,D,T,j,c]),K(()=>{let e=d.current;e&&n&&E&&e.setAttribute(`hidden`,`until-found`)},[E,n]),v.useEffect(function(){let e=d.current;if(!e)return;let t=fe.create(),n=-1,r=(r,i)=>{t.start(0,()=>{w.current||(n=Hn.request(()=>{w.current||(r&&(g.current=!1),i&&e.setAttribute(xS,``),e.setAttribute(`hidden`,`until-found`))}))})},i=Tn(e,`beforematch`,t=>{let n=J(Xt,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}g.current=!0;let i=e.hasAttribute(xS);e.removeAttribute(xS),l(!0),r(!0,i)});return()=>{t.clear(),Hn.cancel(n),i()}},[w,o,l]);let F=i||n||a||s;return{height:k.height,props:{...A?{[xS]:``}:void 0,hidden:E,id:r},ref:C,shouldPreventOpenAnimation:O,shouldRender:F,transitionStatus:D,width:k.width}}function kS(e){return{height:e.scrollHeight,width:e.scrollWidth}}function AS(e,t){let n=Le(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&jS(n.animationDuration),i=jS(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function jS(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function MS(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function NS(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=Hn.request(n);return()=>{Hn.cancel(r),n()}}function PS(e){let t=v.useRef(!0);t.current&&(t.current=!1,e())}function FS(e,t,n,r,i,a,o,s,c,l=2){let u=Or(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return Cr(n.current,u)?void 0:u}function IS(e){return e==null?Xt:e.type.startsWith(`key`)?fn:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?pn:Xt}var LS=v.createContext(void 0),RS=v.createContext(void 0),zS=v.createContext(void 0),BS=v.createContext(!1),VS=v.createContext(``);function HS(){let e=v.useContext(LS);if(!e)throw Error(q(22));return e}function US(){let e=v.useContext(RS);if(!e)throw Error(q(23));return e}function WS(){let e=v.useContext(zS);if(!e)throw Error(q(24));return e}function GS(){return v.useContext(VS)}function KS(){return v.useContext(BS)}function qS(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var JS=(e,t)=>Object.is(e,t);function YS(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function XS(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!qS(e,t,(e,t)=>YS(e,t,n)):e!==t}function ZS(e,t,n){return e?e.some(e=>e!==void 0&&YS(t,e,n)):!1}function QS(e,t,n){return e?e.findIndex(e=>e!==void 0&&YS(e,t,n)):-1}function $S(e,t){if(t!==JS)return n=>ZS(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function eC(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex($S(t,n)):QS(e,t,n);return i===-1?null:i}function tC(e,t,n,r,i,a){return ZS(r,t,i)?a!=null&&e>a&&ZS(r,n[a],i)?a:e:e===a?eC(n,r,i,!0):a}function nC(e,t,n){return e.filter(e=>!YS(t,e,n))}function rC(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function iC(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function aC(e){return iC(e?.[0])}function oC(e){return aC(e)?e.flatMap(e=>e.items):e}function sC(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(aC(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function cC(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return rC(e)}function lC(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?rC(e.value):rC(e)}function uC(e,t,n){function r(){return cC(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=oC(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function dC(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,S.jsx)(v.Fragment,{children:uC(r,t,n)},i)),e),[])}var fC={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?sC(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>YS(t,e,n)):YS(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function pC(e){return e==null?void 0:`${e}-popup`}function mC(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function hC(e){return Array.isArray(e)?e.map(e=>hC(e)).join(`,`):e==null?``:String(e)}var gC=new Map;function _C(e={}){let{locale:t,...n}=e,r={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...n},i=`${hC(t)}|${JSON.stringify(r)}`,a=gC.get(i);if(a)return a;let o=new Intl.Collator(t,r),s={contains(e,t,n){if(!t)return!0;let r=cC(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(o.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=cC(e,n);return o.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=cC(e,n),i=t.length;return r.length>=i&&o.compare(r.slice(r.length-i),t)===0}};return gC.set(i,s),s}var vC=_C;function yC(e,t=!1){let{overflowY:n}=et(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var bC=Symbol(`none`),xC={value:bC,index:-1};function SC(e,t,n){let r=e.get(t);if(r!==void 0||n===JS)return r;for(let[r,i]of e)if(YS(r,t,n))return i}function CC(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:y=!1,items:b,filteredItems:x,filter:C,filterQuery:w,openOnInputClick:T=!0,autoHighlight:E=!1,keepHighlight:D=!1,highlightItemOnHover:O=!0,loopFocus:k=!0,itemToStringLabel:A,itemToStringValue:j,isItemEqualToValue:M=JS,virtualized:N=!1,inline:P=!1,fillInputOnItemPress:F=!0,modal:I=!1,limit:L=-1,autoComplete:R=`list`,formAutoComplete:z,locale:B,submitOnItemClick:V=!1}=e,{clearErrors:H}=Yf(),{setDirty:te,validityData:ne,setFilled:re,name:U,disabled:ie,setTouched:ae,setFocused:se,validationMode:ce,validation:le}=qf(),ue=wc(),de=tp({id:t}),fe=vC({locale:B}),pe=Array.isArray(b)?null:b;if(pe&&typeof pe.label!=`function`)throw Error(q(100));let me=pe?pe.data:b,he=pe?.value,ge=he?void 0:me,_e=v.useMemo(()=>{if(!x||!he)return;let e=oC(x),t=e.map(he),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return SC(n,r,i)}}},[x,he]),ve=v.useMemo(()=>pe?e=>pe.label(e,M,e=>{let t=_e?.findItem(e,M);return t==null?cC(e,A):pe.itemLabel(t)}):A,[pe,A,_e,M]),ye=v.useMemo(()=>pe?Object.assign(e=>pe.itemLabel(e),{selected:e=>cC(e,ve)}):A,[pe,ve,A]);function be(e){return cC(e,ve)}let[xe,Se]=v.useState(!1),[Ce,we]=v.useState(null),Te=v.useRef(Ce),Ee=v.useRef([]),De=v.useRef([]),Oe=v.useRef(null),ke=v.useRef(null),Ae=v.useRef(null),je=v.useRef(null),Me=v.useRef(null),Ne=v.useRef(!1),Pe=v.useRef(null),Fe=v.useRef(null),Ie=v.useRef(null),Le=v.useRef(xC),Re=v.useRef(null),ze=v.useRef([]),Be=v.useRef(null),He=ie||m,Ue=U??f,We=u===`multiple`,Ge=u===`single`,Ke=s!==void 0||o!==void 0,qe=me!==void 0,Je=x!==void 0,Ye;Ye=E===`always`?`always`:E?`input-change`:!1;let[Xe,Ze]=Xb({controlled:i,default:We?r??W:r,name:`Combobox`,state:`selectedValue`}),Qe=v.useMemo(()=>C===null?()=>!0:C===void 0?mC(fe,ye):C,[C,fe,ye]),$e=ee(()=>Ke?o??``:Ge?be(Xe):``).current,[et,tt]=Xb({controlled:s,default:$e,name:`Combobox`,state:`inputValue`}),[nt,rt]=Xb({controlled:c,default:l,name:`Combobox`,state:`open`}),at=aC(me),ut=!nt&&Ce!==null?Ce:String(et).trim(),dt=Ge?be(Xe):``,ft=Ge&&!xe&&ut!==``&&dt.length===ut.length&&fe.contains(dt,ut),pt=ft?``:w??ut,mt=qe&&Je&&ft&&(!pe||pe.hasValue(Xe,M)),ht=v.useMemo(()=>me?oC(me):W,[me]),gt=v.useMemo(()=>{if(x&&!mt)return x;if(!me)return W;if(at){let e=me,t=[],n=0;for(let r of e){if(L>-1&&n>=L)break;let e=L>-1?L-n:1/0,i=pt===``?r.items.slice(0,e):[];if(pt!==``)for(let t of r.items){if(i.length>=e)break;Qe(t,pt,ye)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(pt===``)return L>-1?ht.slice(0,L):ht;let e=[];for(let t of ht){if(L>-1&&e.length>=L)break;Qe(t,pt,ye)&&e.push(t)}return e},[x,mt,me,at,pt,L,Qe,ye,ht]),_t=v.useMemo(()=>{if(_e&>===x)return _e.values;let e=oC(gt);return he?e.map(e=>he(e)):e},[gt,x,_e,he]),vt=ee(()=>{let e=null;return P&&nt&&qe&&u!==`none`&&(e=eC(_t,Xe,M,We)),new ho({id:de,labelId:void 0,selectedValue:Xe,open:nt,items:ge,selectionMode:u,name:Ue,form:p,disabled:He,readOnly:h,required:g,grid:y,virtualized:N,openOnInputClick:T,itemToStringLabel:ve,isItemEqualToValue:M,modal:I,autoHighlight:Ye,submitOnItemClick:V,hasInputValue:Ke,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:P,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemRoot:{props:G,id:de,selectionMode:u,disabled:He,readOnly:h,isItemEqualToValue:M},positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:oe,setOpen:oe,setInputValue:oe,setSelectedValue:oe,setIndices:oe,handleSelection:oe,forceMount:oe,requestSubmit:oe,listRef:Ee,labelsRef:De,popupRef:Oe,emptyRef:Me,inputRef:ke,startDismissRef:Ae,endDismissRef:je,chipsContainerRef:Pe,clearRef:Fe,valuesRef:ze,pointerDownItemRef:Be,selectionEventRef:Ie},fC)}).current,yt=u===`none`?et:Xe,bt=v.useMemo(()=>u===`none`?yt:Array.isArray(Xe)?Xe.map(e=>lC(e,j)):lC(Xe,j),[yt,j,u,Xe]),xt=Y(d),St=Y(n),Ct=vt.useState(`activeIndex`),wt=vt.useState(`selectedIndex`),Tt=vt.useState(`positionerElement`),Et=vt.useState(`listElement`),Dt=vt.useState(`triggerElement`),Ot=vt.useState(`inputElement`),kt=vt.useState(`inputGroupElement`),At=vt.useState(`inline`),jt=vt.useState(`inputInsidePopup`),Mt=vt.useState(`inputOwnsFormValue`),Nt=Ge&&!jt&&et===dt,Pt=Nn(Dt),{openMethod:Ft,triggerProps:It}=Zy(nt),Lt=Y(()=>bt);ap(jt?Pt:ke,de,yt,Lt,!He,f);let Rt=Y(()=>{me?De.current=_t.map(be):vt.set(`forceMounted`,!0)}),zt=Y((e,t,n,r)=>{if(t===-1){if(Le.current===xC)return;Le.current=xC}else Le.current={value:e,index:t};xt(e,Yt(n,r,{index:t}))}),Bt=Y(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),vt.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?zt(void 0,-1,r,e.event):zt(ze.current[n],n,r,e.event)}),Vt=Y((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Ne.current=n.reason===sn,n.reason===`input-change`){nt&&Ce!==null&&we(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&Se(!0),Re.current={hasQuery:e};let n=vt.state.listElement;if(!vt.state.virtualized&&n){let e=Oe.current;for(let t of it(n.firstElementChild??n)){if(!Ve(t)||(e?!st(e,t):t.getAttribute(`role`)===`dialog`))break;if(yC(t)){t.scrollTop=0;break}}}e&&Ye&&vt.state.activeIndex==null&&(nt||At)&&vt.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&vt.state.inputInsidePopup&&(Re.current={hasQuery:!1,selection:!0});tt(t)}}),Ht=Y(e=>{let t=!e&&jt&&!At&&et!==``&&(String(et).trim()===Ce||et===dt);!e&&(t||et===``||Nt)&&Se(!1),we(null),t&&Vt(``,J(sn))}),[Ut,Wt]=v.useState(!1),Gt=Y((t,n)=>{if(nt===t)return;n.reason===`escape-key`&&qe&&_t.length===0&&!Me.current&&n.allowPropagation();let r=n,i=Ja(r);if(e.onOpenChange?.(t,r),Re.current?.hasQuery&&n.reason===`input-change`===n.isCanceled&&(Re.current=null),!n.isCanceled&&(t&&Ce!==null&&Ht(n.reason===on),!t&&xe&&(Ge?(At||we(ut),ut===``&&Se(!1)):We&&(At||we(ut),jt&&Bt({activeIndex:null}),(!jt||At)&&Vt(``,J(sn,n.event,void 0,{isItemPress:n.reason===tn})))),t||Wt(i()),rt(t),!t&&jt&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(ae(!0),se(!1),ce===`onBlur`))){let e=u===`none`?et:Xe;le.commit(e)}}),Kt=Y((e,t)=>{a?.(e,t),!t.isCanceled&&(Ze(e),(u===`none`&&Oe.current&&F||Ge&&!vt.state.inputInsidePopup)&&Vt(be(e),J(t.reason,t.event)))}),qt=Y((e,t)=>{let n=lt(e),r=Ie.current??e;Ie.current=null;let i=J(tn,r),a=ct(n,`a`)?.getAttribute(`href`);if(a)a.startsWith(`#`)&&Gt(!1,i);else if(We){let e=Array.isArray(Xe)?Xe:[],n=ZS(e,t,M),r=n?nC(e,t,M):[...e,t];if(Kt(r,i),i.isCanceled||!(ke.current&&ke.current.value.trim()!==``))return;if(vt.state.inputInsidePopup){Vt(``,J(sn,i.event,void 0,{isItemPress:!0}));let e=Re.current;e&&!n&&(e.toggledValue=t)}else Gt(!1,i)}else{if(Kt(t,i),i.isCanceled)return;Gt(!1,i)}}),Jt=Y(()=>{let e=le.inputRef.current?.form??vt.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Zt=Y(()=>{if(St?.(!1),Se(!1),we(null),Bt(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),We&&ke.current&&ke.current.value!==``&&!Ne.current&&Vt(``,J(sn)),Ge){if(vt.state.inputInsidePopup)ke.current&&ke.current.value!==``&&Vt(``,J(sn));else{let e=be(Xe);ke.current&&ke.current.value!==e&&Vt(e,J(e===``?sn:Xt))}}}),Qt=v.useMemo(()=>At&&Tt?{current:ct(Tt,`[role="dialog"]`)}:Oe,[At,Tt]),{mounted:$t,transitionStatus:en,forceUnmount:nn}=Ba({open:nt,ref:Qt,preventUnmountOnClose:Ut,setPreventUnmountOnClose:Wt,onUnmount:Zt});v.useImperativeHandle(e.actionsRef,()=>({unmount:nn,close:()=>Gt(!1,J(yn))}),[nn,Gt]),K(function(){let e=Te.current!==null&&Ce===null;if(Te.current=Ce,nt&&(!e||!qe)||(nt||(Be.current=null),u===`none`))return;let t=qe?_t:ze.current;Bt({selectedIndex:eC(t,Xe,M,We)})},[nt,Ce,Xe,u,We,qe,_t,M,Bt]),K(()=>{me&&(ze.current=_t,Ee.current.length=_t.length)},[me,_t]),K(()=>{!nt&&Re.current?.hasQuery&&(Re.current=null)},[nt]),K(()=>{if(!nt&&At&&Qt.current){Re.current=null;return}let e=qe||Je?_t:ze.current,t=Re.current;if(t){let n=nt||At||vt.state.positionerElement?.hidden===!1;if(t.hasQuery){let t=ke.current;!Ye||String(et).trim()===``||At&&Ye!==`always`&&(!t||ot(t.ownerDocument)!==t)?Re.current=null:n&&(e[0]!==void 0||!qe&&!Je)&&(vt.set(`activeIndex`,0),Re.current=null)}else if(String(et).trim()===``&&(Re.current=null,n)){let e=t.selection;Ye===`always`&&!e&&vt.state.selectionMode===`none`&&vt.set(`activeIndex`,0),queueMicrotask(()=>{if(!vt.state.open&&(!vt.state.inline||Qt.current)||ke.current&&ke.current.value.trim()!==``)return;let n=vt.state.selectedValue,r=vt.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:vt.state.selectionMode!==`none`&&n!=null){let e=qe||Je?_t:ze.current,i=QS(e,t.toggledValue,vt.state.isItemEqualToValue);vt.set(`activeIndex`,i===-1?eC(e,n,vt.state.isItemEqualToValue,r):i)}else e?vt.set(`activeIndex`,null):Ye===`always`&&vt.set(`activeIndex`,0)})}}if(!nt&&!At)return;let n=vt.state.activeIndex;if(n==null){if(Ye===`always`&&e.length>0){vt.set(`activeIndex`,0);return}zt(void 0,-1,Xt);return}if(n>=e.length){zt(void 0,-1,Xt),vt.set(`activeIndex`,null);return}let r=e[n],i=Le.current.value,a=i!==bC&&YS(r,i,vt.state.isItemEqualToValue);(Le.current.index!==n||!a)&&zt(r,n,Xt)},[Ct,Ye,zt,Je,qe,_t,At,nt,Qt,vt,et]),K(()=>{re(u===`none`?String(et)!==``:We?Array.isArray(Xe)&&Xe.length>0:Xe!=null)},[re,u,et,Xe,We]),v.useEffect(()=>{qe&&Ye&&_t.length===0&&Bt({activeIndex:null})},[qe,Ye,_t.length,Bt]);function rn(){nt&&ut!==``&&ut!==String($e)&&!Nt&&Se(!0)}function an(){nt&&Ce!==null&&Ht(!1)}let ln=!1;function un(){!ln&&et!==dt&&(ln=!0,Vt(dt,J(Xt)))}function dn(){u!==`none`&&(H(Ue),te(XS(Xe,ne.initialValue,M)),le.change(Xe),Ge&&!Ke&&!jt&&un())}function fn(){Ge&&!Ke&&!jt&&!xe&&un()}function pn(){u===`none`&&(H(Ue),te(et!==ne.initialValue),le.change(et))}op(ut,rn),op(nt,an),op(Xe,dn),op(dt,fn),op(me,fn),op(et,pn);let mn=Eo({open:At?!0:nt,onOpenChange:Gt,elements:{reference:jt?Dt:Ot,floating:Tt}}),hn=y?`grid`:`listbox`,gn=nt||At,_n=gn?`true`:`false`,vn=v.useMemo(()=>{let e=Ot?.tagName===`INPUT`,t=Ot==null||e,n=t||gn,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=_n,r[`aria-haspopup`]=hn,r[`aria-controls`]=gn?Et?.id:void 0,r[`aria-autocomplete`]=h?`none`:R),{reference:r,floating:{role:`presentation`}}},[Ot,gn,_n,hn,Et?.id,R,h]),bn=Ta(mn,{enabled:!He&&T,event:`mousedown-only`,toggle:!1,touchOpenDelay:jt?0:100,reason:cn}),xn=ja(mn,{enabled:!He&&!At,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:At?!0:void 0,outsidePress(e){let t=lt(e);return!st(Dt,t)&&!st(Fe.current,t)&&!st(Pe.current,t)&&!st(kt,t)}}),Sn=Uo(mn,{enabled:!He,id:de,listRef:Ee,activeIndex:Ct,selectedIndex:wt,virtual:!0,loopFocus:k,allowEscape:k&&!Ye,focusItemOnOpen:xe||u===`none`&&!Ye?!1:`auto`,focusItemOnHover:O,resetOnPointerLeave:!D,orientation:y?`horizontal`:void 0,rtl:ue===`rtl`,disabledIndices:W,grid:y?FS:void 0,onNavigate(e,t){(t||nt||At&&e===null)&&en!==`ending`&&Bt({activeIndex:e,type:IS(t),event:t?.nativeEvent})}}),Cn=v.useMemo(()=>Ai(Sn.reference,{onKeyDown(e){y&&vt.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},xn.reference,bn.reference,vn.reference),[Sn.reference,xn.reference,bn.reference,vn.reference,y,vt]),wn=v.useMemo(()=>Ai(Va,xn.floating),[xn.floating]),Tn=v.useMemo(()=>Ai(Sn.floating,vn.floating),[Sn.floating,vn.floating]),En=v.useMemo(()=>{let e=Sn.item;return{props:e?{...e,onFocus:void 0}:G,id:de,selectionMode:u,disabled:He,readOnly:h,isItemEqualToValue:M}},[Sn.item,de,u,He,h,M]);vt.useContextCallback(`setOpen`,Gt),vt.useContextCallback(`setInputValue`,Vt),vt.useContextCallback(`setSelectedValue`,Kt),vt.useContextCallback(`setIndices`,Bt),vt.useContextCallback(`handleSelection`,qt),vt.useContextCallback(`forceMount`,Rt),vt.useContextCallback(`requestSubmit`,Jt),vt.useContextCallback(`onOpenChangeComplete`,n),PS(()=>{vt.update({inline:P,popupProps:wn,listProps:Tn,inputProps:Cn,triggerProps:It,itemRoot:En})});let On={id:de,selectedValue:Xe,open:nt,mounted:$t,transitionStatus:en,items:ge,inline:P,popupProps:wn,listProps:Tn,inputProps:Cn,triggerProps:It,itemRoot:En,openMethod:Ft,selectionMode:u,name:Ue,form:p,disabled:He,readOnly:h,required:g,grid:y,virtualized:N,openOnInputClick:T,itemToStringLabel:ve,modal:I,autoHighlight:Ye,isItemEqualToValue:M,submitOnItemClick:V,hasInputValue:Ke};K(()=>{vt.update({...On,inputOwnsFormValue:u===`none`&&(P||!vt.state.inputInsidePopup)})},[vt,...Object.values(On)]);let kn=Dn(_,le.inputRef),An=v.useMemo(()=>({query:ut,hasItems:qe,filteredItems:gt,flatFilteredValues:_t}),[ut,qe,gt,_t]),jn=v.useMemo(()=>Array.isArray(yt)?``:lC(yt,j),[yt,j]),Mn=We&&Array.isArray(Xe)&&Xe.length>0,Pn=We||u===`none`&&Mt?void 0:Ue,Fn=v.useMemo(()=>!We||!Array.isArray(Xe)||!Ue?null:Xe.map(e=>{let t=lC(e,j);return(0,S.jsx)(`input`,{type:`hidden`,form:p,name:Ue,value:t,disabled:He},t)}),[We,Xe,p,Ue,j,He]),In=(0,S.jsxs)(v.Fragment,{children:[e.children,(0,S.jsx)(`input`,{...le.getValidationProps(He,{onFocus(){jt?Dt?.focus():(ke.current||Dt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||He||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=J(Xt,e.nativeEvent),i=()=>ze.current.findIndex(e=>lC(e,j).toLowerCase()===n||be(e).toLowerCase()===n);function a(){if(We)return;if(u===`none`){Vt(t,r);return}let e=i();e===-1&&(e=ze.current.findIndex((e,t)=>{let r=De.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:ze.current[e];a!=null&&Kt?.(a,r)}Ge&&(Rt(),me&&i()===-1&&vt.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:de&&Pn==null?`${de}-hidden-input`:void 0,form:p,name:Pn,autoComplete:z,disabled:He,required:g&&!Mn,readOnly:h,value:jn,ref:kn,style:Pn?qn:Kn,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Fn]});return(0,S.jsx)(LS.Provider,{value:vt,children:(0,S.jsx)(RS.Provider,{value:mn,children:(0,S.jsx)(BS.Provider,{value:qe,children:(0,S.jsx)(zS.Provider,{value:An,children:(0,S.jsx)(VS.Provider,{value:et,children:In})})})})})}var wC=`data-popup-side`,TC=`data-list-empty`,EC={...Mt,...Wf,popupSide:e=>e?{[wC]:e}:null,listEmpty:e=>e?{[TC]:``}:null},DC=5;function OC(e,t){let n=kC(t);return e.clientX>=n.left-DC&&e.clientX<=n.right+DC&&e.clientY>=n.top-DC&&e.clientY<=n.bottom+DC}function kC(e){let t=e.getBoundingClientRect(),n=Le(e);if(Oe)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function AC(e,t){return e??t}function jC(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function MC(){return WS().filteredItems.length===0}function NC(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function PC(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function FC(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var IC=v.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:o,style:s,...c}=e,{state:l,disabled:u,setTouched:d,validationMode:f,validation:p}=qf(),{labelId:m}=Zf(),h=HS(),g=h.useState(`selectionMode`),_=h.useState(`disabled`),y=h.useState(`readOnly`),b=h.useState(`required`),x=h.useState(`positionerElement`),S=h.useState(`listElement`),C=h.useState(`popupId`),w=h.useState(`triggerProps`),T=h.useState(`inputInsidePopup`),E=h.useState(`id`),D=h.useState(`labelId`),O=h.useState(`open`),k=h.useState(`selectedValue`),A=h.useState(`activeIndex`),j=h.useState(`selectedIndex`),M=h.useState(`hasSelectedValue`),N=US(),P=GS(),F=pe(),I=u||_||a,L=MC(),R=jC(h),z=v.useRef(null),B=ip(I,z);tp({id:T?o:void 0});let V=T?o??E:o,ee=AC(m,D),H;O&&T?H=C??pC(E):O&&(H=S?.id);let te=v.useRef(``);function ne(e){te.current=e.pointerType}let{reference:re}=Wo(N,{enabled:!O&&!y&&!_&&g===`single`,listRef:h.context.labelsRef,activeIndex:A,selectedIndex:j,onMatch(e){let t=h.context.valuesRef.current[e];t!==void 0&&h.context.setSelectedValue(t,J(Xt))}}),{reference:U}=Ta(N,{enabled:!_,event:`mousedown`}),{buttonRef:ie,getButtonProps:ae}=Nf({native:i,disabled:I}),oe={...l,readOnly:y,open:O,disabled:I,popupSide:R,listEmpty:L,placeholder:g!==`none`&&!M};return Ui(`button`,e,{ref:[t,ie,z,Y(e=>{h.set(`triggerElement`,e)})],state:oe,props:[w,U,re,{id:V,tabIndex:T?0:-1,role:T?`combobox`:void 0,"aria-expanded":O,"aria-haspopup":T?`dialog`:`listbox`,"aria-controls":H,"aria-required":T&&b||void 0,"aria-readonly":T&&y||void 0,"aria-labelledby":ee,onPointerDown:ne,onPointerEnter:ne,onFocus(){B(!0),!I&&F.start(0,h.context.forceMount)},onBlur(e){if(!st(x,e.relatedTarget)&&(d(!0),B(!1),f===`onBlur`)){let e=g===`none`?P:k;p.commit(e)}},onMouseDown(e){if(I||(T||N.set(`domReferenceElement`,e.currentTarget),h.context.forceMount(),te.current!==`touch`&&(h.context.inputRef.current?.focus(),T||e.preventDefault()),O))return;let t=Wn(e.currentTarget);function n(e){let t=h.state.triggerElement;if(!t)return;let n=lt(e),r=h.state.positionerElement,i=h.state.listElement;st(t,n)||st(r,n)||st(i,n)||OC(e,t)||h.context.setOpen(!1,J(mn,e))}T&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(ke(e),h.context.setOpen(!0,J(dn,e.nativeEvent)),h.context.inputRef.current?.focus())}},p.getValidationProps(I,c),ae],stateAttributesMapping:EC})}),LC=v.createContext(void 0);function RC(){return v.useContext(LC)}var zC=v.createContext(void 0);function BC(e){let t=v.useContext(zC);if(t===void 0&&!e)throw Error(q(21));return t}var VC=v.forwardRef(function(e,t){let n=HS(),{buttonRef:r,getButtonProps:i}=Nf({native:!1}),a=Dn(t,r);function o(e){n.context.setOpen(!1,J(nn,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,S.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:qn})}),HC=v.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,validationMode:d,validation:f}=qf(),{labelId:p}=Zf(),m=RC(),h=!!BC(!0),g=HS(),_=GS(),y=wc(),b=g.useState(`required`),x=g.useState(`disabled`),C=g.useState(`readOnly`),w=g.useState(`name`),T=g.useState(`form`),E=g.useState(`selectionMode`),D=g.useState(`autoHighlight`),O=g.useState(`inputProps`),k=g.useState(`triggerProps`),A=g.useState(`open`),j=g.useState(`mounted`),M=g.useState(`selectedValue`),N=g.useState(`id`),P=g.useState(`inline`),F=g.useState(`modal`),I=!!D,L=jC(g),R=l||x||i,z=MC(),B=ip(R,g.context.inputRef),V=h||P,ee=!V||F,H=uc(a??(V?void 0:N)),te=h?Hf:c,[ne,re]=v.useState(null),U=v.useRef(!1),ie=v.useRef(null);K(()=>{A||(ie.current=null)},[A]);let ae=E===`none`&&!h,oe=Y(e=>{let t=h||g.state.inline;t&&!g.state.hasInputValue&&g.context.setInputValue(``,J(Xt)),g.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ae})}),W=h?s:f.getValidationProps(R,s);function G(e){g.context.setIndices({activeIndex:null,selectedIndex:null,type:IS(e),event:e})}let se={...te,open:A,disabled:R,readOnly:C,popupSide:L,listEmpty:z};function q(e){if(!m)return;let t,n=m.chipsRef.current.length,[r]=NC(y);return e.key===r&&(e.currentTarget.selectionStart??0)===0&&M.length>0&&(e.preventDefault(),t=n>0?n-1:void 0),t}let ce=Ui(`input`,e,{state:se,ref:[t,g.context.inputRef,oe],props:[O,k,{value:ne??_,"aria-readonly":C||void 0,"aria-required":b||void 0,"aria-labelledby":p,disabled:R,readOnly:C,required:E===`none`?b:void 0,form:T,...ae&&w&&{name:w},id:H,onFocus(){if(B(!0),!P)return;let e=ie.current;ie.current=null,e!=null&&Object.hasOwn(g.context.valuesRef.current,e)&&g.context.setIndices({activeIndex:e})},onBlur(){u(!0),B(!1);let e=g.state.activeIndex;if(P&&e!==null&&D!==`always`&&(ie.current=e,g.context.setIndices({activeIndex:null})),d===`onBlur`){let e=E===`none`?_:M;f.commit(e)}},onCompositionStart(e){Se||(U.current=!0,re(e.currentTarget.value))},onCompositionEnd(e){U.current=!1;let t=e.currentTarget.value;re(null),g.context.setInputValue(t,J(on,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=U.current||!r;function a(e){!C&&!R&&e&&i&&(g.context.setOpen(!0,J(on,t)),I||G(t))}if(U.current){let n=e.currentTarget.value;re(n),n===``&&!g.state.openOnInputClick&&!g.state.inputInsidePopup&&g.context.setOpen(!1,J(sn,t));let r=n.trim(),i=I&&r!==``;a(r),A&&g.state.activeIndex!==null&&!i&&G(t);return}let o=J(on,t);if(g.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=J(sn,t);s&&!g.state.inputInsidePopup&&(E===`single`&&g.context.setSelectedValue(null,c),g.state.openOnInputClick||g.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),A&&g.state.activeIndex!==null&&!I&&G(t)},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(R||C){C&&e.key===`Enter`&&A&&g.state.activeIndex!==null&&ke(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){ke(e);let n=Ee&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){ke(e);let i=Ee&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!j&&e.key===`Escape`){let t=E===`multiple`&&Array.isArray(M)?M.length===0:M===null,n=J(un,e.nativeEvent),r=E===`multiple`?[]:null;g.context.setInputValue(``,n),g.context.setSelectedValue(r,n),!t&&!g.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(m&&e.key===`Backspace`&&t.value===``&&Array.isArray(M)&&M.length>0){let t=m.chipsRef.current.length,n=t>0?t-1:M.length-1,r=M.filter((e,t)=>t!==n);G(e.nativeEvent),g.context.setSelectedValue(r,J(Xt,e.nativeEvent));return}let i=q(e);if(i!==void 0&&m?.chipsRef.current[i]?.focus(),e.which!==229&&e.key===`Enter`&&A){let t=g.state.activeIndex,n=e.nativeEvent;if(t===null){if(P)return;g.context.setOpen(!1,J(Xt,n));return}ke(e),FC(g,t,n)}}},W],stateAttributesMapping:EC}),le=h?(0,S.jsx)(Kf.Provider,{value:Gf,children:ce}):ce;return(0,S.jsxs)(v.Fragment,{children:[A&&ee&&(0,S.jsx)(VC,{ref:g.context.startDismissRef}),le]})});function UC(e,t,n,r){if(e.baseUIHandlerPrevented)return;let i=lt(e.nativeEvent),a=Be(i)?i:null;(a===e.currentTarget||!r?.(a)&&!Bt(a))&&(e.preventDefault(),!n&&(t.context.inputRef.current?.focus(),t.state.openOnInputClick&&t.context.setOpen(!0,J(cn,e.nativeEvent))))}var WC={...bt,...jt},GC=v.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,style:s,...c}=e,{disabled:l}=qf(),u=HS(),d=u.useState(`selectionMode`),f=u.useState(`disabled`),p=u.useState(`readOnly`),m=u.useState(`open`),h=u.useState(`selectedValue`),g=u.useState(`hasSelectionChips`),_=GS(),v=!1;v=d===`none`?_!==``:d===`single`?h!=null:g;let y=l||f||i,{buttonRef:b,getButtonProps:x}=Nf({native:a,disabled:y}),{mounted:S,transitionStatus:C,setMounted:w}=Pa(v),T={disabled:y,visible:v,open:m,transitionStatus:C};za({open:v,ref:u.context.clearRef,onComplete(){v||w(!1)}});let E=Ui(`button`,e,{state:T,ref:[t,b,u.context.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(y||p)return;let t=IS(e);u.context.setInputValue(``,J(rn,e.nativeEvent)),d===`none`?u.context.setIndices({activeIndex:null,type:t,event:e.nativeEvent}):(u.context.setSelectedValue(Array.isArray(h)?[]:null,J(rn,e.nativeEvent)),u.context.setIndices({activeIndex:null,selectedIndex:null,type:t,event:e.nativeEvent})),u.context.inputRef.current?.focus()}},c,x],stateAttributesMapping:WC});return o||S?E:null}),KC=v.createContext(null);function qC(){return v.useContext(KC)}function JC(e){let{children:t,items:n}=e,r=v.useMemo(()=>({items:n}),[n]);return(0,S.jsx)(KC.Provider,{value:r,children:t})}function YC(e){let{children:t}=e,{filteredItems:n}=WS(),r=qC(),i=r?r.items:n;return(0,S.jsx)(v.Fragment,{children:i.map(t)})}var XC=v.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=HS(),l=US(),u=!!BC(!0),{filteredItems:d,hasItems:f}=WS(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),y=c.useState(`forceMounted`),b=p===`multiple`,x=d.length===0,C=Y(e=>{c.set(`positionerElement`,e)}),w=Y(e=>{c.set(`listElement`,e)}),T=v.useMemo(()=>typeof o==`function`?n||=(0,S.jsx)(YC,{children:o}):o,[o]),E={empty:x},D=l.useState(`floatingId`),O=Ui(`div`,e,{state:E,ref:[t,w,u?null:C],props:[g,{children:T,tabIndex:-1,id:D,role:m?`grid`:`listbox`,"aria-multiselectable":b?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;ke(e),FC(c,t,e.nativeEvent)}}},s]});if(_)return O;let k=f&&!y?void 0:c.context.labelsRef;return(0,S.jsx)($b,{elementsRef:c.context.listRef,labelsRef:k,children:O})}),ZC=``;function QC(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function $C(e=!0){let t=pe(),n=v.useRef(null);return v.useEffect(()=>{if(!e||be)return;let r=n.current;if(r==null)return;let i=QC(r);if(i==null)return;let a=i.data,o=`${a}${ZC}`;return i.nodeValue=o,t.start(200,()=>{i.nodeValue===o&&(i.nodeValue=a)}),()=>{t.clear(),i.nodeValue===o&&(i.nodeValue=a)}},[e,n,t]),n}var ew=v.createContext(void 0);function tw(){let e=v.useContext(ew);if(e===void 0)throw Error(q(20));return e}var nw=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=HS(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,S.jsx)(ew.Provider,{value:n,children:(0,S.jsx)(aa,{ref:t,...r})}):null}),rw=v.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=Qi,style:g,..._}=e,v=HS(),y=US(),b=tw(),x=v.useState(`modal`),C=v.useState(`open`),w=v.useState(`mounted`),T=v.useState(`openMethod`),E=v.useState(`positionerElement`),D=v.useState(`triggerElement`),O=v.useState(`inputElement`),k=v.useState(`inputGroupElement`),A=v.useState(`inputInsidePopup`),j=v.useState(`transitionStatus`),M=MC(),N=Rc({anchor:i??(A?D:k??O),floatingRootContext:y,positionMethod:a,mounted:w,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});Ob(C&&x,T===`touch`,E,D);let P={open:C,side:N.side,align:N.align,anchorHidden:N.anchorHidden,empty:M};K(()=>{v.set(`popupSide`,N.side)},[v,N.side]);let F=Y(e=>{v.set(`positionerElement`,e)}),I=Hc(e,P,{styles:N.positionerStyles,transitionStatus:j,props:_,refs:[t,F],hidden:!w,inert:!C});return(0,S.jsxs)(zC.Provider,{value:N,children:[w&&x&&(0,S.jsx)(Oy,{inert:qc(!C),cutout:k??O??D}),I]})}),iw={...Nt,...bt},aw=v.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=HS(),l=BC(),u=US(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),y=c.useState(`modal`),b=c.useState(`id`),x=MC(),C=s.id??(g?pC(b):void 0);K(()=>(c.set(`popupId`,c.context.popupRef.current?.id||C),()=>{c.set(`popupId`,void 0)}),[c,C]),za({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let w=Ui(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:x},ref:[t,c.context.popupRef],props:[m,{id:C,role:g?`dialog`:`presentation`,onFocus(e){let t=lt(e.nativeEvent);p!==`touch`&&(st(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},Vc(h),s],stateAttributesMapping:iw}),T=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,E;E=o??(g?void 0:!1);let D=!g||y;return(0,S.jsx)(wa,{context:u,disabled:!d,modal:D,openInteractionType:p,initialFocus:T,returnFocus:E,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,S.jsxs)(v.Fragment,{children:[w,D&&(0,S.jsx)(VC,{ref:c.context.endDismissRef})]})})}),ow=v.createContext(void 0);function sw(){let e=v.useContext(ow);if(e===void 0)throw Error(q(18));return e}var cw=v.forwardRef(function(e,t){let{render:n,className:r,style:i,items:a,...o}=e,s=HS().useState(`grid`),[c,l]=v.useState(),u=v.useMemo(()=>({labelId:c,setLabelId:l,items:a}),[c,l,a]),d=Ui(`div`,e,{ref:t,props:[{role:s?`rowgroup`:`group`,"aria-labelledby":c},o]}),f=(0,S.jsx)(ow.Provider,{value:u,children:d});return a?(0,S.jsx)(JC,{items:a,children:f}):f}),lw=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=sw(),c=uc(a);return K(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),Ui(`div`,e,{ref:t,props:[{id:c,"aria-hidden":!0},o]})}),uw=v.createContext(void 0);function dw(){let e=v.useContext(uw);if(!e)throw Error(q(19));return e}var fw=v.createContext(!1);function pw(){return v.useContext(fw)}function mw(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=v.useRef(null),m=mx({guess:!0,index:l,textRef:p}),h=HS(),g=pw(),_=KS(),{props:y,id:b,selectionMode:x,disabled:C,readOnly:w,isItemEqualToValue:T}=h.useState(`itemRoot`),E=C||u,D=x!==`none`,O=l??i??m.index,k=O!==-1,A=h.useState(`isActive`,O),j=h.useState(`isSelected`,c),M=v.useRef(null),N=b!=null&&k?`${b}-${O}`:void 0,P=j&&D;K(()=>{if(!k||!r&&l==null)return;let e=h.context.listRef.current;return e[O]=M.current,()=>{delete e[O]}},[k,r,O,l,h]),K(()=>{if(!k||_)return;let e=h.context.valuesRef.current;return e[O]=c,()=>{delete e[O]}},[k,_,O,c,h]),K(()=>{if(!k||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=tC(O,c,h.context.valuesRef.current,e,T,t):YS(c,e,T)&&(t=O),h.set(`selectedIndex`,t)},[k,_,h,O,c,T]);let{getButtonProps:F,buttonRef:I}=Nf({disabled:E,focusableWhenDisabled:!0,native:d,composite:!0}),L={disabled:E,selected:P,highlighted:A};function z(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(R.flushSync(t),h.context.requestSubmit()):t()}let B={id:N,role:g?`gridcell`:`option`,"aria-selected":D?P:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){E||w||z(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(E||w||e.button!==0||t||!A)&&z(e.nativeEvent)}},V=Ui(`div`,t,{ref:[I,n,m.ref,M],state:L,props:[y,B,f,F]}),ee=v.useMemo(()=>({selected:P,textRef:p}),[P,p]);return(0,S.jsx)(uw.Provider,{value:ee,children:V})}function hw(e){let{componentProps:t,forwardedRef:n}=e,r=HS().useState(`isItemEqualToValue`),{flatFilteredValues:i}=WS(),a=QS(i,t.value??null,r);return(0,S.jsx)(mw,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var gw=v.memo(v.forwardRef(function(e,t){let n=HS().useState(`virtualized`);return n&&e.index==null?(0,S.jsx)(hw,{componentProps:e,forwardedRef:t}):(0,S.jsx)(mw,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),_w=v.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=WS(),c=HS(),l=$C(),u=s.length===0?a:null;return Ui(`div`,e,{ref:[t,c.context.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})}),vw=v.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Ui(`div`,e,{state:{orientation:i},ref:t,props:[{role:`presentation`},o]})}),yw={...ES,...bt},bw=v.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=Y(o),d=gS({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=v.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=v.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=Ui(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:yw});return(0,S.jsx)(_S.Provider,{value:p,children:m})}),xw={...TS,...bt},Sw=v.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=vS(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=Nf({disabled:c,native:u});return Ui(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:xw})}),Cw=`--collapsible-panel-height`,ww=`--collapsible-panel-width`,Tw=v.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=vS(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;K(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=OS({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=Oi(s,k),j=Ui(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[Cw]:S===void 0?`auto`:`${S}px`,[ww]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:yw});return E?j:null});function Ew(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,S.jsx)(CC,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}function Dw(e){let{children:t,placeholder:n}=e,r=HS(),i=r.useState(`itemToStringLabel`),a=r.useState(`selectedValue`),o=r.useState(`items`),s=r.useState(`selectionMode`)===`multiple`,c=r.useState(`hasSelectedValue`),l=!c&&n!=null&&t==null,u=r.useState(`hasNullItemLabel`,l),d=null;return d=typeof t==`function`?t(a):t??(!c&&n!=null&&!u?n:s&&Array.isArray(a)?dC(a,o,i):uC(a,o,i)),(0,S.jsx)(v.Fragment,{children:d})}var Ow=v.memo(v.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=v.useRef(null),{transitionStatus:l,setMounted:u}=Pa(o),d=Ui(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:bt});return za({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),kw=v.forwardRef(function(e,t){let{selected:n}=dw();return e.keepMounted||n?(0,S.jsx)(Ow,{...e,selected:n,ref:t}):null}),Aw=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=HS(),s=o.useState(`hasSelectionChips`),c=v.useRef([]),l=Ui(`div`,e,{ref:[t,o.context.chipsContainerRef],props:[s?{role:`toolbar`}:G,{onMouseDown(e){UC(e,o,o.state.disabled)}},a]}),u=v.useMemo(()=>({chipsRef:c}),[]);return(0,S.jsx)(LC.Provider,{value:u,children:(0,S.jsx)($b,{elementsRef:c,children:l})})}),jw=v.createContext(void 0);function Mw(){let e=v.useContext(jw);if(!e)throw Error(q(17));return e}var Nw=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=HS(),{chipsRef:s}=RC(),c=wc(),l=o.useState(`disabled`),u=o.useState(`readOnly`),d=o.useState(`selectedValue`),{ref:f,index:p}=mx();function m(e){let t=p,[n,r]=NC(c);return e.key===n?(e.preventDefault(),t=p>0?p-1:void 0):e.key===r?(e.preventDefault(),t=p<s.current.length-1?p+1:void 0):e.key===`Backspace`||e.key===`Delete`?(t=PC(p,d.length),ke(e),R.flushSync(()=>{o.context.setIndices({activeIndex:null,selectedIndex:null,type:fn,event:e.nativeEvent}),o.context.setSelectedValue(d.filter((e,t)=>t!==p),J(Xt,e.nativeEvent))})):e.key===`Enter`||e.key===` `?(ke(e),t=void 0):e.key===`ArrowDown`||e.key===`ArrowUp`?(ke(e),R.flushSync(()=>{o.context.setOpen(!0,J(dn,e.nativeEvent))}),t=void 0):e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(t=void 0),t}let h=Ui(`div`,e,{ref:[t,f],state:{disabled:l},props:[{tabIndex:-1,"aria-disabled":l||void 0,"aria-readonly":u||void 0,onKeyDown(e){if(l||u)return;let t=m(e);t===void 0?o.context.inputRef.current?.focus():s.current[t]?.focus()}},a]}),g=v.useMemo(()=>({index:p}),[p]);return(0,S.jsx)(jw.Provider,{value:g,children:h})}),Pw=v.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,c=HS(),{index:l}=Mw(),u=c.useState(`disabled`),d=c.useState(`readOnly`),f=c.useState(`selectedValue`),p=c.useState(`isItemEqualToValue`),m=u||i,{buttonRef:h,getButtonProps:g}=Nf({native:a,disabled:m||d,focusableWhenDisabled:!0}),_={disabled:m};function v(e,t){let n=c.state.activeIndex;if(n==null)return;let r=QS(c.context.valuesRef.current,e,p);r!==-1&&n===r&&c.context.setIndices({activeIndex:null,type:IS(t),event:t})}function y(e){let t=J(an,e.nativeEvent),n=f[l];return v(n,e.nativeEvent),c.context.setSelectedValue(f.filter((e,t)=>t!==l),t),c.context.inputRef.current?.focus(),t}return Ui(`button`,e,{ref:[t,h],state:_,props:[{tabIndex:-1,onMouseDown(e){e.preventDefault()},onClick(e){y(e).isPropagationAllowed||e.stopPropagation()},onKeyDown(e){(e.key===`Enter`||e.key===` `)&&(y(e).isPropagationAllowed||ke(e))}},s,g]})}),Fw=v.createContext(void 0);function Iw(e=!0){let t=v.useContext(Fw);if(t===void 0&&!e)throw Error(q(25));return t}var Lw=v.createContext(void 0);function Rw(e){let t=v.useContext(Lw);if(t===void 0&&!e)throw Error(q(33));return t}var zw=v.createContext(void 0);function Bw(e){let t=v.useContext(zw);if(t===void 0&&!e)throw Error(q(36));return t}var Vw=v.createContext(null);function Hw(e=`root`){let t=v.useContext(Vw),n=v.useContext(zw);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Uw={visible:!0,ref:null};function Ww(){return Uw}function Gw(e,t,n=`root`){let r=Hw(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Ww)({label:e.label,children:e.children,render:e.render}),a=Dn(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Kw(e){e.preventDefault()}function qw(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Bw(),u=Iw(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return v.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Kw:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:tn})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!Ce&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Mf(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var Jw={type:`regular-item`};function Yw(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=v.useRef(null),{getButtonProps:d,buttonRef:f}=Nf({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=qw({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=v.useCallback(e=>Ai(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=Dn(u,f);return v.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Xw=v.createContext(void 0);function Zw(){let e=v.useContext(Xw);if(e===void 0)throw Error(q(31));return e}var Qw=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=v.useState(void 0),c=Ui(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,S.jsx)(Xw.Provider,{value:s,children:c})}),$w=v.forwardRef(function(e,t){let n=Hw()?.Group??Qw;return(0,S.jsx)(n,{...e,ref:t})}),eT=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=uc(a),c=Zw();return K(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),Ui(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),tT=v.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=Bw(),f=mx({guess:!0,label:a}),p=uc(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=Yw({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Jw});return Ui(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),nT=v.forwardRef(function(e,t){let n=Gw(e,t);return n.visible?(0,S.jsx)(tT,{...e,ref:n.ref}):null}),rT=v.createContext(void 0);function iT(){return v.useContext(rT)}function aT(e,t){let n=qi(e.render);if(v.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function oT(e,t,n){let r=aT(e,t),i=r===t?void 0:r;return[r,v.useCallback(e=>n?.(e?i:void 0),[i,n])]}function sT(e,t,n){let r=qi(e.render),i=v.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var cT=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=Bw(),m=iT(),{side:h,align:g}=Rw(),_=jb(!0)!=null,y=l.useState(`open`),b=l.useState(`transitionStatus`),x=l.useState(`popupProps`),C=l.useState(`mounted`),w=l.useState(`instantType`),T=l.useState(`activeTriggerElement`),E=l.useState(`parent`),D=l.useState(`lastOpenChangeReason`),O=l.useState(`rootId`),k=l.useState(`floatingRootContext`),A=l.useState(`floatingTreeRoot`),j=l.useState(`closeDelay`),M=l.useState(`hoverEnabled`),N=l.useState(`disabled`),P=l.useState(`openMethod`),F=l.useState(`activeTriggerId`),I=l.useState(`listElement`),[L,R]=oT(e,u,d),z=sT(e,T,F),B=E.type===`menu`?m:void 0,V=E.type===`context-menu`,ee=s??E.type!==`menu`;s===void 0&&I&&E.type!==`menu`&&(ee=()=>l.state.activeIndex===null&&I),za({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function e(e){l.setOpen(!1,J(e.reason,e.domEvent))}return A.events.on(`close`,e),()=>{A.events.off(`close`,e)}},[A.events,l]),Po(k,{enabled:M&&!N&&!V&&E.type!==`menubar`,closeDelay:j});let H=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:te,handleFocus:ne}=(v.useContext(Vw)?.useParentHandoff??uT)(l,E,y,f),re=Ui(`div`,e,{state:{transitionStatus:b,side:h,align:g,open:y,nested:E.type===`menu`,instant:w},ref:[t,l.context.popupRef,H,R],stateAttributesMapping:Pt,props:[x,{id:L,...I?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":z},onKeyDown(e){B?.onPopupKeyDown?.(e),_&&_y.has(e.key)&&e.stopPropagation()},onFocus:ne},Vc(b),c,{"data-rootownerid":O}]}),U=E.type===void 0||V;(T||E.type===`menubar`&&D!==`outside-press`)&&(U=!0);let ie=B?.getReturnElement??te;return(0,S.jsx)(wa,{context:k,openInteractionType:P,modal:V,disabled:!C,returnFocus:a??ie??U,explicitReturnFocus:a===void 0&&ie?!1:void 0,initialFocus:ee,restoreFocus:!0,getInsideElements:E.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:E.type===`menubar`?void 0:A,previousFocusableElement:T,nextFocusableElement:E.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:re})}),lT={parentVirtualFocusRef:void 0,handleFocus:void 0};function uT(){return lT}var dT=v.forwardRef(function(e,t){let n=Hw()?.Popup??cT;return(0,S.jsx)(n,{...e,ref:t})}),fT=v.createContext(void 0);function pT(){let e=v.useContext(fT);if(e===void 0)throw Error(q(32));return e}var mT=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Bw();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,S.jsx)(fT.Provider,{value:n,children:(0,S.jsx)(aa,{ref:t,...r,portalOwnerRole:o})})}),hT=v.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Qi,style:g,..._}=e,{store:y,virtualFocus:b,syncHighlightedItem:x}=Bw(),C=pT(),w=Iw(!0),T=y.useState(`parent`),E=y.useState(`floatingRootContext`),D=y.useState(`floatingTreeRoot`),O=y.useState(`mounted`),k=y.useState(`open`),A=y.useState(`modal`),j=y.useState(`openMethod`),M=y.useState(`activeTriggerElement`),N=y.useState(`transitionStatus`),P=y.useState(`positionerElement`),F=y.useState(`instantType`),I=y.useState(`adaptiveOrigin`),L=y.useState(`lastOpenChangeReason`),R=y.useState(`floatingNodeId`),z=y.useState(`floatingParentNodeId`),B=E.useState(`domReferenceElement`),V=n,ee=c,H=l,te=s,ne=h;T.type===`context-menu`&&(V=n??T.context?.anchor,te??=`start`,!o&&te!==`center`&&(H=e.alignOffset??2,ee=e.sideOffset??-5));let re=o,U=te;T.type===`menu`?(re??=`inline-end`,U??=`start`,ne=e.collisionAvoidance??$i):T.type===`menubar`&&(re??=T.context.orientation===`vertical`?`inline-end`:`bottom`,U??=`start`);let ie=T.type===`context-menu`,ae=Rc({anchor:V,floatingRootContext:E,positionMethod:w?`fixed`:r,mounted:O,side:re,sideOffset:ee,align:U,alignOffset:H,arrowPadding:ie?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:R,keepMounted:C,disableAnchorTracking:m,collisionAvoidance:ne,shift:ie?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:D,adaptiveOrigin:I,lazyFlip:b?`placement`:!1});v.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===R&&y.set(`hoverEnabled`,!1),e.nodeId!==R&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,J(hn)))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[y,D.events,R]),v.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,J(t))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[D.events,y]);let oe=pe();v.useEffect(()=>{k||oe.clear()},[k,oe]),v.useEffect(()=>{function e(e){if(k&&e.nodeId===y.select(`floatingParentNodeId`)){if(e.target&&M&&M!==e.target){let e=y.select(`closeDelay`);e>0?oe.isStarted()||oe.start(e,()=>{y.setOpen(!1,J(hn))}):y.setOpen(!1,J(hn))}else oe.clear()}}return D.events.on(`itemhover`,e),()=>{D.events.off(`itemhover`,e)}},[D.events,k,M,y,oe]),v.useEffect(()=>{let e={open:k,nodeId:R,parentNodeId:z,reason:y.select(`lastOpenChangeReason`)};D.events.emit(`menuopenchange`,e)},[D.events,k,y,R,z]),Eb({store:y,domReference:B,positionerElement:P,open:k});let W={open:k,side:ae.side,align:ae.align,anchorHidden:ae.anchorHidden,nested:T.type===`menu`,instant:F},G=T.type===`menubar`&&T.context.modal;Ob(k&&(G||A&&L!==`trigger-hover`),j===`touch`,P,M);let K=Hc(e,W,{styles:ae.positionerStyles,transitionStatus:N,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!O,inert:!k}),se=O&&T.type!==`menu`&&(T.type!==`menubar`&&A&&L!==`trigger-hover`||T.type===`menubar`&&T.context.modal),q=null;return T.type===`menubar`?q=T.context.contentElement:T.type===void 0&&(q=M),(0,S.jsxs)(Lw.Provider,{value:ae,children:[se&&(0,S.jsx)(Oy,{ref:T.type===`context-menu`||T.type===`nested-context-menu`?T.context.internalBackdropRef:null,inert:qc(!k),cutout:q}),(0,S.jsx)(pa,{id:R,children:(0,S.jsx)($b,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,onMapChange:x,children:K})})]})}),gT=v.createContext(null);function _T(e){let t=v.useContext(gT);if(t===null&&!e)throw Error(q(5));return t}var vT={...wo,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=wo.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Te&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!wo.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},yT=class extends ho{constructor(e,t,n=!1){let r=new to,i=xT(r,t,n,e);super(i,bT(r),vT),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function bT(e){return{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:v.createRef(),beforeTriggerFocusGuardRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function xT(e,t,n=!1,r){return{...vo(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:G,inputProps:G,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new sa,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:G,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var ST=v.createContext(null);function CT(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function wT(e,t){return e===`list-navigation`||CT(e,t)}var TT=U(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:y=!1,virtualFocusRef:b,allowEscape:x=!0,resetOnPointerLeave:C=!0}=e,w=Iw(!0),T=Bw(!0),E=_T(!0),D=T?.store,O=T?.virtualFocus??!1,k=v.useMemo(()=>_&&D?{type:`menu`,store:D}:E?{type:`menubar`,context:E}:w&&!D?{type:`context-menu`,context:w}:{type:void 0},[w,D,E,_]),A=uc(),j=uc(),[M,N]=v.useState(void 0),P=(M??j)||void 0,F=ua(),I=k.type===`menu`?k.store:void 0,L=(n??o)&&I?.state.transitionStatus===`starting`,R=ee(()=>L?I?.state.instantType:void 0).current,z=ee(()=>{let e=new yT({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:k,disabled:s,highlightItemOnHover:g,modal:k.type===void 0?c:void 0,rootId:A,instantType:R},P,F!=null);return e.context.virtualFocusRef=b,e}).current;z.useControlledProp(`openProp`,n),z.useControlledProp(`triggerIdProp`,m),z.useContextCallback(`onOpenChangeComplete`,i);let B=z.useState(`floatingTreeRoot`),V=fa(B),H=z.useState(`open`),te=z.useState(`activeTriggerElement`),ne=z.useState(`positionerElement`),re=z.useState(`hoverEnabled`),U=z.useState(`disabled`),ie=z.useState(`lastOpenChangeReason`),ae=z.useState(`parent`),oe=z.useState(`activeIndex`),se=z.useState(`keyboardOpen`),q=z.useState(`payload`),ce=z.useState(`floatingParentNodeId`),le=v.useRef(null),ue=v.useRef(ae.type!==`context-menu`),de=pe(),fe=v.useRef(!0),me=pe(),he=ce!=null,{openMethod:ge,triggerProps:_e}=Zy(H);z.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:ae.type===void 0?c:void 0,openMethod:ge,rootId:A}),Za(z);let{forceUnmount:ve,transitionStatus:ye}=Qa(H,z,()=>{z.set(`allowMouseEnter`,!1)},L),be=Ra(z.context.popupRef);v.useEffect(()=>{if(R===void 0)return;let e=()=>{z.state.instantType===R&&z.set(`instantType`,void 0)};if(!H){e();return}if(ye!==void 0)return;if(z.context.popupRef.current==null){e();return}let t=new AbortController;return be(e,t.signal),()=>{t.abort()}},[R,H,ye,be,z]),K(()=>{w&&!T?z.update({parent:{type:`context-menu`,context:w},floatingNodeId:V,floatingParentNodeId:F}):(T||!z.select(`activeTriggerElement`))&&z.update({floatingNodeId:V,floatingParentNodeId:F})},[w,T,V,F,te,z]),v.useEffect(()=>{H||(le.current=null),ae.type===`context-menu`&&(H?de.start(500,()=>{ue.current=!0}):(de.clear(),ue.current=!1))},[de,H,ae.type]),K(()=>{!H&&!re&&z.set(`hoverEnabled`,!0)},[H,re,z]);let xe=Y((e,t)=>{let n=t.reason;if(!e&&!z.select(`open`)||H===e&&t.trigger===te&&ie===n)return;let i=Ja(t);if(!e&&t.trigger==null&&(t.trigger=te??void 0),r?.(e,t),t.isCanceled)return;z.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!fe.current)return;e&&n===`trigger-focus`?(fe.current=!1,me.start(300,()=>{fe.current=!0})):(fe.current=!0,me.clear());let o=!e&&(n===`escape-key`||n==null);le.current=t.event;let s=qa(z.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&wT(n,a),s.instantType=ae.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:CT(n,a)?`click`:o?`dismiss`:void 0,z.update(s)}),Se=Na({popupStore:z,floatingRootContext:z.state.floatingRootContext,floatingId:P,nested:F!=null,onOpenChange:xe}),Ce=Se.context.events;K(()=>{let e=({open:e,eventDetails:t})=>xe(e,t);return Ce.on(`setOpen`,e),()=>{Ce?.off(`setOpen`,e)}},[Ce,xe]),K(()=>z.subscribeToParentMenu(),[z]);let we=v.useCallback(()=>{z.setOpen(!1,J(yn))},[z]);v.useImperativeHandle(d,()=>({unmount:ve,close:we}),[ve,we]);let Te;ae.type===`context-menu`&&(Te=ae.context),v.useImperativeHandle(Te?.positionerRef,()=>ne,[ne]),v.useImperativeHandle(Te?.actionsRef,()=>({setOpen:xe}),[xe]);let Ee=ja(Se,{enabled:!U,bubbles:{escapeKey:f&&ae.type===`menu`},outsidePress(){return ae.type!==`context-menu`||le.current?.type===`contextmenu`||ue.current},externalTree:he?B:void 0}),De=wc(),Oe=Uo(Se,{enabled:!U,listRef:z.context.itemDomElements,activeIndex:oe,virtual:y,nested:ae.type===`menubar`||!y&&ae.type!==void 0,parentOrientation:ae.type===`menubar`?ae.context.orientation:void 0,loopFocus:l,focusItemOnOpen:y?se:void 0,allowEscape:y&&l&&x,orientation:u,triggerOrientation:y?`vertical`:u,rtl:De===`rtl`,disabledIndices:W,onNavigate(e,t){z.setActiveIndex(e,IS(t),t?.nativeEvent)},openOnArrowKeyDown:ae.type!==`context-menu`&&!(y&&_),externalTree:!y&&he?B:void 0,nestedReturnFocusRef:I?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:C}),ke=v.useCallback(e=>{z.context.typingRef.current=e},[z]),Ae=Wo(Se,{enabled:!U&&!y,listRef:z.context.itemLabels,elementsRef:z.context.itemDomElements,activeIndex:oe,resetMs:500,onMatch:(e,t)=>{H&&e!==oe&&z.setActiveIndex(e,fn,t.nativeEvent)},onTyping:ke}),je=Y(a),Me=v.useRef(-1),Ne=Y(()=>{let e=z.state.activeIndex,t=e===null?void 0:z.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Me.current===n&&z.context.reportedItem===t)return;Me.current=n,z.context.reportedItem=t,y&&z.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=z.context;z.context.highlightReason=Xt,z.context.highlightEvent=void 0,a&&je(t,Yt(r,i,{label:t===void 0?void 0:z.context.itemLabels.current[n]??void 0}))});K(()=>{Ne()},[oe,Ne]);let Pe=v.useMemo(()=>{if(!y)return Oe.reference;if(!Oe.trigger)return G;let{onFocus:e,...t}=Oe.trigger;return t},[y,Oe.reference,Oe.trigger]);z.useSyncedValue(`inputProps`,y?Oe.reference??G:G);let Fe=v.useMemo(()=>{let e=Ai(Ae.reference,Pe,Ee.reference,{onMouseMove(){z.set(`allowMouseEnter`,!0)}},_e);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=H,e},[z,Ae.reference,Pe,Ee.reference,_e,H]),Ie=v.useMemo(()=>{let e=Ai(Oe.trigger,Ee.trigger,_e);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Oe.trigger,Ee.trigger,_e]);ee(()=>(z.update({inactiveTriggerProps:Ie}),null)),$a(z,{floatingRootContext:Se,activeTriggerProps:Fe,inactiveTriggerProps:Ie,popupProps:v.useMemo(()=>Ai(Va,{onMouseMove(){z.set(`allowMouseEnter`,!0),ae.type===`menu`&&z.set(`hoverEnabled`,!1)},onClick(){z.select(`hoverEnabled`)&&z.set(`hoverEnabled`,!1)},onKeyDown(e){let t=z.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ae.floating,Oe.floating,Ee.floating),[ae.type,z,Ae.floating,Oe.floating,Ee.floating]),itemProps:Oe.item??G});let Le=v.useMemo(()=>({store:z,parent:k,orientation:u,loopFocus:l,allowEscape:x,defaultFloatingId:j,setRenderedFloatingId:N,virtualFocus:y,parentVirtualFocus:O,syncHighlightedItem:Ne}),[z,k,u,l,x,j,y,O,Ne]),Re=typeof t==`function`?t({payload:q}):t,ze=(0,S.jsxs)(zw.Provider,{value:Le,children:[p&&(0,S.jsx)(Wa,{handle:p,store:z}),Re]});return(ae.type===void 0||ae.type===`context-menu`)&&(ze=(0,S.jsx)(ma,{externalTree:B,children:ze})),ze});function ET(e){let t=v.useContext(ST);if(t===null)return(0,S.jsx)(TT,{...e});let n=t.Root;return(0,S.jsx)(ST.Provider,{value:null,children:(0,S.jsx)(n,{...t.options,...e})})}function DT(e){let{render:t,className:n,style:r,state:i=G,props:a=W,refs:o=W,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=hx({metadata:s});return Ui(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function OT(e){if(Ve(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!$e(e))return OT(nt(e))}function kT(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=v.useRef(!1);return v.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Wn(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:G,[t,n,r])}var AT=ie(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=Bw(!0),h=To(d)??m?.store;if(!h)throw Error(q(85));let g=uc(s),_=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerControlsId`,g),C=v.useRef(null),w=MT(),T=Af(!0),E=da(),D=v.useMemo(()=>E??new sa,[E]),{registerTrigger:O,isMountedByThisTrigger:k}=Xa(g,C,h,{payload:f,closeDelay:u,parent:w,floatingTreeRoot:D,floatingNodeId:fa(D),floatingParentNodeId:ua(),keyboardEventRelay:T?.relayKeyboardEvent}),A=w.type===`menubar`,j=h.useState(`disabled`),M=a||j||A&&w.context.disabled,{getButtonProps:N,buttonRef:P}=Nf({disabled:M,native:o});v.useEffect(()=>{!b&&w.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,w.type]);let F=v.useRef(null),I=pe(),L=Y(e=>{if(!F.current)return;I.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;st(F.current,t)||st(h.select(`positionerElement`),t)||t===F.current||(t==null||OT(t)!==h.select(`rootId`))&&(OC(e,F.current)||D.events.emit(`close`,{domEvent:e,reason:mn}))});v.useEffect(()=>{let e=Wn(F.current);if(b&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[b,L,h]);let R=A&&w.context.hasSubmenuOpen,z=Io(y,{enabled:(c??R)&&!M&&(!A||R&&!k),handleClose:Qo({blockPointerEvents:!A}),mouseOnly:!0,move:!1,restMs:w.type===void 0?l:void 0,delay:{close:u},triggerElementRef:C,externalTree:D,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),B=jT(b,h.select(`lastOpenChangeReason`)),V=Ta(y,{enabled:!M,event:b&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0&&B}),ee=Oo(y,{enabled:!M&&R}),H=kT({open:b,enabled:A,mouseDownAction:`open`}),te=v.useMemo(()=>Ai(ee.reference,V.reference),[ee.reference,V.reference]),ne=h.useState(`triggerProps`,k),re=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:U,handleFocusTargetFocus:ie}=yb(h,C),ae={disabled:M,open:b},oe=[F,t,P,O,C],W=[te,z??G,ne,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(I.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Wn(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},re,A?{role:`menuitem`}:{},H,p,N],K=Ui(`button`,e,{enabled:!A,stateAttributesMapping:Mt,state:ae,ref:oe,props:W});return A?(0,S.jsx)(DT,{tag:`button`,render:n,className:r,style:i,state:ae,refs:oe,props:W,stateAttributesMapping:Mt}):b?(0,S.jsxs)(v.Fragment,{children:[(0,S.jsx)(Jn,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:U},`${g}-pre-focus-guard`),(0,S.jsx)(v.Fragment,{children:K},g),(0,S.jsx)(Jn,{ref:h.context.triggerFocusTargetRef,onFocus:ie},`${g}-post-focus-guard`)]}):(0,S.jsx)(v.Fragment,{children:K},g)});function jT(e,t){let n=pe(),[r,i]=v.useState(!1);return K(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function MT(){let e=_T(!0);return v.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function NT(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var PT=`base-ui-disable-scrollbar`,FT={className:PT,getElement(e){return(0,S.jsx)(`style`,{nonce:e,href:PT,precedence:`base-ui:low`,children:`.${PT}{scrollbar-width:none}.${PT}::-webkit-scrollbar{display:none}`})}};function IT(e,t){return Math.max(0,e-t)}function LT(e,t){if(t<=0)return 0;let n=NT(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var RT=v.createContext(void 0),zT=v.createContext(void 0);function BT(){let e=v.useContext(RT);if(e===void 0)throw Error(q(60));return e}function VT(){let e=v.useContext(zT);if(e===void 0)throw Error(q(61));return e}var HT={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:lC(t,r)!==``},hasNullItemLabel:(e,t)=>t?sC(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>YS(t,e,n)):YS(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function UT(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:y,multiple:b=!1,itemToStringLabel:x,itemToStringValue:C,isItemEqualToValue:w=JS,highlightItemOnHover:T=!0,children:E}=e,{clearErrors:D}=Yf(),{setDirty:O,setTouched:k,setFocused:A,validityData:j,setFilled:M,name:N,disabled:P,validation:F,validationMode:I}=qf(),L=tp({id:t}),R=P||d,z=N??c,[B,V]=Xb({controlled:n,default:b?r??W:r,name:`Select`,state:`value`}),[H,te]=Xb({controlled:a,default:o,name:`Select`,state:`open`}),ne=v.useRef([]),re=v.useRef([]),U=v.useRef(null),ie=v.useRef(null),ae=v.useRef(0),se=v.useRef(null),q=v.useRef([]),ce=v.useRef(!1),le=v.useRef(null),ue=v.useRef(null),de=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),fe=v.useRef(!1),pe=v.useRef(B),{openMethod:me,triggerProps:he}=Zy(H),ge=ee(()=>new ho({id:L,labelId:void 0,modal:m,multiple:b,disabled:R,readOnly:f,required:p,highlightItemOnHover:T,itemToStringLabel:x,itemToStringValue:C,isItemEqualToValue:w,value:B,open:H,mounted:H,transitionStatus:void 0,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:G,triggerProps:G,itemRoot:{props:G,multiple:b,disabled:R,readOnly:f,isItemEqualToValue:w},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:oe,setOpen:oe,handleScrollArrowVisibility:oe,onOpenChangeComplete:oe,listRef:ne,popupRef:U,scrollHandlerRef:ie,scrollArrowsMountedCountRef:ae,valueRef:se,valuesRef:q,labelsRef:re,typingRef:ce,selectionRef:de,firstItemTextRef:le,selectedItemTextRef:ue,alignItemWithTriggerActiveRef:fe,initialValueRef:pe},HT)).current,[_e,ve]=v.useState(!1),{mounted:ye,transitionStatus:be,forceUnmount:xe}=Ba({open:H,ref:U,preventUnmountOnClose:_e,setPreventUnmountOnClose:ve,onUnmount(){ge.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)}}),Se=ge.useState(`activeIndex`),Ce=ge.useState(`selectedIndex`),we=ge.useState(`triggerElement`),Te=ge.useState(`positionerElement`),Ee=Jc(me),De=me??Ee,Oe=v.useMemo(()=>b?``:lC(B,C),[b,B,C]),ke=v.useMemo(()=>b&&Array.isArray(B)?B.map(e=>lC(e,C)):lC(B,C),[b,B,C]);ap(Nn(we),L,B,Y(()=>ke),!R,c);let Ae=b?Array.isArray(B)&&B.length>0:B!=null&&Oe!==``;K(()=>{M(Ae)},[Ae,M]),K(function(){let e=eC(q.current,B,w,b);e===null&&(ue.current=null),!H&&ge.set(`selectedIndex`,e)},[b,H,B,w,ge]),op(B,()=>{D(z),O(XS(B,j.initialValue,w)),F.change(B)});let je=Y((e,t)=>{let n=t,r=Ja(n);s?.(e,n),!t.isCanceled&&(e||ve(r()),te(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(k(!0),A(!1),I===`onBlur`&&F.commit(B)))});v.useImperativeHandle(h,()=>({unmount:xe,close:()=>{ge.state.open&&je(!1,J(yn))}}),[xe,je,ge]);let Me=Y((e,t)=>{i?.(e,t),!t.isCanceled&&V(e)}),Ne=Y(e=>{let t=IT(e.scrollHeight,e.clientHeight),n=LT(e.scrollTop,t),r=n>0,i=n<t;ge.set(`scrollUpArrowVisible`,r),ge.set(`scrollDownArrowVisible`,i)}),Pe=Eo({open:H,onOpenChange:je,elements:{reference:we,floating:Te}}),Fe=Ta(Pe,{enabled:!R,event:`mousedown`}),Ie=ja(Pe),Le=Uo(Pe,{enabled:!R,listRef:ne,activeIndex:Se,selectedIndex:Ce,disabledIndices:W,onNavigate(e){(e!==null||H)&&ge.set(`activeIndex`,e)},focusItemOnHover:T}),Re=Wo(Pe,{enabled:!R&&(H||!f&&!b),listRef:re,activeIndex:Se,selectedIndex:Ce,disabledIndices:e=>Tx(ne.current[e]),onMatch(e){H?ge.set(`activeIndex`,e):Me(q.current[e],J(Xt))},onTyping(e){ce.current=e}}),ze=v.useMemo(()=>Ai(Re.reference,Le.reference,Ie.reference,Fe.reference,he),[Fe.reference,Re.reference,Le.reference,Ie.reference,he]),Be=v.useMemo(()=>Ai(Va,Re.floating,Le.floating,Ie.floating),[Re.floating,Le.floating,Ie.floating]),Ve=Le.item??G,He=v.useMemo(()=>({props:Ve,multiple:b,disabled:R,readOnly:f,isItemEqualToValue:w}),[Ve,b,R,f,w]);ge.useContextCallback(`setValue`,Me),ge.useContextCallback(`setOpen`,je),ge.useContextCallback(`handleScrollArrowVisibility`,Ne),ge.useContextCallback(`onOpenChangeComplete`,_),PS(()=>{ge.update({popupProps:Be,triggerProps:ze,itemRoot:He})}),ge.useSyncedValues({id:L,modal:m,multiple:b,disabled:R,readOnly:f,required:p,highlightItemOnHover:T,value:B,open:H,mounted:ye,transitionStatus:be,popupProps:Be,triggerProps:ze,itemRoot:He,items:y,itemToStringLabel:x,itemToStringValue:C,isItemEqualToValue:w,openMethod:De});let Ue=Dn(g,F.inputRef),We=b?void 0:z,Ge=v.useMemo(()=>!b||!Array.isArray(B)||!z?null:B.map(e=>{let t=lC(e,C);return(0,S.jsx)(`input`,{type:`hidden`,form:l,name:z,value:t,disabled:R},t)}),[b,B,l,z,C,R]);return(0,S.jsxs)(RT.Provider,{value:ge,children:[(0,S.jsx)(zT.Provider,{value:Pe,children:E}),(0,S.jsx)(`input`,{...F.getValidationProps(R,{onFocus(){ge.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||R||f)return;let t=e.currentTarget.value,n=J(Xt,e.nativeEvent);function r(){if(b)return;let e=t.toLowerCase(),r=q.current.findIndex(t=>lC(t,C).toLowerCase()===e||cC(t,x).toLowerCase()===e);r===-1&&(r=q.current.findIndex((t,n)=>{let r=re.current[n];return r!=null&&r.toLowerCase()===e}));let i=q.current[r];i!=null&&Me(i,n)}ge.set(`forceMount`,!0),queueMicrotask(r)}}),id:L&&We==null?`${L}-hidden-input`:void 0,form:l,name:We,autoComplete:u,value:Oe,disabled:R,required:p&&!(b&&Ae),readOnly:f,ref:Ue,style:z?qn:Kn,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ge]})}var WT=`data-popup-side`,GT=400,KT={...Mt,...Wf,popupSide:e=>e?{[WT]:e}:null,value:()=>null},qT=v.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:u,validation:d,state:f,disabled:p}=qf(),{labelId:m}=Zf(),h=BT(),g=h.useState(`readOnly`),_=h.useState(`required`),y=h.useState(`disabled`),b=p||y||a,x=h.useState(`open`),S=h.useState(`mounted`),C=h.useState(`value`),w=h.useState(`triggerProps`),T=h.useState(`positionerElement`),E=h.useState(`listElement`),D=h.useState(`popupSide`),O=h.useState(`id`),k=h.useState(`labelId`),A=h.useState(`hasSelectedValue`),j=S&&T?D:null,M=i??O,N=AC(m,k);tp({id:i});let P=Nn(T),F=v.useRef(null),I=ip(b,F),{getButtonProps:L,buttonRef:R}=Nf({disabled:b,native:o}),z=h.useStateSetter(`triggerElement`),B=pe(),V=pe(),ee=pe();v.useEffect(()=>{if(x)return ee.start(GT,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},V.clear()},[x,h,V,ee]);let H=Ai(w,{id:M,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?E?.id??Ut(T)?.id:void 0,"aria-labelledby":N,"aria-readonly":g||void 0,"aria-required":_||void 0,tabIndex:b?-1:0,onFocus(e){I(!0),x&&h.context.alignItemWithTriggerActiveRef.current&&h.context.setOpen(!1,J(Xt,e.nativeEvent)),B.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){st(T,e.relatedTarget)||(l(!0),I(!1),u===`onBlur`&&d.commit(C))},onMouseDown(e){if(x)return;let t=Wn(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;st(F.current,t)||st(P.current,t)||OC(e,F.current)||h.context.setOpen(!1,J(mn,e))}V.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,L),te=d.getValidationProps(b,H);te.role=`combobox`;let ne={...f,open:x,disabled:b,value:C,readOnly:g,popupSide:j,placeholder:!A};return Ui(`button`,e,{ref:[t,F,R,z],state:ne,stateAttributesMapping:KT,props:te})}),JT={value:()=>null},YT=v.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=BT(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?dC(l,u,d):uC(l,u,d)),Ui(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:JT})}),XT=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Ui(`span`,e,{state:{open:BT().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:jt})}),ZT=v.forwardRef(function(e,t){let n=BT(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,S.jsx)(aa,{ref:t,...e}):null}),QT=v.createContext(void 0);function $T(){let e=v.useContext(QT);if(!e)throw Error(q(59));return e}function eE(e,t){e&&Object.assign(e.style,t)}var tE={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},nE={position:`fixed`},rE=v.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Qi,style:_,...y}=e,b=BT(),x=VT(),C=b.useState(`open`),w=b.useState(`mounted`),T=b.useState(`modal`),E=b.useState(`value`),D=b.useState(`openMethod`),O=b.useState(`positionerElement`),k=b.useState(`triggerElement`),A=b.useState(`isItemEqualToValue`),j=b.useState(`transitionStatus`),M=v.useRef(null),N=v.useRef(null),[P,F]=v.useState(h),I=w&&P&&D!==`touch`;!w&&P!==h&&F(h),v.useImperativeHandle(b.context.alignItemWithTriggerActiveRef,()=>I),Ob((I||T)&&C,D===`touch`,O,k);let L=Rc({anchor:n,floatingRootContext:x,positionMethod:a,mounted:w,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??I,collisionAvoidance:g,keepMounted:!0}),R=I?`none`:L.side,z=I?nE:L.positionerStyles,B={open:C,side:R,align:L.align,anchorHidden:L.anchorHidden};K(()=>{b.set(`popupSide`,L.side)},[b,L.side]);let V=Hc(e,B,{styles:z,transitionStatus:j,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!w,inert:!C}),ee=v.useRef(0),H=Y(e=>{if(b.context.valuesRef.current.length===0)return;let t=ee.current;ee.current=e.size;let n=J(Xt);if(t!==0&&!b.state.multiple&&E!==null&&QS(b.context.valuesRef.current,E,A)===-1){let e=b.context.initialValueRef.current,t=e!=null&&QS(b.context.valuesRef.current,e,A)!==-1?e:null;b.context.setValue(t,n),t===null&&(b.set(`selectedIndex`,null),b.context.selectedItemTextRef.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(E)){let e=E.filter(e=>QS(b.context.valuesRef.current,e,A)!==-1);e.length!==E.length&&(b.context.setValue(e,n),e.length===0&&(b.set(`selectedIndex`,null),b.context.selectedItemTextRef.current=null))}if(C&&I){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};eE(O,e),eE(b.context.popupRef.current,e)}}),te=v.useMemo(()=>({...L,side:R,alignItemWithTriggerActive:I,setControlledAlignItemWithTrigger:F,scrollUpArrowRef:M,scrollDownArrowRef:N}),[L,R,I,F]);return(0,S.jsx)($b,{elementsRef:b.context.listRef,labelsRef:b.context.labelsRef,onMapChange:H,children:(0,S.jsxs)(QT.Provider,{value:te,children:[w&&T&&(0,S.jsx)(Oy,{inert:qc(!C),cutout:k}),V]})})}),iE=`--transform-origin`,aE={...Nt,...bt},oE=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=BT(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=VT(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=$T(),_=jb(!0)!=null,y=wc(),{nonce:b,disableStyleElements:x}=xx(),C=s.useState(`id`),w=s.useState(`open`),T=s.useState(`openMethod`),E=s.useState(`mounted`),D=s.useState(`popupProps`),O=s.useState(`transitionStatus`),k=s.useState(`triggerElement`),A=s.useState(`positionerElement`),j=s.useState(`listElement`),M=v.useRef(!1),N=v.useRef(!1),P=v.useRef({}),F=Un(),I=Y(e=>{if(!A||!s.context.popupRef.current||!N.current)return;let t=A.style.top===`0px`,n=A.style.bottom===`0px`;if(M.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=lE(A),i=uE(A.getBoundingClientRect().height,`y`,r),a=Wn(A),o=Le(A),c=o.getComputedStyle(A),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=sE(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=cE(e),g=null,_=e=>{A.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=NT(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(M.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=NT(g,0,cE(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(M.current=!0),s.context.handleScrollArrowVisibility(e)});v.useImperativeHandle(s.context.scrollHandlerRef,()=>I,[I]),za({open:w,ref:s.context.popupRef,onComplete(){w&&s.context.onOpenChangeComplete(!0)}});let L={open:w,transitionStatus:O,side:f,align:p};K(()=>{A&&s.context.popupRef.current&&!Object.keys(P.current).length&&(P.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[s,A]),K(()=>{w||m||(N.current=!1,M.current=!1,eE(A,P.current))},[w,m,A]),K(()=>{let e=s.context.popupRef.current;if(!w||!k||!A||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(N.current=!0,e.style.removeProperty(iE),!m){F.request(()=>s.context.handleScrollArrowVisibility(j||e));return}let t=pE(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=Le(A),i=r.getComputedStyle(A),a=r.getComputedStyle(e),o=Wn(k),c=lE(k),l=dE(k.getBoundingClientRect(),c),d=dE(A.getBoundingClientRect(),c),f=l.height,p=j||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,v=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=sE(a),S=o.documentElement.clientHeight-_-v,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=y===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=dE(n.getBoundingClientRect(),c);T=dE(t.getBoundingClientRect(),c),E=d.left+(y===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let O=w+D+v+h,N=Math.min(S,O),F=S-_-v,I=O-N,L=C-5;A.style.left=`${NT(E,5,L-d.width)}px`,A.style.height=`${N}px`,A.style.maxHeight=`none`,A.style.marginTop=`${_}px`,A.style.marginBottom=`${v}px`,e.style.height=`100%`;let R=cE(p),z=I>=R-1;z&&(N=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(N)+1<Math.min(m,b),V=(r.visualViewport?.scale??1)!==1&&Te;if(B||V){eE(A,P.current),g(!1);return}let ee=Math.max(b,N);if(z){let e=Math.max(0,S-O);A.style.top=d.height>=F?`0`:`${e}px`,A.style.height=`${N}px`,p.scrollTop=cE(p)}else A.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=NT(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(iE,`50% ${i}%`)}(ee===S||N>=x)&&(M.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,w,A,k,m,g,F,j,u,y,h]),v.useEffect(()=>{if(!m||!A||!w)return;let e=Le(A);function t(e){s.context.setOpen(!1,J(bn,e))}return Tn(e,`resize`,t)},[s,m,A,w]);let R={...j?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${C}-list`},onKeyDown(e){_&&_y.has(e.key)&&e.stopPropagation()},onScroll(e){j||I(e.currentTarget)},...m&&{style:j?{height:`100%`}:tE},className:!j&&m?FT.className:void 0},z=Ui(`div`,e,{ref:[t,s.context.popupRef],state:L,stateAttributesMapping:aE,props:[D,R,Vc(O),o]});return(0,S.jsxs)(v.Fragment,{children:[!x&&FT.getElement(b),(0,S.jsx)(wa,{context:d,modal:!1,disabled:!E,openInteractionType:T,returnFocus:a,restoreFocus:!0,children:z})]})});function sE(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function cE(e){return IT(e.scrollHeight,e.clientHeight)}function lE(e){return Fs.getScale(e)}function uE(e,t,n){return e/n[t]}function dE(e,t){return xr({x:uE(e.x,`x`,t),y:uE(e.y,`y`,t),width:uE(e.width,`x`,t),height:uE(e.height,`y`,t)})}var fE=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function pE(e){let{style:t}=e,n={};for(let[e,r]of fE)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of fE){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var mE=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=BT(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=$T(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:tE},className:u&&d!==`touch`?FT.className:void 0};return Ui(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),hE=v.createContext(void 0);function gE(){let e=v.useContext(hE);if(!e)throw Error(q(57));return e}var _E=v.memo(v.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=v.useRef(null),d=mx({guess:!0,label:o,textRef:u}),f=BT(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),y=h||s,b=f.useState(`isActive`,d.index),x=f.useState(`open`),C=f.useState(`isSelected`,a),w=f.useState(`isSelectedByFocus`,d.index),T=d.index,E=v.useRef(null);K(()=>{let e=f.context.valuesRef.current;return e[T]=a,()=>{delete e[T]}},[T,a,f]),K(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=tC(T,a,f.context.valuesRef.current,e,_,t),r=n===T,T===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&YS(a,e,_),r&&(n=T)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[T,m,_,f,a]);let D=v.useRef(`mouse`),O=v.useRef(!1),{getButtonProps:k,buttonRef:A}=Nf({disabled:y,focusableWhenDisabled:!0,native:c,composite:!0}),j={disabled:y,selected:C,highlighted:b};function M(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=C?nC(n,a,_):[...n,a];f.context.setValue(r,J(tn,e))}else f.context.setValue(a,J(tn,e)),f.context.setOpen(!1,J(tn,e))}function N(){f.context.selectionRef.current.dragY=0}let P={role:`option`,"aria-selected":C,tabIndex:x&&b?0:-1,onKeyDown(e){f.set(`activeIndex`,T),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=D.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&je(e.nativeEvent)&&(n!==void 0||b),i=t&&!r&&!O.current;O.current=!1,!(y||i)&&M(e.nativeEvent)},onPointerEnter(e){D.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){D.current=e.pointerType,O.current=!0,N()},onMouseUp(){if(N(),y||D.current===`touch`||O.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&C,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!C;e||t||(O.current=!0,E.current?.click(),O.current=!1)}},F=Ui(`div`,e,{ref:[A,t,d.ref,E],state:j,props:[p,P,l,k]}),I=v.useMemo(()=>({selected:C,index:T,textRef:u,selectedByFocus:w}),[C,T,u,w]);return(0,S.jsx)(hE.Provider,{value:I,children:F})})),vE=v.forwardRef(function(e,t){let{selected:n}=gE();return e.keepMounted||n?(0,S.jsx)(Ow,{...e,selected:n,ref:t}):null}),yE=v.memo(v.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=gE(),a=BT(),{render:o,className:s,style:c,...l}=e;return Ui(`div`,e,{ref:[v.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),bE=v.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=BT(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=$T(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=pe(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=Pa(g);K(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),za({open:g,ref:v,onComplete(){g||x(!1)}});let S=Ui(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=IT(e.scrollHeight,e.clientHeight),r=LT(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=xE(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:bt});return y||o?S:null});function xE(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?LT(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?LT(l.offsetTop+l.offsetHeight-r+i,a):a}var SE=v.forwardRef(function(e,t){return(0,S.jsx)(bE,{...e,ref:t,direction:`down`})}),CE=v.forwardRef(function(e,t){return(0,S.jsx)(bE,{...e,ref:t,direction:`up`})}),wE=v.createContext(void 0),TE=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=v.useState(),c=v.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=Ui(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,S.jsx)(wE.Provider,{value:c,children:l})}),EE=vw,DE=v.createContext(void 0);function OE(){return v.useContext(DE)}var kE=v.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,style:f,...p}=e,m=uc(u||void 0),h=OE(),g=h?.value??[],_=(i||h?.disabled)??!1,[y,b]=Xb({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:x,buttonRef:C}=Nf({disabled:_,native:d}),w={disabled:_,pressed:y},T=[C,t],E=[{"aria-pressed":y,onClick(e){let t=!y,n=J(Xt,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&b(t))}},p,x],D=Ui(`button`,e,{enabled:!h,state:w,ref:T,props:E}),O=v.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,S.jsx)(DT,{tag:`button`,render:c,className:n,style:f,metadata:O,state:w,refs:T,props:E}):D}),AE=v.createContext(void 0);function jE(){return v.useContext(AE)}var ME=v.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:l,render:u,style:d,...f}=e,p=jb(!0),m=jE(),h=n??W,g=c!==void 0||n!==void 0,_=(p?.disabled??!1)||(m?.disabled??!1)||r,[y,b]=Xb({controlled:c,default:h,name:`ToggleGroup`,state:`value`}),x=Y((e,t,n)=>{let r;s?(r=y.slice(),t?r.push(e):r.splice(y.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&b(r)}),C={disabled:_,multiple:s,orientation:o},w=v.useMemo(()=>({disabled:_,setGroupValue:x,value:y,isValueInitialized:g}),[_,x,y,g]),T={role:`group`},E=Ui(`div`,e,{enabled:!!p,state:C,ref:t,props:[T,f]});return(0,S.jsx)(DE.Provider,{value:w,children:p?E:(0,S.jsx)(kx,{render:u,className:l,style:d,state:C,refs:[t],props:[T,f],loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})});function NE({className:e,...t}){return(0,S.jsx)(`textarea`,{"data-slot":`textarea`,className:X(`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 PE({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:X(`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 FE=cf(`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 IE({className:e,align:t=`inline-start`,...n}){return(0,S.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:X(FE({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var LE=cf(`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 RE({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,S.jsx)(Rf,{type:t,"data-size":r,variant:n,className:X(LE({size:r}),e),...i})}function zE({className:e,...t}){return(0,S.jsx)(lp,{"data-slot":`input-group-control`,className:X(`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 BE({className:e,...t}){return(0,S.jsx)(NE,{"data-slot":`input-group-control`,className:X(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}var VE=Ew;function HE({...e}){return(0,S.jsx)(Dw,{"data-slot":`combobox-value`,...e})}function UE({className:e,children:t,...n}){return(0,S.jsxs)(IC,{"data-slot":`combobox-trigger`,className:X(`[&_svg:not([class*='size-'])]:size-4`,e),...n,children:[t,(0,S.jsx)(Eu,{className:`pointer-events-none size-4 text-muted-foreground`})]})}function WE({className:e,...t}){return(0,S.jsx)(GC,{"data-slot":`combobox-clear`,render:(0,S.jsx)(RE,{variant:`ghost`,size:`icon-xs`}),className:X(e),...t,children:(0,S.jsx)(nf,{className:`pointer-events-none`})})}function GE({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:i=!1,...a}){return(0,S.jsxs)(PE,{className:X(`w-auto`,e),children:[(0,S.jsx)(HC,{render:(0,S.jsx)(zE,{disabled:n}),...a}),(0,S.jsxs)(IE,{align:`inline-end`,children:[r&&(0,S.jsx)(RE,{size:`icon-xs`,variant:`ghost`,render:(0,S.jsx)(UE,{}),"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:n}),i&&(0,S.jsx)(WE,{disabled:n})]}),t]})}function KE({className:e,side:t=`bottom`,sideOffset:n=6,align:r=`start`,alignOffset:i=0,anchor:a,...o}){return(0,S.jsx)(nw,{children:(0,S.jsx)(rw,{side:t,sideOffset:n,align:r,alignOffset:i,anchor:a,className:`isolate z-50`,children:(0,S.jsx)(aw,{"data-slot":`combobox-content`,"data-chips":!!a,className:X(`group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none 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),...o})})})}function qE({className:e,...t}){return(0,S.jsx)(XC,{"data-slot":`combobox-list`,className:X(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,e),...t})}function JE({className:e,children:t,...n}){return(0,S.jsxs)(gw,{"data-slot":`combobox-item`,className:X(`relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[t,(0,S.jsx)(kw,{render:(0,S.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,S.jsx)(wu,{className:`pointer-events-none`})})]})}function YE({className:e,...t}){return(0,S.jsx)(cw,{"data-slot":`combobox-group`,className:X(e),...t})}function XE({className:e,...t}){return(0,S.jsx)(lw,{"data-slot":`combobox-label`,className:X(`px-2 py-1.5 text-xs text-muted-foreground`,e),...t})}function ZE({...e}){return(0,S.jsx)(YC,{"data-slot":`combobox-collection`,...e})}function QE({className:e,...t}){return(0,S.jsx)(_w,{"data-slot":`combobox-empty`,className:X(`hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex`,e),...t})}function $E({className:e,...t}){return(0,S.jsx)(Aw,{"data-slot":`combobox-chips`,className:X(`flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40`,e),...t})}function eD({className:e,children:t,showRemove:n=!0,...r}){return(0,S.jsxs)(Nw,{"data-slot":`combobox-chip`,className:X(`flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0`,e),...r,children:[t,n&&(0,S.jsx)(Pw,{render:(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-xs`}),className:`-ml-1 opacity-50 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:(0,S.jsx)(nf,{className:`pointer-events-none`})})]})}function tD({className:e,...t}){return(0,S.jsx)(HC,{"data-slot":`combobox-chip-input`,className:X(`min-w-16 flex-1 outline-none`,e),...t})}function nD(){return v.useRef(null)}function rD({className:e,...t}){return(0,S.jsx)(`label`,{"data-slot":`label`,className:X(`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 iD({className:e,...t}){return(0,S.jsx)(`fieldset`,{"data-slot":`field-set`,className:X(`flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function aD({className:e,variant:t=`legend`,...n}){return(0,S.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:X(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n})}function oD({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`field-group`,className:X(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var sD=cf(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function cD({className:e,orientation:t=`vertical`,...n}){return(0,S.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:X(sD({orientation:t}),e),...n})}function lD({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`field-content`,className:X(`group/field-content flex flex-1 flex-col gap-0.5 leading-snug`,e),...t})}function uD({className:e,...t}){return(0,S.jsx)(rD,{"data-slot":`field-label`,className:X(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function dD({className:e,...t}){return(0,S.jsx)(`p`,{"data-slot":`field-description`,className:X(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}var fD=UT;function pD({className:e,...t}){return(0,S.jsx)(TE,{"data-slot":`select-group`,className:X(`scroll-my-1 p-1`,e),...t})}function mD({className:e,...t}){return(0,S.jsx)(YT,{"data-slot":`select-value`,className:X(`flex flex-1 text-left`,e),...t})}function hD({className:e,size:t=`default`,children:n,...r}){return(0,S.jsxs)(qT,{"data-slot":`select-trigger`,"data-size":t,className:X(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 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`,e),...r,children:[n,(0,S.jsx)(XT,{render:(0,S.jsx)(Eu,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function gD({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,S.jsx)(ZT,{children:(0,S.jsx)(rE,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,S.jsxs)(oE,{"data-slot":`select-content`,"data-align-trigger":o,className:X(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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),...s,children:[(0,S.jsx)(yD,{}),(0,S.jsx)(mE,{children:t}),(0,S.jsx)(bD,{})]})})})}function _D({className:e,children:t,...n}){return(0,S.jsxs)(_E,{"data-slot":`select-item`,className:X(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,S.jsx)(yE,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,S.jsx)(vE,{render:(0,S.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,S.jsx)(wu,{className:`pointer-events-none`})})]})}function vD({className:e,...t}){return(0,S.jsx)(EE,{"data-slot":`select-separator`,className:X(`pointer-events-none -mx-1 my-1 h-px bg-border`,e),...t})}function yD({className:e,...t}){return(0,S.jsx)(CE,{"data-slot":`select-scroll-up-button`,className:X(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,S.jsx)(Au,{})})}function bD({className:e,...t}){return(0,S.jsx)(SE,{"data-slot":`select-scroll-down-button`,className:X(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,S.jsx)(Eu,{})})}var xD=`default`,SD=[{value:`1`,label:`Stop that agent`},{value:`2`,label:`Wait for 1 reset, then stop`},{value:`3`,label:`Wait for 2 resets, then stop`},{value:`4`,label:`Wait for 3 resets, then stop`},{value:`5`,label:`Wait for 4 resets, then stop`},{value:`none`,label:`Wait and always continue`}];function CD({value:e,onChange:t}){let n=(n,r)=>{let i={...e.agents};r?i[n]=r:delete i[n],t({...e,agents:i})};return(0,S.jsxs)(oD,{children:[(0,S.jsxs)(iD,{children:[(0,S.jsx)(aD,{variant:`label`,children:`Agents`}),mS.map(t=>{let r=e.agents[t];return(0,S.jsxs)(cD,{orientation:`horizontal`,children:[(0,S.jsx)(tS,{id:`agent-${t}`,checked:r!==void 0,onCheckedChange:e=>n(t,e?{}:void 0)}),(0,S.jsx)(uD,{htmlFor:`agent-${t}`,className:`w-14 flex-none!`,children:t}),(0,S.jsx)(ED,{agent:t,value:r,onChange:e=>n(t,e)})]},t)})]}),(0,S.jsxs)(cD,{children:[(0,S.jsxs)(lD,{children:[(0,S.jsx)(uD,{children:`When an agent hits its usage limit`}),(0,S.jsx)(dD,{children:`Waiting pauses that agent until its plan resets, then it goes on. Once every agent has stopped, the factory turns off.`})]}),(0,S.jsxs)(fD,{items:SD,value:e.limit===null?`none`:String(e.limit),onValueChange:n=>t({...e,limit:n===`none`?null:Number(n)}),children:[(0,S.jsx)(hD,{className:`w-56`,children:(0,S.jsx)(mD,{})}),(0,S.jsx)(gD,{children:SD.map(e=>(0,S.jsx)(_D,{value:e.value,children:e.label},e.value))})]})]}),(0,S.jsxs)(cD,{orientation:`horizontal`,children:[(0,S.jsxs)(lD,{children:[(0,S.jsx)(uD,{htmlFor:`until`,children:`Start nothing new after`}),(0,S.jsx)(dD,{children:`Leave empty to keep going.`})]}),(0,S.jsx)(lp,{id:`until`,type:`time`,className:`w-28`,value:e.until??``,onChange:n=>t({...e,until:n.target.value||void 0})})]})]})}var wD;function TD(){let[e,t]=(0,v.useState)({});return(0,v.useEffect)(()=>{wD??=wf.models(),wD.then(t,()=>wD=void 0)},[]),e}function ED({agent:e,value:t,onChange:n}){let r=TD()[e]??[],i=t=>r.find(e=>e.value===t)?.efforts??hS[e],a=[{value:xD,label:`Default effort`}].concat(i(t?.model).map(e=>({value:e,label:e}))),o=e=>e===xD?void 0:e??void 0;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(DD,{label:`${e} model`,offered:r,disabled:!t,value:t?.model??xD,onChange:e=>{let r=o(e),a=t?.effort&&i(r).includes(t.effort)?t.effort:void 0;n({...t,model:r,effort:a})}}),(0,S.jsx)(OD,{label:`${e} effort`,items:a,disabled:!t,value:t?.effort??xD,onChange:e=>n({...t,effort:o(e)})})]})}function DD({label:e,offered:t,disabled:n,value:r,onChange:i}){let[a,o]=(0,v.useState)(null),s=[{value:xD,label:`Default model`,efforts:[],scoped:!0}];r!==xD&&!t.some(e=>e.value===r)&&s.push({value:r,label:r,efforts:[],scoped:!0});let c=[{value:``,items:s},{value:`Scoped`,items:t.filter(e=>e.scoped)},{value:`All models`,items:t.filter(e=>!e.scoped)}].filter(e=>e.items.length>0),l=c.flatMap(e=>e.items).find(e=>e.value===r);return(0,S.jsxs)(VE,{items:c,disabled:n,value:l,inputValue:a??l?.label??``,onInputValueChange:(e,{reason:t})=>{t===`input-change`&&o(e)},onOpenChange:e=>{e||o(null)},onValueChange:e=>e&&i(e.value),isItemEqualToValue:(e,t)=>e.value===t.value,autoHighlight:!0,filter:(e,t)=>t.toLowerCase().split(/\s+/).every(t=>`${e.label} ${e.value}`.toLowerCase().includes(t)),children:[(0,S.jsx)(GE,{"aria-label":e,className:`w-full min-w-0 flex-1`,disabled:n,onFocus:e=>e.target.select(),onBlur:()=>o(null)}),(0,S.jsxs)(KE,{className:`min-w-72`,children:[(0,S.jsx)(QE,{children:`No model matches`}),(0,S.jsx)(qE,{children:e=>(0,S.jsxs)(YE,{items:e.items,children:[e.value&&(0,S.jsx)(XE,{children:e.value}),(0,S.jsx)(ZE,{children:e=>(0,S.jsx)(JE,{value:e,children:(0,S.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,S.jsx)(`span`,{className:`truncate`,children:e.label}),e.value!==xD&&e.value!==e.label&&(0,S.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.value})]})},e.value)})]},e.value)})]})]})}function OD({label:e,className:t,items:n,disabled:r,value:i,onChange:a}){return(0,S.jsxs)(fD,{items:n,disabled:r,value:i,onValueChange:a,children:[(0,S.jsx)(hD,{"aria-label":e,className:t,children:(0,S.jsx)(mD,{})}),(0,S.jsx)(gD,{children:n.map(e=>(0,S.jsx)(_D,{value:e.value,children:e.label},e.value))})]})}var kD={blocked:{label:`Waiting for you`,shows:e=>e.state===`blocked`},review:{label:`Needs review`,shows:(e,t)=>{let n=ey(e);return n!==void 0&&(t[n]?.state??`OPEN`)===`OPEN`}},failed:{label:`Failed`,shows:e=>e.state===`failed`},nothing:{label:`Nothing to do`,shows:e=>{let t=e.attempts.at(-1);return e.state===`done`&&!t.url&&!t.branch}},all:{label:`All`,shows:()=>!0}},AD={passing:{label:`checks passing`,Icon:Mu,className:`text-success`},failing:{label:`checks failing`,Icon:Ru,className:`text-destructive`},pending:{label:`checks running`,Icon:Pu,className:void 0},none:{label:`no checks`,Icon:Bu,className:void 0}};function jD(e){return e.state===`done`||e.state===`failed`||e.state===`blocked`}var MD=`factory.results.seen`;function ND(){let[e]=(0,v.useState)(()=>{try{return localStorage.getItem(MD)??``}catch{return``}});return(0,v.useEffect)(()=>{let e=()=>{try{localStorage.setItem(MD,new Date().toISOString())}catch{}};return e(),e},[]),e}function PD(e,t,n){let r=ey(e),i=r?t[r]:void 0;return i?.state===`OPEN`&&!i.draft&&i.checks!==`failing`&&!(i.conflicts&&i.fork)&&!$v(n[e.id])}function FD({snapshot:e,act:t,onAsk:n}){let[r,i]=Hx(`filter`,`all`),[a,o]=(0,v.useState)(()=>new Set),[s,c]=(0,v.useState)(!1),l=ND(),{prs:u,train:d}=e,f=e.jobs.filter(e=>e.state!==`removed`),p=new Set(f.filter(e=>e.item.blueprint===`review`).map(e=>Zv(e.item))),m=Object.keys(e.settings.agents),h=f.filter(e=>e.attempts.length>0).sort((e,t)=>t.attempts.at(-1).start.localeCompare(e.attempts.at(-1).start));if(h.length===0)return(0,S.jsx)(lf,{children:(0,S.jsxs)(uf,{children:[(0,S.jsx)(df,{children:`Nothing done yet`}),(0,S.jsx)(ff,{children:`What the agents did shows up here, with their PRs to review and merge.`})]})});let g=h.filter(e=>(kD[r]??kD.all).shows(e,u)),_=g.filter(jD),y=_.filter(e=>a.has(e.id)),b=y.length===_.length,x=y.filter(e=>PD(e,u,d)),C=(e,t)=>{o(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 pt-2`,children:[(0,S.jsxs)(`div`,{className:`flex min-h-8 flex-wrap items-center gap-3 border border-transparent px-3`,children:[_.length>0&&(0,S.jsx)(tS,{"aria-label":b?`Clear selection`:`Select all`,checked:y.length>0&&b,disabled:s,onCheckedChange:e=>o(new Set(e?_.map(e=>e.id):[]))}),y.length===0?(0,S.jsx)(OD,{label:`Filter`,className:`w-56`,items:Object.entries(kD).map(([e,{label:t,shows:n}])=>({value:e,label:`${t} (${h.filter(e=>n(e,u)).length})`})),value:r,onChange:e=>e&&i(e)}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`span`,{className:`text-sm font-medium`,children:[y.length,` of `,_.length,` selected`]}),(0,S.jsxs)(`div`,{role:`group`,"aria-label":`Batch actions`,className:`flex items-center gap-2 sm:ml-auto`,children:[(0,S.jsx)(Rf,{variant:`outline`,size:`sm`,disabled:s,onClick:async()=>{if(!y.some(e=>e.attempts.some(e=>e.branch))||window.confirm(`Dismiss selected results and delete their unpushed branches?`)){c(!0);try{await t(async()=>{let e=(await Promise.allSettled(y.map(e=>wf.remove(e.id)))).find(e=>e.status===`rejected`);if(e)throw e.reason})}finally{c(!1)}}},children:s?`Dismissing…`:`Dismiss`}),x.length>0&&(0,S.jsxs)(Zl,{children:[(0,S.jsx)(Kl,{render:(0,S.jsx)(`span`,{}),children:(0,S.jsxs)(Rf,{variant:`outline`,size:`sm`,disabled:s,onClick:()=>{let e=x.length===1?`1 PR`:`${x.length} PRs`;window.confirm(`Merge ${e} one after another? Conflicting ones get rebased; ones that still conflict are skipped.`)&&(t(()=>wf.mergeTrain(x.map(e=>e.id))),o(new Set))},children:[`Merge `,x.length<y.length&&`(${x.length})`]})}),(0,S.jsx)(ql,{children:`Merges one after another per repo, smallest first`})]})]})]})]}),(0,S.jsx)(rS,{children:g.map(r=>(0,S.jsx)(ID,{job:r,snapshot:e,act:t,car:d[r.id],onAsk:n,asked:e.settings.chat.agent,unread:l!==``&&r.attempts.at(-1).end>l,reviewer:r.item.blueprint!==`review`&&!p.has(Zv(r.item))?m.find(e=>e!==r.agent):void 0,disabled:s&&a.has(r.id),selection:jD(r)&&(0,S.jsx)(tS,{"aria-label":`Select ${vf(r.item)}`,checked:a.has(r.id),disabled:s,onCheckedChange:e=>C(r.id,e)})},r.id))})]})}function ID({job:e,snapshot:t,act:n,car:r,onAsk:i,asked:a,unread:o,reviewer:s,disabled:c,selection:l}){let[u,d]=(0,v.useState)(),f=e.attempts.at(-1),p=ey(e),m=p?t.prs[p]:void 0,h=KD(e,t.prs),g=m?.state===`OPEN`,_=c||u!==void 0||$v(r),y=m&&(ny(m)?`rebase`:ty(m)?`merge`:void 0),b=r?.step===`skipped`?`The merge train skipped ${p}, "${vf(e.item)}": ${r.reason}. Why, and what should I do about it?`:e.state===`failed`?`Job ${e.id}, "${vf(e.item)}" (workwork ${e.item.id} in ${e.item.repo}), failed${f.error?`: ${f.error}`:``}. Its log is ${f.log}. Why did it fail, and should I retry it, pin another agent, or drop it?`:void 0;async function x(t){d(t);try{await n(()=>wf[t](e.id))}finally{d(void 0)}}let C={merge:`Merging…`,rebase:`Rebasing…`,close:`Closing…`},w=y&&(0,S.jsx)(Rf,{variant:`outline`,size:`sm`,disabled:_,onClick:()=>x(y),children:u?C[u]:y===`rebase`?`Rebase`:`Merge`}),T=e.state===`failed`&&(0,S.jsx)(Rf,{variant:`outline`,size:`sm`,disabled:_,onClick:()=>n(()=>wf.retry(e.id)),children:`Retry`}),E=()=>n(()=>wf.remove(e.id)),D=e.state===`blocked`?e.notes.findLast(e=>e.kind===`ask`):void 0;return(0,S.jsxs)(fS,{leading:(0,S.jsxs)(S.Fragment,{children:[l,(0,S.jsx)(WD,{state:h})]}),title:(0,S.jsxs)(S.Fragment,{children:[o&&(0,S.jsx)(`span`,{role:`img`,"aria-label":`new`,className:`mr-1 inline-block size-2 rounded-full bg-primary align-middle`}),(0,S.jsx)(JD,{item:e.item,job:e,snapshot:t,act:n,actions:(0,S.jsxs)(S.Fragment,{children:[jD(e)&&(0,S.jsx)(Rf,{variant:`ghost`,size:`sm`,className:`sm:mr-auto`,disabled:_,onClick:E,children:`Dismiss`}),g&&(0,S.jsx)(Rf,{variant:`outline`,size:`sm`,disabled:_,onClick:()=>x(`close`),children:u===`close`?C.close:`Close PR`}),g&&s&&(0,S.jsxs)(Rf,{variant:`outline`,size:`sm`,disabled:_,onClick:()=>n(()=>wf.review(e.id,s)),children:[`Review with `,Sf(s)]}),b&&(0,S.jsxs)(Rf,{variant:`outline`,size:`sm`,onClick:()=>i(b),children:[`Ask `,Sf(a)]}),T,w]})})]}),meta:(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(GD,{state:h,label:h===`failed`&&f.outcome!==`failed`?f.outcome:void 0}),(0,S.jsx)(LD,{job:e,last:f,pr:m,url:p,car:r})]}),below:D&&(0,S.jsx)(fp,{job:e,question:D,act:n}),children:[w,T,jD(e)&&(0,S.jsxs)(Zl,{children:[(0,S.jsx)(Kl,{render:(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Dismiss ${vf(e.item)}`,disabled:_,onClick:E}),children:(0,S.jsx)(nf,{"aria-hidden":`true`})}),(0,S.jsx)(ql,{children:e.attempts.some(e=>e.branch)?`Dismiss: hide from results and delete its unpushed branch`:`Dismiss: hide from results, its PR stays as it is`})]})]})}function LD({job:e,last:t,pr:n,url:r,car:i}){let a=e.notes.findLast(e=>e.kind===`result`),o=n?.state===`OPEN`&&AD[n.checks],s=r?[n?.state===`OPEN`&&(n.attention??e.item.attention),n&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`span`,{className:`text-success`,children:[`+`,n.additions]}),` `,(0,S.jsxs)(`span`,{className:`text-destructive`,children:[`−`,n.deletions]})]}),o&&(0,S.jsx)(`span`,{className:o.className,children:o.label},`checks`),n?.state===`OPEN`&&n.conflicts&&(0,S.jsx)(`span`,{className:`text-destructive`,children:`conflicts`},`conflicts`),n?.draft&&`draft`,i&&(0,S.jsx)(zD,{car:i},`train`),`#${r.split(`/`).at(-1)}`]:e.state===`failed`?[t.error&&(0,S.jsx)(`span`,{className:`text-destructive`,children:t.error.split(`
|
|
59
|
+
`)[0]},`error`),e.attempts.length>1&&`${e.attempts.length} attempts`]:[e.state===`done`&&(a?.text??`nothing to change`)];return(0,S.jsx)(`span`,{className:`min-w-0 truncate`,children:[...s,Sf(t.agent),hf(t.end)].filter(Boolean).map((e,t)=>(0,S.jsxs)(`span`,{children:[t>0&&` · `,e]},t))})}var RD={queued:`on the merge train`,waiting:`merge train: waiting for checks`,rebasing:`merge train: rebasing`,merging:`merge train: merging`,merged:void 0};function zD({car:e}){return e?.step===`skipped`?(0,S.jsxs)(`span`,{className:`text-destructive`,children:[`merge train skipped it: `,e.reason.replaceAll(`
|
|
60
|
+
`,` `)]}):e&&RD[e.step]?(0,S.jsx)(`span`,{children:RD[e.step]}):null}function BD({jobId:e,url:t,pr:n}){let r=n?.state===`OPEN`&&AD[n.checks];return(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-3`,children:[(0,S.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[(0,S.jsx)(id,{className:`size-3.5`,"aria-hidden":`true`}),t.replace(`https://github.com/`,``)]}),n?(0,S.jsxs)(S.Fragment,{children:[r&&(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1 ${r.className??``}`,children:[(0,S.jsx)(r.Icon,{className:`size-3.5`,"aria-hidden":`true`}),r.label]}),n.draft&&(0,S.jsx)(`span`,{children:`draft`}),n.state===`OPEN`&&n.conflicts===null&&(0,S.jsx)(`span`,{children:`checking mergeability…`}),n.state===`OPEN`&&n.conflicts&&(0,S.jsx)(`span`,{className:`text-destructive`,children:n.fork?`conflicts · resolve in fork`:`conflicts`}),(0,S.jsxs)(`span`,{children:[(0,S.jsxs)(`span`,{className:`text-success`,children:[`+`,n.additions]}),` `,(0,S.jsxs)(`span`,{className:`text-destructive`,children:[`−`,n.deletions]}),` in `,n.files.length,` `,n.files.length===1?`file`:`files`]}),(0,S.jsx)(Rx,{jobId:e,url:t,pr:n})]}):(0,S.jsx)(`span`,{children:`asking GitHub…`})]})}var VD={none:`a check defines correct, so a digest is enough`,skim:`same behavior and a small diff, to skim and accept`,decide:`changes behavior or needs your product judgment`},HD={candidate:{Icon:Pu,icon:`text-muted-foreground`,pill:`bg-muted text-muted-foreground`},queued:{Icon:Bu,icon:`text-muted-foreground`,pill:`bg-muted text-muted-foreground`},running:{Icon:vd,icon:`animate-spin text-primary`,pill:`bg-primary/15 text-primary`},blocked:{Icon:Iu,icon:`text-warning`,pill:`bg-warning text-background`},review:{Icon:id,icon:`text-primary`,pill:`bg-primary/15 text-primary`},done:{Icon:Mu,icon:`text-success`,pill:`bg-success/15 text-success`},merged:{Icon:ed,icon:`text-success`,pill:`bg-success/15 text-success`},failed:{Icon:Ru,icon:`text-destructive`,pill:`bg-destructive/15 text-destructive`},closed:{Icon:nd,icon:`text-muted-foreground`,pill:`bg-muted text-muted-foreground`},removed:{Icon:Ru,icon:`text-muted-foreground`,pill:`bg-muted text-muted-foreground`}},UD={blocked:`waiting for you`,review:`needs review`};function WD({state:e}){let{Icon:t,icon:n}=HD[e];return(0,S.jsx)(t,{role:`img`,"aria-label":e,className:`size-4 shrink-0 ${n}`})}function GD({state:e,label:t}){return(0,S.jsx)(`span`,{className:`inline-flex h-5 items-center rounded-full px-2 text-xs font-medium whitespace-nowrap ${HD[e].pill}`,children:t??UD[e]??e})}function KD(e,t){if(!e)return`candidate`;let n=ey(e);if(!n||e.state!==`done`)return e.state;let r=t[n]?.state;return r===`MERGED`?`merged`:r===`CLOSED`?`closed`:`review`}function qD({item:e,bare:t}){return(0,S.jsxs)(S.Fragment,{children:[!t&&(0,S.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[_f(e.repo),`: `]}),e.title||e.id]})}function JD({item:e,job:t,blueprint:n,snapshot:r,act:i,actions:a,bare:o}){let s=KD(t,r.prs);return(0,S.jsxs)($y,{children:[(0,S.jsx)(eb,{render:(0,S.jsx)(`button`,{type:`button`,className:`cursor-pointer truncate text-left underline-offset-4 hover:underline`}),children:(0,S.jsx)(qD,{item:e,bare:o})}),(0,S.jsxs)(rb,{className:t?`sm:max-w-5xl`:`sm:max-w-3xl`,children:[(0,S.jsx)(ib,{className:`mr-8`,children:(0,S.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,S.jsx)(`span`,{className:`mt-0.5`,children:(0,S.jsx)(WD,{state:s})}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,S.jsx)(ob,{children:(0,S.jsx)(qD,{item:e})}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-muted-foreground`,children:[(0,S.jsx)(GD,{state:s}),(0,S.jsxs)(sb,{children:[e.label,` · `,e.blueprint,` · `,e.attention]})]})]})]})}),t?(0,S.jsxs)(`div`,{className:`-mx-4 -mb-4 grid border-t md:max-h-[65dvh] md:grid-cols-[3fr_2fr]`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 overflow-auto p-4`,children:[(0,S.jsx)(eO,{children:`The task`}),(0,S.jsx)(YD,{item:e,jobId:t.id}),(0,S.jsx)(tO,{item:e,blueprint:n})]}),(0,S.jsx)(`div`,{className:`flex min-w-0 flex-col gap-3 overflow-auto bg-muted/30 p-4 md:border-l`,children:(0,S.jsx)(XD,{job:t,snapshot:r,act:i})})]}):(0,S.jsxs)(`div`,{className:`flex max-h-[65dvh] flex-col gap-3 overflow-auto`,children:[(0,S.jsx)(YD,{item:e}),(0,S.jsx)(tO,{item:e,blueprint:n})]}),a&&(0,S.jsx)(ab,{children:a})]})]})}function YD({item:e,jobId:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)();return(0,v.useEffect)(()=>{let n=!0;return(t?wf.jobPrompt(t):wf.prompt(e)).then(e=>n&&r(e),e=>n&&a(e.message)),()=>{n=!1}},[e,t]),i?(0,S.jsxs)(`p`,{role:`status`,className:`text-destructive`,children:[`Could not load the task: `,i]}):n===void 0?(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,S.jsx)(cb,{}),` Asking workwork…`]}):(0,S.jsx)(`div`,{className:`flex flex-col gap-2 text-sm wrap-anywhere`,children:(0,S.jsx)(qv,{options:Lx,children:n.split(`
|
|
61
|
+
## Standard`)[0].replace(/^# workwork[^]*?(?=^## )/m,``)})})}function XD({job:e,snapshot:t,act:n}){let{status:r,prs:i,train:a}=t,o=e.attempts.at(-1),s=new Set(t.jobs.filter(e=>e.state!==`removed`&&e.item.blueprint===`followup`).map(e=>e.item.title)),c=r?.workers.find(t=>t.job===e.id),l=e.notes.findLast(t=>t.kind===`step`&&t.attempt===e.attempts.length+1),u=e.state===`blocked`?e.notes.findLast(e=>e.kind===`ask`):void 0,d=ey(e),f=aO(e).sort((e,t)=>t.at.localeCompare(e.at)),p=new Map;for(let e of f){let t=lO(e.at);p.set(t,[...p.get(t)??[],e])}return(0,S.jsxs)(S.Fragment,{children:[c&&r&&(0,S.jsxs)($D,{className:`border-primary/40`,children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,S.jsx)(WD,{state:`running`}),c.id,` working, `,gf(c.since),` min`]}),l&&(0,S.jsxs)(`span`,{children:[l.text,l.of?` (${l.done??0}/${l.of})`:``]}),(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:[c.activity,c.context&&`${Math.round(c.context/1e3)}k context`].filter(Boolean).join(` · `)})]}),(0,S.jsx)(ZD,{job:e,act:n}),u&&(0,S.jsx)(fp,{job:e,question:u,act:n}),o?.error&&(0,S.jsx)($D,{className:`border-destructive/40 text-destructive`,children:o.error.split(`
|
|
62
|
+
`)[0]}),d&&(0,S.jsxs)($D,{className:i[d]?.state===`MERGED`?`border-success/40`:``,children:[(0,S.jsx)(BD,{jobId:e.id,url:d,pr:i[d]}),(0,S.jsx)(zD,{car:a[e.id]})]}),(0,S.jsx)(dp,{job:e,act:n,queued:s}),(0,S.jsx)(eO,{children:`Log`}),(0,S.jsx)(`div`,{className:`flex flex-col gap-3 text-sm`,children:[...p].map(([e,t])=>(0,S.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,S.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:e}),(0,S.jsx)(`ol`,{className:`flex flex-col`,children:t.map(e=>(0,S.jsxs)(`li`,{className:`group grid grid-cols-[4.5rem_1rem_1fr] gap-x-2`,children:[(0,S.jsx)(`time`,{dateTime:e.at,className:`text-right whitespace-nowrap text-muted-foreground tabular-nums`,children:mf(e.at)}),(0,S.jsx)(`span`,{className:`relative flex justify-center pt-0.5 before:absolute before:top-5.5 before:bottom-0.5 before:w-px before:bg-border group-last:before:hidden`,children:(0,S.jsx)(cO,{entry:e})}),(0,S.jsxs)(`span`,{className:`pb-3 wrap-anywhere ${e.tone??``}`,children:[e.step&&(0,S.jsx)(sO,{step:e.step}),e.text,` `,e.ended&&(0,S.jsx)(qb,{log:e.ended.log,agent:e.ended.agent,kind:`log`})]})]},`${e.at} ${e.text}`))})]},e))})]})}function ZD({job:e,act:t}){let n=e.notes.flatMap((t,n)=>t.kind===`assume`&&!e.notes.some(e=>e.kind===`answer`&&e.re===n)?[t]:[]),r=[e.tier&&`tier ${e.tier}${e.escalations?`, moved up ${e.escalations}×`:``}`,e.gates.length>0&&`gates ${e.gates.map(e=>`\`${e}\``).join(`, `)}`,e.touches&&`touches ${e.touches.length?e.touches.join(`, `):`anything`}`,e.needs.length>0&&`needs ${e.needs.join(`, `)}`].filter(Boolean);return r.length===0&&e.unverified.length===0&&n.length===0?null:(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[r.length>0&&(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r.join(` · `)}),e.unverified.map(n=>(0,S.jsx)($D,{className:`border-warning/40`,children:(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsxs)(`span`,{className:`flex-1`,children:[`Not verified: `,n]}),(0,S.jsx)(Rf,{size:`sm`,variant:`outline`,onClick:()=>t(()=>wf.verify(e.id,n)),children:`Checked`})]})},n)),n.map(n=>(0,S.jsxs)($D,{className:`border-warning/40`,children:[(0,S.jsxs)(`span`,{children:[`Assumed `,(0,S.jsx)(`strong`,{children:n.assumed}),`, asked: `,n.text]}),(0,S.jsxs)(`span`,{className:`flex gap-2`,children:[(0,S.jsx)(Rf,{size:`sm`,onClick:()=>t(()=>wf.answer(e.id,`fine`)),children:`Fine`}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`or answer below to queue a change`})]}),(0,S.jsx)(QD,{job:e,act:t})]},n.at))]})}function QD({job:e,act:t}){let[n,r]=(0,v.useState)(``);return(0,S.jsxs)(`form`,{className:`flex gap-2`,onSubmit:r=>{r.preventDefault(),t(()=>wf.answer(e.id,n))},children:[(0,S.jsx)(lp,{value:n,onChange:e=>r(e.target.value),placeholder:`Your answer`}),(0,S.jsx)(Rf,{type:`submit`,size:`sm`,variant:`outline`,disabled:!n.trim(),children:`Answer`})]})}function $D({className:e,children:t}){return(0,S.jsx)(`div`,{className:`flex flex-col gap-2 rounded-md border bg-popover p-2 text-sm ${e}`,children:t})}function eO({children:e}){return(0,S.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:e})}function tO({item:e,blueprint:t}){return(0,S.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{className:`font-medium text-foreground`,children:e.blueprint}),`: `,t,` `]}),VD[e.attention]&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{className:`font-medium text-foreground`,children:e.attention}),`:`,` `,VD[e.attention],`.`]})]})}var nO={note:(0,S.jsx)(Kd,{className:`text-muted-foreground`}),ask:(0,S.jsx)(bd,{className:`text-warning`}),assume:(0,S.jsx)(fd,{className:`text-warning`}),answer:(0,S.jsx)(Id,{className:`text-muted-foreground`}),result:(0,S.jsx)(Ju,{className:`text-primary`}),train:(0,S.jsx)(Xd,{className:`text-muted-foreground`}),factory:(0,S.jsx)(Ku,{className:`text-muted-foreground`})},rO=200;function iO(e){if(!e.turns)return``;let t=(e,t)=>`${e} ${t}${e===1?``:`s`}`;return[t(e.turns,`turn`),e.followups?t(e.followups,`follow-up`):``,e.peak?`peak ${Math.round(e.peak/1e3)}k`:``,e.compactions?t(e.compactions,`compaction`):``].filter(Boolean).join(`, `)}function aO(e){return[{at:e.added,job:e,text:`queued${e.agent?` for ${e.agent}`:``}`,icon:(0,S.jsx)(gd,{className:`text-muted-foreground`})},...e.attempts.flatMap(t=>[{at:t.start,job:e,text:`${t.agent} started`,icon:(0,S.jsx)(Ad,{className:`text-muted-foreground`})},{at:t.end,job:e,text:[`${t.preset??t.agent} ${t.outcome}`,t.url?.replace(`https://github.com/`,``),iO(t)].filter(Boolean).join(` · `),icon:t.outcome===`done`?(0,S.jsx)(Mu,{className:`text-success`}):(0,S.jsx)(Ru,{className:`text-destructive`}),tone:t.outcome===`done`?void 0:`text-destructive`,ended:t}]),...e.notes.map(t=>{if(t.kind!==`step`)return{at:t.at,job:e,text:`${up[t.kind]}: ${t.text}`,icon:nO[t.kind],tone:t.kind===`ask`?`text-foreground font-medium`:t.kind===`result`?`text-foreground`:void 0};let n=e.notes.filter(e=>e.kind===`step`&&e.attempt===t.attempt&&e.at<=t.at).length;return{at:t.at,job:e,text:t.text,tone:`text-foreground`,step:t.of?`${t.done??n}/${t.of}`:String(n)}})]}function oO(e){return e.filter(e=>e.state!==`removed`).flatMap(aO).sort((e,t)=>t.at.localeCompare(e.at)).slice(0,rO)}function sO({step:e}){return(0,S.jsx)(`span`,{className:`mr-2 inline-flex min-w-5 justify-center rounded-full bg-primary/15 px-1.5 text-xs font-medium text-primary tabular-nums`,children:e})}function cO({entry:e}){return(0,S.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 items-center justify-center [&_svg]:size-3.5`,children:e.icon??(0,S.jsx)(`span`,{className:`size-2 rounded-full bg-primary`})})}var lO=e=>new Date(e).toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`short`});function uO({snapshot:e,act:t}){let n=oO(e.jobs);if(n.length===0)return(0,S.jsx)(lf,{children:(0,S.jsxs)(uf,{children:[(0,S.jsx)(df,{children:`Nothing happened yet`}),(0,S.jsx)(ff,{children:`Jobs queued, started and finished show up here, with what their agents said.`})]})});let r=new Map;for(let e of n){let t=lO(e.at);r.set(t,[...r.get(t)??[],e])}return(0,S.jsx)(`div`,{className:`flex flex-col gap-6 pt-2`,children:[...r].map(([n,r])=>(0,S.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,S.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground`,children:n}),(0,S.jsx)(`ol`,{className:`flex flex-col gap-1.5 text-sm`,children:r.map(n=>(0,S.jsxs)(`li`,{className:`grid grid-cols-[4.5rem_1fr] gap-x-3 sm:grid-cols-[4.5rem_16rem_1fr]`,children:[(0,S.jsx)(`time`,{dateTime:n.at,className:`whitespace-nowrap text-muted-foreground tabular-nums`,children:mf(n.at)}),(0,S.jsx)(JD,{item:n.job.item,job:n.job,snapshot:e,act:t}),(0,S.jsxs)(`span`,{className:`col-start-2 flex gap-2 wrap-anywhere sm:col-start-3 ${n.tone??`text-muted-foreground`}`,children:[(0,S.jsx)(`span`,{className:`mt-0.5`,children:(0,S.jsx)(cO,{entry:n})}),(0,S.jsxs)(`span`,{children:[n.step&&(0,S.jsx)(sO,{step:n.step}),n.text]})]})]},`${n.at} ${n.job.id} ${n.text}`))})]},n))})}function dO({...e}){return(0,S.jsx)(ET,{"data-slot":`dropdown-menu`,...e})}function fO({...e}){return(0,S.jsx)(AT,{"data-slot":`dropdown-menu-trigger`,...e})}function pO({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,S.jsx)(mT,{children:(0,S.jsx)(hT,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,S.jsx)(dT,{"data-slot":`dropdown-menu-content`,className:X(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--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 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function mO({...e}){return(0,S.jsx)($w,{"data-slot":`dropdown-menu-group`,...e})}function hO({className:e,inset:t,...n}){return(0,S.jsx)(eT,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:X(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function gO({className:e,inset:t,variant:n=`default`,...r}){return(0,S.jsx)(nT,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:X(`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 _O({className:e,...t}){return(0,S.jsx)(nS,{"data-slot":`dropdown-menu-separator`,className:X(`-mx-1 my-1 h-px bg-border`,e),...t})}var vO=cf(`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`}}),yO=v.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function bO({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,S.jsx)(ME,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:X(`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,S.jsx)(yO.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function xO({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=v.useContext(yO);return(0,S.jsx)(kE,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:X(`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`,vO({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}var SO=[{value:`scan`,label:`The whole repo, searched by the agent`},{value:`batch`,label:`Batches of related code files`},{value:`batch tests`,label:`Batches of related test files`}],CO={name:``,attention:`skim`,description:``,finder:`scan`,done:``,onRequest:!0,prompt:``};function wO({act:e}){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(0);(0,v.useEffect)(()=>{wf.blueprints().then(n)},[s]),(0,v.useEffect)(()=>{wf.candidates().then(e=>i(e.repos))},[]);let l=t=>e(async()=>{await t(),c(e=>e+1)}),u=t=>(0,S.jsxs)(fS,{title:(0,S.jsx)(`button`,{className:`text-left hover:underline`,onClick:()=>o(t),children:t.name}),meta:[t.attention,t.finder,t.onRequest&&`on request`,t.description].filter(Boolean).join(` · `),children:[(0,S.jsxs)(dO,{children:[(0,S.jsx)(fO,{render:(0,S.jsx)(Rf,{variant:`outline`,size:`sm`}),children:`Run on…`}),(0,S.jsx)(pO,{align:`end`,className:`max-h-80 w-auto`,children:r.map(n=>(0,S.jsx)(gO,{onClick:()=>e(()=>wf.runBlueprint(t.name,n)),children:_f(n)},n))})]}),t.custom&&(0,S.jsx)(Rf,{variant:`ghost`,size:`sm`,onClick:()=>{confirm(`Delete the blueprint ${t.name}?`)&&l(()=>wf.deleteBlueprint(t.name))},children:`Delete`})]},t.name),d=t.filter(e=>e.custom);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`p`,{className:`flex-1 text-sm text-muted-foreground`,children:`A blueprint is a reusable prompt that workwork turns into candidates in every repo. Running one on a repo queues what it finds there.`}),(0,S.jsx)(Rf,{onClick:()=>o({...CO,custom:!0}),children:`New blueprint`})]}),(0,S.jsx)(pS,{title:`Yours (${d.length})`,children:d.length?(0,S.jsx)(rS,{children:d.map(u)}):(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`None yet.`})}),(0,S.jsx)(pS,{title:`Built in`,children:(0,S.jsx)(rS,{children:t.filter(e=>!e.custom).map(u)})}),a&&(0,S.jsx)(TO,{blueprint:a,onClose:()=>o(void 0),onSave:e=>l(async()=>{await wf.saveBlueprint(e),o(void 0)})})]})}function TO({blueprint:e,onClose:t,onSave:n}){let{custom:r,...i}=e,[a,o]=(0,v.useState)(i),s=e=>o({...a,...e}),c=e.name===``,l=SO.some(({value:e})=>e===a.finder)?SO:[...SO,{value:a.finder,label:a.finder}];return(0,S.jsx)($y,{open:!0,onOpenChange:e=>!e&&t(),children:(0,S.jsxs)(rb,{className:`sm:max-w-2xl`,children:[(0,S.jsxs)(ib,{children:[(0,S.jsx)(ob,{children:c?`New blueprint`:e.name}),(0,S.jsx)(sb,{children:r?`Saved in your workwork folder, so every repo can use it.`:`Built into workwork. A blueprint of yours with the same name replaces it.`})]}),(0,S.jsx)(`fieldset`,{disabled:!r,className:`contents`,children:(0,S.jsxs)(oD,{children:[(0,S.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{htmlFor:`blueprint-name`,children:`Name`}),(0,S.jsx)(lp,{id:`blueprint-name`,placeholder:`naming`,disabled:!c,value:a.name,onChange:e=>s({name:e.target.value})})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{children:`Attention`}),(0,S.jsx)(bO,{variant:`outline`,disabled:!r,value:[a.attention],onValueChange:([e])=>e&&s({attention:e}),children:[`none`,`skim`,`decide`].map(e=>(0,S.jsx)(xO,{value:e,children:e},e))})]})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{children:`Covers`}),(0,S.jsxs)(fD,{items:l,value:a.finder,disabled:!r,onValueChange:e=>e&&s({finder:e}),children:[(0,S.jsx)(hD,{"aria-label":`Covers`,children:(0,S.jsx)(mD,{})}),(0,S.jsx)(gD,{alignItemWithTrigger:!1,children:l.map(({value:e,label:t})=>(0,S.jsx)(_D,{value:e,children:t},e))})]})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{htmlFor:`blueprint-description`,children:`Description`}),(0,S.jsx)(lp,{id:`blueprint-description`,placeholder:`One sentence on what it does`,value:a.description,onChange:e=>s({description:e.target.value})})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{htmlFor:`blueprint-prompt`,children:`Prompt`}),(0,S.jsx)(NE,{id:`blueprint-prompt`,className:`min-h-48`,placeholder:`What to look for and what to change.`,value:a.prompt,onChange:e=>s({prompt:e.target.value})}),(0,S.jsx)(dD,{children:`Markdown. workwork wraps it with the repo, the candidate, its checks and how to deliver.`})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{htmlFor:`blueprint-done`,children:`Done when`}),(0,S.jsx)(lp,{id:`blueprint-done`,placeholder:`checks pass; each change names what it fixed`,value:a.done,onChange:e=>s({done:e.target.value})})]}),(0,S.jsxs)(cD,{orientation:`horizontal`,children:[(0,S.jsx)(eS,{id:`blueprint-on-request`,checked:a.onRequest,onCheckedChange:e=>s({onRequest:e})}),(0,S.jsx)(uD,{htmlFor:`blueprint-on-request`,children:`Only when run on a repo, not in every repo's candidates`})]})]})}),r&&(0,S.jsx)(ab,{children:(0,S.jsx)(Rf,{disabled:!a.name||!a.prompt.trim()||!a.done.trim(),onClick:()=>n(a),children:`Save`})})]})})}function EO(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var DO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kO={};function AO(e,t){return((t||kO).jsx?OO:DO).test(e)}var jO=/[ \t\n\f\r]/g;function MO(e){return typeof e==`object`?e.type===`text`&&NO(e.value):NO(e)}function NO(e){return e.replace(jO,``)===``}var PO=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};PO.prototype.normal={},PO.prototype.property={},PO.prototype.space=void 0;function FO(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new PO(n,r,t)}function IO(e){return e.toLowerCase()}var LO=class{constructor(e,t){this.attribute=t,this.property=e}};LO.prototype.attribute=``,LO.prototype.booleanish=!1,LO.prototype.boolean=!1,LO.prototype.commaOrSpaceSeparated=!1,LO.prototype.commaSeparated=!1,LO.prototype.defined=!1,LO.prototype.mustUseProperty=!1,LO.prototype.number=!1,LO.prototype.overloadedBoolean=!1,LO.prototype.property=``,LO.prototype.spaceSeparated=!1,LO.prototype.space=void 0;var RO=s({boolean:()=>BO,booleanish:()=>VO,commaOrSpaceSeparated:()=>GO,commaSeparated:()=>WO,number:()=>$,overloadedBoolean:()=>HO,spaceSeparated:()=>UO}),zO=0,BO=KO(),VO=KO(),HO=KO(),$=KO(),UO=KO(),WO=KO(),GO=KO();function KO(){return 2**++zO}var qO=Object.keys(RO),JO=class extends LO{constructor(e,t,n,r){let i=-1;if(super(e,t),YO(this,`space`,r),typeof n==`number`)for(;++i<qO.length;){let e=qO[i];YO(this,qO[i],(n&RO[e])===RO[e])}}};JO.prototype.defined=!0;function YO(e,t,n){n&&(e[t]=n)}function XO(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new JO(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[IO(r)]=r,n[IO(a.attribute)]=r}return new PO(t,n,e.space)}var ZO=XO({properties:{ariaActiveDescendant:null,ariaAtomic:VO,ariaAutoComplete:null,ariaBusy:VO,ariaChecked:VO,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:UO,ariaCurrent:null,ariaDescribedBy:UO,ariaDetails:null,ariaDisabled:VO,ariaDropEffect:UO,ariaErrorMessage:null,ariaExpanded:VO,ariaFlowTo:UO,ariaGrabbed:VO,ariaHasPopup:null,ariaHidden:VO,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:UO,ariaLevel:$,ariaLive:null,ariaModal:VO,ariaMultiLine:VO,ariaMultiSelectable:VO,ariaOrientation:null,ariaOwns:UO,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:VO,ariaReadOnly:VO,ariaRelevant:null,ariaRequired:VO,ariaRoleDescription:UO,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:VO,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function QO(e,t){return t in e?e[t]:t}function $O(e,t){return QO(e,t.toLowerCase())}var ek=XO({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:WO,acceptCharset:UO,accessKey:UO,action:null,allow:null,allowFullScreen:BO,allowPaymentRequest:BO,allowUserMedia:BO,alpha:BO,alt:null,as:null,async:BO,autoCapitalize:null,autoComplete:UO,autoFocus:BO,autoPlay:BO,blocking:UO,capture:null,charSet:null,checked:BO,cite:null,className:UO,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:VO,controls:BO,controlsList:UO,coords:$|WO,crossOrigin:null,data:null,dateTime:null,decoding:null,default:BO,defer:BO,dir:null,dirName:null,disabled:BO,download:HO,draggable:VO,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:BO,formTarget:null,headers:UO,height:$,hidden:HO,high:$,href:null,hrefLang:null,htmlFor:UO,httpEquiv:UO,id:null,imageSizes:null,imageSrcSet:null,inert:BO,inputMode:null,integrity:null,is:null,isMap:BO,itemId:null,itemProp:UO,itemRef:UO,itemScope:BO,itemType:UO,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:BO,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:BO,muted:BO,name:null,nonce:null,noModule:BO,noValidate:BO,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:BO,optimum:$,pattern:null,ping:UO,placeholder:null,playsInline:BO,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:BO,referrerPolicy:null,rel:UO,required:BO,reversed:BO,rows:$,rowSpan:$,sandbox:UO,scope:null,scoped:BO,seamless:BO,selected:BO,shadowRootClonable:BO,shadowRootCustomElementRegistry:BO,shadowRootDelegatesFocus:BO,shadowRootMode:null,shadowRootSerializable:BO,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:VO,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:BO,useMap:null,value:VO,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:UO,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:BO,declare:BO,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:BO,noHref:BO,noShade:BO,noWrap:BO,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:VO,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:BO,disablePictureInPicture:BO,disableRemotePlayback:BO,exportParts:WO,part:UO,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:$O}),tk=XO({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:GO,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:UO,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:BO,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:WO,g2:WO,glyphName:WO,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:GO,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:UO,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:GO,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:GO,rev:GO,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:GO,requiredFeatures:GO,requiredFonts:GO,requiredFormats:GO,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:GO,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:GO,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:GO,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:QO}),nk=XO({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()}}),rk=XO({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:$O}),ik=XO({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ak={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`},ok=/[A-Z]/g,sk=/-[a-z]/g,ck=/^data[-\w.:]+$/i;function lk(e,t){let n=IO(t),r=t,i=LO;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ck.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(sk,dk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!sk.test(e)){let n=e.replace(ok,uk);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=JO}return new i(r,t)}function uk(e){return`-`+e.toLowerCase()}function dk(e){return e.charAt(1).toUpperCase()}var fk=FO([ZO,ek,nk,rk,ik],`html`),pk=FO([ZO,tk,nk,rk,ik],`svg`);function mk(e){return e.join(` `).trim()}var hk=/\/\*(?:[^*]|\*(?!\/))*\*\//g,gk=/\n/g,_k=/^\s*/,vk=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,yk=/^:\s*/,bk=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,xk=/^[;\s]*/,Sk=`
|
|
63
|
+
`,Ck=`/`,wk=`*`,Tk=``,Ek=`comment`,Dk=`declaration`;function Ok(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(gk);t&&(n+=t.length);var i=e.lastIndexOf(Sk);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(_k)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(Ck==e.charAt(0)&&wk==e.charAt(1)){for(var n=2;Tk!=e.charAt(n)&&(wk!=e.charAt(n)||Ck!=e.charAt(n+1));)++n;if(n+=2,Tk===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Ek,comment:o})}}function f(){var e=a(),t=c(vk);if(t){if(d(),!c(yk))return s(`property missing ':'`);var n=c(bk),r=e({type:Dk,property:t[0].replace(hk,Tk).trim(),value:n?n[0].replace(hk,Tk).trim():Tk});return c(xk),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function kk(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Ok(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var Ak=Mk(`end`),jk=Mk(`start`);function Mk(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 Nk(e){let t=jk(e),n=Ak(e);if(t&&n)return{start:t,end:n}}function Pk(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Ik(e.position):`start`in e||`end`in e?Ik(e):`line`in e||`column`in e?Fk(e):``}function Fk(e){return Lk(e&&e.line)+`:`+Lk(e&&e.column)}function Ik(e){return Fk(e&&e.start)+`-`+Fk(e&&e.end)}function Lk(e){return e&&typeof e==`number`?e:1}var Rk=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){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=Pk(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}};Object.defineProperties(Rk.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var zk={}.hasOwnProperty,Bk=new Map,Vk=/[A-Z]/g,Hk=/-([a-z])/g,Uk=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Wk=new Set([`td`,`th`]),Gk=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Kk(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=rA(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=nA(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`?pk:fk,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=qk(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function qk(e,t,n){if(t.type===`element`)return Jk(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Yk(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Zk(e,t,n);if(t.type===`mdxjsEsm`)return Xk(e,t);if(t.type===`root`)return Qk(e,t,n);if(t.type===`text`)return $k(e,t)}function Jk(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=pk,e.schema=i),e.ancestors.push(t);let a=lA(e,t.tagName,!1),o=iA(e,t),s=oA(e,t);return Uk.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!MO(e)})),eA(e,o,a,t),tA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Yk(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)}uA(e,t.position)}function Xk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);uA(e,t.position)}function Zk(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=pk,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:lA(e,t.name,!0),o=aA(e,t),s=oA(e,t);return eA(e,o,a,t),tA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Qk(e,t,n){let r={};return tA(r,oA(e,t)),e.create(t,e.Fragment,r,n)}function $k(e,t){return t.value}function eA(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tA(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function nA(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 rA(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=jk(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 iA(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&zk.call(t.properties,i)){let a=sA(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Wk.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 aA(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 uA(e,t.position)}else{let{name:i}=r,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 uA(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function oA(e,t){let n=[],r=-1,i=e.passKeys?new Map:Bk;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=qk(e,a,o);s!==void 0&&n.push(s)}return n}function sA(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=lk(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?EO(n):mk(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:dA(n):cA(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?ak[r.property]||r.property:r.attribute,n]}function cA(e,t){let n={};try{kk(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(Hk,mA))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Rk("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=Gk+`#cannot-parse-style-attribute`,r}return n}function lA(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=AO(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=AO(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return zk.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);uA(e)}function uA(e,t){let n=new Rk("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=Gk+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function dA(e){let t={},n;for(n in e)zk.call(e,n)&&(t[fA(n)]=e[n]);return t}function fA(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(Vk,pA);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function pA(e){return`-`+e.toLowerCase()}function mA(e,t){return t.toUpperCase()}var hA={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`]},gA={};function _A(e,t){let n=t||gA;return vA(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function vA(e,t,n){if(bA(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 yA(e.children,t,n)}return Array.isArray(e)?yA(e,t,n):``}function yA(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=vA(e[i],t,n);return r.join(``)}function bA(e){return!!(e&&typeof e==`object`)}var xA=document.createElement(`i`);function SA(e){let t=`&`+e+`;`;xA.innerHTML=t;let n=xA.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function CA(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 wA(e,t){return e.length>0?(CA(e,e.length,0,t),e):t}var TA={}.hasOwnProperty;function EA(e){let t={},n=-1;for(;++n<e.length;)DA(t,e[n]);return t}function DA(e,t){let n;for(n in t){let r=(TA.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){TA.call(r,a)||(r[a]=[]);let e=i[a];OA(r[a],Array.isArray(e)?e:e?[e]:[])}}}function OA(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);CA(e,0,0,r)}function kA(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 AA(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var jA=UA(/[A-Za-z]/),MA=UA(/[\dA-Za-z]/),NA=UA(/[#-'*+\--9=?A-Z^-~]/);function PA(e){return e!==null&&(e<32||e===127)}var FA=UA(/\d/),IA=UA(/[\dA-Fa-f]/),LA=UA(/[!-/:-@[-`{-~]/);function RA(e){return e!==null&&e<-2}function zA(e){return e!==null&&(e<0||e===32)}function BA(e){return e===-2||e===-1||e===32}var VA=UA(/\p{P}|\p{S}/u),HA=UA(/\s/);function UA(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function WA(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&MA(e.charCodeAt(n+1))&&MA(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 GA(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return BA(r)?(e.enter(n),s(r)):t(r)}function s(r){return BA(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function KA(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&BA(t)?(e.enter(r),c(t)):l(t)}function c(t){return BA(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var qA={tokenize:JA};function JA(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`),GA(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 RA(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var YA=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){XA(this,e,t,n,!1)}addBefore(e,t,n){XA(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 XA(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 ZA={tokenize:$A},QA={tokenize:ej};function $A(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 YA;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(QA,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(QA,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 RA(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 YA;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 ej(e,t,n){return GA(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function tj(e){if(e===null||zA(e)||HA(e))return 1;if(VA(e))return 2}function nj(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 rj={name:`attention`,resolveAll:ij,tokenize:aj};function ij(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};oj(o,-a),oj(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=wA(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=wA(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=wA(r,nj(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=wA(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=wA(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),CA(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 aj(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=tj(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=tj(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 oj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var sj={name:`autolink`,tokenize:cj};function cj(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 jA(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||MA(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||MA(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||PA(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):NA(t)?(e.consume(t),l):n(t)}function u(e){return MA(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||MA(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var lj={partial:!0,tokenize:uj};function uj(e,t,n){return r;function r(t){return BA(t)?GA(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||RA(e)?t(e):n(e)}}var dj={continuation:{tokenize:pj},exit:mj,name:`blockQuote`,tokenize:fj};function fj(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 BA(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function pj(e,t,n){let r=this;return i;function i(t){return BA(t)?GA(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(dj,t,n)(r)}}function mj(e){e.exit(`blockQuote`)}var hj={name:`characterEscape`,tokenize:gj};function gj(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 LA(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var _j={name:`characterReference`,tokenize:vj};function vj(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=MA,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=IA,u):(e.enter(`characterReferenceValue`),a=7,o=FA,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===MA&&!SA(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 yj={partial:!0,tokenize:bj};function bj(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 xj={concrete:!0,name:`codeFenced`,tokenize:Sj};function Sj(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`),BA(t)?GA(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||RA(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(yj,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||RA(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):BA(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),GA(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||RA(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||RA(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&&BA(t)?GA(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||RA(t)?e.check(yj,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||RA(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`),BA(t)?GA(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`),BA(t)?GA(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||RA(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Cj={name:`codeIndented`,tokenize:Tj},wj={partial:!0,tokenize:Ej};function Tj(e,t,n){return r;function r(t){return e.enter(`codeIndented`),KA(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):RA(t)?e.attempt(wj,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||RA(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Ej(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):RA(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):KA(e,t,a,`linePrefix`,4,4)(o)}function a(e){return RA(e)?i(e):n(e)}}var Dj={name:`codeText`,previous:kj,resolve:Oj,tokenize:Aj};function Oj(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 kj(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Aj(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)):RA(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||RA(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 jj=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&&Mj(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),Mj(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Mj(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);Mj(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Mj(this.left,t.reverse())}}}};function Mj(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 Nj(e){let t={},n=-1,r,i,a,o,s,c,l,u=new jj(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,Pj(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 CA(e,0,1/0,u.slice(0)),!l}function Pj(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 Fj={resolve:Lj,tokenize:Rj},Ij={partial:!0,tokenize:zj};function Lj(e){return Nj(e),e}function Rj(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):RA(t)?e.check(Ij,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 zj(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GA(e,a,`linePrefix`)}function a(i){if(i===null||RA(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 Bj(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||PA(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||RA(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||zA(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||PA(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 Vj(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):RA(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||RA(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!BA(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Hj(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):RA(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GA(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||RA(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 Uj(e,t){let n;return r;function r(i){return RA(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):BA(i)?GA(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Wj={name:`definition`,tokenize:Kj},Gj={partial:!0,tokenize:qj};function Kj(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Vj.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=AA(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 zA(t)?Uj(e,l)(t):l(t)}function l(t){return Bj(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Gj,d,d)(t)}function d(t){return BA(t)?GA(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||RA(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function qj(e,t,n){return r;function r(t){return zA(t)?Uj(e,i)(t):n(t)}function i(t){return Hj(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return BA(t)?GA(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||RA(e)?t(e):n(e)}}var Jj={name:`hardBreakEscape`,tokenize:Yj};function Yj(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return RA(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Xj={name:`headingAtx`,resolve:Zj,tokenize:Qj};function Zj(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`};CA(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Qj(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||zA(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||RA(n)?(e.exit(`atxHeading`),t(n)):BA(n)?GA(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||zA(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var $j=`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(`.`),eM=[`pre`,`script`,`style`,`textarea`],tM={concrete:!0,name:`htmlFlow`,resolveTo:rM,tokenize:iM},nM={partial:!0,tokenize:aM};function rM(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 iM(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):jA(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):jA(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return jA(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||zA(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&eM.includes(l)?(i=1,r.interrupt?t(s):O(s)):$j.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||MA(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 BA(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||jA(t)?(e.consume(t),b):BA(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||MA(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):BA(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):BA(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||RA(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||zA(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||BA(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||RA(t)?O(t):BA(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):RA(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(nM,R,k)(t)):t===null||RA(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(yj,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||RA(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return eM.includes(n)?(e.consume(t),L):O(t)}return jA(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||RA(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function aM(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(lj,t,n)}}var oM={name:`htmlText`,tokenize:sM};function sM(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):jA(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):jA(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):RA(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):RA(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):RA(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):RA(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return jA(t)?(e.consume(t),S):n(t)}function S(t){return t===45||MA(t)?(e.consume(t),S):C(t)}function C(t){return RA(t)?(o=C,N(t)):BA(t)?(e.consume(t),C):M(t)}function w(t){return t===45||MA(t)?(e.consume(t),w):t===47||t===62||zA(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||jA(t)?(e.consume(t),E):RA(t)?(o=T,N(t)):BA(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||MA(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):RA(t)?(o=D,N(t)):BA(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):RA(t)?(o=O,N(t)):BA(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):RA(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||zA(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||zA(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return BA(t)?GA(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var cM={name:`labelEnd`,resolveAll:fM,resolveTo:pM,tokenize:mM},lM={tokenize:hM},uM={tokenize:gM},dM={tokenize:_M};function fM(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&&CA(e,0,e.length,n),e}function pM(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=wA(o,e.slice(i+1,i+r+3)),o=wA(o,[[`enter`,l,t]]),o=wA(o,nj(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=wA(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=wA(o,e.slice(a+1)),o=wA(o,[[`exit`,s,t]]),CA(e,i,e.length,o),e}function mM(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(AA(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(lM,u,o?u:d)(t):t===91?e.attempt(uM,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(dM,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function hM(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 zA(t)?Uj(e,a)(t):a(t)}function a(t){return t===41?u(t):Bj(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return zA(t)?Uj(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Hj(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return zA(t)?Uj(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 gM(e,t,n){let r=this;return i;function i(t){return Vj.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(AA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function _M(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 vM={name:`labelStartImage`,resolveAll:cM.resolveAll,tokenize:yM};function yM(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 bM={name:`labelStartLink`,resolveAll:cM.resolveAll,tokenize:xM};function xM(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 SM={name:`lineEnding`,tokenize:CM};function CM(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),GA(e,t,`linePrefix`)}}var wM={name:`thematicBreak`,tokenize:TM};function TM(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||RA(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),BA(t)?GA(e,s,`whitespace`)(t):s(t))}}var EM={continuation:{tokenize:AM},exit:MM,name:`list`,tokenize:kM},DM={partial:!0,tokenize:NM},OM={partial:!0,tokenize:jM};function kM(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:FA(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(wM,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 FA(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(lj,r.interrupt?n:u,e.attempt(DM,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return BA(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 AM(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(lj,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,GA(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!BA(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(OM,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,GA(e,e.attempt(EM,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function jM(e,t,n){let r=this;return GA(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 MM(e){e.exit(this.containerState.type)}function NM(e,t,n){let r=this;return GA(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!BA(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var PM={name:`setextUnderline`,resolveTo:FM,tokenize:IM};function FM(e,t){let n=new YA,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 IM(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`),BA(t)?GA(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||RA(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var LM={tokenize:RM};function RM(e){let t=this,n=e.attempt(lj,r,e.attempt(this.parser.constructs.flowInitial,i,GA(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Fj,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 zM={resolveAll:UM()},BM=HM(`string`),VM=HM(`text`);function HM(e){return{resolveAll:UM(e===`text`?WM: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 UM(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 WM(e,t){let n=new YA,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 GM=s({attentionMarkers:()=>$M,contentInitial:()=>qM,disable:()=>eN,document:()=>KM,flow:()=>YM,flowInitial:()=>JM,insideSpan:()=>QM,string:()=>XM,text:()=>ZM}),KM={42:EM,43:EM,45:EM,48:EM,49:EM,50:EM,51:EM,52:EM,53:EM,54:EM,55:EM,56:EM,57:EM,62:dj},qM={91:Wj},JM={[-2]:Cj,[-1]:Cj,32:Cj},YM={35:Xj,42:wM,45:[PM,wM],60:tM,61:PM,95:wM,96:xj,126:xj},XM={38:_j,92:hj},ZM={[-5]:SM,[-4]:SM,[-3]:SM,33:vM,38:_j,42:rj,60:[sj,oM],91:bM,92:[Jj,hj],93:cM,95:rj,96:Dj},QM={null:[rj,zM]},$M={null:[42,95]},eN={null:[]};function tN(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=wA(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=nj(a,l.events,l),l.events):[]}function f(e,t){return rN(p(e),t)}function p(e){return nN(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){RA(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&&CA(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 nN(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 rN(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=`
|
|
64
|
+
`;break;case-3:o=`\r
|
|
65
|
+
`;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 iN(e){let t={constructs:EA([GM,...(e||{}).extensions||[]]),content:n(qA),defined:[],document:n(ZA),flow:n(LM),lazy:{},string:n(BM),text:n(VM)};return t;function n(e){return n;function n(n){return tN(t,e,n)}}}function aN(e){for(;!Nj(e););return e}var oN=/[\0\t\n\r]/g;function sN(){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;){oN.lastIndex=c;let n=oN.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 cN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lN(e){return e.replace(cN,uN)}function uN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return kA(n.slice(t?2:1),t?16:10)}return SA(n)||e}var dN={}.hasOwnProperty;function fN(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),pN(n)(aN(iN(n).document().write(sN()(e,t,!0))))}function pN(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ce),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(G),blockQuote:o(U),characterEscape:E,characterReference:E,codeFenced:o(ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ie,s),codeText:o(ae,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(W),hardBreakEscape:o(K),hardBreakTrailing:o(K),htmlFlow:o(se,s),htmlFlowData:E,htmlText:o(se,s),htmlTextData:E,image:o(q),label:s,link:o(ce),listItem:o(ue),listItemValue:p,listOrdered:o(le,f),listUnordered:o(le),paragraph:o(de),reference:B,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(G),strong:o(fe),thematicBreak:o(me)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:re,autolinkProtocol:ne,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:H,characterReference:te,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),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(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:L,resourceTitleString:R,resource:z,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};hN(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]),dN.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]||_N).call(o,void 0,e[0])}for(r.position={start:mN(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:mN(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:mN(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+"` ("+Pk({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||_N).call(this,e,r[0])),n.position.end=mN(e.end)}function d(){return _A(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=AA(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=pe(),n.position={start:mN(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=mN(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=mN(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 M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){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 F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=lN(t),n.identifier=AA(t).toLowerCase()}function I(){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 L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function R(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function z(){this.data.inReference=void 0}function B(){this.data.referenceType=`collapsed`}function V(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=AA(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ee(e){this.data.characterReferenceType=e.type}function H(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=kA(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=SA(t);let i=this.stack[this.stack.length-1];i.value+=r}function te(e){let t=this.stack.pop();t.position.end=mN(e.end)}function ne(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function re(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function U(){return{type:`blockquote`,children:[],position:void 0}}function ie(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function ae(){return{type:`inlineCode`,value:``,position:void 0}}function oe(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function W(){return{type:`emphasis`,children:[],position:void 0}}function G(){return{type:`heading`,depth:0,children:[],position:void 0}}function K(){return{type:`break`,position:void 0}}function se(){return{type:`html`,value:``,position:void 0}}function q(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ce(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function le(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function ue(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function de(){return{type:`paragraph`,children:[],position:void 0}}function fe(){return{type:`strong`,children:[],position:void 0}}function pe(){return{type:`text`,value:``,position:void 0}}function me(){return{type:`thematicBreak`,position:void 0}}}function mN(e){return{line:e.line,column:e.column,offset:e.offset}}function hN(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?hN(e,r):gN(e,r)}}function gN(e,t){let n;for(n in t)if(dN.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 _N(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Pk({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Pk({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Pk({start:t.start,end:t.end})+`) is still open`)}function vN(e){let t=this;t.parser=n;function n(n){return fN(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function yN(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 bN(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
66
|
+
`}]}function xN(e,t){let n=t.value?t.value+`
|
|
67
|
+
`:``,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 SN(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CN(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wN(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=WA(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 TN(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 EN(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function DN(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 ON(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DN(e,t);let i={src:WA(r.url||``)};t.alt!==null&&t.alt!==void 0&&(i.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 kN(e,t){let n={src:WA(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 AN(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 jN(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DN(e,t);let i={href:WA(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 MN(e,t){let n={href:WA(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 NN(e,t,n){let r=e.all(t),i=n?PN(n):FN(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:`
|
|
68
|
+
`}),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:`
|
|
69
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function PN(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let{children:n}=e,r=-1;for(;!t&&++r<n.length;)t=FN(n[r])}return t}function FN(e){let{spread:t}=e;return t??e.children.length>1}function IN(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 LN(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RN(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function zN(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BN(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=jk(t.children[1]),o=Ak(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 VN(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 HN(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var UN=9,WN=32;function GN(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(KN(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(KN(t.slice(i),i>0,!1)),a.join(``)}function KN(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===UN||t===WN;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===UN||t===WN;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function qN(e,t){let n={type:`text`,value:GN(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function JN(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var YN={blockquote:yN,break:bN,code:xN,delete:SN,emphasis:CN,footnoteReference:wN,heading:TN,html:EN,imageReference:ON,image:kN,inlineCode:AN,linkReference:jN,link:MN,listItem:NN,list:IN,paragraph:LN,root:RN,strong:zN,table:BN,tableCell:HN,tableRow:VN,text:qN,thematicBreak:JN,toml:XN,yaml:XN,definition:XN,footnoteDefinition:XN};function XN(){}var{defineProperty:ZN}=Object,QN=typeof self==`object`?self:globalThis,$N=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new QN[e](t)},eP=(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__`?ZN(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 QN[e]==`function`?$N(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($N(a,o),i)};return r},tP=e=>eP(new Map,e)(0),nP=``,{toString:rP}={},{keys:iP,is:aP}=Object,oP=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=rP.call(e).slice(8,-1);switch(n){case`Array`:return[1,nP];case`Object`:return[2,nP];case`Date`:return[3,nP];case`RegExp`:return[4,nP];case`Map`:return[5,nP];case`Set`:return[6,nP];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},sP=([e,t])=>e===0&&(t===`function`||t===`symbol`),cP=(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]=oP(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&aP(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 iP(o))(e||!sP(oP(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?nP: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||!(sP(oP(n))||sP(oP(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!sP(oP(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},lP=(e,{json:t,lossy:n}={})=>{let r=[];return cP(!(t||n),!!t,new Map,r)(e),r},uP=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?tP(lP(e,t)):structuredClone(e):(e,t)=>tP(lP(e,t));function dP(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 fP(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function pP(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||dP,r=e.options.footnoteBackLabel||fP,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=[],l=-1;for(;++l<e.footnoteOrder.length;){let t=e.footnoteById.get(e.footnoteOrder[l]);t&&(s[l]=e.all(t))}for(l=-1;++l<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;let a=s[l],o=String(i.identifier).toUpperCase(),u=WA(o.toLowerCase()),d=0,f=[],p=e.footnoteCounts.get(o);for(;p!==void 0&&++d<=p;){f.length>0&&f.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(l,d);typeof e==`string`&&(e={type:`text`,value:e}),f.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+u+(d>1?`-`+d:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(l,d),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let m=a[a.length-1];if(m&&m.type===`element`&&m.tagName===`p`){let e=m.children[m.children.length-1];e&&e.type===`text`?e.value+=` `:m.children.push({type:`text`,value:` `}),m.children.push(...f)}else a.push(...f);let h={type:`element`,tagName:`li`,properties:{id:t+`fn-`+u},children:e.wrap(a,!0)};e.patch(i,h),c.push(h)}if(c.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...uP(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
70
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(c,!0)},{type:`text`,value:`
|
|
71
|
+
`}]}}var mP=(function(e){if(e==null)return yP;if(typeof e==`function`)return vP(e);if(typeof e==`object`)return Array.isArray(e)?hP(e):gP(e);if(typeof e==`string`)return _P(e);throw Error(`Expected function, string, or object as test`)});function hP(e){let t=[],n=-1;for(;++n<e.length;)t[n]=mP(e[n]);return vP(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function gP(e){let t=e;return vP(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function _P(e){return vP(t);function t(t){return t&&t.type===e}}function vP(e){return t;function t(t,n,r){return!!(bP(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function yP(){return!0}function bP(e){return typeof e==`object`&&!!e&&`type`in e}function xP(e){return e}var SP=[];function CP(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=mP(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+xP(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=SP;if(s&&r&&(o=wP(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=wP(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function wP(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?SP:[e]}function TP(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?CP(e,i,DP(a),o):CP(e,i,EP(a),o)}function EP(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?DP(e.enter):e.enter,exit:typeof e.exit==`function`?DP(e.exit):e.exit}}function DP(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var OP={}.hasOwnProperty,kP={};function AP(e,t){let n=t||kP,r=new Map,i=new Map,a={all:s,applyData:MP,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...YN,...n.handlers},one:o,options:n,patch:jP,wrap:PP};return TP(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=String(e.identifier).toUpperCase();e.type===`definition`?r.has(t)||r.set(t,e):i.has(t)||i.set(t,e)}}),a;function o(e,t){let{type:n}=e,r=a.handlers[n];if(OP.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;return{...uP(n),children:a.all(e)}}return uP(e)}return(a.options.unknownHandler||NP)(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=FP(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=FP(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function jP(e,t){e.position&&(t.position=Nk(e))}function MP(e,t){let n=t;if(e&&e.data){let{hChildren:t,hName:r,hProperties:i}=e.data;typeof r==`string`&&(n.type===`element`?n.tagName=r:n={type:`element`,tagName:r,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,uP(i)),`children`in n&&n.children&&t!=null&&(n.children=t)}return n}function NP(e,t){let n=t.data||{},r=`value`in t&&!(OP.call(n,`hProperties`)||OP.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 PP(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
72
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
73
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
74
|
+
`}),n}function FP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function IP(e,t){let n=AP(e,t),r=n.one(e,void 0),i=pP(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
75
|
+
`},i)),a}function LP(e,t){return e&&`run`in e?async function(n,r){let i=IP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return IP(n,{file:r,...e||t})}}function RP(e){if(e)throw e}var zP=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 BP(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 VP(){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?HP(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 HP(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 UP={basename:WP,dirname:GP,extname:KP,join:qP,sep:`/`};function WP(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);XP(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 GP(e){if(XP(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 KP(e){XP(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 qP(...e){let t=-1,n;for(;++t<e.length;)XP(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:JP(n)}function JP(e){XP(e);let t=e.codePointAt(0)===47,n=YP(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function YP(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 XP(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var ZP={cwd:QP};function QP(){return`/`}function $P(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function eF(e){if(typeof e==`string`)e=new URL(e);else if(!$P(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 tF(e)}function tF(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 nF=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],rF=class{constructor(e){let t;t=e?$P(e)?{path:e}:typeof e==`string`||sF(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:ZP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<nF.length;){let e=nF[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)nF.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?UP.basename(this.path):void 0}set basename(e){aF(e,`basename`),iF(e,`basename`),this.path=UP.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?UP.dirname(this.path):void 0}set dirname(e){oF(this.basename,`dirname`),this.path=UP.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?UP.extname(this.path):void 0}set extname(e){if(iF(e,`extname`),oF(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=UP.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){$P(e)&&(e=eF(e)),aF(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?UP.basename(this.path,this.extname):void 0}set stem(e){aF(e,`stem`),iF(e,`stem`),this.path=UP.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 Rk(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 iF(e,t){if(e&&e.includes(UP.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+UP.sep+"`")}function aF(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function oF(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function sF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var cF=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),lF=l(zP(),1),uF={}.hasOwnProperty,dF=new class e extends cF{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=VP()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,lF.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(mF(`data`,this.frozen),this.namespace[e]=t,this):uF.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mF(`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=_F(e),n=this.parser||this.Parser;return fF(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),fF(`process`,this.parser||this.Parser),pF(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=_F(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);yF(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(),fF(`processSync`,this.parser||this.Parser),pF(`processSync`,this.compiler||this.Compiler),this.process(e,r),gF(`processSync`,`process`,t),n;function r(e,r){t=!0,RP(e),n=r}}run(e,t,n){hF(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=_F(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),gF(`runSync`,`run`,n),r;function i(e,t){RP(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=_F(t),r=this.compiler||this.Compiler;return pF(`stringify`,r),hF(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(mF(`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,lF.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];BP(o)&&BP(r)&&(r=(0,lF.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function fF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function pF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function mF(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 hF(e){if(!BP(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function gF(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function _F(e){return vF(e)?e:new rF(e)}function vF(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function yF(e){return typeof e==`string`||bF(e)}function bF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var xF=[],SF={allowDangerousHtml:!0},CF=/^(https?|ircs?|mailto|xmpp)$/i,wF=[{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 TF(e){let t=EF(e),n=DF(e);return OF(t.runSync(t.parse(n),n),e)}function EF(e){let t=e.rehypePlugins||xF,n=e.remarkPlugins||xF,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...SF}:SF;return dF().use(vN).use(n).use(LP,r).use(t)}function DF(e){let t=e.children||``,n=new rF;return typeof t==`string`?n.value=t:``+t,n}function OF(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||kF;for(let e of wF)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return TP(e,l),Kk(e,{Fragment:S.Fragment,components:i,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.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 hA)if(Object.hasOwn(hA,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=hA[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 kF(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||CF.test(e.slice(0,t))?e:``}var AF=cf(`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 jF({className:e,variant:t,...n}){return(0,S.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:X(AF({variant:t}),e),...n})}function MF({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`alert-title`,className:X(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function NF({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`alert-description`,className:X(`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 PF=cf(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function FF({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,S.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:X(PF({variant:e}),n),...r})}function IF({className:e,render:t,...n}){return Ef({defaultTagName:`div`,props:Ai({className:X(`w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50`,e)},n),render:t,state:{slot:`bubble-content`}})}function LF({className:e,align:t=`start`,...n}){return(0,S.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:X(`group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse`,e),...n})}function RF({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`message-content`,className:X(`flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end`,e),...t})}function zF({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=BF(VF(r,i),t);if(!n)return v.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!v.isValidElement(n))return null;let o=n.props,s={...BF(a,o),ref:WF(a.ref,o.ref)};return v.cloneElement(n,s)}function BF(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];t[n]=n===`className`?[i,r].filter(Boolean).join(` `):n===`style`?{...i,...r}:n===`ref`?WF(i,r):UF(n)&&typeof i==`function`&&typeof r==`function`?HF(r,i):r}}return t}function VF(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function HF(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function UF(e){return/^on[A-Z]/.test(e)}function WF(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var GF=8,KF=64,qF=0,JF=.5,YF=180,XF=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),ZF={start:!1,end:!1},QF={currentAnchorId:null,visibleMessageIds:[]};function $F({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return ZF;let i=dI({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function eI({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return QF;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of tI(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+JF&&(u=e)}return l.length===0&&u===null?QF:{currentAnchorId:u,visibleMessageIds:l}}function tI(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function nI(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function rI(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function iI(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function aI(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function oI({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of tI(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function sI({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=cI(t,i),o=t.getBoundingClientRect().height,s=mI(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function cI(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function lI(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function uI({content:e,scrollTop:t,spacer:n,viewport:r}){let i=dI({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function dI({content:e,spacer:t,viewport:n}){let r=tI(e,t),i=pI(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function fI(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function pI(e){let t=window.getComputedStyle(e);return{end:gI(t.paddingBlockEnd||t.paddingBottom),start:gI(t.paddingBlockStart||t.paddingTop)}}function mI(e){let t=e?.parentElement;return t?pI(t):{end:0,start:0}}function hI(e){if(!e)return 0;let t=window.getComputedStyle(e);return gI(t.rowGap===`normal`?t.gap:t.rowGap)}function gI(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function _I(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function vI(e,t){return _I(e,t)}function yI(){return _I(QF,xI)}function bI(e,t){return e.start===t.start&&e.end===t.end}function xI(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function SI({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:r,scrollPreviousItemPeek:i}){let a=v.useRef(e),o=v.useRef(!1),s=v.useRef(null),c=v.useRef(!1),l=v.useRef(n),u=v.useRef(0),d=v.useRef(null),f=v.useRef(0),p=v.useRef(e?`following-bottom`:`free-scrolling`),m=v.useRef(new Map),h=v.useRef(null),g=v.useRef(null),_=v.useRef(null),y=v.useRef(i),b=v.useRef(!0),x=v.useRef(null),S=v.useRef(r),C=v.useRef(null),w=v.useRef(0),T=v.useRef(0),E=v.useRef(null),D=v.useRef(null),O=v.useRef(null),k=v.useRef(null),A=v.useRef(null),j=v.useRef(null),M=v.useRef(null),N=v.useRef(null),P=v.useRef(null),F=v.useRef(new Set),I=v.useRef(new WeakSet);return O.current===null&&(O.current=vI(t===`end`||t===`last-anchor`,(e,t)=>e===t)),k.current===null&&(k.current=vI(ZF,bI)),P.current===null&&(P.current=yI()),a.current=e,l.current=n,S.current=r,y.current=i,{autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:A,streamingTurnRef:_,contentRef:s,defaultScrollPositionAppliedRef:c,firstItemRef:d,itemCountRef:u,lastScrollTopRef:f,messageElementsRef:m,modeRef:p,pendingScrollFrameRef:C,pendingScrollToMessageRef:h,prependRestoreRef:g,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:O.current,rootRef:x,scrollEdgeThresholdRef:l,scrollMarginRef:S,scrollPreviousItemPeekRef:y,spacerGapRef:w,spacerHeightRef:T,spacerRef:E,stateFrameRef:D,stateStore:k.current,viewportRef:j,visibilityFrameRef:M,visibilityObserverRef:N,visibilityStore:P.current,visibleMessageIdsRef:F,handledScrollAnchorsRef:I}}function CI(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function wI(e){e.defaultScrollPositionAppliedRef.current=!0,CI(e)}function TI({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,itemCountRef:l,messageElementsRef:u,modeRef:d,pendingScrollToMessageRef:f,prependRestoreRef:p,scrollMarginRef:m,scrollPreviousItemPeekRef:h,spacerGapRef:g,spacerHeightRef:_,spacerRef:y,viewportRef:b}=e,x=v.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},YF))},[t]),S=v.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));_.current!==n&&(_.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-g.current}px`:``)},[]),C=v.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);Math.abs(a.scrollTop-o)<=JF?(a.scrollTop=o,t()):(i&&x(!0),a.scrollTo({top:o,behavior:r}),n())},[t,n,x]),w=v.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,d.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),T=v.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,d.current=a.current?`following-bottom`:`free-scrolling`,C(fI(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),E=v.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=m.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=b.current;if(!s||!l||!s.contains(e))return!1;let u=sI({align:t,element:e,scrollMargin:o?a+h.current:a,spacer:y.current,viewport:l}),f=uI({content:s,scrollTop:u,spacer:y.current,viewport:l});return S(f),p.current={element:e,viewportTop:lI(e,l)},d.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),D=v.useCallback(()=>{let e=i.current;return!e||!e.isConnected||d.current!==`anchored-to-message`?!1:E(e,{align:`start`},{keepPreviousPeek:!0})},[E]),O=v.useCallback((t,n)=>{let r=u.current.get(t);return r?(wI(e),E(r,n)?(f.current=null,!0):(f.current={messageId:t,options:n},!0)):l.current===0&&(f.current={messageId:t,options:n},wI(e),!0)},[E]);return{flushPendingScrollToMessage:v.useCallback(()=>{let t=f.current;if(!t)return!1;let n=u.current.get(t.messageId);return!n||!E(n,t.options)?!1:(f.current=null,wI(e),!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function EI(e,t){return v.useCallback(n=>{e.current=n,n&&t()},[e,t])}function DI({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=GF,scrollPreviousItemPeek:r=KF,scrollMargin:i=qF}){let a=SI({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:y,prependRestoreRef:b,preserveScrollOnPrependRef:x,pendingDefaultScrollStore:S,rootRef:C,scrollEdgeThresholdRef:w,scrollMarginRef:T,scrollPreviousItemPeekRef:E,spacerGapRef:D,spacerHeightRef:O,spacerRef:k,stateFrameRef:A,stateStore:j,viewportRef:M,visibilityFrameRef:N,visibilityObserverRef:P,visibilityStore:F,visibleMessageIdsRef:I,handledScrollAnchorsRef:L}=a,R=v.useRef(t);R.current!==t&&(R.current=t,d.current=!1);let z=v.useCallback(e=>{let t=C.current,n=M.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),B=v.useCallback(e=>{let t=M.current?.scrollTop??0,n=t<m.current-JF;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),V=v.useCallback(()=>{let e=$F({content:u.current,scrollEdgeThreshold:w.current,spacer:k.current,viewport:M.current});B(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;z(t),j.setSnapshot(t)},[B,j,z]),ee=v.useCallback(()=>{A.current===null&&(A.current=window.requestAnimationFrame(()=>{A.current=null,V()}))},[V]),H=v.useCallback(()=>{F.hasListeners()&&N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,F.hasListeners()&&F.setSnapshot(eI({content:u.current,scrollMargin:T.current,scrollPreviousItemPeek:E.current,spacer:k.current,viewport:M.current,visibleMessageIds:I.current}))}))},[F]),{flushPendingScrollToMessage:te,reanchorToAnchoredMessage:ne,scrollToElement:re,scrollToEnd:U,scrollToMessage:ie,scrollToStart:ae}=TI({refs:a,commitScrollState:V,scheduleStateCommit:ee,scheduleVisibilitySync:H}),oe=v.useCallback(()=>{let e=b.current,t=M.current;if(!e||!t||!e.element.isConnected)return!1;let n=lI(e.element,t)-e.viewportTop;return Math.abs(n)<=JF?!1:(t.scrollTop+=n,e.viewportTop=lI(e.element,t),ee(),H(),!0)},[ee,H]),W=v.useCallback(()=>{let e=u.current,t=M.current;if(!e||!t){b.current=null;return}let n=oI({content:e,spacer:k.current,viewport:t});b.current=n?{element:n,viewportTop:lI(n,t)}:null},[]),G=v.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,te()&&W()}))},[W,te]),K=v.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=M.current,r=t&&n?aI(tI(t,k.current)):null;if(!t||!n||!r)e=U({behavior:`auto`});else{let i=cI(r,n);e=dI({content:t,spacer:k.current,viewport:n})-i<=n.clientHeight?U({behavior:`auto`}):re(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?U({behavior:`auto`}):ae({behavior:`auto`});return e?(wI(a),!0):!1},[t,re,U,ae]),se=v.useCallback(()=>{let e=u.current;if(!e)return;let t=tI(e,k.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(te())return;if(n===0){if(K()||t.length>0&&s.current&&U({behavior:`auto`}))return;V(),H();return}let e=r?t.indexOf(r):-1;if(x.current&&e>0)oe();else{if(t.length>n){let e=nI(t,n);if(e){if(s.current&&g.current===`following-bottom`&&iI(t,n)){U({behavior:`auto`});return}re(e,{align:`start`},{keepPreviousPeek:!0}),L.current.add(e);return}}if(t.length===n){let e=rI(t,L.current);if(e){re(e,{align:`start`},{keepPreviousPeek:!0}),L.current.add(e);return}}g.current===`following-bottom`&&s.current?U({behavior:`auto`}):(V(),H())}})(),W()},[K,W,V,te,oe,H,re,U]),q=v.useCallback(()=>{if(g.current===`following-bottom`&&s.current){U({behavior:`auto`});return}let e=O.current;ne()?s.current&&e>0&&O.current===0&&U({behavior:`auto`}):(ee(),H())},[ne,ee,H,U]),ce=v.useCallback(()=>{let e=M.current;if(e&&F.hasListeners()){if(typeof IntersectionObserver>`u`){H();return}P.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?I.current.add(e):I.current.delete(e))}H()},{root:e,rootMargin:`${-(T.current+E.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{P.current?.observe(e)}),H()}},[H,F]),le=v.useCallback(()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),P.current?.disconnect(),P.current=null,I.current.clear(),F.setSnapshot(QF)},[F]),ue=v.useCallback((e,t,n)=>{t?(h.current.set(e,t),P.current?.observe(t),H(),y.current?.messageId===e&&G()):n&&h.current.get(e)===n&&(h.current.delete(e),I.current.delete(e),P.current?.unobserve(n),H())},[G,H]),de=v.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),fe=v.useCallback(()=>z(j.getSnapshot()),[j,z]),pe=EI(C,fe),me=EI(M,fe),he=v.useCallback(e=>{u.current=e},[]),ge=v.useCallback(e=>{k.current=e,D.current=hI(e?.parentElement??null)},[]),_e=v.useCallback(()=>{V(),H(),W()},[W,V,H]),ve=v.useMemo(()=>({handleContentChange:se,handleResize:q,observeVisibility:ce,pendingDefaultScrollStore:S,preserveScrollOnPrependRef:x,scrollToEnd:U,scrollToMessage:ie,scrollToStart:ae,setContentElement:he,setRootElement:pe,setSpacerElement:ge,setViewportElement:me,stateStore:j,syncAfterScroll:_e,unobserveVisibility:le,userScrollIntent:de,viewportRef:M,visibilityStore:F}),[se,q,ce,S,U,ie,ae,he,pe,ge,me,j,_e,le,de,F]);return v.useLayoutEffect(()=>{K()||p.current===0&&CI(a)},[K]),v.useEffect(()=>()=>{A.current!==null&&(window.cancelAnimationFrame(A.current),A.current=null),N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),P.current?.disconnect(),P.current=null},[]),v.useLayoutEffect(()=>{e&&g.current===`following-bottom`&&p.current>0?U({behavior:`auto`}):V()},[e,V,U]),{context:ve,registerMessage:ue}}function OI(e){let t=v.useRef(e);return t.current=e,t}var kI=v.createContext(null),AI=v.createContext(null);function jI(){let e=v.useContext(kI);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function MI(){let e=v.useContext(AI);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function NI({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=DI({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,S.jsx)(kI.Provider,{value:o,children:(0,S.jsx)(AI.Provider,{value:s,children:t})})}function PI(){let{pendingDefaultScrollStore:e}=jI();return v.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function FI({children:e,...t}){let{setRootElement:n}=jI(),r=PI();return(0,S.jsx)(`div`,{ref:n,...t,...r?{"data-pending-scroll":``}:null,children:e})}function II({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=jI(),_=PI();f.current=o;let y=v.useCallback(e=>{p(e),WF(s)?.(e)},[s,p]);function b(e){m(),r?.(e)}function x(e){h(),a?.(e)}function C(e){h(),i?.(e)}function w(e){XF.has(e.key)&&h(),n?.(e)}return v.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,S.jsx)(`div`,{ref:y,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:w,onScroll:b,onTouchMove:C,onWheel:x,...u,..._?{"data-pending-scroll":``}:null,children:t})}function LI({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=jI(),u=v.useRef(null),d=v.useCallback(e=>{u.current=e,c(e),WF(n)?.(e)},[n,c]);return v.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),v.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,S.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,S.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function RI({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=MI(),a=v.useRef(null),o=v.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),WF(t)?.(n)},[e,t,i]);return(0,S.jsx)(`div`,{ref:o,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function zI({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=jI(),d=OI(r),f=v.useCallback(e=>u.subscribe(e),[u]),p=v.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=v.useSyncExternalStore(f,p,p),h=v.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return zF({defaultTagName:`button`,props:BF({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,S.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var BI={Provider:NI,Root:FI,Viewport:II,Content:LI,Item:RI,Button:zI};function VI(e){return(0,S.jsx)(BI.Provider,{...e})}function HI({className:e,...t}){return(0,S.jsx)(BI.Root,{"data-slot":`message-scroller`,className:X(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function UI({className:e,...t}){return(0,S.jsx)(BI.Viewport,{"data-slot":`message-scroller-viewport`,className:X(`size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible`,e),...t})}function WI({className:e,...t}){return(0,S.jsx)(BI.Content,{"data-slot":`message-scroller-content`,className:X(`flex h-max min-h-full flex-col gap-6`,e),...t})}function GI({className:e,scrollAnchor:t=!1,...n}){return(0,S.jsx)(BI.Item,{"data-slot":`message-scroller-item`,scrollAnchor:t,className:X(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,e),...n})}function KI({direction:e=`end`,className:t,children:n,render:r,variant:i=`secondary`,size:a=`icon-sm`,...o}){return(0,S.jsx)(BI.Button,{"data-slot":`message-scroller-button`,"data-direction":e,"data-variant":i,"data-size":a,direction:e,className:X(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,t),render:r??(0,S.jsx)(Rf,{variant:i,size:a}),...o,children:n??(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(gu,{}),(0,S.jsx)(`span`,{className:`sr-only`,children:e===`end`?`Scroll to end`:`Scroll to start`})]})})}function qI({...e}){return(0,S.jsx)(bw,{"data-slot":`collapsible`,...e})}function JI({...e}){return(0,S.jsx)(Sw,{"data-slot":`collapsible-trigger`,...e})}function YI({...e}){return(0,S.jsx)(Tw,{"data-slot":`collapsible-content`,...e})}function XI({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`trace`,className:X(`flex w-full min-w-0 flex-col gap-2 *:has-[>[data-slot=trace-line]]:flex *:has-[>[data-slot=trace-line]]:w-fit *:has-[>[data-slot=trace-line]]:max-w-full *:has-[>[data-slot=trace-line]]:min-w-0 *:has-[>[data-slot=trace-line]]:rounded-md *:has-[>[data-slot=trace-line]]:text-left *:has-[>[data-slot=trace-line]]:outline-none *:has-[>[data-slot=trace-line]]:focus-visible:ring-3 *:has-[>[data-slot=trace-line]]:focus-visible:ring-ring/50`,e),...t})}function ZI({className:e,status:t,...n}){return(0,S.jsx)(`span`,{"data-slot":`trace-line`,"data-status":t,className:X(`flex w-fit max-w-full min-w-0 items-center gap-2 text-sm text-muted-foreground transition-colors in-[a,button]:cursor-pointer in-[a:hover,button:hover]:text-foreground data-[status=error]:text-destructive data-[status=error]:in-[a:hover,button:hover]:text-destructive data-[status=pending]:opacity-60 data-[status=running]:*:data-[slot=trace-title]:shimmer`,e),...n})}function QI({className:e,...t}){return(0,S.jsx)(`span`,{"data-slot":`trace-icon`,"aria-hidden":`true`,className:X(`flex size-4 shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=trace-title]~&]:-ml-1`,e),...t})}function $I({className:e,...t}){return(0,S.jsx)(`span`,{"data-slot":`trace-title`,className:X(`min-w-0 truncate motion-reduce:shimmer-none`,e),...t})}function eL({className:e,...t}){return(0,S.jsx)(qI,{"data-slot":`trace-collapsible`,className:X(`flex w-full min-w-0 flex-col`,e),...t})}function tL({className:e,children:t,...n}){return(0,S.jsxs)(JI,{"data-slot":`trace-collapsible-trigger`,className:X(`group/trace-collapsible-trigger flex w-fit max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-md text-left text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 has-[[data-status=error]]:text-destructive`,e),...n,children:[t,(0,S.jsx)(QI,{className:`transition-transform group-aria-expanded/trace-collapsible-trigger:rotate-90`,children:(0,S.jsx)(Ou,{})})]})}function nL({className:e,children:t,...n}){return(0,S.jsx)(YI,{"data-slot":`trace-collapsible-content`,className:`h-(--collapsible-panel-height) min-w-0 overflow-hidden transition-[height] duration-200 data-ending-style:h-0 data-starting-style:h-0`,...n,children:(0,S.jsx)(`div`,{"data-slot":`trace-collapsible-content-inner`,className:X(`mt-2 mb-1 ml-[calc(--spacing(2)-1px)] min-w-0 border-l pr-1 pl-4 leading-relaxed wrap-break-word text-muted-foreground`,e),children:t})})}function rL(e){let t=[];for(let n of e){let e=t.at(-1);n.role===`assistant`&&e?.role===`assistant`?e.messages.push(n):t.push({id:n.id,role:n.role,messages:[n]})}return t}function iL(e,t){let n=[];for(let r of e){r.text&&n.push({type:`text`,text:r.text});for(let e of r.tools??[]){let r=t?.(e),i=n.at(-1);r==null?i?.type===`steps`?i.tools.push(e):n.push({type:`steps`,tools:[e]}):n.push({type:`result`,id:e.id,node:r})}}return n}function aL({host:e}){let[t,n]=(0,v.useState)(!1);return t?(0,S.jsx)(od,{}):(0,S.jsx)(`img`,{src:`https://icons.duckduckgo.com/ip3/${e}.ico`,alt:``,className:`size-3 shrink-0 rounded-sm`,onError:()=>n(!0)})}var oL=6;function sL({sources:e}){let t=new Map;for(let n of e){let e=new URL(n.url).hostname;t.has(e)||t.set(e,n)}let n=t.size-oL;return(0,S.jsxs)(`ul`,{"aria-label":`Sources`,className:`flex flex-wrap gap-1 pl-6`,children:[[...t].slice(0,oL).map(([e,t])=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(Zl,{children:[(0,S.jsxs)(Kl,{render:(0,S.jsx)(Of,{variant:`outline`,render:(0,S.jsx)(`a`,{href:t.url,target:`_blank`,rel:`noopener noreferrer`})}),children:[(0,S.jsx)(aL,{host:e}),e.replace(/^www\./,``)]}),(0,S.jsx)(ql,{className:`wrap-anywhere`,children:t.title??t.url})]})},e)),n>0&&(0,S.jsx)(`li`,{children:(0,S.jsxs)(Of,{variant:`secondary`,children:[`+`,n]})})]})}function cL({tool:e}){let t=(0,S.jsxs)(ZI,{status:e.status===`complete`?void 0:e.status,children:[(0,S.jsx)(QI,{children:e.sources?(0,S.jsx)(od,{}):(0,S.jsx)(ef,{})}),(0,S.jsx)($I,{children:e.label})]}),n=e.output?(0,S.jsxs)(eL,{children:[(0,S.jsx)(tL,{children:t}),(0,S.jsx)(nL,{children:(0,S.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap text-xs`,children:e.output})})]}):t;return e.sources?.length?(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[n,(0,S.jsx)(sL,{sources:e.sources})]}):n}function lL({quote:e}){return(0,S.jsx)(XI,{children:(0,S.jsxs)(eL,{defaultOpen:!0,children:[(0,S.jsx)(tL,{children:(0,S.jsxs)(ZI,{children:[(0,S.jsx)(QI,{children:(0,S.jsx)(Jd,{})}),(0,S.jsx)($I,{children:e.source})]})}),(0,S.jsxs)(nL,{children:[(0,S.jsx)(`p`,{className:`max-h-48 overflow-auto whitespace-pre-wrap text-foreground`,children:e.text}),e.href&&(0,S.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`block truncate text-xs underline underline-offset-4`,children:e.href})]})]})})}var uL=(0,v.memo)(function({text:e}){return(0,S.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2 text-sm leading-relaxed wrap-break-word`,children:(0,S.jsx)(TF,{skipHtml:!0,allowedElements:[`p`,`strong`,`em`,`a`,`ul`,`ol`,`li`,`code`,`pre`,`br`,`blockquote`],components:{a:({children:e,href:t})=>(0,S.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`underline underline-offset-4`,children:e}),ul:({children:e})=>(0,S.jsx)(`ul`,{className:`list-disc pl-5`,children:e}),ol:({children:e})=>(0,S.jsx)(`ol`,{className:`list-decimal pl-5`,children:e}),pre:({children:e})=>(0,S.jsx)(`pre`,{className:`overflow-auto whitespace-pre-wrap`,children:e})},children:e})})});function dL({messages:e,prompt:t,onPromptChange:n,busy:r,disabled:i=!1,error:a,onSend:o,onStop:s,renderTool:c,model:l,placeholder:u=`Ask the agent…`,emptyTitle:d=`What would you like to do?`,emptyDescription:f=`Ask a question or describe a change. You stay in control of what gets applied.`}){let[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),_=a||h,y=(0,v.useId)(),b=r||p;async function x(){let e=t.trim();if(!(!e||b||i)){m(!0),g(``);try{await o(e)&&n(t=>t.trim()===e?``:t)}catch(e){g(e instanceof Error?e.message:`Could not send. Please try again.`)}finally{m(!1)}}}return(0,S.jsxs)(`section`,{"aria-label":`Agent conversation`,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4`,children:[(0,S.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,S.jsx)(VI,{autoScroll:!0,children:(0,S.jsxs)(HI,{children:[(0,S.jsx)(UI,{children:(0,S.jsx)(WI,{children:e.length===0?(0,S.jsx)(GI,{messageId:`empty`,children:(0,S.jsx)(lf,{children:(0,S.jsxs)(uf,{children:[(0,S.jsx)(df,{children:d}),(0,S.jsx)(ff,{children:f})]})})}):rL(e).map(e=>(0,S.jsx)(GI,{messageId:e.id,scrollAnchor:e.role===`user`,children:(0,S.jsx)(LF,{align:e.role===`user`?`end`:`start`,children:(0,S.jsx)(RF,{children:e.role===`user`?(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col items-end gap-2`,children:[e.messages[0].quote&&(0,S.jsx)(lL,{quote:e.messages[0].quote}),(0,S.jsx)(FF,{align:`end`,variant:`muted`,children:(0,S.jsx)(IF,{className:`whitespace-pre-wrap`,children:e.messages[0].text})})]}):(0,S.jsx)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:iL(e.messages,c).map((e,t)=>e.type===`text`?(0,S.jsx)(uL,{text:e.text},t):e.type===`steps`?(0,S.jsx)(XI,{children:e.tools.map(e=>(0,S.jsx)(cL,{tool:e},e.id))},e.tools[0].id):(0,S.jsx)(`div`,{className:`min-w-0`,children:e.node},e.id))})})})},e.id))})}),(0,S.jsx)(KI,{})]})})}),_&&(0,S.jsxs)(jF,{variant:`destructive`,children:[(0,S.jsx)(MF,{children:`The agent could not continue`}),(0,S.jsx)(NF,{children:_})]}),(0,S.jsxs)(`form`,{className:`shrink-0`,onSubmit:e=>{e.preventDefault(),x()},children:[(0,S.jsx)(`label`,{htmlFor:y,className:`sr-only`,children:`Message the agent`}),(0,S.jsxs)(PE,{children:[(0,S.jsx)(BE,{id:y,value:t,onChange:e=>n(e.target.value),className:`max-h-40`,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),x())},placeholder:u,disabled:i,maxLength:4e3,rows:2}),(0,S.jsx)(IE,{align:`block-end`,className:`justify-end`,children:b?(0,S.jsxs)(RE,{type:`button`,size:`sm`,variant:`outline`,onClick:s,disabled:p||i,children:[(0,S.jsx)(Hd,{"data-icon":`inline-start`}),`Stop`]}):(0,S.jsxs)(RE,{type:`submit`,size:`sm`,variant:t.trim()?`default`:`secondary`,disabled:i,"aria-disabled":i||!t.trim(),children:[(0,S.jsx)(bu,{"data-icon":`inline-start`}),`Send`]})})]})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,S.jsx)(`p`,{role:`status`,className:`truncate text-xs text-muted-foreground`,children:b?`Agent working. You can stop it at any time.`:`Enter to send. Shift+Enter for a new line.`}),l&&(0,S.jsxs)(Zl,{children:[(0,S.jsxs)(Kl,{render:(0,S.jsx)(Of,{variant:`secondary`}),children:[(0,S.jsx)(Su,{}),l.name,` · `,l.thinking]}),(0,S.jsxs)(ql,{children:[`Model `,l.name,`, thinking `,l.thinking]})]})]})]})}var fL=768;function pL(){let[e,t]=v.useState(void 0);return v.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<fL)};return e.addEventListener(`change`,n),t(window.innerWidth<fL),()=>e.removeEventListener(`change`,n)},[]),!!e}function mL({...e}){return(0,S.jsx)(qy,{"data-slot":`sheet`,...e})}function hL({...e}){return(0,S.jsx)(ky,{"data-slot":`sheet-portal`,...e})}function gL({className:e,...t}){return(0,S.jsx)(cy,{"data-slot":`sheet-overlay`,className:X(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function _L({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,S.jsxs)(hL,{children:[(0,S.jsx)(gL,{}),(0,S.jsxs)(Dy,{"data-slot":`sheet-content`,"data-side":n,className:X(`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-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] 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=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] 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=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,S.jsxs)(ly,{"data-slot":`sheet-close`,render:(0,S.jsx)(Rf,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,S.jsx)(nf,{}),(0,S.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function vL({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`sheet-header`,className:X(`flex flex-col gap-0.5 p-4`,e),...t})}function yL({className:e,...t}){return(0,S.jsx)(Jy,{"data-slot":`sheet-title`,className:X(`font-heading text-base font-medium text-foreground`,e),...t})}function bL({className:e,...t}){return(0,S.jsx)(uy,{"data-slot":`sheet-description`,className:X(`text-sm text-muted-foreground`,e),...t})}var xL=`sidebar_state`,SL=604800,CL=`16rem`,wL=`18rem`,TL=`3rem`,EL=`b`,DL=v.createContext(null);function OL(){let e=v.useContext(DL);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function kL({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=pL(),[c,l]=v.useState(!1),[u,d]=v.useState(e),f=t??u,p=v.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${xL}=${t}; path=/; max-age=${SL}`},[n,f]),m=v.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);v.useEffect(()=>{let e=e=>{e.key===EL&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=v.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,S.jsx)(DL.Provider,{value:g,children:(0,S.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":CL,"--sidebar-width-icon":TL,...i},className:X(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function AL({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}=OL();return n===`none`?(0,S.jsx)(`div`,{"data-slot":`sidebar`,className:X(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,S.jsx)(mL,{open:l,onOpenChange:u,...o,children:(0,S.jsxs)(_L,{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":wL},side:e,children:[(0,S.jsxs)(vL,{className:`sr-only`,children:[(0,S.jsx)(yL,{children:`Sidebar`}),(0,S.jsx)(bL,{children:`Displays the mobile sidebar.`})]}),(0,S.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,S.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,S.jsx)(`div`,{"data-slot":`sidebar-gap`,className:X(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`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,S.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:X(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear 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,S.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 jL({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:X(`flex flex-col gap-2 p-2`,e),...t})}function ML({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:X(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function NL({children:e,agent:t,title:n=`Agent`}){return(0,S.jsx)(kL,{defaultOpen:!1,style:{"--sidebar-width":`24rem`},children:(0,S.jsx)(PL,{agent:t,title:n,children:e})})}function PL({children:e,agent:t,title:n}){let{open:r,openMobile:i,isMobile:a,toggleSidebar:o}=OL(),s=a?i:r,[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(null);return(0,v.useEffect)(()=>{s?l(!0):c&&u.current?.focus()},[s,c]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`min-w-0 flex-1`,children:e}),(0,S.jsx)(`div`,{hidden:s,className:`fixed right-6 bottom-6 z-20`,children:(0,S.jsxs)(Rf,{ref:u,"aria-label":`Open agent`,"aria-expanded":s,onClick:o,children:[(0,S.jsx)(Sd,{"data-icon":`inline-start`}),n]})}),(0,S.jsx)(AL,{side:`right`,collapsible:`offcanvas`,children:(0,S.jsxs)(`div`,{inert:!s,className:`flex h-full min-h-0 flex-col`,children:[(0,S.jsx)(jL,{children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`h2`,{className:`text-sm font-medium`,children:n}),(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Minimize agent`,onClick:o,children:(0,S.jsx)(Od,{})})]})}),(0,S.jsx)(ML,{className:`overflow-hidden`,children:(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 p-4`,children:c?t:null})})]})})]})}function FL(e){let t=e.match(/https?:\/\/[^\s"'<>()[\]]+/g)??[];return[...new Set(t.map(e=>e.replace(/[.,;:!?]+$/,``)))].filter(e=>URL.canParse(e)).map(e=>({url:e}))}var IL=e=>typeof e==`string`?e.split(`
|
|
76
|
+
`)[0]:void 0,LL=e=>e>1?` and ${e-1} more`:``,RL=({url:e,urls:t})=>[e,t].flat().filter(e=>typeof e==`string`&&URL.canParse(e)),zL={running:`Running`,complete:`Ran`,error:`Failed to run`},BL={bash:{verbs:zL,subject:({command:e})=>IL(e)},read:{verbs:{running:`Reading`,complete:`Read`,error:`Failed to read`},subject:({path:e})=>IL(e)},edit:{verbs:{running:`Editing`,complete:`Edited`,error:`Failed to edit`},subject:({path:e})=>IL(e)},write:{verbs:{running:`Writing`,complete:`Wrote`,error:`Failed to write`},subject:({path:e})=>IL(e)},grep:{verbs:{running:`Searching for`,complete:`Searched for`,error:`Failed to search for`},subject:({pattern:e})=>IL(e)},find:{verbs:{running:`Finding`,complete:`Found`,error:`Failed to find`},subject:({pattern:e})=>IL(e)},ls:{verbs:{running:`Listing`,complete:`Listed`,error:`Failed to list`},subject:({path:e})=>IL(e)},web_search:{verbs:{running:`Searching`,complete:`Searched`,error:`Failed to search`},subject:({query:e,queries:t})=>{let n=Array.isArray(t)?t:[e];return typeof n[0]==`string`?`for “${n[0]}”${LL(n.length)}`:`the web`},sources:(e,t)=>t?FL(t):void 0},fetch_content:{verbs:{running:`Reading`,complete:`Read`,error:`Failed to read`},subject:e=>{let t=RL(e);return t.length?`${new URL(t[0]).hostname}${LL(t.length)}`:`a page`},sources:e=>RL(e).map(e=>({url:e}))}};function VL(e,t,n,r=BL){let i=r[e.name];return i?{label:`${i.verbs[t]} ${i.subject(e.arguments)??``}`.trim(),sources:i.sources?.(e.arguments,n)}:{label:`${zL[t]} ${e.name}`}}var HL=(0,v.createContext)({});function UL(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var WL=typeof window<`u`?v.useLayoutEffect:v.useEffect,GL=(0,v.createContext)(null);function KL(e,t){e.indexOf(t)===-1&&e.push(t)}function qL(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var JL=(e,t,n)=>n>t?t:n<e?e:n,YL={},XL=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ZL=e=>typeof e==`object`&&!!e,QL=e=>/^0[^.\s]+$/u.test(e);function $L(e){let t;return()=>(t===void 0&&(t=e()),t)}var eR=e=>e,tR=(...e)=>e.reduce((e,t)=>n=>t(e(n))),nR=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},rR=class{constructor(){this.subscriptions=[]}add(e){return KL(this.subscriptions,e),()=>this.remove(e)}remove(e){qL(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},iR=e=>e*1e3,aR=e=>e/1e3,oR=(e,t)=>t?1e3/t*e:0,sR=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},cR=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function lR(e,t,n,r){return e===t&&n===r?eR:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=cR(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(cR(s+1e-7,e,n)-i-r)}return cR(s,t,r)}}var uR=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,dR=e=>t=>1-e(1-t),fR=lR(.33,1.53,.69,.99),pR=dR(fR),mR=uR(pR),hR=e=>e>=1?1:(e*=2)<1?.5*pR(e):.5*(2-2**(-10*(e-1))),gR=e=>1-Math.sin(Math.acos(e)),_R=dR(gR),vR=uR(gR),yR=lR(.42,0,1,1),bR=lR(0,0,.58,1),xR=lR(.42,0,.58,1),SR=e=>Array.isArray(e)&&typeof e[0]!=`number`;function CR(e,t){return SR(e)?e[sR(0,e.length,t)]:e}var wR=e=>Array.isArray(e)&&typeof e[0]==`number`,TR={linear:eR,easeIn:yR,easeInOut:xR,easeOut:bR,circIn:gR,circInOut:vR,circOut:_R,backIn:pR,backInOut:mR,backOut:fR,anticipate:hR},ER=e=>typeof e==`string`,DR=e=>{if(wR(e)){let[t,n,r,i]=e;return lR(t,n,r,i)}return ER(e)?TR[e]:e},OR={delta:0,timestamp:0,isProcessing:!1},kR;function AR(){kR=void 0}var jR={now:()=>(kR===void 0&&jR.set(OR.isProcessing||YL.useManualTiming?OR.timestamp:performance.now()),kR),set:e=>{kR=e,queueMicrotask(AR)}},MR=e=>Math.round(e*1e5)/1e5,NR=e=>t=>typeof t==`string`&&t.startsWith(e),PR=NR(`--`),FR=NR(`var(--`),IR=e=>FR(e)?LR.test(e.split(`/*`)[0].trim()):!1,LR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function RR(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var zR={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},BR={...zR,transform:e=>JL(0,1,e)},VR={...zR,default:1},HR=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function UR(e){return e==null}var WR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,GR=(e,t)=>n=>!!(typeof n==`string`&&WR.test(n)&&n.startsWith(e)||t&&!UR(n)&&Object.prototype.hasOwnProperty.call(n,t)),KR=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(HR);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},qR=e=>JL(0,255,e),JR={...zR,transform:e=>Math.round(qR(e))},YR={test:GR(`rgb`,`red`),parse:KR(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+JR.transform(e)+`, `+JR.transform(t)+`, `+JR.transform(n)+`, `+MR(BR.transform(r))+`)`},XR=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function ZR(e){let t=e.length>5?2:1,n=XR(e,3,t);return{red:parseInt(XR(e,0,t),16),green:parseInt(XR(e,1,t),16),blue:parseInt(XR(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var QR={test:GR(`#`),parse:ZR,transform:YR.transform},$R=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ez=$R(`deg`),tz=$R(`%`),nz=$R(`px`),rz=$R(`vh`),iz=$R(`vw`),az={...tz,parse:e=>tz.parse(e)/100,transform:e=>tz.transform(e*100)},oz={test:GR(`hsl`,`hue`),parse:KR(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+tz.transform(MR(t))+`, `+tz.transform(MR(n))+`, `+MR(BR.transform(r))+`)`},sz={test:e=>YR.test(e)||QR.test(e)||oz.test(e),parse:e=>YR.test(e)?YR.parse(e):oz.test(e)?oz.parse(e):QR.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?YR.transform(e):oz.transform(e),getAnimatableNone:e=>{let t=sz.parse(e);return t.alpha=0,sz.transform(t)}},cz=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,lz=new RegExp(HR.source),uz=new RegExp(cz.source,`i`);function dz(e){return isNaN(e)&&typeof e==`string`&&(lz.test(e)||uz.test(e))}var fz=`number`,pz=`color`,mz=`var`,hz=`var(`,gz="${}",_z=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function vz(e){let t=e.toString();return lz.test(t)||uz.test(t)}function yz(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(_z,e=>(sz.test(e)?(r.color.push(a),i.push(pz),n.push(sz.parse(e))):e.startsWith(hz)?(r.var.push(a),i.push(mz),n.push(e)):(r.number.push(a),i.push(fz),n.push(parseFloat(e))),++a,gz)).split(gz),indexes:r,types:i}}function bz(e){return yz(e).values}function xz({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===fz?MR(r[a]):e===pz?sz.transform(r[a]):r[a]}return i}}function Sz(e){return xz(yz(e))}var Cz=e=>typeof e==`number`?0:sz.test(e)?sz.getAnimatableNone(e):e,wz=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Cz(e);function Tz(e){let t=yz(e);return xz(t)(t.values.map((e,n)=>wz(e,t.split[n])))}var Ez={test:dz,parse:bz,createTransformer:Sz,getAnimatableNone:Tz};function Dz(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Oz({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Dz(s,r,e+1/3),a=Dz(s,r,e),o=Dz(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function kz(e,t){return n=>n>0?t:e}var Az=(e,t,n)=>e+(t-e)*n,jz=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Mz=[QR,YR,oz],Nz=e=>Mz.find(t=>t.test(e));function Pz(e){let t=Nz(e);if(!t)return!1;let n=t.parse(e);return t===oz&&(n=Oz(n)),n}var Fz=(e,t)=>{let n=Pz(e),r=Pz(t);if(!n||!r)return kz(e,t);let i={...n};return e=>(i.red=jz(n.red,r.red,e),i.green=jz(n.green,r.green,e),i.blue=jz(n.blue,r.blue,e),i.alpha=Az(n.alpha,r.alpha,e),YR.transform(i))},Iz=new Set([`none`,`hidden`]);function Lz(e,t){return Iz.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Rz(e,t){return n=>Az(e,t,n)}function zz(e){return typeof e==`number`?Rz:typeof e==`string`?IR(e)?kz:sz.test(e)?Fz:Uz:Array.isArray(e)?Bz:typeof e==`object`?sz.test(e)?Fz:Vz:kz}function Bz(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>zz(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Vz(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=zz(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Hz(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Uz=(e,t)=>{let n=yz(e),r=yz(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?Iz.has(e)&&!r.values.length||Iz.has(t)&&!n.values.length?Lz(e,t):tR(Bz(Hz(n,r),r.values),xz(r)):kz(e,t)},Wz=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Gz(e,t){let n=Wz.exec(e);if(!n)return;let r=Wz.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>MR(Az(a,o,e))+i}function Kz(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Az(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Gz(e,t);if(n)return n}return zz(e)(e,t)}var qz=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Jz(e){let t=new Set,n=new Set,r=!1,i=!1,a,o=new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var Yz=40;function Xz(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=qz.reduce((e,t)=>(e[t]=Jz(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=YL.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Yz),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:qz.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<qz.length;t++)o[qz[t]].cancel(e)},state:n,steps:o}}var{schedule:Zz,cancel:Qz,steps:$z}=Xz(typeof requestAnimationFrame<`u`?requestAnimationFrame:eR,!0,OR),eB=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Zz.update(t,e),stop:()=>Qz(t),now:()=>OR.isProcessing?OR.timestamp:jR.now()}},tB=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},nB=2e4;function rB(e,t=50,n=nB,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function iB(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(rB(o),nB);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:aR(s)}}var aB=100,oB=10,sB=1,cB=800,lB=.3,uB=.3,dB=.01,fB=2,pB=.005,mB=.5,hB=.01,gB=10,_B=.05,vB=e=>e<0?1/Math.max(1+e,_B):Math.max(1-e,_B);function yB(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return SB(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function bB(e,t){return e*Math.sqrt(1-t*t)}var xB=12;function SB(e,t,n){let r=n;for(let n=1;n<xB;n++)r-=e(r)/t(r);return r}var CB=.001;function wB({duration:e=cB,bounce:t=lB}){let n,r,i=vB(t);e=JL(hB,gB,aR(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=bB(t,i),o=Math.exp(-r);return CB-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=bB(t*t,i);return(-n(t)+CB>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=SB(n,r,a),s=o*yB(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:iR(e)}}var TB=(e,t)=>(t?e>=0:e>0)&&e<1/0;function EB(e,t){if(TB(e,t))return e}function DB(e){let t=EB(e.stiffness),n=EB(e.damping,!0),r=EB(e.mass),i={...e,stiffness:t??aB,damping:n??oB,mass:r??sB,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=vB(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*yB(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,wB(i)),i.isResolvedFromDuration=!0;(!TB(i.stiffness)||!TB(i.damping,!0))&&(i.stiffness=aB,i.damping=oB)}return i}function OB(e=uB,t=lB){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=DB({...n}),f=e=>u?0:-aR(e),p=s/(2*Math.sqrt(o*c)),m=aR(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?dB:fB),g.restDelta=n.restDelta||(e?pB:mB)};_();let v,y,b;if(p<1){let e=bB(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>iR(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=iR(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(rB(S),nB),t=tB(t=>S.next(e*t).value,e,30);return e+`ms `+t}};return S}var kB=Object.assign(OB,{applyToOptions:e=>{let t=iB(e,100,OB);return e.ease=t.ease,e.duration=iR(t.duration),e.type=`keyframes`,e}});function AB({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=kB({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function jB(e,t,n){let r=[],i=YL.mix||Kz,a=e.length-1;for(let o=0;o<a;o++){let a=n?.(e[o],e[o+1])||i(e[o],e[o+1]);t&&(a=tR(Array.isArray(t)?t[o]||eR:t,a)),r.push(a)}return r}function MB(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=jB(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=nR(e[r],e[r+1],n);return s[r](i)};return n?t=>l(JL(e[0],e[a-1],t)):l}function NB(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=nR(0,t,r);e.push(Az(n,1,i))}}function PB(e){let t=[0];return NB(t,e.length-1),t}function FB(e,t){return e.map(e=>e*t)}function IB(e,t){return e.map(()=>t||xR).splice(0,e.length-1)}function LB({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`,mixer:i}){let a=typeof t[0]==`number`?void 0:i,o=SR(r)?r.map(DR):DR(r)||xR,s={done:!1,value:t[0]},c=-1;if(!a){for(let e=1;e<t.length;e++)if(t[e]!==t[e-1]){if(c>=0){c=-2;break}c=e-1}}if(c>=0){let r=n&&n.length===t.length?n:PB(t),i=r[c]*e,a=r[c+1]*e,l=t[c],u=t[c+1],d=Array.isArray(o)?o[c]:o,f=(YL.mix||Kz)(l,u),p=t.length-2;return{calculatedDuration:e,next:t=>(s.value=c&&t<i?f(0):c<p&&(t>=a||!e)?typeof u==`number`?u:f(1):f(d(t>=a||!e?1:t<=i?0:(t-i)/(a-i))),s.done=t>=e,s)}}let l=MB(FB(n&&n.length===t.length?n:PB(t),e),t,{ease:Array.isArray(o)?o:IB(t,o),mixer:a});return{calculatedDuration:e,next:t=>(s.value=l(t),s.done=t>=e,s)}}var RB=5;function zB(e,t,n){let r=Math.max(t-RB,0);return oR(n-e(r),t-r)}function BB(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):zB(t=>e.next(t).value,t,e.next(t).value)}function VB(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a,o,s=0;for(let t=0;t<e.length;t++){let n=e[t];n!==null&&(s++||(a=n),o=n)}let c=i<0||t&&n!==`loop`&&t%2==1?0:s-1;return!c||r===void 0?c?o:a:r}var HB={decay:AB,inertia:AB,tween:LB,keyframes:LB,spring:kB};function UB(e){typeof e.type==`string`&&(e.type=HB[e.type])}var WB=40,GB=(e,t)=>t-e>WB&&!YL.useManualTiming?t:e;function KB(e,t){return{kind:e,animation:t,timestamp:jR.now(),frameTimestamp:OR.timestamp,frameIsProcessing:OR.isProcessing}}function qB(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...KB(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function JB(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...KB(`layout-animation-start`,e),node:t})}catch{}}var YB=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},XB=e=>e/100,ZB=e=>Math.round(e*1e4)/1e4,QB=class extends YB{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options,t=jR.now();e&&e.updatedAt!==t&&this.tick(e.updatedAt=t),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),qB(this,this.options)}initAnimation(){let{options:e}=this;UB(e);let{type:t=LB,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||LB;this.mixKeyframes=void 0,s!==LB&&typeof o[0]!=`number`&&(this.mixKeyframes=tR(XB,e.mixer?.(o[0],o[1])||Kz(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=rB(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=GB(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==AB&&(f.value=VB(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??ZB((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==AB?VB(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=JL(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return aR(this.calculatedDuration)}get iterationDuration(){return this.duration+aR(this.options.delay??0)}get time(){return aR(this.currentTime)}set time(e){this.state===`finished`&&this.updateFinished(),e=iR(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return BB(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(jR.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=aR(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=eB,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(jR.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},$B=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function eV(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(HR)||[];if(!r)return e;let i=n.replace(r,``),a=+!!$B.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var tV=/\b([a-z-]*)\(.*?\)/gu,nV={...Ez,getAnimatableNone:e=>{let t=e.match(tV);return t?t.map(eV).join(` `):e}},rV={...Ez,getAnimatableNone:e=>{let t=Ez.parse(e);return Ez.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},iV={...zR,transform:Math.round},aV={rotate:ez,pathRotation:ez,rotateX:ez,rotateY:ez,rotateZ:ez,scale:VR,scaleX:VR,scaleY:VR,scaleZ:VR,skew:ez,skewX:ez,skewY:ez,distance:nz,translateX:nz,translateY:nz,translateZ:nz,x:nz,y:nz,z:nz,perspective:nz,transformPerspective:nz,opacity:BR,originX:az,originY:az,originZ:nz},oV={borderWidth:nz,borderTopWidth:nz,borderRightWidth:nz,borderBottomWidth:nz,borderLeftWidth:nz,borderRadius:nz,borderTopLeftRadius:nz,borderTopRightRadius:nz,borderBottomRightRadius:nz,borderBottomLeftRadius:nz,width:nz,maxWidth:nz,height:nz,maxHeight:nz,top:nz,right:nz,bottom:nz,left:nz,inset:nz,insetBlock:nz,insetBlockStart:nz,insetBlockEnd:nz,insetInline:nz,insetInlineStart:nz,insetInlineEnd:nz,padding:nz,paddingTop:nz,paddingRight:nz,paddingBottom:nz,paddingLeft:nz,paddingBlock:nz,paddingBlockStart:nz,paddingBlockEnd:nz,paddingInline:nz,paddingInlineStart:nz,paddingInlineEnd:nz,margin:nz,marginTop:nz,marginRight:nz,marginBottom:nz,marginLeft:nz,marginBlock:nz,marginBlockStart:nz,marginBlockEnd:nz,marginInline:nz,marginInlineStart:nz,marginInlineEnd:nz,fontSize:nz,backgroundPositionX:nz,backgroundPositionY:nz,...aV,zIndex:iV,fillOpacity:BR,strokeOpacity:BR,numOctaves:iV},sV={...oV,color:sz,backgroundColor:sz,outlineColor:sz,fill:sz,stroke:sz,borderColor:sz,borderTopColor:sz,borderRightColor:sz,borderBottomColor:sz,borderLeftColor:sz,filter:nV,WebkitFilter:nV,mask:rV,WebkitMask:rV},cV=e=>sV[e],lV=new Set([nV,rV]),uV,dV,fV;function pV(e,t){if(e===uV&&t===dV)return fV;let n=cV(e);return lV.has(n)||(n=Ez),fV=n.getAnimatableNone?n.getAnimatableNone(t):void 0,uV=e,dV=t,fV}function mV(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var hV=e=>e*180/Math.PI,gV=e=>vV(hV(Math.atan2(e[1],e[0]))),_V={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gV,rotateZ:gV,skewX:e=>hV(Math.atan(e[1])),skewY:e=>hV(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vV=e=>(e%=360,e<0&&(e+=360),e),yV=gV,bV=e=>Math.hypot(e[0],e[1]),xV=e=>Math.hypot(e[4],e[5]),SV={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bV,scaleY:xV,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(bV(e)+xV(e))/2,rotateX:e=>vV(hV(Math.atan2(e[6],e[5]))),rotateY:e=>vV(hV(Math.atan2(-e[2],e[0]))),rotateZ:yV,rotate:yV,skewX:e=>hV(Math.atan(e[4])),skewY:e=>hV(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function CV(e){return+!!e.includes(`scale`)}function wV(e,t){if(!e||e===`none`)return CV(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return CV(t);let r=(n[1]?SV:_V)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var TV=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wV(n,t)},EV=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],DV=new Set([...EV,`pathRotation`]),OV=e=>e===zR||e===nz,kV=new Set([`x`,`y`,`z`]),AV=EV.filter(e=>!kV.has(e));function jV(e){let t=[];return AV.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var MV=new Set([`bottom`,`right`]);function NV(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var PV=({transform:e})=>wV(e,`x`),FV=({transform:e})=>wV(e,`y`),IV={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>NV(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>NV(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:PV,y:FV,translateX:PV,translateY:FV},LV=new Set,RV=!1,zV=!1,BV=!1;function VV(){if(zV){let e=[],t=new Set,n=new Set;LV.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),MV.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=jV(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}zV=!1,RV=!1,LV.forEach(e=>e.complete(BV)),LV.clear()}function HV(){LV.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zV=!0)})}function UV(){BV=!0,HV(),VV(),BV=!1}function WV(e,t,n){if(typeof e==`string`){if(XL(e)||QL(e))return parseFloat(e);if(!Ez.test(e)&&Ez.test(n))return pV(t,n)}return e??void 0}var GV=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(LV.add(this),RV||(RV=!0,Zz.read(HV),Zz.resolveKeyframes(VV))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=WV(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}mV(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),LV.delete(this)}cancel(){this.state===`scheduled`&&(LV.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},KV=e=>e.startsWith(`--`);function qV(e,t,n){KV(t)?e.style.setProperty(t,n):e.style[t]=n}var JV={};function YV(e,t){let n=$L(e);return()=>JV[t]??n()}var XV=YV(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),ZV=YV(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),QV=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,$V={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:QV([0,.65,.55,1]),circOut:QV([.55,0,1,.45]),backIn:QV([.31,.01,.66,-.59]),backOut:QV([.33,1.53,.69,.99])};function eH(e,t){if(e)return typeof e==`function`?ZV()?tB(e,t):`ease-out`:wR(e)?QV(e):Array.isArray(e)?e.map(e=>eH(e,t)||$V.easeOut):$V[e]}function tH(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=eH(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function nH(e){return typeof e==`function`&&`applyToOptions`in e}function rH({type:e,...t}){return nH(e)&&ZV()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var iH=class extends YB{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=rH(e);this.animation=tH(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!i){let e=VB(r,this.options,o,this.speed);this.updateMotionValue?.(e),qV(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},qB(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.onfinish=this.onFinish,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.isStopped||(this.animation.onfinish=this.onFinish),this.animation.finish?.()}cancel(){this.animation.onfinish=null;try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel()))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return aR(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+aR(e)}get time(){return aR(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=iR(e),t&&(this.animation.pause(),this.updateFinished())}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=this.onFinish=null,e&&XV()?(this.animation.timeline=e,t?.(this.animation),eR):n(this)}},aH={anticipate:hR,backInOut:mR,circInOut:vR};function oH(e){return e in aH}function sH(e){typeof e.ease==`string`&&oH(e.ease)&&(e.ease=aH[e.ease])}var cH=class extends iH{constructor(e){sH(e),UB(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(jR.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new QB({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?JL(0,10,a):0,s=this.sample(a);n&&r&&qV(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},lH=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Ez.test(e)||e===`0`)&&!e.startsWith(`url(`));function uH(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function dH(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=lH(i,t),s=lH(a,t);return!o||!s?!1:uH(e)||(n===`spring`||nH(n))&&r}function fH(e){e.duration=0,e.type=`keyframes`}var pH=new Set([`opacity`,`clipPath`,`filter`,`transform`]),mH=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function hH(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&mH.test(e[t]))return!0;return!1}var gH=({mixer:e,keyframes:t})=>e&&typeof t[0]!=`number`&&t.some((n,r)=>r&&e(t[r-1],n)),_H=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),vH=()=>!YL.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function yH(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(pH.has(n)||_H.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return vH()&&(pH.has(n)||_H.has(n)&&hH(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`&&!gH(e)}var bH=(e,t)=>t&&typeof e==`number`?t.transform(e):e,xH={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},SH=EV.length,CH={},wH=(e,t,n=bH(t,aV[e]))=>(CH[e]||(CH[e]=(xH[e]||e)+`(`))+n+`)`,TH=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function EH(e,t,n){let r=``;for(let i=0;i<SH;i++){let a=EV[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=bH(o,oV[a]));TH(a,o)||(r+=wH(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=wH(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var DH=new WeakMap,OH=200,kH=.001,AH=.1,jH=.001,MH=100,NH=100,PH=new Set([`linear`,`easeIn`,`easeOut`,`easeInOut`]),FH=e=>PH.has(e),IH=new WeakMap,LH=(e,t)=>{let n=IH.get(e);return n?.[0]!==t&&(n=[t,`linear(`+PB(Array(t+1)).map(t=>ZB(e(t))+` `+ZB(t*100)+`%`)+`)`],IH.set(e,n)),n[1]},RH=(e,t)=>Math.min(OH,Math.max(2,Math.ceil((t-e)/10))),zH=(e,t)=>Math.abs(e-t)<=kH,BH=(e,t)=>e-t,VH=(e,t,n)=>PB(Array(n+1)).map(n=>Az(e,t,n)),HH=e=>e.motionValue.owner,UH=e=>DH.get(e),WH=({state:e})=>e===`idle`||e===`finished`,GH=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),KH=({name:e,motionValue:t})=>e&&EV.includes(e)&&t?.owner?.current instanceof HTMLElement&&vH()&&ZV();function qH(e){let t=HH(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(GH(t,`transform`)||`none`)===`none`&&!GH(t,`pathRotation`)&&!t.projection?.isProjecting()&&!gH(e)}var JH=class{constructor(e,t,n,r){this.element=e,this.update=t,this.makeDriver=n,this.animation=r}get js(){return this.driver||=this.makeDriver(this.update)}now(){return this.driver||this.makeDriver!==eB?this.js.now():OR.isProcessing?OR.timestamp:jR.now()}start(e=!0){let t=UH(this.element);!t||t.isJS?this.js.start(e):t.schedule(!1,!e)}stopJS(){this.driver?.stop()}stop(){this.stopJS();let e=UH(this.element);e&&!e.isFinishing&&e.release(this.animation)}},YH,XH=class extends QB{constructor(e){let t=HH(e).current,{driver:n=eB}=e,r,i=qH(e);e.driver=e=>new JH(t,e,n,r),super(e),r=this;let a=this.driver;a&&(a.animation=this),this.canAccelerate=i;let{stop:o}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),o()}}offsets(){let{keyframes:e,times:t}=this.options;return t||(this.offsetsOf!==e&&(this.offsetsOf=e,this.cachedOffsets=PB(e)),this.cachedOffsets)}get group(){return UH(HH(this.options).current)}get js(){return this.driver?.js}stopJS(){this.driver?.stopJS()}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(jR.now()):void 0}tween(){let{keyframes:e,type:t,repeat:n,delay:r=0}=this.options,i=-1;if(n||t!==LB||this.holdTime!==null)return;for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]){if(i>=0)return;i=t-1}let{ease:a}=this.options;SR(a)&&(a=a[i]);let o=this.offsets(),s=e=>this.startTime+(r+o[e]*this.totalDuration)/this.speed;if(i>=0){let e=wR(a)?QV(a):FH(a)?$V[a]:DR(a);return[s(i),s(i+1),typeof e==`string`||zH(e(0),0)&&zH(e(1),1)?e:void 0]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,type:u}=a,d=(u||LB)===LB?this.offsets():[0,1],f=n+o/r,p=[];if(this.holdTime!==null||!(i>0))return p;for(let n=Math.max(0,Math.floor((e-f)*r/i));n<=s;n++){let a=f+n*i/r;if(a>t)break;for(let o of d){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&p.push(s)}}return p}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=jR.now(),t=this.sampleAt(e,!0);this.options.motionValue.setWithVelocity(this.holdTime===null?this.sampleAt(e-10,!0):t,t,10)}play(){this.isStopped||((this.group||$H(HH(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&this.group.schedule(!1)}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.tick(jR.now())}get time(){return this.isAccelerated()?aR(JL(0,this.totalDuration,this.at(jR.now())-(this.options.delay||0))):super.time}set time(e){(YH??=Object.getOwnPropertyDescriptor(QB.prototype,`time`).set).call(this,e)}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}},ZH,QH=e=>{ZH||queueMicrotask(()=>{let e=ZH;ZH=void 0,e.forEach(e=>e())}),(ZH||=[]).push(e)};function $H(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p,m=1/0,h,g=e=>{for(let t of n)if(t.name===e)return!0},_=(t,n)=>{let o={};for(let s of t===void 0?EV:a){let a=r.get(s),c=t===void 0?GH(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},v=(e,t)=>{let n=``;for(let r in e){let i=e[r];(!t||!TH(r,i))&&(n+=wH(r,i)+` `)}return(t?n.trim():n)||`none`},y=(e,t)=>v(_(e,t)),b=(e=_())=>{t.style.transform=v(e,!0)},x=e=>{e.onfinish=e.oncancel=null,e.cancel()},S=(e=!0)=>{clearTimeout(p),m=1/0,h=void 0,e&&b(),s.forEach(({animation:e})=>x(e)),s=[]},C=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),w=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=jR.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(x(e),s=s.filter(e=>e!==r)),F.schedule(!1)}),e.oncancel=()=>s.includes(r)&&F.demote(),s.push(r)},T=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},E=(e,t,n,r)=>{let i=RH(t,n);if(r.length*4>i)return;let a;for(let r of e){let e=r.numberAt(t),i=(r.numberAt((t+n)/2)-e)/(r.numberAt(n)-e);if(i===i){if(a===void 0)a=i;else if(!zH(i,a))return}}let o=VH(t,n,i).concat(r).sort(BH),s=e=>nR(t,n,e),c,l;for(let n of e){let e=n.numberAt(t),r=o.map(t=>n.numberAt(t)-e),i=r[r.length-1],a=r.some(e=>Math.abs(e)*kH>Math.abs(i))?0:i,s=r.map(e=>a?e/a:e);if(a&&!c)c=s,l=t=>(n.numberAt(t)-e)/a;else if(s.some((e,t)=>!zH(e,a&&c[t])))return}if(!c||c.every((e,t)=>zH(e,s(o[t]))))return`linear`;let u=[],d=(e,t=l(e))=>u.push(ZB(t)+` `+ZB(s(e)*100)+`%`);return c.forEach((e,t)=>{t&&Math.abs(e-c[t-1])>.2&&T(l,o[t-1],o[t]).forEach(e=>d(e)),d(o[t],e)}),`linear(`+u+`)`},D=(e,t,n,r)=>{let i=[t],a=[],o=n,s=t;for(let r of e){let e=r.tween();if(e?.[2]!==`linear`){let[i,c]=r.timing(),[l,u]=e||[t,c?n:i];o=Math.min(o,l),s=Math.max(s,u),a.push(r)}}o=Math.max(t,o),s=Math.min(n,s);let c=(e,t)=>a.every(n=>!(Math.abs(n.numberAt((e+t)/2)-(n.numberAt(e)+n.numberAt(t))/2)>(n.name.startsWith(`scale`)?jH:AH))),l=(t,n,r)=>{if(n-t<1||c(t,n))i.push(n);else if(r<4)l(t,(t+n)/2,r+1),l((t+n)/2,n,r+1);else{for(let r of e)i.push(...T(e=>r.numberAt(e),t,n));i.push(n)}},u=s>o?VH(o,s,Math.ceil((s-o)/100)):[];u.push(n);for(let e of r)u.push(e,Math.min(e+.01,n));let d=t;for(let e of u.sort(BH))e>d&&l(d,e,0),d=e;return i.sort(BH)},O=e=>{let t;for(let n of e){let e=n.tween();if(!e||t&&(Math.abs(e[0]-t[0])>1||Math.abs(e[1]-t[1])>1))return;t=[e[0],e[1],!t||e[2]===t[2]?e[2]:void 0]}return t},k=(e,t,n,r,i={fill:`both`},a)=>{let o=r?[]:e.flatMap(e=>e.boundaries(t,n)),s=r||E(e,t,n,o),c=s?[t,n]:D(e,t,n,o),l=c.map(e=>y(e,a)),u={transform:l};return s||(u.offset=c.map(e=>nR(t,n,e))),l.every(e=>e===l[0])&&(b(_(t,a)),u=null),C(u,{...i,duration:n-t,easing:s||`linear`})},A=e=>{let t=jR.now()+e;t<m&&(clearTimeout(p),m=t,p=setTimeout(()=>{m=1/0,F.schedule(!1)},e))},j=t=>{let c=t,l=0,u=0,d=[],f=[],p=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),!a){if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=EV.filter(t=>{if(r.has(t))return!0;let n=i[t]=GH(e,t);return n!==void 0&&!TH(t,n)}),S(!1);let m=!l&&O(d);try{if(c>t){let e;if(m&&m[1]>t){let[n,r,i]=m;if(n-t>NH)return d.forEach(e=>e.sync()),A(h=n-t-NH),!0;e=typeof i==`string`?i:i?LH(i,RH(n,r)):E(d,n,r,[]),e&&w(k(d,n,r,e,{fill:`both`,endDelay:c-r}),n-t,c-n)}e||w(k(d,t,c),0,c-t),p.forEach(e=>e<c-1&&w(C(null,{duration:e-t}),0,e-t))}if(l){let e=u+Math.floor((c-u)/l)*l;w(k(f,e,e+l,void 0,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||S(),!0},M=(e,t)=>{let r,i=0;for(let t of n){let n=o.get(t);if(!n)return!1;let[a,c,l]=n,u=t.at(e),d=t.timing()[0]===1/0;if(l){if(d&&(u===a||!s.length))continue;return!1}let f=(u-a)/c,p=d?0:t.speed/c;if(r===void 0)r=f,i=p;else if(Math.abs(f-r)>1||p!==i)return!1}if(r===void 0)return!0;if(!s.length){if(h===void 0||t&&i)return!1;if(i){let e=(h-r)/i;if(e<1)return!1;A(e)}return!0}for(let{offset:e,end:n,isDone:i}of s){let a=r-e;if(n<1/0&&(i?a<n-1:a<0&&(t||e<=0)||a>=n))return!1}for(let{animation:t,offset:n,isDone:a}of s){if(a)continue;let o=r-n;i&&t.updatePlaybackRate&&t.playState===`running`&&Math.abs(Number(t.currentTime)-o)<20?t.playbackRate!==i&&t.updatePlaybackRate(i):i?(t.playbackRate!==i&&(t.playbackRate=i),t.startTime=e-o/i):(t.startTime=null,t.currentTime=o)}return!0},N=()=>!n.size&&(u=!0,UH(t)===F&&DH.delete(t),F.isJS||S(),!0),P=()=>{let t=jR.now();if(F.isJS||(F.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=GH(e,n.name),o.has(n)||(c=!0))}),F.isFinishing=!1),l=!1,u||(n.forEach(e=>WH(e)&&n.delete(e)),N()))return;for(let e of n)if(!e.canAccelerate)return F.demote(!0);F.isJS&&(F.isJS=!1,c=!0,n.forEach(e=>e.stopJS()));let r=c,a=d;if(c=d=!1,r||!M(t,a)){if(a){if(t-f<MH)return F.demote();f=t}if(!j(t))return F.demote()}else if(h!==void 0&&!a)return;n.forEach(e=>e.timing()[0]===1/0&&e.sync())},F={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,OR.isProcessing?Zz.render(P,!1,!0):QH(P)))},release(e){WH(e)&&n.delete(e),N()||F.schedule(!0)},check(){if(!F.isJS){for(let t in i)if(GH(e,t)!==i[t]&&!g(t))return F.schedule(!0,!0)}},demote(e){if(!(F.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),F.isJS=!0,o=new Map,S(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return DH.set(t,F),F}var eU=class extends YB{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=jR.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||GV;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=jR.now();let u=dH(e,i,a,o);u||((YL.instantAnimations||!s)&&l?.(VB(e,n,t)),e[0]=e[e.length-1],fH(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&yH(n),p=!f&&KH(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=GB(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new cH(n)}catch{m=new QB(n)}}else m=p?new XH(n):new QB(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),UV()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},tU=class{constructor(e){this.stop=()=>{for(let e of this.animations)e.stop()},this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){for(let t of this.animations)t.time=e}get speed(){return this.getAll(`speed`)}set speed(e){for(let t of this.animations)t.speed=e}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return nU(this.animations,`duration`)}get iterationDuration(){return nU(this.animations,`iterationDuration`)}play(){for(let e of this.animations)e.play()}pause(){for(let e of this.animations)e.pause()}cancel(){for(let e of this.animations)e.cancel()}complete(){for(let e of this.animations)e.complete()}};function nU(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var rU=class extends tU{then(e,t){return this.finished.finally(e).then(()=>{})}};function iU(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var aU=30,oU=e=>!isNaN(parseFloat(e)),sU={current:void 0},cU=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=jR.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=jR.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=oU(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new rR)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new rR,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Zz.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){t&&(this.updatedAt=jR.now(),this.stop()),this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){sU.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=jR.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>aU)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,aU);return oR(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return new Promise(t=>this.run(e,t))}run(e,t){this.stop(),this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t?.()}),n||(this.animation=r),this.events.animationStart?.notify()}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function lU(e,t){return new cU(e,t)}function uU(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function dU(e,t){let n=e?.[t]??e?.default??e;return n===e?n:uU(n,e)}var fU={type:`spring`,stiffness:500,damping:25,restSpeed:10},pU=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),mU={type:`keyframes`,duration:.8},hU={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},gU=(e,{keyframes:t})=>t.length>2?mU:DV.has(e)?e.startsWith(`scale`)?pU(t[1]):fU:hU,_U=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`,`mixer`]);function vU(e){for(let t in e)if(!_U.has(t))return!0;return!1}var yU=(e,t,n,r={},i,a)=>o=>{let s=dU(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=iR(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};vU(s)||Object.assign(u,gU(e,u)),u.duration&&=iR(u.duration),u.repeatDelay&&=iR(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(fH(u),u.delay===0&&(d=!0)),(YL.instantAnimations||YL.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,fH(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=VB(u.keyframes,s);if(e!==void 0){Zz.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new QB(u):new eU(u)},bU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xU(e){let t=bU.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function SU(e,t,n=1){let[r,i]=xU(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return XL(e)?parseFloat(e):e}return IR(i)?SU(i,t,n+1):i}function CU(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function wU(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...CU(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function TU(e,t,n){return wU(e.getProps(),t,n,e)}var EU=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,DU=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...EV]),OU=e=>Array.isArray(e);function kU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,lU(n))}function AU(e){return OU(e)?e[e.length-1]||0:e}function jU(e,t){let{transitionEnd:n={},transition:r={},...i}=TU(e,t)||{};i={...i,...n};for(let t in i)kU(e,t,AU(i[t]))}var MU=e=>!!(e&&e.getVelocity);function NU(e){return!!(MU(e)&&e.add)}function PU(e,t){let n=e.getValue(`willChange`);if(NU(n))return n.add(t);if(!n&&YL.WillChange){let n=new YL.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var FU=`data-framer-appear-id`;function IU(e){return e.props[FU]}var LU=typeof window<`u`;function RU({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function zU(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?uU(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&RU(f,t))continue;let o={delay:n,...dU(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Zz.update(()=>r.set(i));continue}let p=!1;if(LU&&window.MotionHandoffAnimation){let n=IU(e);if(n){let e=window.MotionHandoffAnimation(n,t,Zz);e!==null&&(o.startTime=e,p=!0)}}PU(e,t);let m=l??e.shouldReduceMotion;r.run(yU(t,r,i,m&&DU.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Zz.update(()=>{o&&jU(e,o)});d.length?Promise.all(d).then(t):t()}return d}function BU(e,t,n={}){let r=TU(e,t,EU(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?zU(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(BU(e,t,{...n,delay:r+(typeof o==`function`?0:o)+iU(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function VU(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>BU(e,t,n))):typeof t==`string`?BU(e,t,n):Promise.all(zU(e,TU(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var HU={test:e=>e===`auto`,parse:e=>e},UU=e=>t=>t.test(e),WU=[zR,nz,tz,ez,iz,rz,HU],GU=e=>WU.find(UU(e));function KU(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||QL(e)}var qU=new Set([`auto`,`none`,`0`]);function JU(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!qU.has(t)&&vz(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=pV(n,i))}var YU=class extends GV{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(RR(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),IR(r))){let i=SU(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!DU.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=GU(r),o=GU(i);if(RR(r)!==RR(i)&&IV[n])this.needsMeasurement=!0;else if(a!==o){if(OV(a)&&OV(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else IV[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||KU(e[t]))&&n.push(t);n.length&&JU(e,n,t)}measure(){let{element:e,name:t}=this;return IV[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},XU=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],ZU=[];function QU(e){$U(e),ZU.unshift(e)}function $U(e){qL(ZU,e)}function eW(e){return ZU.find(t=>t.test(e))}function tW(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?Zz.update(()=>l.set(c)):(l.run(yU(o,l,c,s&&DU.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>Zz.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function nW(e,t,n,r,i){let a,o=!1,s=tW(r=>{let s=a?.[r]??e.get(t,r);if(!s){let c;if(!i){let i=n[r];c=rW(i)??e.read(t,r,i)}s=lU(c,{owner:i}),o?e(t,{[r]:s}):(a||={})[r]=s}return s},n,r,i);return o=!0,a&&e(t,a),s}function rW(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function iW(e){return ZL(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function aW(e){return ZL(e)&&`ownerSVGElement`in e}var oW={};function sW(e){return oW.current?.add(e),e}var cW=e=>oW.current?oW.current.bind(e):e;function lW(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:oW.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var uW=class{constructor(e=Zz.render){this.step=e,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function dW(e,{step:t,...n}={}){let r=new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new uW(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function fW(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(TH(i,a)||(t+=(t&&` `)+wH(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+wH(`rotate`,i)),t||`none`}var pW=new Set([`originX`,`originY`,`originZ`]),mW=(e,t)=>bH(e.get(t)?.get(),oV[t]),hW=(e,t,n,r)=>{let i,a;if(DV.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>EV.indexOf(e)-EV.indexOf(t)))}t.get(`transform`)||(!iW(e)&&!t.get(`transformBox`)&&hW(e,t,`transformBox`,new cU(`fill-box`)),t.set(`transform`,new cU(`none`),()=>{DH.get(e)?.check(),e.style.transform=fW(t)})),a=t.get(`transform`)}else pW.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new cU(``),()=>{let n=mW(t,`originX`)??`50%`,r=mW(t,`originY`)??`50%`,i=mW(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=KV(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=bH(r.getCurrent(),oV[n])};return t.set(n,r,i,a)},gW=e=>iW(e)||aW(e),_W=(e,t)=>{if(DV.has(t))return TV(e,t);let n=getComputedStyle(e),r=KV(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},vW=dW(hW,{test:gW,read:_W});function yW(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function bW(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(DV.has(e))o=!0;else if(PR(e))i[e]=n;else{let t=bH(n,oV[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=EH(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var xW={offset:`stroke-dashoffset`,array:`stroke-dasharray`},SW={offset:`strokeDashoffset`,array:`strokeDasharray`};function CW(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?xW:SW;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var wW=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function TW(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(bW(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of wW)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&CW(d,i,a,o,!1)}function EW(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var DW=(e,t,n,r,i=n)=>{let a=EW(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=yW(i));let o=oV[n]||oV[i],s=a?()=>{e[i]=bH(r.get(),oV[n])}:()=>{let t=bH(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function OW(e,t,n,r){return Zz.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new cU(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var kW=dW((e,t,n,r)=>n.startsWith(`path`)&&!DV.has(n)?OW(e,t,n,r):n.startsWith(`attr`)?DW(e,t,n,r,AW(n)):n===`d`?t.set(n,r,()=>{let t=r.get()?.replace(/path\(|["')]/g,``);t===void 0?e.removeAttribute(n):e.setAttribute(n,t)}):(DV.has(n)||pW.has(n)||KV(n)||n in e.style?hW:DW)(e,t,n,r),{test:aW,read:(e,t)=>DV.has(t)?oV[t]?.default||0:KV(t)||wW.includes(t)?_W(e,t)||e.getAttribute(yW(t))||0:(t=AW(t),e.getAttribute(yW(t))??e.getAttribute(t)??void 0)});function AW(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function jW({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function MW({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function NW(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function PW(e){return e===void 0||e===1}function FW({scale:e,scaleX:t,scaleY:n}){return!PW(e)||!PW(t)||!PW(n)}var IW=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function LW(e){return FW(e)||zW(e)||RW(e)}function RW(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function zW(e){return BW(e.x)||BW(e.y)}function BW(e){return e&&e!==`0%`}function VW(e,t,n){return n+t*(e-n)}function HW(e,t,n,r,i){return i!==void 0&&(e=VW(e,i,r)),VW(e,n,r)+t}function UW(e,t=0,n=1,r,i){e.min=HW(e.min,t,n,r,i),e.max=HW(e.max,t,n,r,i)}function WW(e,{x:t,y:n}){UW(e.x,t.translate,t.scale,t.originPoint),UW(e.y,n.translate,n.scale,n.originPoint)}var GW=.999999999999,KW=1.0000000000001;function qW(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(JW(e.x,-a.scroll.offset.x),JW(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,WW(e,o)),r&&(r.path?.[s]||r)!==a&&LW(a.latestValues)&&ZW(e,a.latestValues,a.layout?.layoutBox));t.x<KW&&t.x>GW&&(t.x=1),t.y<KW&&t.y>GW&&(t.y=1)}function JW(e,t){e.min+=t,e.max+=t}function YW(e,t,n,r,i=.5){UW(e,t,n,Az(e.min,e.max,i),r)}function XW(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function ZW(e,t,n){let r=n??e;YW(e.x,XW(t.x,r.x),t.scaleX,t.scale,t.originX),YW(e.y,XW(t.y,r.y),t.scaleY,t.scale,t.originY)}function QW(e,t){return jW(NW(e.getBoundingClientRect(),t))}function $W(e,t,n){let r=QW(e,n),{scroll:i}=t;return i&&(JW(r.x,i.offset.x),JW(r.y,i.offset.y)),r}var eG=()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),tG={},nG=e=>aW(e)?kW:vW,rG=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=YU}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return QW(this.current)}getProps(){return tG}};function iG(e,t,n,r){if(oW.current?.track(e),r)return tW(e=>r.getValue(e,null),t,n,r);let i=nG(e);return nW(i,e,t,n,new rG(i,e))}var aG=dW((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>ZL(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:oG,cancel:sG}=Xz(queueMicrotask,!1);function cG(e,t,n){let r=MU(e)?e:lU(e);return r.run(yU(``,r,t,n)),r.animation}var lG={},uG={value:null,addProjectionMetrics:null,countProjection:void 0};function dG(e,t){let n=jR.now();e=cW(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(Qz(r),e(a-t))};return Zz.setup(r,!0),sW(()=>Qz(r))}function fG(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function pG(e){return aW(e)&&e.tagName===`svg`}function mG(e){return MU(e)?e.get():e}var hG=e=>typeof e==`number`?e:parseFloat(e),gG=XU.length,_G=e=>typeof e==`number`||nz.test(e);function vG(e,t,n,r,i,a){i?(e.opacity=Az(0,n.opacity??1,bG(r)),e.opacityExit=Az(t.opacity??1,0,xG(r))):a&&(e.opacity=Az(t.opacity??1,n.opacity??1,r));for(let i=0;i<gG;i++){let a=XU[i],o=yG(t,a),s=yG(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||_G(o)===_G(s)?(e[a]=Math.max(Az(hG(o),hG(s),r),0),(tz.test(s)||tz.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<IW.length;i++){let a=IW[i];(t[a]||n[a])&&(e[a]=Az(t[a]||0,n[a]||0,r))}}function yG(e,t){return e[t]===void 0?e.borderRadius:e[t]}var bG=SG(0,.5,_R),xG=SG(.5,.95,eR);function SG(e,t,n){return r=>r<e?0:r>t?1:n(nR(e,t,r))}var CG=(e,t,{x:n,y:r})=>{let i=e*e+t*t;return i<1?0:-1e3*(n*e+r*t)/i},wG=(e,t=300)=>{let n=JL(.25,2,t/300),{stiffness:r,damping:i}=DB({...e,duration:e.duration&&iR(e.duration)});return{...e,stiffness:r,damping:i*Math.sqrt(n),mass:n}};function TG(e,t){e.min=t.min,e.max=t.max}function EG(e,t){TG(e.x,t.x),TG(e.y,t.y)}function DG(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var OG=.9999,kG=1.0001,AG=-.01,jG=.01;function MG(e){return e.max-e.min}function NG(e,t,n){return Math.abs(e-t)<=n}function PG(e,t,n,r=.5){e.origin=r,e.originPoint=Az(t.min,t.max,e.origin),e.scale=MG(n)/MG(t),e.translate=Az(n.min,n.max,e.origin)-e.originPoint,(e.scale>=OG&&e.scale<=kG||isNaN(e.scale))&&(e.scale=1),(e.translate>=AG&&e.translate<=jG||isNaN(e.translate))&&(e.translate=0)}function FG(e,t,n,r){PG(e.x,t.x,n.x,r?.originX),PG(e.y,t.y,n.y,r?.originY)}function IG(e,t,n,r=0){e.min=(r?Az(n.min,n.max,r):n.min)+t.min,e.max=e.min+MG(t)}function LG(e,t,n,r){IG(e.x,t.x,n.x,r?.x),IG(e.y,t.y,n.y,r?.y)}function RG(e,t,n,r=0){let i=r?Az(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+MG(t)}function zG(e,t,n,r){RG(e.x,t.x,n.x,r?.x),RG(e.y,t.y,n.y,r?.y)}function BG(e,t,n,r,i){return e-=t,e=VW(e,1/n,r),i!==void 0&&(e=VW(e,1/i,r)),e}function VG(e,t=0,n=1,r=.5,i,a=e,o=e){if(tz.test(t)&&(t=parseFloat(t),t=Az(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Az(a.min,a.max,r);e===a&&(s-=t),e.min=BG(e.min,t,n,s,i),e.max=BG(e.max,t,n,s,i)}function HG(e,t,[n,r,i],a,o){VG(e,t[n],t[r],t[i],t.scale,a,o)}var UG=[`x`,`scaleX`,`originX`],WG=[`y`,`scaleY`,`originY`];function GG(e,t,n,r){HG(e.x,t,UG,n?.x,r?.x),HG(e.y,t,WG,n?.y,r?.y)}var KG=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),qG=KG(`applewebkit/`)&&!KG(`chrome/`)?Math.round:eR;function JG(e){e.min=qG(e.min),e.max=qG(e.max)}function YG(e){JG(e.x),JG(e.y)}var XG=()=>({translate:0,scale:1,origin:0,originPoint:0}),ZG=()=>({x:XG(),y:XG()}),QG=()=>({min:0,max:0}),$G=()=>({x:QG(),y:QG()});function eK(e){return e.translate===0&&e.scale===1}function tK(e){return eK(e.x)&&eK(e.y)}function nK(e,t){return e.min===t.min&&e.max===t.max}function rK(e,t){return nK(e.x,t.x)&&nK(e.y,t.y)}function iK(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aK(e,t){return iK(e.x,t.x)&&iK(e.y,t.y)}function oK(e){return MG(e.x)/MG(e.y)}function sK(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var cK=class{constructor(){this.members=[]}add(e){KL(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(qL(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(qL(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function lK(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var uK={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(nz.test(e))e=parseFloat(e);else return e}return`${lK(e,t.target.x)}% ${lK(e,t.target.y)}%`}},dK={borderRadius:Object.assign({},uK,{applyTo:XU.slice()}),borderTopLeftRadius:uK,borderTopRightRadius:uK,borderBottomLeftRadius:uK,borderBottomRightRadius:uK,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ez.parse(e);if(i.length>5)return r;let a=Ez.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Az(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function fK(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;(i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `);let s=``;if(n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<IW.length;e++){let t=IW[e],r=n[t];r&&(s+=`${t}(${r}deg) `),!e&&n.pathRotation&&(s+=`rotate(${n.pathRotation}deg) `)}}if(s){(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),r+=s;let n=e.x.scale*t.x,i=e.y.scale*t.y;(n!==1||i!==1)&&(r+=`scale(${n}, ${i})`)}else e.x.scale!==1||e.y.scale!==1?r+=`scale(${e.x.scale}, ${e.y.scale})`:!r&&(t.x!==1||t.y!==1)&&(r=`scale(1, 1)`);return r||`none`}function pK(e){return[e(`x`),e(`y`)]}var mK=(e,t)=>e.depth-t.depth,hK=class{constructor(){this.children=[],this.isDirty=!1}add(e){KL(this.children,e),this.isDirty=!0}remove(e){qL(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(mK),this.isDirty=!1,this.children.forEach(e)}},gK={hasAnimatedSinceResize:!0,hasEverUpdated:!1},_K=[`z`,`skew`,`skewZ`],vK=1e3,yK=0;function bK(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var xK=e=>e.instance&&DH.get(e.instance)?.demote()&&e.resetSkewAndRotation();function SK(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=IU(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Zz,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&SK(r)}function CK(e){if(e)return e.options.allowProjection===!1?CK(e.parent):e.projection}function wK({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(lG,{...dK,...lG}),class{static create(e,t,n){let{layoutId:r,layout:i,drag:a,dragConstraints:o,layoutScroll:s,layoutRoot:c,layoutAnchor:l,layoutCrossfade:u}=t,d=e.projection=new this(e.latestValues,t[`data-framer-portal-id`]?void 0:CK(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&fG(o),visualElement:e,animationType:typeof i==`string`?i:`both`,initialPromotionConfig:n,crossfade:u,layoutScroll:s,layoutRoot:c,layoutAnchor:l});let f=d.getStack()?.lead;f&&!d.root.isUpdateBlocked()&&(f.willUpdate(),f.scheduleCheckAfterUnmount())}constructor(e={},n=t?.()){this.id=yK++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(DK),this.nodes.forEach(RK),this.nodes.forEach(zK),this.nodes.forEach(OK),uG.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new hK)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new rR),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=aW(t)&&!pG(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Zz.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=dG(i,250),gK.hasAnimatedSinceResize&&(gK.hasAnimatedSinceResize=!1,this.nodes.forEach(LK)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||KK,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!aK(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...dU(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||LK(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,Qz(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(BK),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&SK(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;xK(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,xK(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(jK),this.nodes.forEach(AK);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(MK);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(PK),this.nodes.forEach(FK),this.nodes.forEach(IK),this.nodes.forEach(TK),this.nodes.forEach(EK)):this.nodes.forEach(MK),this.clearAllSnapshots();let e=jR.now();OR.delta=JL(0,1e3/60,e-OR.timestamp),OR.timestamp=e,OR.isProcessing=!0,$z.update.process(OR),$z.preRender.process(OR),$z.render.process(OR),OR.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,oG.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(kK),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Zz.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Zz.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!MG(this.snapshot.measuredBox.x)&&!MG(this.snapshot.measuredBox.y)&&(this.snapshot=void 0),this.snapshot)){let{visualElement:e}=this.options,t=this.currentAnimation?.state===`running`,n=t&&this.animationEdges;t&&this.relativeTarget&&(this.snapshot.relativeVelocity=this.relativeVelocity?.slice()||[]);let r=n&&this.motionValue?.getVelocity()||0,i=[0,1,2,3,4,5].map(t=>(t<4?n&&(this.edgeValues?this.edgeVelocity(t):-n[t]*r/1e3):e?.getValue(t<5?`x`:`y`)?.getVelocity())||0);i.some(Boolean)&&(this.snapshot.velocity=i)}}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=$G(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&xK(this);let t=this.projectionDelta&&!tK(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||LW(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),YG(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return $G();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(YK))){let{scroll:e}=this.root;e&&(JW(t.x,e.offset.x),JW(t.y,e.offset.y))}return t}removeElementScroll(e){let t=$G();if(EG(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&EG(t,e),JW(t.x,i.offset.x),JW(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||$G();EG(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(JW(a.x,-n.scroll.offset.x),JW(a.y,-n.scroll.offset.y)),LW(n.latestValues)&&ZW(a,n.latestValues,n.layout?.layoutBox)}return!r&&LW(this.latestValues)&&ZW(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=$G();EG(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!LW(n.latestValues))continue;let r;n.instance&&(FW(n.latestValues)&&n.updateSnapshot(),r=$G(),EG(r,n.measurePageBox())),GG(t,n.latestValues,n.snapshot?.layoutBox,r)}return LW(this.latestValues)&&GG(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==OR.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=OR.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=$G(),this.targetWithTransforms=$G()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),LG(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):EG(this.target,this.layout.layoutBox),WW(this.target,this.targetDelta)):EG(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),uG.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||FW(this.parent.latestValues)||zW(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$G(),this.relativeTargetOrigin=$G(),zG(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),EG(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===OR.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;EG(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;qW(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=$G());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(DG(this.prevProjectionDelta.x,this.projectionDelta.x),DG(this.prevProjectionDelta.y,this.projectionDelta.y)),FG(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!sK(this.projectionDelta.x,this.prevProjectionDelta.x)||!sK(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),uG.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ZG(),this.projectionDelta=ZG(),this.projectionDeltaWithTransform=ZG()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=ZG();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=$G(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(GK));this.animationProgress=0;let f,p=n?.interpolateProjection(e),m=this.layout?.layoutBox,h=m&&[m.x.min,m.x.max,m.y.min,m.y.max].map((t,n)=>{let{translate:r,scale:i,originPoint:a}=e[n<2?`x`:`y`];return(t-a)*(i-1)+r});h?.every(isFinite)||(h=void 0),this.animationEdges=h,this.edgeValues=this.startVelocity=this.impulse=this.relativeVelocity=this.relativeStart=void 0;let g=r?.velocity,_=r?.relativeVelocity||g;if(_?.slice(0,4).some(Boolean)&&this.getClosestProjectingParent()&&(this.relativeStart=_),g&&h){let t=g.slice(0,4).map((e,t)=>e+(c?g[4+(t>>1)]:0));t.some(Boolean)&&(this.startVelocity=p?CG(e.x.translate,e.y.translate,{x:(t[0]+t[1])/2,y:(t[2]+t[3])/2}):t)}this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n),l=this.edgeValues;for(let t=0;t<2;t++){let r=t?`y`:`x`;l?VK(o[r],e[r],this.layout.layoutBox[r],l[t*2],l[t*2+1]):HK(o[r],e[r],n)}if(r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){zG(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);let e=this.relativeTargetOrigin,t=s;if(WK(this.relativeTarget,e,t,n),this.isSpringLayout){let e=this.relativeTarget,t=this.impulse||0,n=this.relativeStart,r=jR.now(),i=(r-this.relativeTime)/1e3;this.relativeTime=r;let a=this.relativeVelocity||=[0,0,0,0];for(let r=0;r<4;r++){let o=r<2?`x`:`y`,s=r&1?`max`:`min`;n&&(e[o][s]+=n[r]*t),f&&i>0&&(a[r]=(e[o][s]-f[o][s])/i)}}f&&rK(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=$G(),EG(f,this.relativeTarget)}c&&(this.animationValues=a,vG(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`);let t=this.isSpringLayout=e.type===`spring`;this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.resumingFrom&&(this.resumingFrom.edgeValues=void 0),this.pendingAnimation&&=(Qz(this.pendingAnimation),void 0),this.pendingAnimation=Zz.update(()=>{gK.hasAnimatedSinceResize=!0,this.motionValue||=lU(0),this.motionValue.jump(0,!1);let n=this.startVelocity;this.startVelocity=void 0;let r=e,i=0;if(t){if(e.mass===`auto`){let t=this.layout?.layoutBox;r=wG(e,t&&Math.sqrt(MG(t.x)*MG(t.y)))}let t=this.relativeStart;if((n||t)&&!e.repeat){if(typeof n==`number`)i=n;else{let e=n&&this.animationEdges;r={...r,type:r=>{let i=[r.velocity,...n||[]].map((t,n)=>kB({...r,keyframes:n?[e[n-1],0]:r.keyframes,velocity:t})),a=i.length;t&&i.push(kB({...r,keyframes:[0,0],velocity:1e3,restDelta:.5,restSpeed:5}));let o=0,s=[],c={calculatedDuration:null,next:t=>{o=t;let n=i[0].next(t),r=n.done;for(let e=1;e<i.length;e++){let{value:n,done:o}=i[e].next(t);e<a?s[e-1]=n:this.impulse=n/1e3,r&&=o}return e&&(this.edgeValues=s),n.done=r,n}};return c.calculatedDuration=rB(c),c.next(0),this.edgeVelocity=e=>i[e+1].velocity(o),c}}}}}let a=cG(this.motionValue,[0,1e3],{...r,velocity:i,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}});this.currentAnimation=a,JB(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=this.edgeValues=this.edgeVelocity=this.impulse=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.edgeValues=this.impulse=void 0,this.mixTargetDelta?.(vK),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&JK(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||$G(),qK(i.x,t.x,e.x),qK(i.y,t.y,e.y)}EG(t,i),ZW(t,r),FG(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new cK),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!RW(t))return;let n={};for(let t=0;t<_K.length;t++)bK(_K[t],e,n,this.animationValues);for(let t=0;t<IW.length;t++)bK(IW[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=mG(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=mG(t?.pointerEvents)||``),this.hasProjected&&!LW(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=fK(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in lG){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=lG[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?mG(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(AK),this.root.sharedNodes.clear()}}}function TK(e){e.updateLayout(),NK(e)}function EK(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)pK(e=>{let t=MG(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;TG(r[e],a[e])}else JK(i,t.layoutBox,n)&&pK(t=>{let n=MG(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=ZG();FG(c,n,t.layoutBox);let l=ZG();FG(l,a?e.applyTransform(r,!0):n,s);let u=!tK(c),d=!1,f=e.getClosestProjectingParent();if((!a||f?.options.layoutRoot&&e.resumeFrom?.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=$G();zG(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=$G();zG(l,n,i.layoutBox,s),a&&o(c,l),aK(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function DK(e){uG.countProjection?.(0),e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function OK(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function kK(e){e.clearSnapshot()}function AK(e){e.clearMeasurements()}function jK(e){e.isLayoutDirty=!0,e.updateLayout()}function MK(e){e.isLayoutDirty=!1}function NK(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;pK(e=>JW(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function PK(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function FK(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function IK(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function LK(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function RK(e){e.resolveTargetDelta()}function zK(e){e.calcProjection()}function BK(e){e.resetSkewAndRotation()}function VK(e,t,n,r,i){let a=n.max-n.min,o=a?Math.max(0,(a+i-r)/a):1,s=e.originPoint=t.originPoint;e.origin=t.origin,e.scale=o,e.translate=n.min+r-(s+(n.min-s)*o)}function HK(e,t,n){e.translate=Az(t.translate,0,n),e.scale=Az(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function UK(e,t,n,r){e.min=Az(t.min,n.min,r),e.max=Az(t.max,n.max,r)}function WK(e,t,n,r){UK(e.x,t.x,n.x,r),UK(e.y,t.y,n.y,r)}function GK(e){return e.animationValues?.opacityExit!==void 0}var KK={duration:.45,ease:[.4,0,.1,1]};function qK(e,t,n){e.max=MG(n)+(e.min=t.min)}function JK(e,t,n){return e===`position`||e===`preserve-aspect`&&!NG(oK(t),oK(n),.2)}function YK(e){return e!==e.root&&e.scroll?.wasRoot}function XK(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var ZK=wK({attachResizeListener:(e,t)=>XK(e,`resize`,t),measureScroll:eG,checkIsScrollRoot:()=>!0}),QK={current:void 0},$K=wK({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!QK.current){let e=new ZK({});e.mount(window),e.setOptions({layoutScroll:!0}),QK.current=e}return QK.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),eq=new WeakMap;function tq(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function nq(e){return typeof e==`string`||Array.isArray(e)}var rq=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`whilePinch`,`exit`],iq=[`initial`].concat(rq);function aq(e){if(tq(e.animate))return!0;for(let t=0;t<iq.length;t++)if(nq(e[iq[t]]))return!0;return!1}function oq(e){return!!(aq(e)||e.variants)}function sq(e,t,n){for(let r in t){let i=t[r],a=n[r];if(MU(i))e.addValue(r,i);else if(MU(a))e.addValue(r,lU(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,lU(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var cq={current:null},lq={current:!1},uq=typeof window<`u`;function dq(){if(lq.current=!0,uq){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>cq.current=e.matches;e.addEventListener(`change`,t),t()}else cq.current=!1}}var fq=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],pq={};function mq(e){pq=e}function hq(){return pq}var gq=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=GV,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=jR.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Zz.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=aq(t),this.isVariantNode=oq(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&MU(t)&&t.set(c[e])}}mount(e){let t=this.presenceContext;if(this.hasBeenMounted&&t?.isPresent!==!1&&!t?.keepValuesOnRemount)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,eq.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(lq.current||dq(),this.shouldReduceMotion=cq.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),Qz(this.notifyUpdate),Qz(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&pH.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new iH({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:iR(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=DV.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Zz.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),DH.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in pq){let t=pq[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$G()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&DH.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<fq.length;t++){let n=fq[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=sq(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=lU(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(XL(n)||QL(n))?n=parseFloat(n):typeof n!=`number`&&!Ez.test(n)&&Ez.test(t)&&(n=pV(e,t)),this.setBaseTarget(e,MU(n)?n.get():n)),MU(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new rR)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){oG.render(this.render)}},_q=class extends gq{constructor(){super(...arguments),this.KeyframeResolver=YU}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;MU(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function vq(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function yq(e,{layout:t,layoutId:n}){return DV.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!lG[e]||e===`opacity`)}function bq(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(MU(r[t])||i&&MU(i[t])||yq(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function xq(e){return window.getComputedStyle(e)}var Sq=class extends _q{constructor(){super(...arguments),this.type=`html`,this.renderInstance=vq}mount(e){super.mount(e)}readValueFromInstance(e,t){if(DV.has(t))return this.projection?.isProjecting?CV(t):TV(e,t);{let n=xq(e),r=(PR(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return QW(e,t)}build(e,t,n){bW(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return bq(e,t,n)}},Cq=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function wq(e){return{point:{x:e.pageX,y:e.pageY}}}var Tq=e=>t=>Cq(t)&&e(t,wq(t));function Eq(e,t,n,r){return XK(e,t,Tq(n),r)}var Dq=new WeakMap,Oq,kq=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:aW(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Aq=kq(`inline`,`width`,`offsetWidth`),jq=kq(`block`,`height`,`offsetHeight`);function Mq({target:e,borderBoxSize:t}){Dq.get(e)?.forEach(n=>{n(e,{get width(){return Aq(e,t)},get height(){return jq(e,t)}})})}function Nq(e){e.forEach(Mq)}function Pq(){typeof ResizeObserver<`u`&&(Oq=new ResizeObserver(Nq))}function Fq(e,t){Oq||Pq();let n=lW(e);return n.forEach(e=>{let n=Dq.get(e);n||(n=new Set,Dq.set(e,n)),n.add(t),Oq?.observe(e)}),()=>{n.forEach(e=>{let n=Dq.get(e);n?.delete(t),n?.size||Oq?.unobserve(e)})}}var Iq=new Set,Lq;function Rq(){Lq=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Iq.forEach(t=>t(e))},window.addEventListener(`resize`,Lq)}function zq(e){return Iq.add(e),Lq||Rq(),()=>{Iq.delete(e),!Iq.size&&typeof Lq==`function`&&(window.removeEventListener(`resize`,Lq),Lq=void 0)}}function Bq(e,t){return sW(typeof e==`function`?zq(e):Fq(e,t))}var Vq=(e,t)=>Math.abs(e-t);function Hq(e,t){let n=Vq(e.x,t.x),r=Vq(e.y,t.y);return Math.sqrt(n**2+r**2)}var Uq=new Set([`auto`,`scroll`]),Wq=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o,immediate:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Kq(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Jq(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Hq(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:jR.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Kq(t,this.transformPagePoint),this.hasPendingMove=!0,Zz.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Jq(e.type===`pointercancel`?this.lastMoveEventInfo:Kq(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!Cq(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=s?0:a,this.contextWindow=r||window;let c=wq(e),l=Kq(c,this.transformPagePoint),{point:u}=l;this.history=[{...u,timestamp:jR.now()}];let{onSessionStart:d}=t;d&&d(e,Jq(l,this.history));let f={passive:!0,capture:!0};this.removeListeners=tR(Eq(this.contextWindow,`pointermove`,this.handlePointerMove,f),Eq(this.contextWindow,`pointerup`,this.handlePointerUp,f),Eq(this.contextWindow,`pointercancel`,this.handlePointerUp,f)),o&&this.startScrollTracking(o),s&&(this.handlePointerMove(e,c),this.updatePoint())}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Uq.has(e.overflowX)||Uq.has(e.overflowY))&&this.scrollPositions.set(t,Gq(t)),t=t.parentElement}this.scrollPositions.set(window,Gq(window)),this.removeScrollListeners=tR(XK(window,`scroll`,this.onElementScroll,{capture:!0}),XK(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=Gq(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Zz.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),Qz(this.updatePoint)}},Gq=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function Kq(e,t){return t?{point:t(e.point)}:e}function qq(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jq({point:e},t){return{point:e,delta:qq(e,Xq(t)),offset:qq(e,Yq(t)),velocity:Zq(t,.1)}}function Yq(e){return e[0]}function Xq(e){return e[e.length-1]}function Zq(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Xq(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>iR(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>iR(t)*2&&(r=e[1]);let a=aR(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Qq=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function $q(e){return Qq.has(e.tagName)||e.isContentEditable===!0}var eJ=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function tJ(e){return eJ.has(e.tagName)||e.isContentEditable===!0}var nJ={x:!1,y:!1};function rJ(){return nJ.x||nJ.y}function iJ(e){return e===`x`||e===`y`?nJ[e]?null:(nJ[e]=!0,()=>{nJ[e]=!1}):nJ.x||nJ.y?null:(nJ.x=nJ.y=!0,()=>{nJ.x=nJ.y=!1})}function aJ(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Az(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Az(n,e,r.max):Math.min(e,n)),e}function oJ(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function sJ(e,{top:t,left:n,bottom:r,right:i}){return{x:oJ(e.x,n,i),y:oJ(e.y,t,r)}}function cJ(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function lJ(e,t){return{x:cJ(e.x,t.x),y:cJ(e.y,t.y)}}function uJ(e,t){let n=.5,r=MG(e),i=MG(t);return i>r?n=nR(t.min,t.max-r,e.min):r>i&&(n=nR(e.min,e.max-i,t.min)),JL(0,1,n)}function dJ(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var fJ=.35;function pJ(e=fJ){return e===!1?e=0:e===!0&&(e=fJ),{x:mJ(e,`left`,`right`),y:mJ(e,`top`,`bottom`)}}function mJ(e,t,n){return{min:hJ(e,t),max:hJ(e,n)}}function hJ(e,t){return typeof e==`number`?e:e[t]||0}function gJ(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var _J=new WeakMap,vJ=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$G(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,t={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let n=e=>{t.snapToCursor&&this.snapToCursor(e),this.stopAnimation()},r=(e,t)=>{let{drag:n,dragConstraints:r,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock=iJ(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),pK(e=>{let t=this.getAxisMotionValue(e).get()||0;if(IR(t)&&(t=SU(t,this.visualElement.current)||0),nz.test(t))t=parseFloat(t);else if(tz.test(t)){let n=o?.layout?.layoutBox[e];n&&(t=MG(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),this.point=typeof r==`function`&&r(this),a&&Zz.update(()=>a(e,t),!1,!0),PU(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},i=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=wJ(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.point&&this.point.move(),this.visualElement.render(),a&&Zz.update(()=>a(e,t),!1,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},o=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:s}=this.getProps();this.panSession=new Wq(e,{onSessionStart:n,onStart:r,onMove:i,onSessionEnd:a,resumeAnimation:o},{...t,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&Zz.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!CJ(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=aJ(i,a,this.elastic[e])),this.point?this.point[e]=i:r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;yJ(e)?(!this.constraints||this.scroll!==gJ(n))&&(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?sJ(r.layoutBox,e):!1,this.elastic=pJ(t),i!==this.constraints&&!yJ(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&pK(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=dJ(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!yJ(e))return!1;let n=bJ(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=gJ(r);let i=$W(n,r.root,this.visualElement.getTransformPagePoint()),a=lJ(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(MW(a));this.hasMutatedConstraints=!!e,e&&(a=jW(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c={bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a},l=i=>r&&!(this.point&&o)&&CJ(i,t||n,this.currentDirection)?e[i]:0;if(this.point&&!o)return this.point.release({x:l(`x`),y:l(`y`)},c).then(s);let u=this.constraints||{},d=pK(e=>{if(!CJ(e,t||n,this.currentDirection))return;let r=u[e]||{};(o===!0||o===e)&&(r={min:0,max:0});let i={type:`inertia`,velocity:l(e),...c,...r};return this.startAxisValueAnimation(e,i)});return Promise.all(d).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return PU(this.visualElement,e),n.start(yU(e,n,0,t,this.visualElement,!1))}stopAnimation(){pK(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();pK(e=>{if(!CJ(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Az(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!yJ(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};pK(e=>{let t=this.getAxisMotionValue(e).get();i[e]=uJ({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),pK(t=>{let n=this.getAxisMotionValue(t);if(!CJ(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Az(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_J.set(this.visualElement,this);let e=this.visualElement.current,t=Eq(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&tJ(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=yJ(t)&&bJ(t);r&&(this.constraints=this.resolveRefConstraints(),n||=SJ(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),Zz.read(r);let o=XK(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(pK(t=>{if(!CJ(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=fJ,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function yJ(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var bJ=e=>`current`in e?e.current:e;function xJ(e){let t=!0;return()=>{t?t=!1:e()}}function SJ(e,t,n){let r=Bq(e,xJ(n)),i=Bq(t,xJ(n));return()=>{r(),i()}}function CJ(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wJ(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function TJ(e,t){let n=lW(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},sW(()=>r.abort())]}function EJ(e){return!(e.pointerType===`touch`||rJ())}function DJ(e,t,n={}){t=cW(t);let[r,i,a]=TJ(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!EJ(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var OJ=(e,t)=>t?e===t||OJ(e,t.parentElement):!1,kJ=new WeakSet;function AJ(e){return t=>{t.key===`Enter`&&e(t)}}function jJ(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var MJ=(e,t)=>{let n=!1,r=AJ(()=>{n||kJ.has(e)||(n=!0,jJ(e,`down`))}),i=AJ(()=>{n&&(n=!1,jJ(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&jJ(e,`cancel`)},{...t,once:!0})};function NJ(e){return Cq(e)&&!rJ()}var PJ=new WeakSet,FJ=100,IJ=8,LJ=(e,t,n)=>Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)>n,RJ=e=>e.preventDefault();function zJ(e,t,n={}){t=cW(t);let[r,i,a]=TJ(e,n),o=new WeakMap,s=e=>{let r=e.currentTarget;if(!NJ(e)||PJ.has(e))return;n.stopPropagation&&PJ.add(e);let{count:a=1,countTimeout:s=.3,hold:c=0,repeat:l}=n,u=jR.now(),d=iR(c),f=iR(s),p=o.get(r);p?.expire(LJ(p.event,e,FJ))?p=void 0:p&&(Qz(p.expire),o.delete(r));let m=p?p.count+1:1,h=m>=a,g=h&&(c||l),_=!c,v=0,y;if(kJ.add(r),p)y=p.handlers;else{let n=t(r,e);y=typeof n==`function`?{onComplete:n}:n||{}}h&&_&&y.onActive?.();let b=iR(l),x=d||b,S=u+x,C=!0,w=()=>{if(i.signal.aborted)return Qz(w);let e=Math.min(1-(S-jR.now())/x,1);C&&e<1&&(e=0),C=!1,y.onHold?.(e),!(e<1)&&(_?y.onRepeat?.(++v):(_=!0,y.onActive?.()),l?(C=!0,S+=x=b):Qz(w))},T={...i,capture:!0},E=(t,n)=>{if(Cq(t)){if(window.removeEventListener(`pointerup`,D,T),window.removeEventListener(`pointercancel`,O,T),window.removeEventListener(`pointermove`,k,T),r.removeEventListener(`contextmenu`,RJ),Qz(w),kJ.delete(r),rJ()&&(n=!1),n&&!h){let n=jR.now(),a=e=>{let s=i.signal.aborted;if(s||e===!0||jR.now()-n>f)return Qz(a),o.delete(r),s||y.onComplete?.(t,{success:!1}),!0};o.set(r,{count:m,event:e,handlers:y,expire:a}),Zz.update(a,!0)}else y.onComplete?.(t,{success:n&&_})}},D=e=>{E(e,r===window||r===document||n.useGlobalTarget||OJ(r,e.target))},O=e=>{E(e,!1)},k=t=>{Cq(t)&&((l||!_)&&LJ(e,t,IJ)||a>1&&rJ())&&O(t)};window.addEventListener(`pointerup`,D,T),window.addEventListener(`pointercancel`,O,T),(g||a>1)&&window.addEventListener(`pointermove`,k,T),g&&(Zz.update(w,!0),r.addEventListener(`contextmenu`,RJ,{...i,passive:!1}))};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,s,i),iW(e)&&(e.addEventListener(`focus`,()=>MJ(e,i),i),!$q(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function BJ(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=MB(i,a,o);return t?s(r):s}var VJ=new Set,HJ=({timestamp:e})=>{VJ.forEach(t=>t.tick(e))},UJ=class extends YB{constructor(e){super(),this.state=`idle`,this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.factory=e.type,this.generator=this.factory(e);let{driver:t}=e;t&&(this.driver=t(e=>this.tick(e))),this.startTime=this.now(),this.state=`running`,this.driver?this.driver.start():(VJ.size||Zz.update(HJ,!0),VJ.add(this))}setTarget(e,t){this.nextTarget=e,this.nextVelocity=t,this.hasNextTarget=!0}retarget(e,t){let{options:n,generator:r}=this;n.keyframes=e,n.velocity=t,this.startTime=this.now(),this.currentTime=0,r.retarget?r.retarget(e,t):this.generator=this.factory(n)}tick(e){let{options:t,hasNextTarget:n}=this,{delay:r=0,onUpdate:i,onPlay:a}=t;this.started||(this.startTime=GB(this.startTime,e));let o=Math.round(e-this.startTime)-r,s=this.currentTime=Math.max(0,o),c=this.generator.next(s),l=o<0?t.keyframes[0]:c.value;if(n){this.hasNextTarget=!1;let{keyframes:e}=t;e[0]=l,e[1]=this.nextTarget,this.retarget(e,this.nextVelocity??this.getGeneratorVelocity())}(n||!this.started)&&(this.started=!0,a?.()),this.state===`running`&&(i?.(l),c.done&&o>=0&&!n&&!this.hasNextTarget&&this.state===`running`&&(this.notifyFinished(),this.teardown(),this.state=`finished`,t.onComplete?.()))}getGeneratorVelocity(){return BB(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():jR.now()}teardown(){this.state=`idle`,this.driver?this.driver.stop():(VJ.delete(this),VJ.size||Qz(HJ))}};function WJ(e,t,n){let r=e.get(),i=null,a,o=typeof r==`string`?r.replace(/[\d.-]/g,``):void 0,s=e=>a(o?e+o:e),c=()=>e.events.animationStart?.notify(),l=()=>{i&&=(i.stop(),null),e.animation=void 0};if(e.attach((t,r)=>{a=r;let o=hG(t);if(i?.state===`running`){i.setTarget(o,n.velocity);return}let u=hG(e.get()),d=i?i.getGeneratorVelocity():e.getVelocity();if(l(),u===o)return;let f=i=new UJ({keyframes:[u,o],velocity:d,restDelta:.001,restSpeed:.01,...n,onUpdate:s,onPlay:c});e.animation=f,f.then(()=>{i===f&&(i=null,e.animation=void 0,e.events.animationComplete?.notify())})},l),MU(t)){let r=n.skipInitialAnimation===!0,i=t=>{r?(r=!1,e.jump(GJ(t,o),!1)):e.set(GJ(t,o))},a=t.on(`change`,i),s=t.get();hG(s)-hG(e.get())&&i(s);let c=e.on(`destroy`,a);return()=>{a(),c(),l()}}return l}function GJ(e,t){return t?e+t:e}function KJ(e,t,n){return WJ(e,t,{...n,type:kB})}var qJ=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},JJ=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),YJ=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function XJ(e,t,n,r){vq(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(JJ.has(n)?n:yW(n),t.attrs[n])}function ZJ(e,t,n){let r=bq(e,t,n);for(let n in e)if(n!==`children`&&(MU(e[n])||MU(t[n]))){let t=EV.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var QJ=class extends _q{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=$G}getBaseTargetFromProps(e,t){return DV.has(t)?super.getBaseTargetFromProps(e,t)??CV(t):e[t]}getDefaultValue(e){return DV.has(e)?this.latestValues[e]??CV(e):void 0}readValueFromInstance(e,t){if(DV.has(t)){let e=cV(t);return e&&e.default||0}if(wW.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=JJ.has(t)?t:yW(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return ZJ(e,t,n)}build(e,t,n){TW(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){XJ(e,t,n,r)}mount(e){this.isSVGTag=YJ(e.tagName),super.mount(e)}};function $J(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var eY=[...rq].reverse(),tY=e=>e?.out===!0?e:e?.out;function nY(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>VU(e,t,n))),n=iY(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&TU(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&tY(f(l??(g&&g.props.initial))?.transition);if(eY.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?nq(f)||f===!1?f:void 0:l,y=nq(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||tq(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=rY(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=TU(e,n,EU(e,t))||{};E={...E,...a,...i},D=tY(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!$J(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=TU(s,n)?.transition?.delayChildren;r.delay=iU(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!MU(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=iY(),i=!0}}}function rY(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!$J(t,e):!1}function iY(){let e={};for(let t of rq)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var aY=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function oY(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function sY(...e){return t=>{let n=!1,r=e.map(e=>{let r=oY(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():oY(e[t],null)}}}}function cY(...e){return v.useCallback(sY(...e),e)}var lY=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},uY=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=lY(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=lY(e.offsetParent);return[t/i,n/a]},dY=class extends v.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(iW(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=iW(e)&&e.offsetWidth||0,r=iW(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=uY(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function fY({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,v.useId)(),c=(0,v.useRef)(null),l=(0,v.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,v.useContext)(aY),d=cY(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,v.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return oG.setup(()=>{let[e,t]=uY(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),oG.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,S.jsx)(dY,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:v.cloneElement(e,{ref:d})})}var pY=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=UL(mY),d=(0,v.useId)(),f=(0,v.useRef)(),p=(0,v.useRef)(n),m=(0,v.useRef)(r);WL(()=>{p.current=n,m.current=r});let h=!0,g=(0,v.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,v.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,S.jsx)(fY,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,S.jsx)(GL.Provider,{value:g,children:e})};function mY(){return new Map}function hY(e=!0){let t=(0,v.useContext)(GL);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var gY=e=>e.key||``;function _Y(e){let t=[];return v.Children.forEach(e,e=>{(0,v.isValidElement)(e)&&t.push(e)}),t}var vY=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=hY(o),f=(0,v.useMemo)(()=>_Y(e),[e]),p=o&&!u?[]:f.map(gY),m=(0,v.useRef)(!0),h=UL(()=>new Map),g=(0,v.useRef)(new Set),[_,y]=(0,v.useState)(f),[b,x]=(0,v.useState)(f);WL(()=>{o&&!u&&!b.length&&d?.()},[u,o,b.length,d]);let C=(0,v.useRef)();(0,v.useEffect)(()=>()=>{let e=C.current;C.current=void 0,e?.()},[b]),WL(()=>{m.current=!1;for(let e=0;e<b.length;e++){let t=gY(b[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[b,p.length,p.join(`-`)]);let w=[];if(f!==_){let e=[...f],t=0;for(let n of b){let r=p.indexOf(gY(n));r===-1?(e.splice(t++,0,n),w.push(n)):t=r+w.length+1}return w.every(e=>h.get(gY(e)))?e=f:a===`wait`&&(e=w),x(_Y(e)),y(f),null}let{forceRender:T}=(0,v.useContext)(HL);return(0,S.jsx)(S.Fragment,{children:b.map(e=>{let _=gY(e),v=o&&!u?!1:f===b||p.includes(_);return(0,S.jsx)(pY,{isPresent:v,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:v?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(T?.(),y([]),o&&d?.(),C.current=r)},anchorX:s,anchorY:c,children:e},_)})})},yY=(0,v.createContext)({strict:!1}),bY={animation:[`variants`,...rq],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},xY=!1;function SY(){if(xY)return;let e={};for(let t in bY)e[t]={isEnabled:e=>bY[t].some(t=>!!e[t])};mq(e),xY=!0}function CY(){return SY(),hq()}function wY(e){let t=CY();for(let n in e)t[n]={...t[n],...e[n]};mq(t)}var TY=(0,v.createContext)({});function EY(e,t){if(aq(e)){let{initial:t,animate:n}=e;return{initial:t===!1||nq(t)?t:void 0,animate:nq(n)?n:void 0}}return e.inherit===!1?{}:t}function DY(e){let{initial:t,animate:n}=EY(e,(0,v.useContext)(TY));return(0,v.useMemo)(()=>({initial:t,animate:n}),[OY(t),OY(n)])}function OY(e){return Array.isArray(e)?e.join(` `):e}var kY=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function AY(e,t,n){for(let r in t)!MU(t[r])&&!yq(r,n)&&(e[r]=t[r])}function jY({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=kY();return bW(n,t,e),Object.assign({},n.vars,n.style)},[t])}function MY(e,t){let n=e.style||{},r={};return AY(r,n,e),Object.assign(r,jY(e,t)),r}function NY(e,t){let n={},r=MY(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var PY=()=>({...kY(),attrs:{}});function FY(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=PY();return TW(n,t,YJ(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return AY(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var IY=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.tap.propagate.ignoreStrict.viewport.pinch`.split(`.`));function LY(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||IY.has(e)}function RY(e,t){return e.startsWith(`on`)?!LY(e):t?.(e)??!LY(e)}function zY(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(MU(e[a])||(a===`fx`?e.fx&&(i.fx=``):(RY(a,r)||n===!0&&LY(a)||!t&&!LY(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a])));return i}var BY=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function VY(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(BY.indexOf(e)>-1||/[A-Z]/u.test(e))}function HY(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??VY(e)?FY:NY)(t,r,i,e),l=zY(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>MU(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function UY({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:WY(n,r,i,e),renderState:t()}}function WY(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=mG(a[e]);let{initial:o,animate:s}=e,c=aq(e),l=oq(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!tq(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=wU(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var GY=e=>(t,n)=>{let r=(0,v.useContext)(TY),i=(0,v.useContext)(GL),a=()=>UY(e,t,r,i);return n?a():UL(a)},KY=GY({scrapeMotionValuesFromProps:bq,createRenderState:kY}),qY=GY({scrapeMotionValuesFromProps:ZJ,createRenderState:PY}),JY=Symbol.for(`motionComponentSymbol`);function YY(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var XY=(0,v.createContext)({});function ZY(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(TY),s=(0,v.useContext)(yY),c=(0,v.useContext)(GL),l=(0,v.useContext)(aY),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,v.useContext)(XY);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&i.create(m,n,h),(0,v.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[FU],_=(0,v.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return WL(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),WL(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function QY(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&wY(r);let a=n?n===`svg`:VY(e),o=a?qY:KY;function s(n,s){let c,l=$Y(n);UL(()=>!!QK.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,v.useContext)(aY),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=DY(n),m=o(n,d);if(!d&&typeof window<`u`){eX(u,r);let t=tX(u);p.visualElement=ZY(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,S.jsxs)(TY.Provider,{value:p,children:[c&&p.visualElement?(0,S.jsx)(c,{visualElement:p.visualElement,...u}):null,HY(e,n,YY(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[JY]=e,c}function $Y({layoutId:e}){let t=(0,v.useContext)(HL).id;return t&&e!==void 0?t+`-`+e:e}function eX(e,t){(0,v.useContext)(yY).strict}function tX(e){let{drag:t,layout:n}=CY();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function nX(e,t){if(typeof Proxy>`u`)return QY;let n=new Map,r=(n,r)=>QY(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,QY(a,void 0,e,t)),n.get(a))})}var rX=(e,t)=>t.isSVG??VY(e)?new QJ(t):new Sq(t,{allowProjection:e!==v.Fragment}),iX=class extends qJ{constructor(e){super(e),e.animationState||=nY(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();tq(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},aX=0,oX={animation:{Feature:iX},exit:{Feature:class extends qJ{constructor(){super(...arguments),this.id=aX++}update(){let{presenceContext:e,animationState:t}=this.node;if(!e||!t)return;let{isPresent:n,onExitComplete:r}=e;if(n===!this.exit)return;if(n){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=TU(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,t.reset(),t.animateChanges()}else t.setActive(`exit`,!1);this.exit=void 0;return}let i=this.exit=t.setActive(`exit`,!0);r&&i.then(()=>{this.exit===i&&(this.exit=!0,r(this.id))})}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id,this.node)),this.update()}unmount(){}}}},sX=class extends qJ{constructor(e){super(e),this.removeGroupControls=eR,this.removeListeners=eR,this.controls=new vJ(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||eR}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},cX=e=>(t,n)=>{e&&Zz.update(()=>e(t,n),!1,!0)},lX=class extends qJ{constructor(){super(...arguments),this.removePointerDownListener=eR}onPointerDown(e){this.session=new Wq(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:cX(e),onStart:cX(t),onMove:cX(n),onEnd:(e,t)=>{delete this.session,r&&Zz.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Eq(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},uX=!1,dX=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),fX=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},pX=class extends v.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),uX&&i.root.didUpdate(),i.options.layoutId!==r&&fX(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...dX(this.props),onExitComplete:()=>this.safeToRemove()})),gK.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),fX(o,n)),o.setOptions({...o.options,...dX(this.props)}),uX=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Zz.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),oG.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;uX=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function mX(e){let[t,n]=hY(),r=(0,v.useContext)(HL);return(0,S.jsx)(pX,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(XY),isPresent:t,safeToRemove:n})}var hX={pan:{Feature:lX},drag:{Feature:sX,ProjectionNode:$K,MeasureLayout:mX}};function gX(e,t,n,r,i){let{props:a}=e,o=`while`+n;!i&&e.animationState&&a[o]&&e.animationState.setActive(o,r===`Start`);let s=a[`on`+n+r];s&&Zz.postRender(()=>s(t,wq(t)))}var _X=class extends qJ{mount(){let{current:e}=this.node;e&&(this.unmount=DJ(e,(e,t)=>(gX(this.node,t,`Hover`,`Start`),e=>gX(this.node,e,`Hover`,`End`))))}unmount(){}},vX=class extends qJ{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=tR(XK(this.node.current,`focus`,()=>this.onFocus()),XK(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function yX(e,t,n,r){e.current instanceof HTMLButtonElement&&e.current.disabled||gX(e,t,`Tap`,n,r)}var bX=class extends qJ{constructor(){super(...arguments),this.options={}}mount(){let{current:e}=this.node;e&&(this.update(),this.unmount=zJ(e,(e,t)=>(yX(this.node,t,`Start`),{onComplete:(e,{success:t})=>yX(this.node,e,t?``:`Cancel`),onRepeat:()=>yX(this.node,t,``,!0)}),this.options))}update(){let{options:e,node:t}=this,{globalTapTarget:n,propagate:r,tap:i}=t.props;for(let t in e)delete e[t];Object.assign(e,i,{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}},xX=new WeakMap,SX=new WeakMap,CX=e=>{let t=xX.get(e.target);t&&t(e)},wX=e=>{e.forEach(CX)};function TX({root:e,...t}){let n=e||document;SX.has(n)||SX.set(n,{});let r=SX.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(wX,{root:e,...t})),r[i]}function EX(e,t,n){let r=TX(t);return xX.set(e,n),r.observe(e),()=>{xX.delete(e),r.unobserve(e)}}var DX={some:0,all:1},OX=class extends qJ{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:DX[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=EX(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(kX(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function kX({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var AX=nX(Object.assign({},oX,{inView:{Feature:OX},tap:{Feature:bX},focus:{Feature:vX},hover:{Feature:_X}},hX,{layout:{ProjectionNode:$K,MeasureLayout:mX}}),rX);function jX(e,t,n){(0,v.useInsertionEffect)(()=>e.on(t,n),[e,t,n])}function MX(e){let t=UL(()=>lU(e)),{isStatic:n}=(0,v.useContext)(aY);if(n){let[,n]=(0,v.useState)(e);(0,v.useEffect)(()=>t.on(`change`,n),[])}return t}function NX(e,t){let n=MX(t()),r=()=>n.set(t());return r(),WL(()=>{let t=()=>Zz.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),Qz(r)}}),n}function PX(e){sU.current=[],e();let t=NX(sU.current,e);return sU.current=void 0,t}function FX(e,t,n){let{isStatic:r}=(0,v.useContext)(aY),i=()=>MU(e)?e.get():e;if(r)return PX(i);let a=MX(i());return(0,v.useInsertionEffect)(()=>n(a,e,t),[a,JSON.stringify(t)]),a}function IX(e,t={}){return FX(e,t,KJ)}function LX(e,t,n,r){if(typeof e==`function`)return PX(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return zX(e,t,n,r);let i=typeof t==`function`?t:BJ(t,n,r),a=Array.isArray(e)?RX(e,i):RX([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&!r?.mixer){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function RX(e,t){let n=UL(()=>[]);return NX(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function zX(e,t,n,r){let i=UL(()=>Object.keys(n)),a=UL(()=>({}));for(let o of i)a[o]=LX(e,t,n[o],r);return a}function BX(){!lq.current&&dq();let[e]=(0,v.useState)(cq.current);return e}function VX(e){return typeof e==`object`&&!Array.isArray(e)}function HX(e,t,n,r){return e==null?[]:typeof e==`string`&&VX(t)?lW(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function UX(e,t,n){return e*(t+1)+n*t}function WX(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function GX(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):WX(t,r)??e}function KX(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(qL(e,i),r--)}}function qX(e,t,n,r,i,a){KX(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Az(i,a,r[o]),easing:CR(n,o)})}function JX(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function YX(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var XX=`easeInOut`,ZX=20;function QX(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=new Map,c=new Map,l={},u=new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:GX(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=tZ(e),{delay:l=0,times:u=PB(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n;r.mixer||=n.mixer;let x=typeof l==`function`?l(a,s):l,S=c.length,C=nH(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&iZ(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=iR(b));let r=iB(n,e,C);v=r.ease,b=r.duration}b??=o;let w=f+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&NB(u,T),c.length===1&&c.unshift(null),m&&m<ZX){let e=b>0?g/b:0;b=UX(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?dR(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:CR(f,e-1))}JX(u,m,e)}let E=w+b;qX(r,c,v,u,w,E),y=Math.max(x+b,y),p=Math.max(E,p)};if(MU(g)){let e=$X(g,c);b(_,v,eZ(`default`,e))}else{let e=HX(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=$X(r,c);for(let e in _)b(_[e],nZ(v,e),eZ(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};m(e,0),a&&(a.duration=p,a.labels=u);let{type:h,...g}=t;return c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(YX);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(nR(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(XX)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o,u.transition[i]={...g,duration:p,ease:l,times:c,mixer:a.mixer||t.mixer,...n}}}),s}function $X(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function eZ(e,t){return t[e]||(t[e]=[]),t[e]}function tZ(e){return Array.isArray(e)?e:[e]}function nZ(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var rZ=e=>typeof e==`number`,iZ=e=>e.every(rZ);function aZ(e,t){return MU(e)||typeof e==`number`||typeof e==`string`&&!VX(t)}function oZ(e,t,n,r){let i=[];if(aZ(e,t))i.push(cG(e,VX(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=HX(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...iG(r,t,s,eq.get(r))):i.push(...nW(eW(r)??aG,r,t,s))}}return i}function sZ(e,t,n,r){let i=[],a=QX(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=lU(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:kB},r),o=t?.reduceMotion??t?.defaultTransition?.reduceMotion;return a.forEach(({keyframes:e,transition:t},n)=>{i.push(...oZ(n,e,{...t,reduceMotion:o}))}),i}var cZ=0;function lZ({repeat:e=0,repeatDelay:t=0,repeatType:n=`loop`,delay:r=0},i,a,o){let s=i+t,c=o===void 0;if(c){let t=Math.max(0,a-r);o=s&&t>0?Math.min(e,Math.ceil(t/s-1e-9)-1):0,a=Math.min(t-o*s,i)}return n!==`loop`&&o%2&&(a=i-a),[o,c?a:r+o*s+a]}function uZ(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var dZ=(e,t)=>t===void 0?e:{name:e,at:t};function fZ(e){e.pause(),e.time=0,e.stop()}var pZ=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.motionScope=oW.current,this.isKilled=!1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new rU(n),this.watch()):(this.invalidate(),this.flush())}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+cZ++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+cZ++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=this.iterationDuration,r=this.time,[i]=lZ(this.options,n,r),a=lZ(this.options,n,t,i)[1],o=Math.abs(this.speed);return this.speed=a<r?-o:o,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&!this.isKilled&&this.build()}adopt(e){this.group&&=(fZ(this.group),void 0),this.isDirty=!1,this.parent=e}build(){let e=this.isWrapped?this.group.iterationDuration:this.totalDuration;this.isDirty=!1,this.isWrapped=!1;let t=this.group,n=0;t&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),t.cancel()):(n=t.animations.length?t.time:0,fZ(t)),this.isRebuilding=!1);let{defaultTransition:r,onComplete:i,onUpdate:a,onRepeat:o,onReverseComplete:s,autoplay:c,scope:l,...u}=this.options,d={};l?.reduceMotion!==void 0&&(d.reduceMotion=l.reduceMotion),l?.skipAnimations!==void 0&&(d.skipAnimations=l.skipAnimations),Object.assign(d,u);let f=new Map,p={},m=oW.current;oW.current=this.motionScope;let h;try{h=sZ(this.toSequence(f),{defaultTransition:r,...d},l,p)}finally{oW.current=m}let g=p.labels,_=d.duration??p.duration,v=p.duration?_/p.duration:1;if(g.forEach((e,t)=>g.set(t,e*v)),this.markers=[],f.forEach((e,t)=>{e.time=g.get(t),g.delete(t),_=Math.max(_,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=g,this.totalDuration=_,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||a||o){let e=this.clock=lU(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),h.unshift(this.clockAnimation=cG(e,[0,_],{...d,duration:_,ease:`linear`}))}let y=this.group=new rU(h),{delay:b=0,repeat:x=0,repeatDelay:S=0}=this.options,[C,w]=lZ(this.options,e,n);n>b&&(n=lZ(this.options,_,Math.min(w,_),C)[1]),this.isDone&&n<b+(x+1)*(_+S)-S&&this.newFinished(),this.scrollTimeline?this.detachScroll=y.attachTimeline(this.scrollTimeline):(y.speed=this.playbackSpeed,this.isPaused&&y.pause(),n&&(y.time=n)),this.repeatIndex=this.currentRepeat(),this.prevTime=n||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),dZ(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?dZ(n,r):r===void 0?n:Array.isArray(n)?uZ(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:WX(e,this.labels)??this.time}currentRepeat(){return lZ(this.options,this.totalDuration,this.clockAnimation?.time??0)[0]}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat(),o=a>this.repeatIndex?1:-1;for(;a!==this.repeatIndex;){let e=this.speed>0==(i===`loop`||!(this.repeatIndex%2)),n=e?this.totalDuration:0;if(this.cross(t,n))return;this.repeatIndex+=o,r?.(),t=i===`loop`?e?-1:1/0:n}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=lZ(this.options,this.totalDuration,e,this.repeatIndex)[1],!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options,r=this.speed<0&&n||t,i=this.resolveFinished;r?.(),i()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e});let{scope:e}=this.options,t=this.motionScope?.add(()=>{this.isKilled=!0,this.stop()});e?.animations.push(this),this.finished.then(()=>{t?.(),e&&qL(e.animations,this)})}};function mZ(e){return Array.isArray(e)&&e.some(e=>Array.isArray(e)||e?.sequence)}function hZ(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=oW.current?.transition,s={};n!==void 0&&(s.reduceMotion=n),r!==void 0&&(s.skipAnimations=r);let c;if(mZ(e)){let r={...s,...i,scope:t};o&&(r.defaultTransition={...o,...r.defaultTransition}),r.reduceMotion=i?.reduceMotion??r.defaultTransition?.reduceMotion??n,c=new pZ(e,r)}else{let{onComplete:n,...r}=a||{},l={...s,...o,...r},{onUpdate:u}=r;c=new pZ([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...l,onUpdate:void 0}]:[e,i,l]],{...s,onComplete:n,scope:t},oZ(e,i,l,t))}return c}return i}var gZ=Object.assign(hZ(),{addEffect:QU,removeEffect:$U}),_Z=AX;function vZ({className:e,...t}){return(0,S.jsx)(`kbd`,{"data-slot":`kbd`,className:X(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}var yZ={maskImage:`linear-gradient(#000 0 0), linear-gradient(#000 0 0)`,maskClip:`content-box, border-box`,maskComposite:`exclude`};function bZ({glareX:e,glareY:t,rimAngle:n,shine:r,rimOpacity:i,glare:a,rim:o,rimWidth:s}){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(_Z.div,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-3xl mix-blend-soft-light`,style:{opacity:r},children:(0,S.jsx)(_Z.div,{className:`absolute -inset-1/2`,style:{x:e,y:t,background:`radial-gradient(circle closest-side, rgb(255 255 255 / ${a*.55}) 0%, rgb(255 255 255 / ${a*.12}) 35%, transparent 85%)`}})}),(0,S.jsx)(_Z.div,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-3xl`,style:{opacity:i,padding:s,...yZ},children:(0,S.jsx)(_Z.div,{className:`absolute top-1/2 left-1/2 aspect-square w-[200%]`,style:{x:`-50%`,y:`-50%`,rotate:n,background:`linear-gradient(0deg, rgb(255 255 255 / ${o}) 16%, rgb(255 255 255 / 0) 45%)`}})})]})}var xZ=()=>window.matchMedia(`(prefers-color-scheme: dark)`),SZ=e=>{let t=xZ();return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)};function CZ(e){let t=(0,v.useSyncExternalStore)(SZ,()=>xZ().matches,()=>!1);return e===`system`?t:e===`dark`}var wZ=3,TZ=2,EZ={text:`Small tools and games,`,highlight:`built with care`};function DZ({theme:e,tagline:t=EZ,depth:n=0,grain:r=!0,className:i,style:a,selectable:o=!1,pressed:s=!1,children:c}){let l=CZ(e.mode),u=n>0,d=e=>u?{transform:`translateZ(${e*n}px)`}:void 0;return(0,S.jsxs)(`div`,{"data-theme":e.name,className:X(`relative flex flex-col rounded-3xl border border-black/[0.07] bg-background p-2 text-foreground select-none`,`shadow-rim`,l&&`dark border-white/10`,u&&`transform-3d`,i),style:{colorScheme:l?`dark`:`light`,...a},children:[u&&Array.from({length:wZ},(e,t)=>(0,S.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -inset-px rounded-3xl`,style:{transform:`translateZ(${-(t+1)*TZ}px)`,background:`color-mix(in oklab, var(--background), black ${30+t*13}%)`}},t)),r&&(0,S.jsx)(`div`,{"aria-hidden":!0,className:X(`pointer-events-none absolute inset-0 rounded-3xl`,l?`opacity-12 mix-blend-screen`:`opacity-7 mix-blend-multiply`),style:{backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E")`}}),(0,S.jsxs)(`div`,{className:X(`relative flex flex-1 flex-col justify-center rounded-inner bg-card p-3.5 text-card-foreground`,`shadow-surface`,u&&`transform-3d`),style:d(10),children:[(0,S.jsxs)(`div`,{className:`text-center`,style:d(6),children:[(0,S.jsx)(`div`,{className:`truncate text-lg leading-tight font-semibold tracking-tight`,children:e.label}),(0,S.jsxs)(`p`,{className:`mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:[t.text,` `,(0,S.jsx)(`span`,{className:`rounded-xs bg-(--selection) px-0.5 whitespace-nowrap text-(--selection-foreground)`,children:t.highlight}),`.`]})]}),(0,S.jsxs)(`div`,{className:`mt-3 flex items-center justify-center gap-1.5 text-3xs font-medium`,style:d(8),children:[(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-success`,children:[(0,S.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`}),`Live`]}),(0,S.jsx)(`span`,{className:`rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground`,children:`v1.2`})]}),(0,S.jsx)(`div`,{className:`mt-5 flex items-center justify-center`,style:d(14),children:(0,S.jsx)(`span`,{"data-select":!0,className:X(`inline-flex items-center rounded-full bg-primary px-3 py-1 text-xs font-medium text-primary-foreground`,`shadow-glow transition duration-150 ease-out`,o&&!s&&`hover:shadow-glow-lifted hover:brightness-110`,s&&`scale-[0.985] shadow-glow-pressed brightness-95 duration-75`),children:`Select`})})]}),(0,S.jsx)(`div`,{className:`flex items-center justify-between gap-1 px-1.5 pt-2 pb-0.5`,style:d(4),children:[1,2,3,4,5,6,7,8].map(e=>(0,S.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full shadow-swatch`,style:{background:`var(--tint-${e})`}},e))}),c&&(0,S.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,style:d(30),children:c})]})}var OZ=236,kZ=252,AZ=168,jZ=50,MZ=.07,NZ=1100,PZ=10,FZ=24,IZ=140,LZ=(e,t)=>({type:`spring`,stiffness:e,damping:t}),RZ=LZ(260,30),zZ=LZ(380,26),BZ=.45,VZ=60,HZ=100,UZ=2,WZ=[1.5,3.5,1/0],GZ=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]),KZ=e=>{if(typeof requestIdleCallback>`u`){let t=window.setTimeout(e,1e3);return()=>clearTimeout(t)}let t=requestIdleCallback(e,{timeout:3e3});return()=>cancelIdleCallback(t)},qZ=()=>Math.min(1,window.innerWidth/(OZ*2.6)),JZ=(e,t)=>`${e.label} ${e.mode}`.toLowerCase().includes(t.trim().toLowerCase()),YZ=e=>jZ/(360/Math.max(e,FZ)),XZ=e=>(e-1)/2>=YZ(e),ZZ=(e,t)=>(e%t+t)%t,QZ=(e,t)=>Math.min(t-1,Math.max(0,e)),$Z=(e,t,n)=>{let r=e-t;return XZ(n)?r-n*Math.round(r/n):r},eQ=(e,t)=>XZ(t)?Math.round(e):QZ(Math.round(e),t),tQ=(e,t)=>ZZ(eQ(e,t),t),nQ=.3,rQ=(e,t)=>{if(XZ(t))return e;let n=QZ(e,t);return n+(e-n)*nQ};function iQ({tagline:e,open:t,onOpenChange:n,trigger:r,shortcut:i=!0,finalFocus:a,favoriteKey:o=`!`,favoritesOnlyKey:s=`@`}={}){let{theme:c,themes:l,setTheme:u,favorites:d,toggleFavorite:f}=I(),p=l.filter(e=>!e.hidden||e.name===c),m=BX()??!1,[h,g]=(0,v.useState)(!1),_=t??h,[y,b]=(0,v.useState)(0),[x,C]=(0,v.useState)(1),[w,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(!1),M=MX(1),N=MX(1/0),P=MX(0),F=(0,v.useRef)(0),R=(0,v.useRef)(null),[z,V]=(0,v.useState)(``),[ee,H]=(0,v.useState)(!1),te=(e,t,n)=>p.filter(r=>JZ(r,e)&&(!t||n.includes(r.name))),ne=te(z,ee,d),re=ne.length,U=ne[y];jX(P,`change`,e=>re&&b(tQ(e,re)));let ie=(0,v.useRef)(!1),ae=e=>{ie.current=!1,F.current=eQ(e,re),gZ(P,F.current,m?{duration:0}:RZ)},oe=e=>ae(Math.round(F.current)+e),W=e=>{let t=Math.max(-60,Math.min(VZ,e));if(m)return ae(P.get());ie.current=!0,F.current=eQ(P.get()+t*BZ,re),gZ(P,F.current,{type:`inertia`,velocity:t,power:BZ,timeConstant:BZ*1e3,modifyTarget:e=>eQ(e,re),restDelta:.001})},G=(0,v.useEffectEvent)(e=>{!i||_||e.defaultPrevented||e.repeat||e.metaKey||e.ctrlKey||e.altKey||e.key.toLowerCase()!==`t`||L(e.target)||(e.preventDefault(),K(!0))});(0,v.useEffect)(()=>(window.addEventListener(`keydown`,G),()=>window.removeEventListener(`keydown`,G)),[]),(0,v.useEffect)(()=>KZ(()=>j(!0)),[]),(0,v.useEffect)(()=>{if(A)return KZ(()=>{let e=R.current?.closest(`[hidden]`);e&&(e.style.visibility=`hidden`,e.hidden=!1,e.offsetWidth,e.hidden=!0,e.style.visibility=``)})},[A]),(0,v.useEffect)(()=>{if(!_)return;let e=e=>e.preventDefault();return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)},[_]),(0,v.useEffect)(()=>{if(!_)return;let e=()=>C(qZ());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[_]);let K=(e,r)=>{if(!e&&r?.reason===`escape-key`&&z)return le(``);t===void 0&&g(e),n?.(e)},se=(0,v.useEffectEvent)(()=>{V(``),H(!1),T(!1),C(qZ());let e=Math.max(0,p.findIndex(e=>e.name===c));P.jump(e),b(e),F.current=e,N.jump(WZ[0]);let t=e=>requestAnimationFrame(()=>requestAnimationFrame(()=>{N.jump(WZ[e]),e<WZ.length-1&&t(e+1)}));t(1),m||(M.jump(.4),gZ(M,1,zZ))});(0,v.useEffect)(()=>{_&&se()},[_]);let q=e=>{if(!e||e.name===c)return K(!1);let t=document.getElementById(`theme-card-${e.name}`)?.getBoundingClientRect();B(()=>{u(e.name),T(!0),K(!1)},t&&{x:t.left+t.width/2,y:t.top+t.height/2},m)},ce=e=>{let t=U?e.indexOf(U):-1,n=Math.max(0,t);P.stop(),P.jump(n),F.current=n,b(n)},le=e=>{ce(te(e,ee,d)),V(e)},ue=e=>{ce(te(z,e,d)),H(e)},de=e=>{ee&&ce(ne.filter(t=>t!==e)),f(e.name)},fe=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;if(GZ.has(e.key)&&e.target===R.current&&e.preventDefault(),e.key===o||e.key===s){if(e.preventDefault(),e.repeat)return;e.key===s?ue(!ee):U&&de(U);return}if(e.key.length===1&&(e.key!==` `||z!==``)&&(e.key!==` `||e.target===R.current))return e.preventDefault(),le(z+e.key);if(e.key===`Backspace`&&z)return e.preventDefault(),le(z.slice(0,-1));if(!re)return;let t={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(t)e.preventDefault(),oe(t);else if((e.key===`Enter`||e.key===` `)&&e.target===R.current){if(e.preventDefault(),e.repeat||E)return;if(m)return q(U);D(!0),window.setTimeout(()=>{D(!1),q(U)},IZ)}else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=Math.round(F.current),n=XZ(re)?t-ZZ(t,re):0;ae(e.key===`Home`?n:XZ(re)?n-1:re-1)}},pe=(0,v.useRef)({last:0,settle:0}),me=e=>{let t=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(e.deltaMode!==0||Number.isInteger(t)&&Math.abs(t)>=50){if(e.timeStamp-pe.current.last<60)return;pe.current.last=e.timeStamp,oe(Math.sign(t))}else P.stop(),P.set(rQ(P.get()+t/(AZ*x),re)),clearTimeout(pe.current.settle),pe.current.settle=window.setTimeout(()=>ae(P.get()),120)},he=(0,v.useRef)({x:0,y:0,start:0,moved:!1,caught:!1,gesture:`ring`,samples:[]}),ge=(0,v.useRef)(null),[_e,ve]=(0,v.useState)(!1);return(0,S.jsxs)(qy,{open:_,onOpenChange:K,modal:`trap-focus`,onOpenChangeComplete:e=>!e&&T(!1),children:[r===void 0&&(0,S.jsxs)(Zl,{children:[(0,S.jsx)(Kl,{render:(0,S.jsx)(Qy,{render:(0,S.jsxs)(Rf,{variant:`ghost`,size:`icon`,"aria-label":`Choose a theme`,"aria-keyshortcuts":i?`t`:void 0,className:`relative outline-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0`,children:[(0,S.jsx)(Ed,{}),(0,S.jsx)(`span`,{className:`absolute right-1.5 bottom-1.5 size-2 rounded-full bg-primary ring-2 ring-background`})]})})}),(0,S.jsxs)(ql,{children:[`Theme `,i&&(0,S.jsx)(vZ,{children:`T`})]})]}),r&&(0,S.jsx)(Qy,{render:r}),(0,S.jsxs)(ky,{keepMounted:A,children:[(0,S.jsx)(cy,{className:X(`fixed inset-0 z-50 bg-background/55 duration-200 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,w&&`invisible`)}),(0,S.jsxs)(Dy,{initialFocus:R,finalFocus:a,onKeyDown:fe,onPointerDown:e=>{if(e.button!==0||e.target.closest(`button`))return;let t=e.pointerType===`touch`,n=e.target.closest(`[data-theme-index]`),r=n!==null&&Math.round($Z(Number(n.dataset.themeIndex),F.current,re))===0;if(r&&e.target.closest(`[data-select]`)){k(!0);let e=()=>{k(!1),window.removeEventListener(`pointerup`,e),window.removeEventListener(`pointercancel`,e)};window.addEventListener(`pointerup`,e),window.addEventListener(`pointercancel`,e)}if(he.current.moved=he.current.caught=!1,he.current.gesture=`ring`,re<2&&!(t&&r))return;let i=ie.current&&Math.abs(P.getVelocity())>UZ;i&&P.stop(),he.current={x:e.clientX,y:e.clientY,start:P.get(),moved:!1,caught:i,gesture:t?`pending`:`ring`,samples:[{t:e.timeStamp,x:e.clientX}]};let a=e=>{let{current:t}=he,n=e.clientX-t.x;if(t.gesture===`pending`){let i=e.clientY-t.y;if(Math.hypot(n,i)<6)return;t.gesture=Math.abs(i)>Math.abs(n)?r&&!m?`tilt`:`none`:re<2?`none`:`ring`,k(!1)}if(t.gesture===`tilt`)return ge.current?.aim(e.clientX,e.clientY);if(t.gesture===`ring`){for(t.samples.push({t:e.timeStamp,x:e.clientX});t.samples.length>2&&e.timeStamp-t.samples[0].t>HZ;)t.samples.shift();!t.moved&&Math.abs(n)<4||(t.moved||(k(!1),P.stop(),t.start=P.get()+n/(AZ*x),ve(!0)),t.moved=!0,P.set(rQ(t.start-n/(AZ*x),re)))}},o=e=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),ve(!1),he.current.gesture===`tilt`&&ge.current?.release();let{samples:t}=he.current,n=t[0],r=t[t.length-1],i=e.timeStamp-r.t>50||r.t===n.t?0:(r.x-n.x)/(r.t-n.t)*1e3;he.current.moved?W(-i/(AZ*x)):he.current.caught&&ae(P.get())};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,o)},onWheel:me,onClick:e=>{let{moved:t,caught:n,gesture:r}=he.current;if(t||n||r===`tilt`||r===`none`)return;let i=e.target;if(i.closest(`button`))return;let a=i.closest(`[data-theme-index]`);if(!a)return K(!1);let o=Number(a.dataset.themeIndex);if(i.closest(`[data-favorite]`))return de(ne[o]);let s=Math.round($Z(o,F.current,re));s===0?q(ne[o]):oe(s)},className:X(`fixed inset-0 z-50 flex touch-none flex-col items-center justify-center overflow-hidden text-foreground outline-none select-none duration-200 data-open:duration-75 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,w&&`invisible`),children:[(0,S.jsx)(ly,{render:(0,S.jsx)(Rf,{variant:`ghost`,size:`icon`,"aria-label":`Close`,className:`absolute top-4 right-4`,children:(0,S.jsx)(nf,{})})}),(0,S.jsxs)(Zl,{children:[(0,S.jsx)(Kl,{render:(0,S.jsx)(Rf,{variant:`ghost`,size:`icon`,"aria-label":`Favorites only`,"aria-pressed":ee,"aria-keyshortcuts":s,className:`absolute top-4 right-14`,onMouseDown:e=>e.preventDefault(),onClick:()=>ue(!ee)}),children:(0,S.jsx)(Wd,{className:X(ee&&`fill-current`)})}),(0,S.jsxs)(ql,{children:[`Favorites only `,(0,S.jsx)(vZ,{children:s})]})]}),(0,S.jsxs)(_Z.div,{className:`flex w-full flex-col items-center will-change-transform`,style:{scale:M},children:[(0,S.jsxs)(`div`,{className:`text-center`,children:[(0,S.jsx)(Jy,{className:`text-xs font-medium tracking-wider text-muted-foreground uppercase`,children:`Theme`}),(0,S.jsx)(`div`,{"aria-live":`polite`,className:`mt-1 h-9 overflow-hidden`,children:z?(0,S.jsxs)(`div`,{className:`text-3xl font-semibold tracking-tight whitespace-pre`,children:[z,(0,S.jsx)(`span`,{className:`ml-0.5 inline-block h-[0.9em] w-[2px] translate-y-[0.1em] animate-pulse bg-primary`})]}):(0,S.jsx)(_Z.div,{initial:!m&&{y:14,opacity:0},animate:{y:0,opacity:1},transition:LZ(420,32),className:`text-3xl font-semibold tracking-tight`,children:U?.label},U?.name)}),(0,S.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground tabular-nums`,children:[re===0?ee&&!z?`No favorites yet`:`No theme matches`:z?`${U?.label} · ${y+1} of ${re}`:`${String(y+1).padStart(2,`0`)} / ${String(re).padStart(2,`0`)}`,ee&&` · favorites`,U?.name===c&&` · current`]})]}),(0,S.jsx)(`div`,{ref:R,tabIndex:0,role:`listbox`,"aria-label":`Themes`,"aria-activedescendant":U?`theme-card-${U.name}`:void 0,className:`relative my-6 w-full outline-none`,style:{height:332*x},children:(0,S.jsx)(`div`,{className:`absolute top-1/2 left-1/2`,style:{transform:`scale(${x})`},children:!w&&ne.map((t,n)=>(0,S.jsx)(oQ,{theme:t,index:n,count:re,position:P,reach:N,isFront:n===y,tilt:n===y&&!_e&&!m,aimRef:ge,pressed:n===y&&(E||O),favorite:d.includes(t.name),taglineText:e?.text,taglineHighlight:e?.highlight},t.name))})}),(0,S.jsxs)(`div`,{className:`hidden items-center gap-1.5 text-xs text-muted-foreground sm:flex`,children:[(0,S.jsx)(`span`,{children:`Drag or`}),(0,S.jsx)(vZ,{children:`←`}),(0,S.jsx)(vZ,{children:`→`}),(0,S.jsx)(`span`,{className:`mr-2`,children:`to browse`}),(0,S.jsx)(vZ,{children:`Enter`}),(0,S.jsx)(`span`,{className:`mr-2`,children:`select`}),(0,S.jsx)(`span`,{className:`mr-2`,children:`type to filter`}),(0,S.jsx)(vZ,{children:o}),(0,S.jsx)(`span`,{className:`mr-2`,children:`favorite`}),(0,S.jsx)(vZ,{children:s}),(0,S.jsx)(`span`,{className:`mr-2`,children:`favorites only`}),(0,S.jsx)(vZ,{children:`Esc`}),(0,S.jsx)(`span`,{children:z?`clear`:`close`})]})]})]})]})]})}var aQ=e=>Math.min(1,Math.max(-1,e*2-1)),oQ=(0,v.memo)(function({theme:e,index:t,count:n,position:r,reach:i,isFront:a,tilt:o,aimRef:s,pressed:c,favorite:l,taglineText:u,taglineHighlight:d}){let f=Math.max(n,FZ),p=2*Math.PI/f,m=AZ*f/(2*Math.PI),h=YZ(n),g=LX(r,e=>$Z(t,e,n)),_=LX(g,e=>{let t=e*p,n=1+MZ*Math.max(0,1-Math.abs(e));return`translate(-50%, -50%) perspective(${NZ}px) translate3d(${m*Math.sin(t)}px, 0, ${m*(Math.cos(t)-1)}px) rotateY(${t*180/Math.PI}deg) scale(${n})`}),y=LX(g,e=>Math.min(1,Math.max(0,h+.5-Math.abs(e)))),b=LX([y,g,i],([e,t,n])=>e<=0||Math.abs(t)>n?`hidden`:`visible`),x=LX(g,e=>100-Math.round(Math.abs(e)*4)),C=LX(g,e=>Math.min(.45,Math.abs(e)*.09)),w=IX(0,{stiffness:320,damping:26}),T=IX(0,{stiffness:320,damping:26}),E=IX(0,{stiffness:200,damping:30}),D=LX(T,e=>-e*PZ),O=LX(w,e=>e*PZ),k=LX(w,e=>`${e*25}%`),A=LX(T,e=>`${e*25}%`),j=LX([w,T,g],([e,t,n])=>Math.atan2(t,e+n)*180/Math.PI+90),M=LX(E,[0,1],[.25,1]),N=LX(O,e=>-e*1.6),P=LX(D,e=>18+e*.8),F=LX(g,e=>Math.max(0,1-Math.abs(e))),I=LX(F,e=>e<=0?`hidden`:`visible`),L=LX(F,e=>e*.5);(0,v.useEffect)(()=>{o||(w.set(0),T.set(0),E.set(0))},[o,w,T,E]);let R=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!o)return;let e={aim(e,t){let n=R.current?.getBoundingClientRect();n&&(w.set(aQ((e-n.left)/n.width)),T.set(aQ((t-n.top)/n.height)),E.set(1))},release(){w.set(0),T.set(0),E.set(0)}};return s.current=e,()=>{s.current===e&&(s.current=null)}},[o,s,w,T,E]),(0,S.jsxs)(_Z.div,{"data-theme-index":t,className:`absolute top-0 left-0 cursor-pointer transform-3d`,style:{width:OZ,height:kZ,transform:_,opacity:y,visibility:b,zIndex:x},ref:R,onPointerMove:e=>{o&&e.pointerType!==`touch`&&s.current?.aim(e.clientX,e.clientY)},onPointerLeave:e=>{e.pointerType!==`touch`&&(w.set(0),T.set(0),E.set(0))},children:[(0,S.jsx)(_Z.div,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-[8%] top-[12%] bottom-0 rounded-4xl bg-black blur-2xl`,style:{x:N,y:P,z:-40,opacity:L,visibility:I}}),(0,S.jsx)(_Z.div,{id:`theme-card-${e.name}`,role:`option`,"aria-selected":a,"aria-label":l?`${e.label}, favorite`:e.label,className:`relative size-full transform-3d`,style:{rotateX:D,rotateY:O},children:(0,S.jsxs)(DZ,{theme:e,tagline:u&&d?{text:u,highlight:d}:void 0,depth:1,grain:a,selectable:a,pressed:c,className:`size-full`,children:[(0,S.jsx)(`span`,{"data-favorite":!0,"aria-hidden":!0,className:X(`pointer-events-auto absolute top-1 right-1 flex size-11 items-center justify-center rounded-full transition duration-150 ease-out hover:scale-115`,l?`text-primary`:`text-muted-foreground/60 hover:text-foreground`),children:(0,S.jsx)(Wd,{className:X(`size-4`,l&&`fill-current`)})}),(0,S.jsx)(_Z.div,{"aria-hidden":!0,className:`absolute inset-0 rounded-3xl bg-black`,style:{opacity:C}}),(0,S.jsx)(_Z.div,{className:`absolute inset-0`,style:{opacity:F,visibility:I},children:(0,S.jsx)(bZ,{glareX:k,glareY:A,rimAngle:j,shine:E,rimOpacity:M,glare:.55,rim:.7,rimWidth:.5})})]})})]})}),sQ=cf(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function cQ({className:e,orientation:t,...n}){return(0,S.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:X(sQ({orientation:t}),e),...n})}function lQ({act:e,open:t,onOpenChange:n,onCloned:r,finalFocus:i}){return(0,S.jsx)($y,{open:t,onOpenChange:n,children:(0,S.jsxs)(rb,{className:`sm:max-w-xl`,finalFocus:i,children:[(0,S.jsxs)(ib,{children:[(0,S.jsx)(ob,{children:`Clone a repo`}),(0,S.jsx)(sb,{children:`Your GitHub repos that aren't cloned yet, newest first. Once cloned, workwork looks for work in it.`})]}),(0,S.jsx)(uQ,{act:e,onCloned:r})]})})}function uQ({act:e,onCloned:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)();if((0,v.useEffect)(()=>{wf.repos().then(r,e=>a(e.message))},[]),i)return(0,S.jsx)(`p`,{className:`text-sm text-destructive`,children:i});if(!n)return(0,S.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(cb,{}),` Asking GitHub`]});let u=o.toLowerCase(),d=n.repos.filter(e=>e.name.toLowerCase().includes(u)||e.description.toLowerCase().includes(u)),f=i=>e(async()=>{l(i.name);try{await wf.clone(i.name),t(),r({...n,repos:n.repos.filter(e=>e!==i)})}finally{l(void 0)}});return(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,children:[(0,S.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Clones into `,n.root,`/`]}),(0,S.jsx)(lp,{placeholder:`Search ${n.repos.length} repos`,value:o,onChange:e=>s(e.target.value)}),(0,S.jsxs)(rS,{className:`max-h-[50svh] overflow-y-auto`,children:[d.map(e=>(0,S.jsx)(fS,{title:e.name,meta:[e.description,`created ${e.createdAt.slice(0,10)}`].filter(Boolean).join(` · `),children:(0,S.jsxs)(Rf,{variant:`outline`,size:`sm`,disabled:c!==void 0,onClick:()=>f(e),children:[c===e.name&&(0,S.jsx)(cb,{}),` Clone`]})},e.name)),d.length===0&&(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.repos.length?`No repo matches.`:`Every repo of yours is cloned.`})]})]})}var dQ=``,fQ={value:`clone-project`,label:`Clone project...`},pQ=100,mQ=e=>`${e.repo} ${e.id}`;function hQ({snapshot:e,act:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(0),o=(0,v.useRef)(null),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)(dQ),[p,m]=(0,v.useState)(dQ),[h,g]=(0,v.useState)([`none`,`skim`,`decide`]),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(pQ),[C,w]=(0,v.useState)(new Map),[T,E]=(0,v.useState)(0),{at:D,count:O,refreshing:k}=e.candidates;(0,v.useEffect)(()=>{let e=!1;return wf.candidates().then(({items:t,repos:n})=>{e||(c(t),u(n))}),()=>{e=!0}},[D,i]),(0,v.useEffect)(()=>{wf.blueprints().then(e=>w(new Map(e.map(e=>[e.name,e.description]))))},[D]);let A=(0,v.useMemo)(()=>{let t=new Map;for(let n of e.jobs)n.state!==`removed`&&t.set(mQ(n.item),n);return t},[e.jobs]),j={value:dQ,label:`All repos (${s.length})`},M=(0,v.useMemo)(()=>{let e=new Map;for(let t of s)e.set(t.repo,(e.get(t.repo)??0)+1);return l.map(t=>({value:t,label:`${_f(t)} (${e.get(t)??0})`})).sort((e,t)=>e.label.localeCompare(t.label))},[s,l]),N=d===dQ?s:s.filter(e=>e.repo===d),P=new Map;for(let e of N)P.set(e.blueprint,(P.get(e.blueprint)??0)+1);let F=[...P].sort((e,t)=>e[1]-t[1]),I=_.toLowerCase().split(/\s+/).filter(Boolean),L=N.filter(e=>(p===dQ||e.blueprint===p)&&h.includes(e.attention)&&I.every(t=>`${vf(e)} ${e.id} ${e.label}`.toLowerCase().includes(t))),R=(e,n)=>t(()=>wf.queue(e,n)),z=L.filter(e=>!A.has(mQ(e))),B=(0,S.jsxs)(lf,{children:[(0,S.jsxs)(uf,{children:[(0,S.jsx)(df,{children:k?`Asking workwork`:`No candidates yet`}),(0,S.jsx)(ff,{children:k?`workwork is looking through every repo under $SRC. That takes a few minutes.`:d===dQ?`Ask workwork for candidates across your repos. It takes a few minutes.`:`There are no candidates for ${_f(d)}.`})]}),(0,S.jsx)(pf,{children:(0,S.jsxs)(Rf,{variant:`outline`,disabled:k,onClick:()=>t(wf.refreshCandidates),children:[k&&(0,S.jsx)(cb,{}),` Ask workwork`]})})]});return(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 pt-2`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(lp,{className:`max-w-xs`,placeholder:`Search titles, ids, repos`,value:_,onChange:e=>y(e.target.value)}),(0,S.jsx)(bO,{multiple:!0,variant:`outline`,value:h,onValueChange:g,children:[`none`,`skim`,`decide`].map(e=>(0,S.jsx)(xO,{value:e,children:e},e))}),(0,S.jsxs)(fD,{items:[j,...M,fQ],value:d,onValueChange:e=>{if(e===fQ.value){r(!0);return}let t=e??dQ;f(t),x(pQ),s.some(e=>e.blueprint===p&&(t===dQ||e.repo===t))||m(dQ)},children:[(0,S.jsx)(hD,{"aria-label":`Repo`,ref:o,children:(0,S.jsx)(mD,{})}),(0,S.jsxs)(gD,{alignItemWithTrigger:!1,children:[(0,S.jsxs)(pD,{children:[(0,S.jsx)(_D,{value:j.value,children:j.label}),M.map(e=>(0,S.jsx)(_D,{value:e.value,children:e.label},e.value))]}),(0,S.jsx)(vD,{}),(0,S.jsx)(pD,{children:(0,S.jsx)(_D,{value:fQ.value,children:fQ.label})})]})]}),(0,S.jsx)(lQ,{act:t,open:n,onOpenChange:r,onCloned:()=>a(e=>e+1),finalFocus:o}),(0,S.jsxs)(`span`,{className:`flex flex-1 items-center justify-end gap-2 text-sm text-muted-foreground`,children:[k?`Asking workwork…`:`${O} candidates${D?`, ${hf(D)}`:``}`,(0,S.jsxs)(Zl,{children:[(0,S.jsx)(Kl,{render:(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh candidates`,disabled:k,onClick:()=>{E(T+1),t(wf.refreshCandidates)}}),children:(0,S.jsx)(Pd,{className:T?`refresh-turn`:void 0},T)}),(0,S.jsx)(ql,{children:k?`Asking workwork, takes a few minutes`:`Ask workwork again`})]})]})]}),N.length===0?B:(0,S.jsxs)(`div`,{className:`flex flex-col gap-6 md:flex-row`,children:[(0,S.jsx)(`nav`,{className:`flex flex-wrap gap-1 md:w-48 md:flex-none md:flex-col`,children:[[dQ,N.length],...F].map(([e,t])=>(0,S.jsxs)(Zl,{disabled:!C.has(e),children:[(0,S.jsxs)(Kl,{render:(0,S.jsx)(Rf,{variant:p===e?`secondary`:`ghost`,size:`sm`,onClick:()=>{m(e),x(pQ)}}),children:[(0,S.jsx)(`span`,{className:`flex-1 text-left`,children:e||`All blueprints`}),(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:t})]}),(0,S.jsx)(ql,{side:`right`,children:C.get(e)})]},e))}),(0,S.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,S.jsxs)(pS,{title:(0,S.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(`span`,{className:`flex-1`,children:[L.length,` matching, `,z.length,` not queued yet`]}),z.length>0&&z.length<=20&&(0,S.jsx)(gQ,{label:`Queue all ${z.length}`,presets:e.settings.presets,onQueue:e=>R(z,e)})]}),children:[(0,S.jsx)(rS,{children:L.slice(0,b).map(n=>{let r=A.get(mQ(n)),i=(0,S.jsx)(gQ,{label:`Queue`,presets:e.settings.presets,onQueue:e=>R([n],e)});return(0,S.jsx)(fS,{leading:(0,S.jsx)(WD,{state:KD(r,e.prs)}),title:(0,S.jsx)(JD,{item:n,job:r,blueprint:C.get(n.blueprint),snapshot:e,act:t,actions:!r&&i}),meta:(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(GD,{state:KD(r,e.prs)}),[n.blueprint,n.attention,n.id].join(` · `)]}),children:!r&&i},mQ(n))})}),L.length>b&&(0,S.jsxs)(Rf,{variant:`ghost`,onClick:()=>x(b+pQ),children:[`Show `,Math.min(pQ,L.length-b),` more`]})]})})]})]})}function gQ({label:e,presets:t,onQueue:n}){return(0,S.jsxs)(cQ,{children:[(0,S.jsx)(Rf,{variant:`outline`,size:`sm`,onClick:()=>n(),children:e}),(0,S.jsxs)(dO,{children:[(0,S.jsxs)(Zl,{children:[(0,S.jsx)(Kl,{render:(0,S.jsx)(fO,{render:(0,S.jsx)(Rf,{variant:`outline`,size:`icon-sm`,"aria-label":`${e} with`})}),children:(0,S.jsx)(Eu,{})}),(0,S.jsxs)(ql,{children:[e,` for a specific agent or preset`]})]}),(0,S.jsxs)(pO,{align:`end`,className:`w-auto`,children:[(0,S.jsxs)(mO,{children:[(0,S.jsx)(hO,{children:`Agent`}),mS.map(e=>(0,S.jsx)(gO,{onClick:()=>n({agent:e}),children:e},e))]}),(0,S.jsx)(_O,{}),(0,S.jsxs)(mO,{children:[(0,S.jsx)(hO,{children:`Preset`}),t.length===0&&(0,S.jsx)(gO,{disabled:!0,children:`Add presets in Settings`}),t.map((e,t)=>(0,S.jsx)(gO,{onClick:()=>n(e),children:xf(e)},t))]})]})]})]})}function _Q({snapshot:e,act:t}){let{settings:n,on:r}=e,[i,a]=(0,v.useState)();return(0,S.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,S.jsxs)(Zl,{children:[(0,S.jsxs)(Kl,{render:(0,S.jsx)(cD,{orientation:`horizontal`}),children:[(0,S.jsx)(eS,{id:`auto`,checked:n.auto.on,onCheckedChange:e=>t(()=>wf.saveSettings({...n,auto:{...n.auto,on:e}}))}),(0,S.jsx)(uD,{htmlFor:`auto`,children:`Auto`})]}),(0,S.jsx)(ql,{children:`Keep the queue topped up from candidates while the factory is on`})]}),(0,S.jsxs)(Zl,{disabled:r,children:[(0,S.jsx)(Kl,{render:(0,S.jsx)(Rf,{variant:`outline`,onClick:e=>{let i={agents:n.agents,limit:n.limit,until:n.until};r?t(wf.turnOff):e.shiftKey?t(()=>wf.turnOn(i)):a(i)}}),children:r?`Turn off`:`Turn on`}),(0,S.jsx)(ql,{children:`Shift-click to turn on with your defaults`})]}),(0,S.jsx)($y,{open:i!==void 0,onOpenChange:e=>!e&&a(void 0),children:(0,S.jsxs)(rb,{children:[(0,S.jsxs)(ib,{children:[(0,S.jsx)(ob,{children:`Turn the factory on`}),(0,S.jsx)(sb,{children:`For this run only; the defaults are under Settings. Your picks go first, then what auto mode queues.`})]}),i&&(0,S.jsx)(CD,{value:i,onChange:a}),(0,S.jsx)(ab,{children:(0,S.jsx)(Rf,{disabled:!i||Object.keys(i.agents).length===0,onClick:()=>t(async()=>{await wf.turnOn(i),a(void 0)}),children:`Turn on`})})]})})]})}var vQ={value:`new-project`,label:`New project...`};function yQ({act:e,open:t,onOpenChange:n,onCreated:r}){return(0,S.jsx)($y,{open:t,onOpenChange:n,children:(0,S.jsxs)(rb,{className:`sm:max-w-2xl`,children:[(0,S.jsxs)(ib,{children:[(0,S.jsx)(ob,{children:`New goal`}),(0,S.jsx)(sb,{children:`A goal is one large task, planned into jobs. Nothing runs until you approve the plan.`})]}),(0,S.jsxs)(jx,{defaultValue:`brief`,children:[(0,S.jsxs)(Nx,{children:[(0,S.jsx)(Px,{value:`brief`,children:`From a brief`}),(0,S.jsx)(Px,{value:`plan`,children:`Import a plan`})]}),(0,S.jsx)(Fx,{value:`brief`,children:(0,S.jsx)(bQ,{act:e,onCreated:r})}),(0,S.jsx)(Fx,{value:`plan`,children:(0,S.jsx)(xQ,{act:e,onCreated:r})})]})]})})}function bQ({act:e,onCreated:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>{wf.candidates().then(r)},[]);let m=o===vQ.value,h=(n?.repos??[]).map(e=>({value:e,label:_f(e)})),g=i.trim()&&(m?c.trim():o),_=()=>e(async()=>{p(!0);try{t((await wf.newGoal({title:i,brief:u,...m?{project:c.trim()}:{repo:o}})).id)}finally{p(!1)}});return(0,S.jsxs)(oD,{className:`mt-2`,children:[(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{htmlFor:`goal-title`,children:`Title`}),(0,S.jsx)(lp,{id:`goal-title`,autoFocus:!0,placeholder:`GPUI client for Tasks`,value:i,onChange:e=>a(e.target.value)})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{children:`Repo`}),(0,S.jsxs)(fD,{items:[...h,vQ],value:o,onValueChange:e=>s(e??``),children:[(0,S.jsx)(hD,{"aria-label":`Repo`,children:(0,S.jsx)(mD,{placeholder:`Pick a repo`})}),(0,S.jsxs)(gD,{alignItemWithTrigger:!1,children:[(0,S.jsx)(pD,{children:h.map(e=>(0,S.jsx)(_D,{value:e.value,children:e.label},e.value))}),(0,S.jsx)(vD,{}),(0,S.jsx)(pD,{children:(0,S.jsx)(_D,{value:vQ.value,children:vQ.label})})]})]}),m&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(lp,{"aria-label":`Project name`,placeholder:`units`,value:c,onChange:e=>l(e.target.value)}),(0,S.jsxs)(dD,{children:[`Creates `,n?.root,`/`,c.trim()||`<name>`,` and a private GitHub repo of the same name.`]})]})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{htmlFor:`goal-brief`,children:`Brief`}),(0,S.jsx)(NE,{id:`goal-brief`,className:`min-h-48`,placeholder:`What done looks like, constraints, links to specs, and the commands that prove it works.`,value:u,onChange:e=>d(e.target.value)}),(0,S.jsx)(dD,{children:`Markdown. A communicator plans it into jobs, which wait for your approval here.`})]}),(0,S.jsx)(ab,{children:(0,S.jsx)(Rf,{disabled:!g||f,onClick:_,children:f?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(cb,{}),` `,m?`Creating the repo…`:`Setting up the branch…`]}):`Plan it`})})]})}function xQ({act:e,onCreated:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1);return(0,S.jsxs)(oD,{className:`mt-2`,children:[(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{htmlFor:`goal-plan`,children:`Plan`}),(0,S.jsx)(NE,{id:`goal-plan`,className:`min-h-64`,placeholder:`{ "format": "factory-plan/1", "goal": { ... }, "nodes": [ ... ] }`,value:n,onChange:e=>r(e.target.value)}),(0,S.jsx)(dD,{children:`JSON or YAML in factory-plan/1, as in spec/plan-format.md. It's validated before anything changes.`})]}),(0,S.jsx)(ab,{children:(0,S.jsx)(Rf,{disabled:!n.trim()||i,onClick:()=>e(async()=>{a(!0);try{t((await wf.importPlan(n)).id)}finally{a(!1)}}),children:i?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(cb,{}),` Importing…`]}):`Import`})})]})}var SQ={communicator:`comm`,builder:`build`,grunt:`grunt`};function CQ(e,t){if(e.blocked)return wQ[e.blocked];if(e.state===`queued`)return t.some(e=>e.item.blueprint===`decompose`&&(e.state===`queued`||e.state===`running`))?`planning`:`working`}var wQ={checkpoint:`needs your approval`,paused:`paused`,red:`integration branch red`,asked:`waiting for you`,held:`held by a failure`,review:`merging`};function TQ(e,t){if(e.goal.brief)return e.goal.brief;let n=(t.find(e=>e.item.blueprint===`decompose`)?.prompt)?.match(/^Repo: .*\n\n([^]*?)\n\n## The plan format/m)?.[1];return n===`(no brief beyond the title)`?void 0:n}var EQ=e=>e.charAt(0).toUpperCase()+e.slice(1)+`.`,DQ=(e,t)=>e.filter(e=>e.of===t.id&&e.state!==`removed`);function OQ(e,t){return[t,...e].flatMap(e=>[e.added,...e.notes.map(e=>e.at),...e.attempts.map(e=>e.end)]).sort().at(-1)}function kQ({snapshot:e,act:t}){let[n,r]=Hx(`goal`,``),[i,a]=(0,v.useState)(!1),o=e.jobs.filter(e=>e.goal&&e.state!==`removed`),s=o.find(e=>e.id===n);return s?(0,S.jsx)(jQ,{goal:s,snapshot:e,act:t,onBack:()=>r(``)}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(AQ,{goals:o,snapshot:e,onNew:()=>a(!0),onOpen:r}),(0,S.jsx)(yQ,{act:t,open:i,onOpenChange:a,onCreated:e=>{a(!1),r(e)}})]})}function AQ({goals:e,snapshot:t,onNew:n,onOpen:r}){let i=(0,S.jsxs)(Rf,{variant:`outline`,onClick:n,children:[(0,S.jsx)(Md,{}),` New goal`]});return e.length===0?(0,S.jsxs)(lf,{children:[(0,S.jsxs)(uf,{children:[(0,S.jsx)(df,{children:`No goals yet`}),(0,S.jsx)(ff,{children:`A goal is one large task, planned into jobs that run on their own branch.`})]}),(0,S.jsx)(pf,{children:i})]}):(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 pt-2`,children:[(0,S.jsx)(`div`,{className:`flex justify-end`,children:i}),(0,S.jsx)(rS,{children:e.map(e=>{let n=DQ(t.jobs,e),i=n.filter(e=>e.state===`done`).length,a=n.reduce((e,t)=>e+t.attempts.length,0),o=e.goal.budget?.attempts;return(0,S.jsx)(fS,{leading:(0,S.jsx)(WD,{state:e.state}),progress:n.length?i/n.length:0,title:(0,S.jsx)(`button`,{type:`button`,className:`text-left hover:underline`,onClick:()=>r(e.id),children:e.item.title}),meta:(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(GD,{state:e.state,label:CQ(e,n)}),(0,S.jsxs)(`span`,{children:[i,`/`,n.length,` done`]}),Jv.map(e=>{let t=n.filter(t=>t.tier===e);return t.length?(0,S.jsxs)(`span`,{children:[SQ[e],` `,t.filter(e=>e.state===`done`).length,`/`,t.length]},e):null}),(0,S.jsxs)(`span`,{children:[a,o?`/${o}`:``,` attempts`]}),(0,S.jsx)(`span`,{children:hf(OQ(n,e))})]}),children:(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open goal`,onClick:()=>r(e.id),children:(0,S.jsx)(Ou,{})})},e.id)})})]})}function jQ({goal:e,snapshot:t,act:n,onBack:r}){let{jobs:i,status:a}=t,o=DQ(i,e),s=e.goal,c=o.filter(e=>e.state===`done`).length,l=o.reduce((e,t)=>e+t.attempts.length,0),u=e.blocked===`red`,d=e.notes.findLast(e=>e.kind===`factory`),f=ey(e),p=TQ(e,o),m=o.filter(e=>Yv.includes(e.item.blueprint)),h=o.flatMap(e=>e.unverified.map(t=>({node:e,need:t}))),g=o.flatMap(e=>e.notes.flatMap((t,n)=>t.kind===`assume`&&!e.notes.some(e=>e.kind===`answer`&&e.re===n)?[{node:e,note:t}]:[]));return(0,S.jsxs)(`div`,{className:`flex flex-col gap-6 pt-2`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-sm`,"aria-label":`All goals`,onClick:r,children:(0,S.jsx)(vu,{})}),(0,S.jsx)(`h2`,{className:`font-heading text-lg font-semibold`,children:e.item.title}),(0,S.jsx)(GD,{state:e.state,label:CQ(e,o)}),(0,S.jsxs)(`span`,{className:`ml-auto flex gap-1`,children:[e.blocked===`paused`?(0,S.jsx)(Rf,{variant:`outline`,size:`sm`,onClick:()=>n(()=>wf.goal(e.id,`resume`)),children:`Resume`}):e.state!==`done`&&(0,S.jsx)(Rf,{variant:`outline`,size:`sm`,onClick:()=>n(()=>wf.goal(e.id,`pause`)),children:`Pause`}),e.state!==`done`&&(0,S.jsx)(IQ,{goal:e,act:n}),e.state!==`done`&&(0,S.jsx)(Rf,{variant:`ghost`,size:`sm`,onClick:()=>n(()=>wf.goal(e.id,`cancel`)),children:`Cancel goal`})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted-foreground`,children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(Qu,{className:`size-4`}),` goal/`,s.slug]}),(0,S.jsx)(`span`,{className:u?`text-destructive`:``,children:s.gates.length===0?`no goal gates`:`${u?`red`:`green`}: ${s.gates.map(e=>`\`${e}\``).join(`, `)}`}),(0,S.jsxs)(`span`,{children:[c,`/`,o.length,` done`]}),(0,S.jsxs)(`span`,{children:[l,s.budget?` of ${s.budget.attempts}`:``,` attempts`]}),f&&(0,S.jsx)(`a`,{className:`text-primary hover:underline`,href:f,target:`_blank`,rel:`noreferrer`,children:`final PR`})]}),p&&(0,S.jsxs)(qI,{children:[(0,S.jsxs)(JI,{render:(0,S.jsx)(`button`,{type:`button`,className:`group flex items-center gap-1 text-sm font-medium text-muted-foreground`}),children:[(0,S.jsx)(Ou,{className:`size-4 transition-transform group-aria-expanded:rotate-90`}),`Brief`]}),(0,S.jsx)(YI,{className:`mt-2`,children:(0,S.jsx)(`div`,{className:`flex flex-col gap-2 rounded-md border p-3 text-sm wrap-anywhere`,children:(0,S.jsx)(qv,{options:Lx,children:p})})})]}),e.blocked===`checkpoint`&&(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border border-warning/50 bg-warning/10 p-3 text-sm sm:flex-row sm:items-center`,children:[(0,S.jsx)(`p`,{className:`flex-1`,children:EQ(e.why??d?.text??`waiting for your approval`)}),(0,S.jsx)(Rf,{size:`sm`,className:`self-start sm:self-auto`,onClick:()=>n(()=>wf.goal(e.id,`approve`)),children:`Approve`})]}),u&&d&&(0,S.jsxs)(`p`,{className:`rounded-md border border-destructive/40 p-3 text-sm text-destructive`,children:[d.text,`; a fix is queued at the front.`]}),(h.length>0||g.length>0)&&(0,S.jsx)(pS,{title:`For you to check`,children:(0,S.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:[h.map(({node:e,need:t})=>(0,S.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(Of,{variant:`outline`,children:`unverified`}),(0,S.jsxs)(`span`,{className:`flex-1`,children:[e.item.title,`: `,t]}),(0,S.jsx)(Rf,{size:`sm`,variant:`outline`,onClick:()=>n(()=>wf.verify(e.id,t)),children:`Checked`})]},`${e.id} ${t}`)),g.map(({node:e,note:t})=>(0,S.jsx)(FQ,{node:e,question:t.text,assumed:t.assumed??``,act:n},`${e.id} ${t.at}`))]})}),m.length>0&&(0,S.jsx)(pS,{title:`Planning`,children:(0,S.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:m.map(e=>(0,S.jsx)(PQ,{node:e,snapshot:t,act:n,status:a,onPath:!1,dependency:!1,onHover:()=>{}},e.id))})}),(0,S.jsx)(pS,{title:`Plan`,children:(0,S.jsx)(`div`,{className:`overflow-x-auto pb-2`,children:(0,S.jsx)(MQ,{nodes:o.filter(e=>!e.parent&&!m.includes(e)),all:o,snapshot:t,act:n,status:a})})})]})}function MQ({nodes:e,all:t,snapshot:n,act:r,status:i}){let[a,o]=(0,v.useState)(),s=iy(e.filter(e=>!e.branchOf));for(let t of e.filter(e=>e.branchOf))s.set(t.id,s.get(t.branchOf)??0);let c=ay(t),l=new Set(t.find(e=>e.id===a)?.after??[]),u=[...new Set(s.values())].sort((e,t)=>e-t);return(0,S.jsx)(`div`,{className:`flex w-max gap-3`,children:u.map(a=>(0,S.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.filter(e=>s.get(e.id)===a).map(e=>{let a=t.filter(t=>t.parent===e.id),s={node:e,snapshot:n,act:r,status:i,onPath:c.size>1&&c.has(e.id),dependency:l.has(e.id),onHover:o};return a.length>0?(0,S.jsx)(NQ,{...s,members:a,all:t},e.id):(0,S.jsx)(PQ,{...s},e.id)})},a))})}function NQ({members:e,all:t,...n}){let{node:r,snapshot:i,act:a,status:o}=n,s=e.filter(e=>e.state===`done`).length;return(0,S.jsx)(`div`,{className:`min-w-60 rounded-md border border-dashed p-2`,children:(0,S.jsxs)(qI,{defaultOpen:r.state!==`done`,children:[(0,S.jsxs)(JI,{render:(0,S.jsx)(`button`,{type:`button`,className:`flex w-full items-center gap-2 text-left text-sm font-medium`}),children:[(0,S.jsx)(WD,{state:r.state}),(0,S.jsx)(`span`,{className:`flex-1`,children:r.item.title}),(0,S.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s,`/`,e.length]})]}),(0,S.jsx)(YI,{className:`mt-2`,children:(0,S.jsx)(MQ,{nodes:e,all:t,snapshot:i,act:a,status:o})})]})})}function PQ({node:e,snapshot:t,act:n,status:r,onPath:i,dependency:a,onHover:o}){let s=r?.workers.find(t=>t.job===e.id),c=e.notes.findLast(t=>t.kind===`step`&&t.attempt===e.attempts.length+1),l=e.attempts.some(e=>(e.compactions??0)>2);return(0,S.jsxs)(`div`,{className:`flex w-60 flex-col gap-1 rounded-md border bg-card p-2 text-sm ${a?`ring-2 ring-accent`:i?`border-primary/60`:``}`,onMouseEnter:()=>o(e.id),onMouseLeave:()=>o(void 0),children:[(0,S.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,S.jsx)(WD,{state:e.state}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere [&_button]:whitespace-normal`,children:(0,S.jsx)(JD,{item:e.item,job:e,snapshot:t,act:n,bare:!0})})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[e.tier&&(0,S.jsx)(Of,{variant:`secondary`,children:e.tier}),e.front&&(0,S.jsx)(Of,{variant:`outline`,children:`factory`}),e.blocked&&(0,S.jsx)(`span`,{children:wQ[e.blocked]}),e.attempts.length>0&&(0,S.jsxs)(`span`,{children:[e.attempts.length,` attempt`,e.attempts.length===1?``:`s`]}),l&&(0,S.jsxs)(Zl,{children:[(0,S.jsxs)(Kl,{render:(0,S.jsx)(`span`,{className:`flex items-center text-warning`}),children:[(0,S.jsx)(Xu,{className:`size-3.5`}),` heavy`]}),(0,S.jsx)(ql,{children:`Compacted more than twice; replans split work like this smaller.`})]}),i&&(0,S.jsx)(`span`,{className:`text-primary`,children:`critical path`})]}),s&&(0,S.jsxs)(`div`,{className:`text-xs`,children:[(0,S.jsx)(`span`,{className:`text-primary`,children:s.id}),`, `,gf(s.since),` min`,s.context?`, ${Math.round(s.context/1e3)}k context`:``,(0,S.jsx)(`div`,{className:`truncate text-muted-foreground`,children:c?`${c.text}${c.of?` (${c.done??0}/${c.of})`:``}`:s.activity??`starting`})]})]})}function FQ({node:e,question:t,assumed:n,act:r}){let[i,a]=(0,v.useState)(``);return(0,S.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`span`,{children:[(0,S.jsx)(Of,{variant:`outline`,children:`assumed`}),` `,e.item.title,`: assumed`,` `,(0,S.jsx)(`strong`,{children:n}),`, asked `,t]}),(0,S.jsxs)(`form`,{className:`flex gap-2`,onSubmit:t=>{t.preventDefault(),r(()=>wf.answer(e.id,i))},children:[(0,S.jsx)(lp,{value:i,onChange:e=>a(e.target.value),placeholder:`A different answer queues a change`}),(0,S.jsx)(Rf,{type:`submit`,variant:`outline`,size:`sm`,disabled:!i.trim(),children:`Answer`}),(0,S.jsx)(Rf,{type:`button`,size:`sm`,onClick:()=>r(()=>wf.answer(e.id,`fine`)),children:`Fine`})]})]})}function IQ({goal:e,act:t}){let[n,r]=(0,v.useState)();return n===void 0?(0,S.jsx)(Rf,{variant:`outline`,size:`sm`,onClick:()=>r(``),children:`Replan`}):(0,S.jsxs)(`form`,{className:`flex gap-1`,onSubmit:i=>{i.preventDefault(),t(()=>wf.replan(e.id,n)).then(()=>r(void 0))},children:[(0,S.jsx)(lp,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),placeholder:`Why replan?`,className:`h-8 w-48`}),(0,S.jsx)(Rf,{type:`submit`,size:`sm`,disabled:!n.trim(),children:`Queue`})]})}var LQ={y:14.2,width:3,height:3.4,rx:.6};function RQ({working:e}){return(0,S.jsxs)(`svg`,{viewBox:`0 0 48 48`,width:32,height:32,"aria-hidden":!0,className:e?`logo-working`:void 0,children:[(0,S.jsx)(`rect`,{width:`48`,height:`48`,rx:`10.5`,className:`logo-tile`}),(0,S.jsxs)(`g`,{transform:`translate(6 6) scale(1.5)`,children:[(0,S.jsx)(`g`,{fill:`none`,className:`logo-ink`,strokeWidth:`2.25`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,S.jsx)(`path`,{d:`M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z`})}),(0,S.jsx)(`g`,{className:`logo-ink-fill`,children:[6.5,10.5,14.5].map(e=>(0,S.jsx)(`rect`,{className:`logo-window`,x:e,...LQ},e))})]})]})}function zQ({dialog:e,onAnswer:t}){let[n,r]=(0,v.useState)(e.method===`editor`?e.prefill??``:``),i=e.method===`input`||e.method===`editor`;return(0,S.jsx)($y,{open:!0,onOpenChange:e=>!e&&t({cancelled:!0}),children:(0,S.jsxs)(rb,{children:[(0,S.jsxs)(ib,{children:[(0,S.jsx)(ob,{children:e.title}),e.method===`confirm`&&e.message&&(0,S.jsx)(sb,{children:e.message})]}),e.method===`input`&&(0,S.jsx)(lp,{autoFocus:!0,value:n,placeholder:e.placeholder,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===`Enter`&&t({value:n})}),e.method===`editor`&&(0,S.jsx)(NE,{autoFocus:!0,value:n,onChange:e=>r(e.target.value)}),(0,S.jsxs)(ab,{children:[e.method===`select`&&e.options.map(e=>(0,S.jsx)(Rf,{variant:`outline`,onClick:()=>t({value:e}),children:e},e)),e.method===`confirm`&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Rf,{variant:`outline`,onClick:()=>t({confirmed:!1}),children:`No`}),(0,S.jsx)(Rf,{autoFocus:!0,onClick:()=>t({confirmed:!0}),children:`Yes`})]}),i&&(0,S.jsx)(Rf,{onClick:()=>t({value:n}),children:`Send`})]})]})})}var BQ=[`select`,`confirm`,`input`,`editor`],VQ={messages:[],busy:!1,dialogs:[]};function HQ(e,t){let{messages:n}=e;switch(t.type){case`agent_start`:return{...e,busy:!0,error:void 0};case`agent_settled`:return{...e,busy:!1,dialogs:[]};case`exit`:return{...e,busy:!1,dialogs:[],error:t.error};case`extension_ui_request`:return BQ.includes(t.method)?{...e,dialogs:[...e.dialogs,t]}:e;case`extension_ui_answered`:return{...e,dialogs:e.dialogs.filter(e=>e.id!==t.id)};case`reset`:return VQ;case`message_start`:return{...e,messages:[...n,t.message]};case`message_end`:return{...e,messages:[...n.slice(0,-1),t.message]};case`message_update`:{let r=n.at(-1);if(r?.role!==`assistant`)return e;let i=UQ(r.content,t.assistantMessageEvent);return{...e,messages:[...n.slice(0,-1),{...r,content:i}]}}case`response`:if(!t.success)return{...e,error:t.error};if(t.command===`get_messages`)return{...e,messages:t.data.messages};if(t.command===`get_state`){let n=t.data;return n.model?{...e,model:{name:n.model.name,thinking:n.thinkingLevel}}:e}return e;default:return e}}function UQ(e,t){if(!(`contentIndex`in t))return e;let n=[...e],r=t.contentIndex;if(t.type===`text_start`)n[r]={type:`text`,text:``};else if(t.type===`thinking_start`)n[r]={type:`thinking`};else if(t.type===`text_delta`&&`delta`in t){let e=n[r];n[r]={type:`text`,text:(e?.type===`text`?e.text:``)+t.delta}}else t.type===`toolcall_start`&&`toolName`in t?n[r]={type:`toolCall`,id:t.id,name:t.toolName,arguments:{}}:t.type===`toolcall_end`&&`toolCall`in t&&(n[r]=t.toolCall);return n}function WQ({messages:e,busy:t}){let n=new Map;for(let t of e)t.role===`toolResult`&&n.set(t.toolCallId,t);return e.flatMap((e,r)=>{let i=String(r);if(e.role===`user`)return[{id:i,role:`user`,text:GQ(e.content)}];if(e.role!==`assistant`)return[];let a=e.content.flatMap(e=>e.type===`toolCall`?[KQ(e,n.get(e.id),t)]:[]),o=e.stopReason===`error`?[e.errorMessage,e.model&&`(${e.provider}/${e.model})`].filter(Boolean).join(` `):void 0;return[{id:i,role:`assistant`,text:[GQ(e.content),o&&`**Error:** ${o}`].filter(Boolean).join(`
|
|
77
|
+
|
|
78
|
+
`),tools:a}]})}function GQ(e){return typeof e==`string`?e:e.flatMap(e=>e?.type===`text`?[e.text]:[]).join(`
|
|
79
|
+
|
|
80
|
+
`)}function KQ(e,t,n){let r=t?t.isError?`error`:`complete`:n?`running`:`error`,i=t&&GQ(t.content);return{id:e.id,name:e.name,status:r,output:i,...VL(e,r,i)}}function qQ({agent:e,prompt:t,onPromptChange:n}){let[r,i]=(0,v.useState)(VQ),[a,o]=(0,v.useState)();(0,v.useEffect)(()=>{let e=new EventSource(`/api/chat`);return e.onopen=()=>i(VQ),e.onmessage=e=>i(t=>HQ(t,JSON.parse(e.data))),()=>e.close()},[]);async function s(e){try{return await e(),o(void 0),!0}catch(e){return o(e.message),!1}}return(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[Sf(e),` looks through the candidates and queues jobs once you agree. It never turns the factory on.`]}),(0,S.jsxs)(Rf,{variant:`outline`,size:`sm`,disabled:r.messages.length===0,onClick:()=>void s(wf.resetChat),children:[(0,S.jsx)(Rd,{}),`New chat`]})]}),r.dialogs[0]&&(0,S.jsx)(zQ,{dialog:r.dialogs[0],onAnswer:e=>void s(()=>wf.answerChat({id:r.dialogs[0].id,...e}))},r.dialogs[0].id),(0,S.jsx)(dL,{messages:WQ(r),prompt:t,onPromptChange:n,busy:r.busy,model:r.model,error:a??r.error,placeholder:`What should the factory work on next?`,emptyTitle:`Plan the queue`,emptyDescription:`For example: pick five auto jobs for tonight that won't conflict.`,onSend:e=>s(()=>wf.chat(e)),onStop:()=>void s(wf.abortChat)})]})}function JQ({act:e,open:t,onOpenChange:n}){let[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(`builder`),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``);return(0,v.useEffect)(()=>{t&&wf.candidates().then(e=>i(e.repos))},[t]),(0,S.jsx)($y,{open:t,onOpenChange:n,children:(0,S.jsxs)(rb,{className:`sm:max-w-2xl`,children:[(0,S.jsxs)(ib,{children:[(0,S.jsx)(ob,{children:`New job`}),(0,S.jsx)(sb,{children:`One task of your own, for a single agent. It goes into your picks, ahead of auto jobs.`})]}),(0,S.jsxs)(oD,{children:[(0,S.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{children:`Repo`}),(0,S.jsxs)(fD,{items:r.map(e=>({value:e,label:_f(e)})),value:a,onValueChange:e=>o(e??``),children:[(0,S.jsx)(hD,{"aria-label":`Repo`,children:(0,S.jsx)(mD,{placeholder:`Pick a repo`})}),(0,S.jsx)(gD,{alignItemWithTrigger:!1,children:r.map(e=>(0,S.jsx)(_D,{value:e,children:_f(e)},e))})]})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{children:`Tier`}),(0,S.jsxs)(fD,{items:Jv.map(e=>({value:e,label:e})),value:s,onValueChange:e=>e&&c(e),children:[(0,S.jsx)(hD,{"aria-label":`Tier`,children:(0,S.jsx)(mD,{})}),(0,S.jsx)(gD,{alignItemWithTrigger:!1,children:Jv.map(e=>(0,S.jsx)(_D,{value:e,children:e},e))})]})]})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{htmlFor:`job-title`,children:`Title`}),(0,S.jsx)(lp,{id:`job-title`,placeholder:`The prompt's first line`,value:l,onChange:e=>u(e.target.value)})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{htmlFor:`job-prompt`,children:`Prompt`}),(0,S.jsx)(NE,{id:`job-prompt`,autoFocus:!0,className:`min-h-64`,placeholder:`What to do, where, how to check it, and what not to touch.`,value:d,onChange:e=>f(e.target.value)}),(0,S.jsx)(dD,{children:`Markdown. The agent gets it as written, in a fresh worktree of the repo's default branch.`})]}),(0,S.jsx)(ab,{children:(0,S.jsx)(Rf,{disabled:!a||!d.trim(),onClick:()=>e(async()=>{await wf.ownJob({repo:a,tier:s,title:l,prompt:d}),u(``),f(``),n(!1)}),children:`Queue it`})})]})]})})}function YQ(e,t){let n=e.agent?xf({...e,agent:e.agent}):``,r=e.after.flatMap(e=>{let n=t.get(e);return n&&n.state!==`done`?[vf(n.item)]:[]}),i=r.length>0&&`after ${r.join(`, `)}`;return[e.item.blueprint,e.item.attention,n,i].filter(Boolean).join(` · `)}function XQ({job:e,byId:t}){return(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(GD,{state:e.state}),YQ(e,t)]})}function ZQ({worker:e,settings:t}){let n=Jv.filter(n=>t.tiers[n].includes(e.preset));return(0,S.jsx)(_Z.span,{layoutId:`worker-${e.id}`,transition:{duration:.35},className:`inline-flex`,children:(0,S.jsxs)(Of,{variant:e.job?`default`:`secondary`,children:[n.length>0?n.join(`, `):`untiered`,(0,S.jsxs)(`span`,{className:`opacity-60`,children:[`#`,e.id.split(`#`).at(-1)]})]})})}var QQ={idle:`bg-success`,working:`bg-primary`,sleeping:`bg-muted-foreground`,stopped:`bg-destructive`};function $Q({status:e,settings:t}){return(0,S.jsx)(`aside`,{className:`flex flex-col gap-4 lg:col-start-2`,children:e.pools.map(n=>{let r=e.workers.filter(e=>e.pool===n.name),i=r.filter(e=>!e.job),a=n.stopped??(n.until?`${n.reserved?`keeps its reserve`:`sleeps`} until ${mf(n.until)}`:``);return(0,S.jsxs)(`section`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,S.jsxs)(`h2`,{className:`flex items-baseline justify-between gap-2 font-medium text-muted-foreground`,children:[n.name,(0,S.jsxs)(`span`,{className:`text-xs font-normal tabular-nums`,children:[i.length,` of `,r.length,` free · limits `,n.limits,`/`,e.limit??`∞`,n.used!==void 0&&` · ${n.used}% of 5h, reserve ${t.reserves[n.name]??0}%`]})]}),a&&(0,S.jsx)(`p`,{className:`text-xs text-warning`,children:a}),(0,S.jsx)(`ul`,{className:`flex flex-col gap-1`,children:i.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(Zl,{children:[(0,S.jsxs)(Kl,{render:(0,S.jsx)(`span`,{className:`flex items-center gap-2`}),children:[(0,S.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${QQ[e.state]}`}),(0,S.jsx)(ZQ,{worker:e,settings:t}),(0,S.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.state===`idle`?bf(e):e.state})]}),(0,S.jsxs)(ql,{children:[e.id,`, `,e.state,e.until?` until ${mf(e.until)}`:e.reason?`: ${e.reason}`:` since ${mf(e.since)}`,e.preset===e.agent&&`. The run's own ${e.agent} worker, for jobs without a tier, like maintenance picks.`]})]})},e.id))})]},n.name)})})}function e$({worker:e,job:t,title:n,settings:r}){let i=t.notes.findLast(e=>e.kind===`step`&&e.attempt===t.attempts.length+1),a=t.notes.findLast(e=>e.kind!==`step`);return(0,S.jsx)(fS,{leading:(0,S.jsx)(WD,{state:t.state}),title:n,meta:(0,S.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(ZQ,{worker:e,settings:r}),[bf(e),`${gf(e.since)} min`,e.context&&`${Math.round(e.context/1e3)}k context`].filter(Boolean).join(` · `)]}),i&&(0,S.jsxs)(`span`,{className:`text-foreground`,children:[i.text,i.of?` (${i.done??0}/${i.of})`:``]}),e.activity&&(0,S.jsx)(`span`,{children:e.activity}),a&&(0,S.jsxs)(`span`,{children:[mf(a.at),` `,a.kind,`: `,a.text]})]})})}function t$({ref:e,children:t}){return(0,S.jsx)(_Z.div,{ref:e,layout:`position`,exit:{opacity:0,x:64},transition:{duration:.2},children:t})}function n$({snapshot:e,act:t,onCandidates:n}){let[r,i]=(0,v.useState)(!1),{jobs:a,status:o,on:s,settings:c}=e,l=new Map(a.map(e=>[e.id,e])),u=a.filter(e=>e.state===`queued`&&e.source===`pick`),d=a.filter(e=>e.state===`queued`&&e.source===`auto`),f=(n,r)=>(0,S.jsx)(JD,{item:n.item,job:n,snapshot:e,act:t,actions:r&&(0,S.jsx)(Rf,{variant:`destructive`,size:`sm`,className:`sm:mr-auto`,onClick:()=>t(()=>wf.remove(n.id)),children:`Remove from queue`})}),p=e=>(0,S.jsxs)(Zl,{children:[(0,S.jsx)(Kl,{render:(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Remove from queue`,onClick:()=>t(()=>wf.remove(e.id))}),children:(0,S.jsx)(nf,{})}),(0,S.jsx)(ql,{children:`Remove from queue`})]}),m=(0,S.jsxs)(Rf,{variant:`outline`,onClick:()=>i(!0),children:[(0,S.jsx)(Md,{}),` New job`]}),h=s&&o?o.workers.filter(e=>e.job):[];return(0,S.jsxs)(`div`,{className:`grid gap-8 pt-2 ${s&&o?`lg:grid-cols-[1fr_15rem]`:``}`,children:[s&&o&&(0,S.jsx)($Q,{status:o,settings:c}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-8 lg:row-start-1`,children:[(0,S.jsx)(JQ,{act:t,open:r,onOpenChange:i}),h.length>0&&(0,S.jsx)(pS,{title:`Running (${h.length})`,children:(0,S.jsx)(rS,{children:h.map(e=>{let t=l.get(e.job);return t&&(0,S.jsx)(e$,{worker:e,job:t,title:f(t,!1),settings:c},e.id)})})}),(0,S.jsx)(pS,{title:`Your picks (${u.length})`,children:u.length===0?(0,S.jsxs)(lf,{children:[(0,S.jsxs)(uf,{children:[(0,S.jsx)(df,{children:`Nothing picked`}),(0,S.jsx)(ff,{children:`Picks go before anything auto mode queues. Find work under Candidates, or write a job of your own.`})]}),(0,S.jsxs)(pf,{className:`flex-row justify-center`,children:[(0,S.jsx)(Rf,{variant:`outline`,onClick:n,children:`Browse candidates`}),m]})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`flex justify-end`,children:m}),(0,S.jsx)(rS,{children:(0,S.jsx)(vY,{mode:`popLayout`,initial:!1,children:u.map((e,n)=>(0,S.jsx)(t$,{children:(0,S.jsxs)(fS,{leading:(0,S.jsx)(WD,{state:e.state}),title:f(e,!0),meta:(0,S.jsx)(XQ,{job:e,byId:l}),children:[(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move up`,disabled:n===0,onClick:()=>t(()=>wf.move(e.id,n-1)),children:(0,S.jsx)(bu,{})}),(0,S.jsx)(Rf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move down`,disabled:n===u.length-1,onClick:()=>t(()=>wf.move(e.id,n+1)),children:(0,S.jsx)(gu,{})}),p(e)]})},e.id))})})]})}),(0,S.jsx)(pS,{title:`Auto (${d.length})`,children:d.length===0?(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c.auto.on?`Auto mode tops this up to 5 jobs per agent while the factory is on.`:`Auto mode is off. Turn it on to keep the queue topped up from workwork.`}):(0,S.jsx)(rS,{children:(0,S.jsx)(vY,{mode:`popLayout`,initial:!1,children:d.map(e=>(0,S.jsx)(t$,{children:(0,S.jsx)(fS,{leading:(0,S.jsx)(WD,{state:e.state}),title:f(e,!0),meta:(0,S.jsx)(XQ,{job:e,byId:l}),children:p(e)})},e.id))})})})]})]})}var r$=`0.4.0`;function i$({snapshot:e,act:t}){let[n,r]=(0,v.useState)(!1);return(0,S.jsxs)($y,{open:n,onOpenChange:r,children:[(0,S.jsx)(eb,{render:(0,S.jsx)(Rf,{variant:`ghost`,size:`icon`,"aria-label":`Settings`}),children:(0,S.jsx)(Bd,{})}),(0,S.jsxs)(rb,{className:`sm:max-w-xl`,children:[(0,S.jsxs)(ib,{children:[(0,S.jsx)(ob,{children:`Settings`}),(0,S.jsx)(sb,{children:`Defaults for every run, and what auto mode may queue. Closing without saving discards changes.`})]}),(0,S.jsx)(a$,{snapshot:e,act:t,onSaved:()=>r(!1)})]})]})}function a$({snapshot:e,act:t,onSaved:n}){let[r,i]=(0,v.useState)(e.settings),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),l={...r,auto:{...r.auto,on:e.settings.auto.on}},u=JSON.stringify(l)===JSON.stringify(e.settings);(0,v.useEffect)(()=>{wf.candidates().then(e=>{c([...new Set(e.items.map(e=>e.repo))].sort())})},[e.candidates.at]),(0,v.useEffect)(()=>{wf.blueprints().then(e=>o(e.filter(e=>!e.onRequest).map(e=>e.name).sort()))},[]);let d=r.auto,f=e=>i({...r,auto:{...d,...e}});return(0,S.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),t(async()=>{await wf.saveSettings(l),n()})},children:[(0,S.jsxs)(jx,{defaultValue:`runs`,children:[(0,S.jsxs)(Nx,{children:[(0,S.jsx)(Px,{value:`runs`,children:`Runs`}),(0,S.jsx)(Px,{value:`presets`,children:`Presets`}),(0,S.jsx)(Px,{value:`tiers`,children:`Tiers`}),(0,S.jsx)(Px,{value:`auto`,children:`Auto mode`}),(0,S.jsx)(Px,{value:`chat`,children:`Live Agent`})]}),(0,S.jsxs)(`div`,{className:`mt-2 grid`,children:[(0,S.jsx)(s$,{value:`runs`,children:(0,S.jsxs)(oD,{children:[(0,S.jsx)(CD,{value:r,onChange:e=>i({...r,...e})}),(0,S.jsxs)(cD,{orientation:`horizontal`,children:[(0,S.jsx)(uD,{htmlFor:`idle`,children:`Minutes without a sign of life before an attempt times out`}),(0,S.jsx)(lp,{id:`idle`,type:`number`,className:`w-20`,min:1,value:r.idle,onChange:e=>i({...r,idle:Number(e.target.value)})})]}),(0,S.jsx)(c$,{value:r.reserves,onChange:e=>i({...r,reserves:e})})]})}),(0,S.jsx)(s$,{value:`presets`,children:(0,S.jsx)(o$,{value:r.presets,onChange:e=>i({...r,presets:e})})}),(0,S.jsx)(s$,{value:`tiers`,children:(0,S.jsx)(u$,{presets:r.presets,value:r.tiers,onChange:e=>i({...r,tiers:e})})}),(0,S.jsx)(s$,{value:`auto`,children:(0,S.jsxs)(oD,{children:[(0,S.jsx)(dD,{children:`While the factory is on, auto mode keeps up to 5 jobs per agent queued, cheapest attention first, and never queues a candidate that already had a job. An empty filter allows everything.`}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{children:`Attention`}),(0,S.jsx)(bO,{multiple:!0,variant:`outline`,value:d.attention,onValueChange:e=>f({attention:e}),children:[`none`,`skim`,`decide`].map(e=>(0,S.jsx)(xO,{value:e,children:e},e))})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{children:`Blueprints`}),(0,S.jsx)(d$,{items:a,value:d.blueprints,onChange:e=>f({blueprints:e}),placeholder:`All blueprints`,label:e=>e})]}),(0,S.jsxs)(cD,{children:[(0,S.jsx)(uD,{children:`Repos`}),(0,S.jsx)(d$,{items:s,value:d.repos,onChange:e=>f({repos:e}),placeholder:`All repos`,label:_f})]})]})}),(0,S.jsx)(s$,{value:`chat`,children:(0,S.jsxs)(oD,{children:[(0,S.jsx)(dD,{children:`The agent you plan the queue with. Changing it starts a new chat.`}),(0,S.jsxs)(cD,{orientation:`horizontal`,children:[(0,S.jsx)(OD,{label:`Chat agent`,className:`w-24 flex-none`,items:mS.map(e=>({value:e,label:Sf(e)})),value:r.chat.agent,onChange:e=>e&&i({...r,chat:{agent:e}})}),(0,S.jsx)(ED,{agent:r.chat.agent,value:r.chat,onChange:e=>i({...r,chat:{...e,agent:r.chat.agent}})})]})]})})]})]}),(0,S.jsxs)(ab,{className:`sm:items-center`,children:[(0,S.jsxs)(`span`,{className:`text-xs text-muted-foreground sm:mr-auto`,children:[`factory `,r$]}),(0,S.jsx)(Rf,{type:`submit`,disabled:u,children:`Save`})]})]})}function o$({value:e,onChange:t}){let n=(n,r)=>t(e.map((e,t)=>t===n?r:e));return(0,S.jsxs)(oD,{children:[(0,S.jsx)(dD,{children:`Queue a candidate with one of these from the arrow next to its Queue button. Tiers run on them too: workers is how many run at once (empty: one once a tier lists it), and k ctx the context size, in thousands of tokens, where the agent compacts (empty: 90 for Haiku, 200 otherwise).`}),e.map((r,i)=>(0,S.jsxs)(cD,{orientation:`horizontal`,children:[(0,S.jsx)(OD,{label:`Preset agent`,className:`w-24 flex-none`,items:mS.map(e=>({value:e,label:Sf(e)})),value:r.agent,onChange:e=>e&&n(i,{agent:e})}),(0,S.jsx)(ED,{agent:r.agent,value:r,onChange:e=>n(i,{...r,...e,agent:r.agent})}),(0,S.jsx)(lp,{"aria-label":`Workers`,type:`number`,min:0,className:`w-24`,placeholder:`workers`,value:r.workers??``,onChange:e=>n(i,{...r,workers:e.target.value===``?void 0:Number(e.target.value)})}),(0,S.jsx)(lp,{"aria-label":`Compact at, thousands of tokens`,type:`number`,min:10,className:`w-20`,placeholder:`k ctx`,value:r.compactAt?r.compactAt/1e3:``,onChange:e=>n(i,{...r,compactAt:e.target.value===``?void 0:Number(e.target.value)*1e3})}),(0,S.jsx)(Rf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove preset`,onClick:()=>t(e.filter((e,t)=>t!==i)),children:(0,S.jsx)(nf,{})})]},i)),(0,S.jsxs)(Rf,{type:`button`,variant:`outline`,className:`self-start`,onClick:()=>t([...e,{agent:mS[0]}]),children:[(0,S.jsx)(Md,{}),` Add preset`]})]})}function s$(e){return(0,S.jsx)(Fx,{keepMounted:!0,hidden:!1,className:`col-start-1 row-start-1 data-hidden:invisible`,...e})}function c$({value:e,onChange:t}){let n=(n,r)=>{let i={...e};r===``?delete i[n]:i[n]=Number(r),t(i)};return(0,S.jsxs)(iD,{children:[(0,S.jsx)(aD,{variant:`label`,children:`Reserve`}),(0,S.jsx)(dD,{children:`Percent of a pool's 5-hour window to leave for other apps. Once it's reached, the pool starts nothing new until the window resets; jobs already running finish, so leave room for them.`}),Qv.map(t=>(0,S.jsxs)(cD,{orientation:`horizontal`,children:[(0,S.jsx)(uD,{htmlFor:`reserve-${t}`,children:t}),(0,S.jsx)(lp,{id:`reserve-${t}`,type:`number`,className:`w-20`,min:0,max:99,placeholder:`none`,value:e[t]??``,onChange:e=>n(t,e.target.value)})]},t))]})}var l$={communicator:`decomposition, UX, visual design, copy: anything judged by taste`,builder:`architecture, foundations, tricky logic, reviews`,grunt:`well-specified mechanical work`};function u$({presets:e,value:t,onChange:n}){let[r,i]=(0,v.useState)(),a=e.map(Xv),o=(e,r)=>n({...t,[e]:r}),s=(e,n,r)=>{let i=[...t[e]],[a]=i.splice(n,1);i.splice(r,0,a),o(e,i)};return(0,S.jsxs)(oD,{children:[(0,S.jsx)(dD,{children:`A goal's node runs on the first preset of its tier whose usage limit isn't hit and that has a free worker. A tier with no presets here runs on the run's agents.`}),Jv.map(e=>{let n=t[e],c=a.filter(e=>!n.includes(e));return(0,S.jsxs)(cD,{children:[(0,S.jsxs)(uD,{children:[e,` `,(0,S.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:l$[e]})]}),(0,S.jsx)(`ol`,{className:`flex flex-col gap-1`,children:n.map((t,c)=>(0,S.jsxs)(`li`,{draggable:!0,onDragStart:()=>i({tier:e,index:c}),onDragOver:t=>r?.tier===e&&t.preventDefault(),onDrop:()=>{r?.tier===e&&s(e,r.index,c),i(void 0)},className:`flex items-center gap-1 rounded-md border px-2 py-1 text-sm`,children:[(0,S.jsx)(cd,{className:`size-4 cursor-grab text-muted-foreground`}),(0,S.jsxs)(`span`,{className:`flex-1`,children:[c+1,`. `,t,!a.includes(t)&&(0,S.jsx)(`span`,{className:`text-destructive`,children:` (no such preset)`})]}),(0,S.jsx)(Rf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Move up`,disabled:c===0,onClick:()=>s(e,c,c-1),children:(0,S.jsx)(bu,{})}),(0,S.jsx)(Rf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Move down`,disabled:c===n.length-1,onClick:()=>s(e,c,c+1),children:(0,S.jsx)(gu,{})}),(0,S.jsx)(Rf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove from tier`,onClick:()=>o(e,n.filter(e=>e!==t)),children:(0,S.jsx)(nf,{})})]},t))}),c.length>0&&(0,S.jsx)(OD,{label:`Add a preset to ${e}`,className:`w-56`,items:[{value:``,label:`Add a preset…`},...c.map(e=>({value:e,label:e}))],value:``,onChange:t=>t&&o(e,[...n,t])})]},e)})]})}function d$({items:e,value:t,onChange:n,placeholder:r,label:i}){let a=nD();return(0,S.jsxs)(VE,{multiple:!0,autoHighlight:!0,items:e,value:t,onValueChange:n,itemToStringLabel:i,children:[(0,S.jsx)($E,{ref:a,children:(0,S.jsx)(HE,{children:e=>(0,S.jsxs)(v.Fragment,{children:[e.map(e=>(0,S.jsx)(eD,{children:i(e)},e)),(0,S.jsx)(tD,{placeholder:e.length?``:r})]})})}),(0,S.jsxs)(KE,{anchor:a,children:[(0,S.jsx)(QE,{children:`Nothing matches`}),(0,S.jsx)(qE,{children:e=>(0,S.jsx)(JE,{value:e,children:i(e)},e)})]})]})}function f$(){let{snapshot:e,error:t,act:n}=Tf(),[r,i]=(0,v.useState)(``);return e?(0,S.jsx)(NL,{title:`Live Agent`,agent:(0,S.jsx)(qQ,{agent:e.settings.chat.agent,prompt:r,onPromptChange:i}),children:(0,S.jsx)(p$,{snapshot:e,error:t,act:n,onAsk:i})}):(0,S.jsx)(`div`,{className:`flex min-h-svh items-center justify-center gap-2 p-4 text-muted-foreground`,children:t??(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(cb,{}),` Loading`]})})}function p$({snapshot:e,error:t,act:n,onAsk:r}){let[i,a]=Hx(`tab`,`queue`),{isMobile:o,setOpen:s,setOpenMobile:c}=OL(),{on:l,status:u}=e,d=e.jobs.filter(e=>e.goal&&e.state!==`removed`&&e.state!==`done`).filter(e=>e.blocked===`checkpoint`).length,f=l&&u?[`since ${mf(yf(u.run))}`,u.until&&`until ${mf(u.until)}`,...u.pools.map(e=>e.stopped?`${e.name} out of limits`:e.until?`${e.name} sleeps until ${mf(e.until)}`:void 0)].filter(Boolean).join(` · `):``;return(0,S.jsxs)(`div`,{className:`mx-auto flex min-h-svh w-full max-w-5xl flex-col gap-6 p-4`,children:[(0,S.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,S.jsxs)(`div`,{className:`flex flex-1 items-center gap-2`,children:[(0,S.jsxs)(`h1`,{className:`flex items-center gap-2 font-heading text-xl font-semibold`,children:[(0,S.jsx)(RQ,{working:l}),`Factory`]}),(0,S.jsx)(Of,{variant:l?`accent`:`outline`,children:l?`on`:`off`}),(0,S.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:f})]}),(0,S.jsx)(_Q,{snapshot:e,act:n}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(iQ,{}),(0,S.jsx)(i$,{snapshot:e,act:n})]})]}),t&&(0,S.jsx)(`p`,{role:`alert`,className:`text-sm wrap-anywhere whitespace-pre-line text-destructive`,children:t}),(0,S.jsxs)(jx,{value:i,onValueChange:a,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`div`,{className:`min-w-0 overflow-x-auto overflow-y-hidden`,children:(0,S.jsxs)(Nx,{children:[(0,S.jsxs)(Px,{value:`queue`,children:[(0,S.jsx)(md,{}),`Queue`]}),(0,S.jsxs)(Px,{value:`goals`,children:[(0,S.jsx)(Qd,{}),`Goals`,d>0&&(0,S.jsx)(Of,{variant:`accent`,children:d})]}),(0,S.jsxs)(Px,{value:`candidates`,children:[(0,S.jsx)(ud,{}),`Candidates`]}),(0,S.jsxs)(Px,{value:`blueprints`,children:[(0,S.jsx)(Hu,{}),`Blueprints`]}),(0,S.jsxs)(Px,{value:`results`,children:[(0,S.jsx)(wd,{}),`Results`]}),(0,S.jsxs)(Px,{value:`activity`,children:[(0,S.jsx)(mu,{}),`Activity`]})]})}),(0,S.jsx)(`div`,{className:`ml-auto`})]}),(0,S.jsx)(Fx,{value:`queue`,children:(0,S.jsx)(n$,{snapshot:e,act:n,onCandidates:()=>a(`candidates`)})}),(0,S.jsx)(Fx,{value:`goals`,children:(0,S.jsx)(kQ,{snapshot:e,act:n})}),(0,S.jsx)(Fx,{value:`candidates`,children:(0,S.jsx)(hQ,{snapshot:e,act:n})}),(0,S.jsx)(Fx,{value:`blueprints`,children:(0,S.jsx)(wO,{act:n})}),(0,S.jsx)(Fx,{value:`activity`,children:(0,S.jsx)(uO,{snapshot:e,act:n})}),(0,S.jsx)(Fx,{value:`results`,children:(0,S.jsx)(FD,{snapshot:e,act:n,onAsk:e=>{r(e),(o?c:s)(!0)}})})]})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(v.StrictMode,{children:(0,S.jsx)(F,{themes:b,storageKey:Ql,children:(0,S.jsx)(Xl,{children:(0,S.jsx)(f$,{})})})}));
|